From ad9d535edc8a773ab93164598a2cdb5f7f50bd10 Mon Sep 17 00:00:00 2001 From: epilepticseizureee Date: Wed, 22 Jul 2026 23:45:09 +0300 Subject: [PATCH 1/5] feat(admin-ui): softer pre-material styling and dark theme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rebuild admin console styling on semantic CSS variables (light + dark palettes) - Soften palette, shadows and corner radii for a calmer pre-material look - Add theme provider with light/dark toggle in the topbar and login header - Respect prefers-color-scheme and persist choice, with anti-FOUC inline script - Polish Russian translations (yo letters, consistent 'Звёзды' currency, wording) - Rebuild dist bundle to match the updated source --- .../web/dist/assets/index-CqgHld2y.js | 9 + .../web/dist/assets/index-DHdrFM5j.css | 1 - .../web/dist/assets/index-DuOdm70q.css | 1 + .../web/dist/assets/index-Duge82ST.js | 9 - cmd/telesrv-admin/web/dist/index.html | 43 ++- cmd/telesrv-admin/web/index.html | 17 ++ .../web/src/components/Layout.tsx | 2 + cmd/telesrv-admin/web/src/i18n.tsx | 62 +++-- cmd/telesrv-admin/web/src/main.tsx | 9 +- cmd/telesrv-admin/web/src/pages/LoginPage.tsx | 2 + .../web/src/styles/01-foundation.css | 246 +++++++++++++++--- .../web/src/styles/02-pages-and-forms.css | 132 ++++++---- .../src/styles/03-entities-and-actions.css | 165 ++++++------ .../web/src/styles/04-modal-and-login.css | 48 ++-- cmd/telesrv-admin/web/src/theme.tsx | 106 ++++++++ 15 files changed, 601 insertions(+), 251 deletions(-) create mode 100644 cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js delete mode 100644 cmd/telesrv-admin/web/dist/assets/index-DHdrFM5j.css create mode 100644 cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css delete mode 100644 cmd/telesrv-admin/web/dist/assets/index-Duge82ST.js create mode 100644 cmd/telesrv-admin/web/src/theme.tsx diff --git a/cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js b/cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js new file mode 100644 index 00000000..4d0101b7 --- /dev/null +++ b/cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js @@ -0,0 +1,9 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-Ee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` +`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{re=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ne(e):``}function ae(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return``}}function oe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function se(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return oe(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ce(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function le(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ue(e){var t=le(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function z(e){e._valueTracker||=ue(e)}function de(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=le(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function B(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function V(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ce(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function pe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function me(e,t){pe(e,t);var n=ce(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ge(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ge(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function he(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ge(e,t,n){(t!==`number`||B(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var _e=Array.isArray;function ve(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Se.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function we(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Te={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Te).forEach(function(e){Ee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Te[t]=Te[e]})});function De(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Te.hasOwnProperty(e)&&Te[e]?(``+t).trim():t+`px`}function Oe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=De(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var ke=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ae(e,t){if(t){if(ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function je(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Me=null;function Ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pe=null,Fe=null,Ie=null;function Le(e){if(e=ji(e)){if(typeof Pe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ni(t),Pe(e.stateNode,e.type,t))}}function Re(e){Fe?Ie?Ie.push(e):Ie=[e]:Fe=e}function ze(){if(Fe){var e=Fe,t=Ie;if(Ie=Fe=null,Le(e),t)for(e=0;e>>=0,e===0?32:31-(_t(e)/vt|0)|0}var bt=64,xt=4194304;function St(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ct(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=St(a))):r=St(s)}else o=n&~i,o===0?a!==0&&(r=St(a)):r=St(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function kt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function At(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=mn(),pn=fn=dn=null,Qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(){for(var e=window,t=B();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=B(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Er(e){var t=wr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cr(n.ownerDocument.documentElement,n)){if(r!==null&&Tr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Sr(n,a);var o=Sr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==B(r)||(r=Or,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&br(Ar,r)||(Ar=r,r=ii(kr,`onSelect`),0Fi||(e.current=Pi[Fi],Pi[Fi]=null,Fi--)}function Ri(e,t){Fi++,Pi[Fi]=e.current,e.current=t}var zi={},Bi=Ii(zi),Vi=Ii(!1),Hi=zi;function Ui(e,t){var n=e.type.contextTypes;if(!n)return zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Wi(e){return e=e.childContextTypes,e!=null}function Gi(){Li(Vi),Li(Bi)}function Ki(e,t,n){if(Bi.current!==zi)throw Error(r(168));Ri(Bi,t),Ri(Vi,n)}function qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,se(e)||`Unknown`,a));return R({},n,i)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zi,Hi=Bi.current,Ri(Bi,e),Ri(Vi,Vi.current),!0}function Yi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=qi(e,t,Hi),i.__reactInternalMemoizedMergedChildContext=e,Li(Vi),Li(Bi),Ri(Bi,e)):Li(Vi),Ri(Vi,n)}var Xi=null,Zi=!1,Qi=!1;function $i(e){Xi===null?Xi=[e]:Xi.push(e)}function ea(e){Zi=!0,$i(e)}function ta(){if(!Qi&&Xi!==null){Qi=!0;var e=0,t=X;try{var n=Xi;for(X=1;e>=o,i-=o,la=1<<32-gt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),_a&&da(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),_a&&da(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return _a&&da(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),_a&&da(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&ja(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=ka(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=ka(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(_e(i))return h(e,r,i,o);if(ee(i))return g(e,r,i,o);Aa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Na=Ma(!0),Pa=Ma(!1),Fa=Ii(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Li(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e)if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(r(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e;return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{X=n,vo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Z(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}var ds={readContext:Ua,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ua,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=bo,a=jo();if(_a){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Vc===null)throw Error(r(349));yo&30||Ro(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,i,o,e),[e]),i.flags|=2048,Wo(9,zo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(_a){var n=ua,r=la;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[wi]=t,e[Ti]=i,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=je(n,i),n){case`dialog`:Zr(`cancel`,e),Zr(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:Zr(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;oel&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304)}else{if(!i)if(e=mo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!_a)return oc(t),null}else 2*ot()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ot(),t.sibling=null,n=po.current,Ri(po,i?n&1|2:n&1),t);case 22:case 23:return wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function cc(e,t){switch(ma(t),t.tag){case 1:return Wi(t.type)&&Gi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),Li(Vi),Li(Bi),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fo(t),null;case 13:if(Li(po),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Li(po),null;case 4:return lo(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(fi=rn,e=wr(),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(pi={focusedElem:e,selectionRange:n},rn=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wi],delete t[Ti],delete t[Di],delete t[Oi],delete t[ki])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=di));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount==`function`)try{mt.onCommitFiberUnmount(pt,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?bi(e.parentNode,n):e.nodeType===1&&bi(e,n),tn(e)):bi(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=ot()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Lc(i/1960))-i,10e?16:e,ol===null)var i=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(r(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lot()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=xt,xt<<=1,!(xt&130023424)&&(xt=4194304)):t=1);var n=fl();e=qa(e,t),e!==null&&(kt(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}else Ms=!1,_a&&t.flags&1048576&&fa(t,aa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;$s(e,t),e=t.pendingProps;var a=Ui(t,Bi.current);Ha(t,n),a=ko(null,t,i,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Wi(i)?(o=!0,Ji(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,i,e,n),t=Vs(null,t,i,!0,o,n)):(t.tag=0,_a&&o&&pa(t),Ns(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=hs(i,e),a){case 0:t=zs(null,t,i,e,n);break a;case 1:t=Bs(null,t,i,e,n);break a;case 11:t=Ps(null,t,i,e,n);break a;case 14:t=Fs(null,t,i,hs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),zs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Bs(e,t,i,a,n);case 3:a:{if(Hs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(r(423)),t),t=Us(e,t,i,n,a);break a}else if(i!==a){a=Ss(Error(r(424)),t),t=Us(e,t,i,n,a);break a}else for(ga=xi(t.stateNode.containerInfo.firstChild),ha=t,_a=!0,va=null,n=Pa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ea(),i===a){t=ec(e,t,n);break a}Ns(e,t,i,n)}t=t.child}return t;case 5:return uo(t),e===null&&Sa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,mi(i,a)?s=null:o!==null&&mi(i,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Sa(t),null;case 13:return Ks(e,t,n);case 4:return co(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Na(t,null,i,n):Ns(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Ps(e,t,i,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ri(Fa,i._currentValue),i._currentValue=s,o!==null)if(Z(o.value,s)){if(o.children===a.children&&!Vi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ha(t,n),a=Ua(a),i=i(a),t.flags|=1,Ns(e,t,i,n),t.child;case 14:return i=t.type,a=hs(i,t.pendingProps),a=hs(i.type,a),Fs(e,t,i,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),$s(e,t),t.tag=1,Wi(i)?(e=!0,Ji(t)):e=!1,Ha(t,n),ys(t,i,a),xs(t,i,a,n),Vs(null,t,i,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return nt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Kl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ot(0),this.expirationTimes=Ot(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ot(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=typeof FormData<`u`&&t.body instanceof FormData,r=await fetch(e,{credentials:`same-origin`,headers:n?t.headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok){let e=a?.error||a?.Error||a?.message||r.statusText;throw new v(r.status,e)}return a}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),gifts:()=>y(`/api/gifts`),officialGifts:()=>y(`/api/official-gifts`),officialGiftAnimation:e=>y(`/api/official-gifts/${encodeURIComponent(e)}/animation`),giftAnimation:e=>y(`/api/gifts/${encodeURIComponent(e)}/animation`),giftCollectibles:e=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles`),giftCollectibleAnimation:(e,t,n)=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles/${t}/${encodeURIComponent(n)}/animation`),importGift:e=>y(`/api/actions/import-gift`,{method:`POST`,body:e}),importOfficialGift:e=>y(`/api/actions/import-official-gift`,{method:`POST`,body:JSON.stringify(e)}),publishGiftCollectibles:(e,t)=>y(`/api/actions/publish-gift-collectibles?gift_id=${encodeURIComponent(e)}`,{method:`POST`,body:t}),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},S=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),C=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...w,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),E=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(T,{ref:i,iconNode:t,className:C(`lucide-${S(e)}`,n),...r}));return n.displayName=`${e}`,n},D=E(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=E(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),k=E(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),A=E(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),j=E(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),M=E(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),N=E(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),P=E(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),F=E(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),I=E(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),L=E(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),ee=E(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),R=E(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),te=E(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),ne=E(`Gem`,[[`path`,{d:`M6 3h12l4 6-10 13L2 9Z`,key:`1pcd5k`}],[`path`,{d:`M11 3 8 9l4 13 4-13-3-6`,key:`1fcu3u`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),re=E(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),ie=E(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ae=E(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),oe=E(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),se=E(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),ce=E(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),le=E(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),ue=E(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),z=E(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),de=E(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),B=E(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),V=E(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),fe=E(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),pe=E(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),me=E(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),he=E(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ge=E(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),_e=E(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),ve=E(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),ye=E(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),H=E(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),U=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),W=o(((e,t)=>{t.exports=U()}))(),be=`telesrv.admin.lang`,xe={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"route.gifts":`Star Gifts`,"route.giftsSubtitle":`Console / Star Gifts`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.gifts":`Star Gifts`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Switch to dark theme`,"theme.switchToLight":`Switch to light theme`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.accountFrozen":`Account frozen`,"account.accountActive":`Account active`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeAccount":`Freeze account`,"account.updateFreeze":`Update freeze`,"account.unfreezeAccount":`Unfreeze account`,"account.freezeSince":`Frozen since`,"account.freezeUntil":`Appeal deadline`,"account.freezeUntilAria":`Freeze appeal deadline`,"account.freezeAppealURL":`Appeal URL`,"account.freezeAppealURLAria":`Freeze appeal URL`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"gifts.pageTitle":`Star Gift Catalog`,"gifts.eyebrow":`Catalog, immutable revisions and animation assets`,"gifts.total":`Catalog entries`,"gifts.enabled":`Enabled`,"gifts.received":`Received gifts`,"gifts.formats":`Accepted formats`,"gifts.add":`Add gift`,"gifts.searchPlaceholder":`Search gift ID, title or format`,"gifts.listSummary":`Showing {shown} of {total}`,"gifts.idRevision":`ID / Revision`,"gifts.price":`Price / Conversion`,"gifts.importTitle":`Import a Star Gift`,"gifts.importEyebrow":`Gift catalog operation`,"gifts.newRevision":`Create revision for gift #{id}`,"gifts.importHint":`Upload TGS or plain Lottie JSON. Lottie is normalized and compressed to TGS.`,"gifts.officialSource":`Official snapshot`,"gifts.fileSource":`Upload file`,"gifts.officialHint":`Choose a verified gift from data/official-gifts. Complete collectible pools are imported atomically.`,"gifts.officialSearch":`Search official gift ID or title`,"gifts.officialSelect":`Choose an official gift`,"gifts.officialRequired":`Choose an official gift first`,"gifts.officialResults":`Showing {shown} of {total}`,"gifts.officialCategoryLabel":`Official gift capability category`,"gifts.officialCategory.all":`All`,"gifts.officialCategory.upgrade":`Upgradable`,"gifts.officialCategory.craft":`Craftable`,"gifts.officialCategory.basic":`Not upgradable`,"gifts.officialUnnamed":`Unnamed official gift #{id}`,"gifts.officialAttributes":`{count} attributes`,"gifts.canUpgrade":`Can upgrade`,"gifts.cannotUpgrade":`Cannot upgrade`,"gifts.canCraft":`Can Craft`,"gifts.cannotCraft":`Cannot Craft`,"gifts.officialEmpty":`No official gifts match this category and search.`,"gifts.includeCollectible":`Import the complete collectible pool, including crafted models`,"gifts.animation":`Animation file`,"gifts.filePrompt":`Drop or choose a TGS / Lottie file`,"gifts.fileHint":`TGS, JSON or Lottie · validated before import`,"gifts.chooseFile":`Choose file`,"gifts.changeFile":`Change file`,"gifts.title":`Display title`,"gifts.titlePlaceholder":`e.g. Celebration Star`,"gifts.stars":`Price in Stars`,"gifts.convertStars":`Conversion Stars`,"gifts.sortOrder":`Sort order`,"gifts.reason":`Audit reason`,"gifts.reasonPlaceholder":`Briefly describe why this gift is being imported`,"gifts.enableAfterImport":`Enable after import`,"gifts.validate":`Dry-run validation`,"gifts.confirmImport":`Confirm import`,"gifts.stepDetails":`File and details`,"gifts.stepValidate":`Dry-run validation`,"gifts.stepImport":`Confirm import`,"gifts.fileRequired":`Choose a TGS or Lottie file first`,"gifts.source":`Source`,"gifts.replace":`New revision`,"gifts.disable":`Disable`,"gifts.enable":`Enable`,"gifts.empty":`No Star Gifts have been imported.`,"gifts.emptyHint":`Import the first animation above to build the gift catalog.`,"gifts.validationReady":`Validation passed`,"gifts.validationHint":`Review the normalized metadata, then confirm the import.`,"gifts.confirmState":`Apply the validated state change to gift #{id}?`,"collectibles.manage":`Attribute pool`,"collectibles.title":`Collectible pool · Gift #{id}`,"collectibles.eyebrow":`Unique gift attributes`,"collectibles.activeRevision":`Published revision {revision}`,"collectibles.published":`Published`,"collectibles.noPool":`No collectible pool published`,"collectibles.noPoolHint":`Publish models, patterns and backdrops to enable upgrades.`,"collectibles.publishNew":`Publish a new immutable revision`,"collectibles.immutableHint":`Dry-run checks every file and the attribute-pool structure before the revision becomes active.`,"collectibles.upgradeStars":`Upgrade price in Stars`,"collectibles.supply":`Unique supply`,"collectibles.slug":`Public slug prefix`,"collectibles.models":`Models`,"collectibles.patterns":`Patterns`,"collectibles.backdrops":`Backdrops`,"collectibles.model":`Model`,"collectibles.pattern":`Pattern`,"collectibles.backdrop":`Backdrop`,"collectibles.rarity":`Rarity ‰`,"collectibles.rarityHint":`Keep at least two attributes. Permille values are relative regular-upgrade weights; add/remove redistributes them to 1000.`,"collectibles.minimumAttributes":`Models, patterns, and backdrops must each contain at least two attributes.`,"collectibles.duplicateBackdropID":`Backdrop IDs must be unique within the pool.`,"collectibles.colorHint":`Colors are stored as 24-bit RGB values.`,"collectibles.addAttribute":`Add`,"collectibles.remove":`Remove attribute`,"collectibles.fileRequired":`Every model and pattern needs a TGS or Lottie file.`,"collectibles.backdropID":`Backdrop ID`,"collectibles.color.center":`Center`,"collectibles.color.edge":`Edge`,"collectibles.color.pattern":`Pattern`,"collectibles.color.text":`Text`,"collectibles.validationReady":`Attribute pool is valid`,"collectibles.validationHint":`Review the normalized assets, then publish this immutable revision.`,"collectibles.publish":`Publish revision`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"route.gifts":`星星礼物`,"route.giftsSubtitle":`控制台 / 星星礼物`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.gifts":`礼物目录`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`切换到深色主题`,"theme.switchToLight":`切换到浅色主题`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.accountFrozen":`账号已冻结`,"account.accountActive":`账号正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeAccount":`冻结账号`,"account.updateFreeze":`更新冻结信息`,"account.unfreezeAccount":`解冻账号`,"account.freezeSince":`冻结开始时间`,"account.freezeUntil":`申诉截止时间`,"account.freezeUntilAria":`账号冻结申诉截止时间`,"account.freezeAppealURL":`申诉链接`,"account.freezeAppealURLAria":`账号冻结申诉链接`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"gifts.pageTitle":`星星礼物目录`,"gifts.eyebrow":`目录、不可变版本与动画资源`,"gifts.total":`目录条目`,"gifts.enabled":`已启用`,"gifts.received":`已领取礼物`,"gifts.formats":`支持格式`,"gifts.add":`添加礼物`,"gifts.searchPlaceholder":`搜索礼物 ID、标题或格式`,"gifts.listSummary":`显示 {shown} / {total} 项`,"gifts.idRevision":`ID / 版本`,"gifts.price":`售价 / 兑换`,"gifts.importTitle":`导入星星礼物`,"gifts.importEyebrow":`礼物目录操作`,"gifts.newRevision":`为礼物 #{id} 创建新版本`,"gifts.importHint":`支持 TGS 或纯 Lottie JSON;Lottie 会规范化并压缩成 TGS。`,"gifts.officialSource":`官方资源库`,"gifts.fileSource":`上传文件`,"gifts.officialHint":`从 data/official-gifts 的已校验快照中选择;完整 collectible 属性池会与礼物原子导入。`,"gifts.officialSearch":`搜索官方礼物 ID 或标题`,"gifts.officialSelect":`请选择官方礼物`,"gifts.officialRequired":`请先选择一个官方礼物`,"gifts.officialResults":`显示 {shown} / {total} 项`,"gifts.officialCategoryLabel":`官方礼物能力分类`,"gifts.officialCategory.all":`全部`,"gifts.officialCategory.upgrade":`可升级`,"gifts.officialCategory.craft":`可 Craft`,"gifts.officialCategory.basic":`不可升级`,"gifts.officialUnnamed":`未命名官方礼物 #{id}`,"gifts.officialAttributes":`{count} 个属性`,"gifts.canUpgrade":`可升级`,"gifts.cannotUpgrade":`不可升级`,"gifts.canCraft":`可 Craft`,"gifts.cannotCraft":`不可 Craft`,"gifts.officialEmpty":`当前分类和搜索条件下没有官方礼物。`,"gifts.includeCollectible":`完整导入 collectible 属性池(包含 crafted 模型)`,"gifts.animation":`动画文件`,"gifts.filePrompt":`拖放或选择 TGS / Lottie 文件`,"gifts.fileHint":`支持 TGS、JSON、Lottie,导入前会先进行校验`,"gifts.chooseFile":`选择文件`,"gifts.changeFile":`更换文件`,"gifts.title":`显示标题`,"gifts.titlePlaceholder":`例如:庆典星星`,"gifts.stars":`售价 Stars`,"gifts.convertStars":`可兑换 Stars`,"gifts.sortOrder":`排序值`,"gifts.reason":`审计原因`,"gifts.reasonPlaceholder":`简要说明本次导入礼物的原因`,"gifts.enableAfterImport":`导入后启用`,"gifts.validate":`Dry-run 校验`,"gifts.confirmImport":`确认导入`,"gifts.stepDetails":`文件与信息`,"gifts.stepValidate":`Dry-run 校验`,"gifts.stepImport":`确认导入`,"gifts.fileRequired":`请先选择 TGS 或 Lottie 文件`,"gifts.source":`来源`,"gifts.replace":`创建新版本`,"gifts.disable":`停用`,"gifts.enable":`启用`,"gifts.empty":`尚未导入星星礼物。`,"gifts.emptyHint":`从上方导入第一个动画,开始搭建礼物目录。`,"gifts.validationReady":`校验已通过`,"gifts.validationHint":`确认规范化后的元数据无误,再执行正式导入。`,"gifts.confirmState":`确认执行礼物 #{id} 的状态变更吗?`,"collectibles.manage":`属性池`,"collectibles.title":`Collectibles 属性池 · 礼物 #{id}`,"collectibles.eyebrow":`唯一礼物属性管理`,"collectibles.activeRevision":`已发布版本 {revision}`,"collectibles.published":`已发布`,"collectibles.noPool":`尚未发布 Collectibles 属性池`,"collectibles.noPoolHint":`发布模型、图案与背景后,客户端即可升级为唯一礼物。`,"collectibles.publishNew":`发布新的不可变版本`,"collectibles.immutableHint":`Dry-run 会校验全部文件和属性池结构,通过后才切换为当前版本。`,"collectibles.upgradeStars":`升级价格 Stars`,"collectibles.supply":`唯一礼物总量`,"collectibles.slug":`公开 Slug 前缀`,"collectibles.models":`模型`,"collectibles.patterns":`图案`,"collectibles.backdrops":`背景`,"collectibles.model":`模型`,"collectibles.pattern":`图案`,"collectibles.backdrop":`背景`,"collectibles.rarity":`稀有度 ‰`,"collectibles.rarityHint":`每类至少保留两项。Permille 是普通升级的相对权重,增删时会自动重新分配为 1000。`,"collectibles.minimumAttributes":`模型、图案和背景每类都必须至少包含两个属性。`,"collectibles.duplicateBackdropID":`同一属性池中的背景 ID 必须唯一。`,"collectibles.colorHint":`颜色会按 24 位 RGB 数值保存。`,"collectibles.addAttribute":`添加`,"collectibles.remove":`删除属性`,"collectibles.fileRequired":`每个模型和图案都必须选择 TGS 或 Lottie 文件。`,"collectibles.backdropID":`背景 ID`,"collectibles.color.center":`中心色`,"collectibles.color.edge":`边缘色`,"collectibles.color.pattern":`图案色`,"collectibles.color.text":`文字色`,"collectibles.validationReady":`属性池校验通过`,"collectibles.validationHint":`确认规范化资源无误后,即可发布这个不可变版本。`,"collectibles.publish":`发布版本`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`},ru:{"app.adminConsole":`Панель администратора`,"app.localAccess":`Локальный доступ`,"app.title":`telesrv admin`,"common.actions":`Действия`,"common.admins":`Администраторы`,"common.backToList":`Назад к списку`,"common.channel":`Канал`,"common.channelOrGroup":`Канал / Группа`,"common.clear":`Очистить`,"common.close":`Закрыть`,"common.count":`Количество`,"common.deleted":`Удалено`,"common.detail":`Детали`,"common.device":`Устройство`,"common.disabled":`Отключено`,"common.enabled":`Включено`,"common.fromPeer":`От пира`,"common.group":`Группа`,"common.id":`ID`,"common.limit":`Лимит`,"common.loading":`Загрузка…`,"common.member":`Участник`,"common.members":`Участники`,"common.messageId":`ID сообщения`,"common.name":`Имя`,"common.no":`Нет`,"common.noResults":`Нет результатов`,"common.none":`Нет`,"common.normal":`Обычный`,"common.operations":`Операции`,"common.owner":`Владелец`,"common.platform":`Платформа`,"common.refresh":`Обновить`,"common.search":`Поиск`,"common.sender":`Отправитель`,"common.status":`Статус`,"common.survived":`Уцелело`,"common.time":`Время`,"common.type":`Тип`,"common.updatedAt":`Обновлено`,"common.username":`Имя пользователя`,"common.valid":`Действителен`,"common.verified":`Подтверждён`,"common.views":`Просмотры`,"common.yes":`Да`,"route.accounts":`Аккаунты`,"route.accountsSubtitle":`Консоль / Аккаунты`,"route.channels":`Супергруппы и каналы`,"route.channelsSubtitle":`Консоль / Каналы`,"route.dashboard":`Панель управления`,"route.dashboardSubtitle":`Консоль / Обзор`,"route.messages":`Аудит сообщений`,"route.messagesSubtitle":`Консоль / Сообщения`,"route.gifts":`Звёздные подарки`,"route.giftsSubtitle":`Консоль / Звёздные подарки`,"layout.navigation":`Навигация`,"layout.primaryNav":`Основное меню`,"layout.dashboard":`Обзор`,"layout.accounts":`Аккаунты`,"layout.channels":`Супергруппы / Каналы`,"layout.messages":`Сообщения`,"layout.gifts":`Звёздные подарки`,"layout.privateMessages":`Личные`,"layout.groupMessages":`Группы`,"layout.runtime":`Среда выполнения`,"layout.adminBackend":`Админ-бэкенд`,"layout.ready":`Готов`,"layout.pgRead":`Чтение из PG`,"layout.readOnly":`Только чтение`,"layout.writeOps":`Операции записи`,"layout.dryRun":`Тестовый запуск`,"layout.actor":`Вы вошли как: {actor}`,"layout.logout":`Выйти`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Тёмная тема`,"theme.switchToLight":`Светлая тема`,"login.heading":`Панель администратора`,"login.body":`Введите учётные данные для входа в консоль.`,"login.secret":`Пароль или токен администратора`,"login.submit":`Войти`,"login.submitting":`Вход…`,"dashboard.eyebrow":`Состояние системы`,"dashboard.title":`Обзор консоли`,"dashboard.readPath":`Путь чтения`,"dashboard.readPathValue":`PG только для чтения`,"dashboard.writePath":`Путь записи`,"dashboard.executionPolicy":`Политика выполнения`,"dashboard.dryRunFirst":`Сначала тестовый запуск`,"dashboard.accountsText":`Статус аккаунтов, Premium, подтверждение, сессии.`,"dashboard.channelsText":`Публичные каналы и группы, число участников, статус подтверждения.`,"dashboard.messagesText":`Ящики сообщений, обновления, состояние исходящих.`,"dashboard.strip.dryRun":`Все опасные действия начинаются с тестового запуска`,"dashboard.strip.token":`Браузер никогда не сохраняет внутренние токены`,"dashboard.strip.pagination":`Списки используют курсорную пагинацию`,"dashboard.strip.snapshot":`Детальные страницы сохраняют моментальные снимки исходного состояния`,"account.pageTitle":`Аккаунты`,"account.queryResults":`Результаты поиска`,"account.recentActive":`Недавно активные аккаунты`,"account.currentPage":`Аккаунты на странице`,"account.onlineDevices":`Активные сессии устройств`,"account.premium":`Premium`,"account.frozen":`Заморожен`,"account.searchPlaceholder":`ID пользователя / телефон / имя пользователя`,"account.userID":`ID пользователя`,"account.phone":`Телефон`,"account.lastActive":`Последняя активность`,"account.notVerified":`Не подтверждён`,"account.notPremium":`Без Premium`,"account.premiumUntil":`Premium истекает`,"account.starsBalance":`Баланс Звёзд`,"account.startingGrantApplied":`стартовый бонус начислен`,"account.startingGrantPending":`ожидает стартового бонуса`,"account.activeSessions":`Авторизованные устройства`,"account.accountFlags":`Флаги аккаунта`,"account.restriction":`Ограничение`,"account.restricted":`Ограничен`,"account.createdAt":`Создан`,"account.detailTitle":`Аккаунт #{id}`,"account.profile":`Профиль аккаунта`,"account.loadingDetail":`Загрузка данных аккаунта`,"account.waitingData":`Ожидание данных`,"account.noUsername":`Нет имени пользователя`,"account.noPhone":`Нет телефона`,"account.accountFrozen":`Аккаунт заморожен`,"account.accountActive":`Аккаунт активен`,"account.authorizationsTitle":`Авторизованные устройства`,"account.authorizationsCount":`Авторизаций: {count}`,"account.recentAdminOps":`Последние действия администратора`,"account.recent30Audit":`Последние 30 записей аудита`,"account.actionDock":`Действия с аккаунтом`,"account.freezeAccount":`Заморозить аккаунт`,"account.updateFreeze":`Обновить параметры заморозки`,"account.unfreezeAccount":`Разморозить аккаунт`,"account.freezeSince":`Заморожен с`,"account.freezeUntil":`Срок подачи апелляции`,"account.freezeUntilAria":`Срок подачи апелляции на заморозку`,"account.freezeAppealURL":`URL для апелляции`,"account.freezeAppealURLAria":`URL для апелляции на заморозку`,"account.premiumMonths":`Срок действия Premium (в месяцах)`,"account.premiumMonthsAria":`Указать срок действия Premium в месяцах`,"account.setPremium":`Выдать Premium`,"account.clearPremium":`Снять Premium`,"account.starsAmount":`Количество Звёзд`,"account.starsAmountAria":`Указать количество начисляемых Звёзд`,"account.grantStars":`Начислить Звёзды`,"account.setVerified":`Подтвердить аккаунт`,"account.clearVerified":`Снять подтверждение`,"channel.pageTitle":`Супергруппы и каналы`,"channel.recentUpdated":`Недавно обновлённые`,"channel.currentPage":`Объекты на странице`,"channel.megagroups":`Супергруппы`,"channel.broadcasts":`Каналы`,"channel.verifiedCount":`Подтверждённые`,"channel.searchPlaceholder":`ID канала / имя пользователя / название`,"channel.channelID":`ID канала`,"channel.kind":`Тип`,"channel.title":`Название`,"channel.pts":`PTS`,"channel.detailProfile":`Профиль канала`,"channel.loadingDetail":`Загрузка данных канала`,"channel.creator":`Создатель: {id}`,"channel.governance":`Модерация`,"channel.governanceValue":`Заблокировано {banned} / Исключено {kicked}`,"channel.flags":`Флаги канала`,"channel.rawRow":`Исходная строка БД`,"channel.rawRowText":`Снимок базы данных только для чтения`,"channel.actionDock":`Действия с каналом`,"channel.setVerified":`Подтвердить канал`,"channel.clearVerified":`Снять подтверждение`,"channel.kind.broadcast":`Канал`,"channel.kind.forum":`Супергруппа / Форум`,"channel.kind.megagroup":`Супергруппа`,"channel.kind.generic":`Канал / Группа`,"messages.privateTitle":`Личные сообщения`,"messages.privateEyebrow":`Личные ящики сообщений`,"messages.groupTitle":`Групповые сообщения`,"messages.groupEyebrow":`Сообщения супергрупп и каналов`,"messages.selectPrivatePeers":`Сначала найдите и выберите владельца и собеседника`,"messages.selectChannel":`Сначала найдите и выберите супергруппу или канал`,"messages.ownerUser":`Пользователь-владелец`,"messages.peerUser":`Собеседник`,"messages.beforeDatePlaceholder":`курсор before_date`,"messages.beforeIDPlaceholder":`курсор before_msg_id`,"messages.limitPlaceholder":`лимит <= 100`,"messages.searchMessages":`Поиск сообщений`,"messages.nextPage":`Следующая страница`,"messages.currentPage":`Сообщения на странице`,"messages.deleted":`Удалено`,"messages.outgoing":`Исходящее`,"messages.incoming":`Входящее`,"messages.ownerPeer":`Владелец / Собеседник`,"messages.deleteSelected":`Удалить выбранные сообщения`,"messages.idsPlaceholder":`ID сообщений через запятую`,"messages.revoke":`Удалить для обеих сторон`,"messages.previewDelete":`Тестовое удаление`,"messages.clearHistory":`Очистить историю личной переписки`,"messages.maxIDPlaceholder":`граница max_id`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Очистить только у себя`,"messages.previewClearHistory":`Тестовая очистка истории`,"messages.direction":`Направление`,"messages.body":`Текст сообщения`,"messages.privateDetailTitle":`Сообщение #{id}`,"messages.detailEyebrow":`Детали сообщения`,"messages.backPrivate":`Назад к личным сообщениям`,"messages.backGroup":`Назад к групповым сообщениям`,"messages.ownerPeerTitle":`Владелец {owner} · Собеседник {peer}`,"messages.senderSubtitle":`Отправитель {sender} · {date}`,"messages.boxID":`ID ящика сообщений`,"messages.privateMessageID":`ID личного сообщения`,"messages.messageSender":`Отправитель сообщения`,"messages.messageBox":`Ящик сообщений`,"messages.dialogRow":`Строка диалога`,"messages.privateRow":`Строка личного сообщения`,"messages.channelMessageRow":`Строка сообщения канала`,"messages.channelRow":`Строка канала`,"messages.userUpdateEvents":`События обновления пользователей`,"messages.channelUpdateEvents":`События обновления каналов`,"messages.eventJson":`JSON события`,"messages.dispatchOutbox":`Очередь отправки (Outbox)`,"messages.messageBoxesSnapshot":`Снимок message_boxes только для чтения`,"messages.dialogSnapshot":`Снимок dialogs только для чтения`,"messages.privateSnapshot":`Снимок private_messages только для чтения`,"messages.channelMessagesSnapshot":`Снимок channel_messages только для чтения`,"messages.channelSnapshot":`Снимок channels только для чтения`,"messages.userEventsSource":`постоянные user_update_events`,"messages.channelEventsSource":`постоянные channel_update_events`,"messages.outboxSource":`онлайн/офлайн dispatch_outbox`,"messages.attempts":`Попытки`,"messages.deleteThis":`Удалить это сообщение`,"messages.groupDetailTitle":`Групповое сообщение #{id}`,"messages.channelGroupTitle":`Канал / Группа {id}`,"messages.mediaCount":`С медиафайлами`,"messages.channelPosts":`Посты канала`,"messages.channelGroup":`Канал / Группа`,"messages.pinned":`Закреплено`,"messages.channelPost":`Пост в канале`,"gifts.pageTitle":`Каталог звёздных подарков`,"gifts.eyebrow":`Каталог, неизменяемые версии и файлы анимаций`,"gifts.total":`Подарков в каталоге`,"gifts.enabled":`Включено`,"gifts.received":`Полученные подарки`,"gifts.formats":`Поддерживаемые форматы`,"gifts.add":`Добавить подарок`,"gifts.searchPlaceholder":`Поиск по ID подарка, названию или формату`,"gifts.listSummary":`Показано {shown} из {total}`,"gifts.idRevision":`ID / Версия`,"gifts.price":`Цена / Конвертация`,"gifts.importTitle":`Импорт звёздного подарка`,"gifts.importEyebrow":`Управление каталогом подарков`,"gifts.newRevision":`Создать версию для подарка #{id}`,"gifts.importHint":`Загрузите файл TGS или обычный Lottie JSON. Lottie нормализуется и сжимается в формат TGS.`,"gifts.officialSource":`Официальный снимок`,"gifts.fileSource":`Загрузить файл`,"gifts.officialHint":`Выберите проверенный подарок из data/official-gifts. Полные пулы коллекционных предметов импортируются атомарно.`,"gifts.officialSearch":`Поиск по ID или названию официального подарка`,"gifts.officialSelect":`Выберите официальный подарок`,"gifts.officialRequired":`Сначала выберите официальный подарок`,"gifts.officialResults":`Показано {shown} из {total}`,"gifts.officialCategoryLabel":`Категория возможностей официального подарка`,"gifts.officialCategory.all":`Все`,"gifts.officialCategory.upgrade":`Можно улучшить`,"gifts.officialCategory.craft":`Можно создать`,"gifts.officialCategory.basic":`Нельзя улучшить`,"gifts.officialUnnamed":`Официальный подарок без названия #{id}`,"gifts.officialAttributes":`Атрибутов: {count}`,"gifts.canUpgrade":`Можно улучшить`,"gifts.cannotUpgrade":`Нельзя улучшить`,"gifts.canCraft":`Можно создать`,"gifts.cannotCraft":`Нельзя создать`,"gifts.officialEmpty":`Нет подарков, соответствующих категории и поиску.`,"gifts.includeCollectible":`Импортировать полный пул коллекционных предметов, включая созданные модели`,"gifts.animation":`Файл анимации`,"gifts.filePrompt":`Перетащите или выберите файл TGS / Lottie`,"gifts.fileHint":`TGS, JSON или Lottie · файл проверяется перед импортом`,"gifts.chooseFile":`Выбрать файл`,"gifts.changeFile":`Изменить файл`,"gifts.title":`Отображаемое название`,"gifts.titlePlaceholder":`например, Праздничная звезда`,"gifts.stars":`Цена в Звёздах`,"gifts.convertStars":`Звёзд при конвертации`,"gifts.sortOrder":`Порядок сортировки`,"gifts.reason":`Причина для аудита`,"gifts.reasonPlaceholder":`Кратко опишите причину импорта этого подарка`,"gifts.enableAfterImport":`Включить после импорта`,"gifts.validate":`Тестовая проверка`,"gifts.confirmImport":`Подтвердить импорт`,"gifts.stepDetails":`Файл и описание`,"gifts.stepValidate":`Тестовая проверка`,"gifts.stepImport":`Подтверждение импорта`,"gifts.fileRequired":`Сначала выберите файл TGS или Lottie`,"gifts.source":`Источник`,"gifts.replace":`Новая версия`,"gifts.disable":`Отключить`,"gifts.enable":`Включить`,"gifts.empty":`Звёздные подарки ещё не импортированы.`,"gifts.emptyHint":`Импортируйте первую анимацию, чтобы начать наполнение каталога.`,"gifts.validationReady":`Проверка пройдена`,"gifts.validationHint":`Проверьте нормализованные метаданные и подтвердите импорт.`,"gifts.confirmState":`Применить проверенные изменения состояния к подарку #{id}?`,"collectibles.manage":`Пул атрибутов`,"collectibles.title":`Пул коллекционных предметов · Подарок #{id}`,"collectibles.eyebrow":`Уникальные атрибуты подарка`,"collectibles.activeRevision":`Опубликованная версия {revision}`,"collectibles.published":`Опубликовано`,"collectibles.noPool":`Нет опубликованного пула коллекционных предметов`,"collectibles.noPoolHint":`Опубликуйте модели, узоры и фоны для активации улучшений.`,"collectibles.publishNew":`Опубликовать новую неизменяемую версию`,"collectibles.immutableHint":`Тестовый запуск проверяет каждый файл и структуру набора атрибутов перед активацией версии.`,"collectibles.upgradeStars":`Цена улучшения в Звёздах`,"collectibles.supply":`Уникальный тираж`,"collectibles.slug":`Публичный префикс ссылки (slug)`,"collectibles.models":`Модели`,"collectibles.patterns":`Узоры`,"collectibles.backdrops":`Фоны`,"collectibles.model":`Модель`,"collectibles.pattern":`Узор`,"collectibles.backdrop":`Фон`,"collectibles.rarity":`Редкость ‰`,"collectibles.rarityHint":`В каждой категории должно быть не менее двух атрибутов. Значения в промилле задают относительные веса обычного улучшения; при добавлении или удалении они перераспределяются до суммы 1000.`,"collectibles.minimumAttributes":`Модели, узоры и фоны должны содержать не менее двух атрибутов в каждой категории.`,"collectibles.duplicateBackdropID":`ID фонов в одном наборе должны быть уникальными.`,"collectibles.colorHint":`Цвета сохраняются как 24-битные RGB-значения.`,"collectibles.addAttribute":`Добавить`,"collectibles.remove":`Удалить атрибут`,"collectibles.fileRequired":`Для каждой модели и узора требуется файл TGS или Lottie.`,"collectibles.backdropID":`ID фона`,"collectibles.color.center":`Центр`,"collectibles.color.edge":`Край`,"collectibles.color.pattern":`Узор`,"collectibles.color.text":`Текст`,"collectibles.validationReady":`Пул атрибутов корректен`,"collectibles.validationHint":`Проверьте нормализованные ресурсы и опубликуйте эту неизменяемую версию.`,"collectibles.publish":`Опубликовать версию`,"messages.msgIDsInvalid":`Некорректные ID сообщений`,"auth.device":`Устройство`,"auth.platform":`Платформа`,"auth.ip":`IP-адрес`,"auth.lastActive":`Последняя активность`,"auth.revokeCurrent":`Отозвать текущую`,"auth.keepCurrent":`Оставить текущую`,"auth.revokeAll":`Отозвать все устройства`,"picker.userPlaceholder":`Поиск по user_id / телефону / имени пользователя`,"picker.channelPlaceholder":`Поиск по channel_id / имени пользователя / названию`,"picker.verified":`Подтверждённые`,"picker.regular":`Обычные`,"action.reasonRequired":`Пожалуйста, укажите причину операции`,"action.flow":`Процесс выполнения`,"action.close":`Закрыть`,"action.stepReason":`Укажите причину`,"action.stepDryRun":`Тестовый запуск`,"action.stepConfirm":`Подтверждение выполнения`,"action.reason":`Причина операции`,"action.reasonPlaceholder":`Опишите, почему выполняется эта операция`,"action.requestPreview":`Запросить предпросмотр`,"action.result":`Результат действия`,"action.commandID":`ID команды`,"action.status":`Статус`,"action.dryRun":`Тестовый запуск`,"action.runAgain":`Повторить тестовый запуск`,"action.runDry":`Сначала выполните тестовый запуск`,"action.confirm":`Подтвердить выполнение`,"audit.id":`ID`,"audit.commandID":`ID команды`,"audit.action":`Действие`,"audit.actor":`Исполнитель`,"audit.status":`Статус`,"audit.dryRun":`Тестовый запуск`,"audit.reason":`Причина`,"audit.time":`Время`}},Se=(0,g.createContext)(null);function Ce({children:e}){let[t,n]=(0,g.useState)(()=>De());(0,g.useEffect)(()=>{try{localStorage.setItem(be,t)}catch{}let e=t===`zh`?`zh-CN`:t===`ru`?`ru`:`en`;document.documentElement.lang=e,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=Ee(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>Ee(t,e,n)}),[t]);return(0,W.jsx)(Se.Provider,{value:r,children:e})}function we(){let e=(0,g.useContext)(Se);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function Te(){let{lang:e,setLang:t,t:n}=we();return(0,W.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`,`ru`].map(r=>(0,W.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function Ee(e,t,n){let r=xe[e][t]??xe.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function De(){try{let e=Oe(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=Oe(localStorage.getItem(be));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=Oe(t);if(e)return e}return`en`}function Oe(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:t===`ru`||t.startsWith(`ru-`)?`ru`:null}function ke(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function Ae(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/messages`)?t(`route.messages`):e.startsWith(`/gifts`)?t(`route.gifts`):t(`route.dashboard`)}function je(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):e.startsWith(`/gifts`)?t(`route.giftsSubtitle`):t(`route.dashboardSubtitle`)}var Me=`telesrv.admin.theme`,Ne=(0,g.createContext)(null);function Pe(e){document.documentElement.setAttribute(`data-theme`,e),document.documentElement.style.colorScheme=e}function Fe({children:e}){let[t,n]=(0,g.useState)(()=>Re());(0,g.useEffect)(()=>{Pe(t);try{localStorage.setItem(Me,t)}catch{}},[t]),(0,g.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>{let t=null;try{t=localStorage.getItem(Me)}catch{t=null}t!==`light`&&t!==`dark`&&n(e.matches?`dark`:`light`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let r=(0,g.useCallback)(e=>n(e),[]),i=(0,g.useCallback)(()=>n(e=>e===`dark`?`light`:`dark`),[]),a=(0,g.useMemo)(()=>({theme:t,setTheme:r,toggleTheme:i}),[t,r,i]);return(0,W.jsx)(Ne.Provider,{value:a,children:e})}function Ie(){let e=(0,g.useContext)(Ne);if(!e)throw Error(`useTheme must be used inside ThemeProvider`);return e}function Le(){let{theme:e,toggleTheme:t}=Ie(),{t:n}=we(),r=n(e===`light`?`theme.switchToDark`:`theme.switchToLight`);return(0,W.jsx)(`button`,{className:`theme-toggle`,type:`button`,onClick:t,"aria-label":r,title:r,children:e===`dark`?(0,W.jsx)(ge,{size:16}):(0,W.jsx)(le,{size:16})})}function Re(){try{let e=localStorage.getItem(Me);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches)return`dark`}catch{}return`light`}function ze({href:e,navigate:t,className:n,children:r}){return(0,W.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function G(){let{t:e}=we();return(0,W.jsxs)(`div`,{className:`boot-screen`,children:[(0,W.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,W.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`strong`,{children:`telesrv`}),(0,W.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,W.jsx)(`div`,{className:`loader-bar`})]})}function Be({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=we(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,W.jsxs)(`div`,{className:`shell`,children:[(0,W.jsxs)(`aside`,{className:`sidebar`,children:[(0,W.jsxs)(ze,{className:`brand`,href:`/`,navigate:n,children:[(0,W.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`strong`,{children:`telesrv`}),(0,W.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,W.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,W.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,W.jsx)(Ve,{icon:(0,W.jsx)(oe,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,W.jsx)(Ve,{icon:(0,W.jsx)(ye,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,W.jsx)(Ve,{icon:(0,W.jsx)(pe,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,W.jsx)(Ve,{icon:(0,W.jsx)(re,{size:16}),href:`/gifts`,route:t,navigate:n,children:a(`layout.gifts`)}),(0,W.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,W.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,W.jsx)(ce,{size:16}),(0,W.jsx)(`span`,{children:a(`layout.messages`)}),(0,W.jsx)(F,{className:`nav-section-chevron`,size:15})]}),s&&(0,W.jsxs)(`div`,{className:`nav-children`,children:[(0,W.jsx)(Ve,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,W.jsx)(Ve,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,W.jsxs)(`div`,{className:`sidebar-status`,children:[(0,W.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,W.jsxs)(`div`,{className:`runtime-row`,children:[(0,W.jsx)(fe,{size:14}),(0,W.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,W.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,W.jsxs)(`div`,{className:`runtime-row`,children:[(0,W.jsx)(ee,{size:14}),(0,W.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,W.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,W.jsxs)(`div`,{className:`runtime-row`,children:[(0,W.jsx)(me,{size:14}),(0,W.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,W.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,W.jsxs)(`div`,{className:`workspace`,children:[(0,W.jsxs)(`header`,{className:`topbar`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:je(t.path,a)}),(0,W.jsx)(`h1`,{children:Ae(t.path,a)})]}),(0,W.jsxs)(`div`,{className:`topbar-actions`,children:[(0,W.jsx)(Le,{}),(0,W.jsx)(Te,{}),(0,W.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,W.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,W.jsx)(se,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,W.jsx)(`main`,{className:`content`,children:i})]})]})}function Ve({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,W.jsxs)(ze,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,W.jsx)(`span`,{children:i})]})}function He(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function Ue(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function We(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function Ge(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function Ke(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function K(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function qe(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function q(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function Je({title:e,eyebrow:t,children:n,actions:r}){return(0,W.jsxs)(`div`,{className:`page-frame`,children:[(0,W.jsxs)(`div`,{className:`page-title-row`,children:[(0,W.jsxs)(`div`,{children:[t&&(0,W.jsx)(`div`,{className:`eyebrow`,children:t}),(0,W.jsx)(`h2`,{children:e})]}),r&&(0,W.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function Ye({children:e}){return(0,W.jsx)(`div`,{className:`query-panel`,children:e})}function Xe({main:e,side:t}){return(0,W.jsxs)(`div`,{className:`split-layout`,children:[(0,W.jsx)(`div`,{className:`split-main`,children:e}),(0,W.jsx)(`aside`,{className:`split-side`,children:t})]})}function Ze({title:e,text:t,action:n}){return(0,W.jsxs)(`div`,{className:`section-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{children:e}),t&&(0,W.jsx)(`p`,{children:t})]}),n&&(0,W.jsx)(`div`,{className:`section-action`,children:n})]})}function Qe({children:e}){return(0,W.jsxs)(`div`,{className:`alert`,children:[(0,W.jsx)(O,{size:16}),` `,(0,W.jsx)(`span`,{children:e})]})}function J({children:e,tone:t=`neutral`}){return(0,W.jsx)(`span`,{className:`badge ${t}`,children:e})}function $e({label:e,value:t,tone:n}){return(0,W.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`strong`,{children:t})]})}function et({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,W.jsxs)(`div`,{className:`metric ${n}`,children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function Y({label:e,value:t,mono:n=!1}){return(0,W.jsxs)(`div`,{className:`summary-item`,children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function tt({rows:e}){let{t}=we();return(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`audit.id`)}),(0,W.jsx)(`th`,{children:t(`audit.commandID`)}),(0,W.jsx)(`th`,{children:t(`audit.action`)}),(0,W.jsx)(`th`,{children:t(`audit.actor`)}),(0,W.jsx)(`th`,{children:t(`audit.status`)}),(0,W.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,W.jsx)(`th`,{children:t(`audit.reason`)}),(0,W.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,W.jsxs)(`tbody`,{children:[e.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.ID}),(0,W.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,W.jsx)(`td`,{children:e.Action}),(0,W.jsx)(`td`,{children:e.Actor}),(0,W.jsx)(`td`,{children:e.Status}),(0,W.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,W.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,W.jsx)(`td`,{children:Ke(e.CreatedAt)})]},e.ID)),e.length===0&&(0,W.jsx)(nt,{colSpan:8})]})]})})}function nt({colSpan:e}){let{t}=we();return(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function rt({label:e}){return(0,W.jsx)(`section`,{className:`surface`,children:(0,W.jsx)(`div`,{className:`loading-line`,children:e})})}function it({value:e}){return(0,W.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function at({onLogin:e}){let{t}=we(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,W.jsx)(`main`,{className:`login-page`,children:(0,W.jsxs)(`section`,{className:`login-panel`,children:[(0,W.jsxs)(`div`,{className:`login-head`,children:[(0,W.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,W.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`strong`,{children:`telesrv`}),(0,W.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,W.jsxs)(`div`,{className:`login-head-actions`,children:[(0,W.jsx)(Le,{}),(0,W.jsx)(Te,{}),(0,W.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,W.jsxs)(`div`,{className:`login-copy`,children:[(0,W.jsx)(`h1`,{children:t(`login.heading`)}),(0,W.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,W.jsx)(Qe,{children:i}),(0,W.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:t(`login.secret`)}),(0,W.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,W.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var ot=m();function st({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=we(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function S(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let C=f?.dry_run&&!f.error,w=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,T=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{className:w,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,ot.createPortal)((0,W.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,W.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,W.jsxs)(`div`,{className:`modal-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,W.jsx)(`h2`,{children:e})]}),(0,W.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,W.jsx)(H,{size:15})})]}),(0,W.jsxs)(`div`,{className:`command-body`,children:[(0,W.jsxs)(`div`,{className:`command-steps`,children:[(0,W.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,W.jsx)(`span`,{children:`1`}),(0,W.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`2`}),(0,W.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:C?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`3`}),(0,W.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,W.jsxs)(`label`,{className:`form-field`,children:[(0,W.jsx)(`span`,{children:s(`action.reason`)}),(0,W.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,W.jsxs)(`div`,{className:`command-preview`,children:[(0,W.jsxs)(`div`,{className:`preview-head`,children:[(0,W.jsx)(te,{size:14}),` `,s(`action.requestPreview`)]}),(0,W.jsx)(it,{value:JSON.stringify(T,null,2)})]}),m&&(0,W.jsx)(Qe,{children:m}),f&&(0,W.jsxs)(`div`,{className:`result-box`,children:[(0,W.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,W.jsx)(O,{size:16}):(0,W.jsx)(k,{size:16}),(0,W.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,W.jsxs)(`div`,{className:`result-line`,children:[(0,W.jsx)(`span`,{children:s(`action.commandID`)}),(0,W.jsx)(`strong`,{children:f.command_id})]}),(0,W.jsxs)(`div`,{className:`result-line`,children:[(0,W.jsx)(`span`,{children:s(`action.status`)}),(0,W.jsx)(`strong`,{children:f.status})]}),(0,W.jsxs)(`div`,{className:`result-line`,children:[(0,W.jsx)(`span`,{children:s(`action.dryRun`)}),(0,W.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,W.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,W.jsx)(it,{value:JSON.stringify(f.details,null,2)})]})]}),(0,W.jsxs)(`div`,{className:`modal-actions`,children:[(0,W.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>S(!1),disabled:_,children:[_?(0,W.jsx)(A,{size:15,className:`spin`}):(0,W.jsx)(z,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,W.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>S(!0),disabled:_||!C,children:[(0,W.jsx)(k,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function ct({rows:e,userID:t,onDone:n}){let{t:r}=we(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,W.jsxs)(`div`,{className:`authorization-block`,children:[(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:r(`auth.device`)}),(0,W.jsx)(`th`,{children:r(`auth.platform`)}),(0,W.jsx)(`th`,{children:r(`auth.ip`)}),(0,W.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,W.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,W.jsxs)(`tbody`,{children:[o.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,W.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,W.jsx)(`td`,{children:n.IP}),(0,W.jsx)(`td`,{children:Ke(n.ActiveAt)}),(0,W.jsx)(`td`,{className:`device-actions-cell`,children:(0,W.jsxs)(`div`,{className:`device-actions`,children:[(0,W.jsx)(st,{label:r(`auth.revokeCurrent`),icon:(0,W.jsx)(se,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,W.jsx)(st,{label:r(`auth.keepCurrent`),icon:(0,W.jsx)(pe,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,W.jsx)(nt,{colSpan:5})]})]})}),(0,W.jsx)(`div`,{className:`danger-zone`,children:(0,W.jsx)(st,{label:r(`auth.revokeAll`),icon:(0,W.jsx)(N,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function lt({id:e,navigate:t}){let{t:n}=we(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`),[p,m]=(0,g.useState)(()=>ut(new Date(Date.now()+7*864e5))),[h,_]=(0,g.useState)(``);async function v(){c(!0),o(``);try{let t=await x.account(e);i(t),t.Restriction.Frozen&&(t.Restriction.Until&&m(ut(new Date(t.Restriction.Until))),_(t.Restriction.AppealURL||``))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{v()},[e]),a)return(0,W.jsx)(Qe,{children:a});if(!r)return(0,W.jsx)(rt,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let y=r.Account;return(0,W.jsx)(Je,{title:n(`account.detailTitle`,{id:y.ID}),eyebrow:n(`account.profile`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,W.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,W.jsx)(Xe,{main:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:We(y)}),(0,W.jsxs)(`div`,{className:`entity-subtitle`,children:[Ue(y.Username)||n(`account.noUsername`),` · `,He(y.Phone)||n(`account.noPhone`)]})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[y.PremiumUntil>0?(0,W.jsx)(J,{tone:`good`,children:n(`account.premium`)}):(0,W.jsx)(J,{children:n(`account.notPremium`)}),r.Verified?(0,W.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,W.jsx)(J,{children:n(`account.notVerified`)}),y.Frozen?(0,W.jsx)(J,{tone:`danger`,children:n(`account.accountFrozen`)}):(0,W.jsx)(J,{children:n(`account.accountActive`)})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:n(`account.userID`),value:String(y.ID),mono:!0}),(0,W.jsx)(Y,{label:n(`account.lastActive`),value:K(r.LastSeenAt)||`-`}),(0,W.jsx)(Y,{label:n(`account.premiumUntil`),value:y.PremiumUntil>0?K(y.PremiumUntil):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,W.jsx)(Y,{label:n(`common.updatedAt`),value:Ke(y.UpdatedAt)||`-`}),(0,W.jsx)(Y,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,W.jsx)(Y,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,W.jsx)(Y,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.freezeSince`),value:r.Restriction.Since?Ke(r.Restriction.Since):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.freezeUntil`),value:r.Restriction.Until?Ke(r.Restriction.Until):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.freezeAppealURL`),value:r.Restriction.AppealURL||n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.createdAt`),value:Ke(y.CreatedAt)||`-`})]}),r.About&&(0,W.jsx)(`p`,{className:`about-text`,children:r.About}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,W.jsx)(ct,{rows:r.Authorizations,userID:y.ID,onDone:v})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,W.jsx)(tt,{rows:r.AuditLogs})]})]}),side:(0,W.jsxs)(`section`,{className:`action-dock`,children:[(0,W.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.freezeUntil`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.freezeUntilAria`),value:p,onChange:e=>m(e.target.value),type:`datetime-local`})]}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.freezeAppealURL`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.freezeAppealURLAria`),value:h,onChange:e=>_(e.target.value),type:`url`,placeholder:`https://...`})]}),(0,W.jsx)(st,{label:y.Frozen?n(`account.updateFreeze`):n(`account.freezeAccount`),icon:(0,W.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!0,freeze_until:new Date(p).toISOString(),freeze_appeal_url:h.trim()}),onDone:v}),y.Frozen&&(0,W.jsx)(st,{label:n(`account.unfreezeAccount`),icon:(0,W.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!1}),onDone:v}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,W.jsxs)(`div`,{className:`action-stack`,children:[(0,W.jsx)(st,{label:n(`account.setPremium`),icon:(0,W.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:qe(l)}),onDone:v}),(0,W.jsx)(st,{label:n(`account.clearPremium`),icon:(0,W.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:0}),onDone:v}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,W.jsx)(st,{label:n(`account.grantStars`),icon:(0,W.jsx)(he,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:y.ID,amount:qe(d)}),onDone:v}),(0,W.jsx)(st,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,W.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:y.ID,verified:!r.Verified}),onDone:v})]})]})})})}function ut(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function dt(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function ft(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function pt({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=dt(o?.rows??[]);return(0,W.jsxs)(Je,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,W.jsx)(B,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,W.jsx)(Qe,{children:f}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,W.jsx)(et,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,W.jsx)(et,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,W.jsx)(et,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,W.jsx)(Ye,{children:(0,W.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,W.jsxs)(`label`,{className:`field-inline`,children:[(0,W.jsx)(`span`,{children:t(`common.limit`)}),(0,W.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,W.jsx)(A,{size:15,className:`spin`}):(0,W.jsx)(V,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`account.userID`)}),(0,W.jsx)(`th`,{children:t(`account.phone`)}),(0,W.jsx)(`th`,{children:t(`common.username`)}),(0,W.jsx)(`th`,{children:t(`common.name`)}),(0,W.jsx)(`th`,{children:t(`common.device`)}),(0,W.jsx)(`th`,{children:t(`account.lastActive`)}),(0,W.jsx)(`th`,{children:t(`account.premium`)}),(0,W.jsx)(`th`,{children:t(`common.verified`)}),(0,W.jsx)(`th`,{children:t(`account.frozen`)}),(0,W.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.ID}),(0,W.jsx)(`td`,{children:He(n.Phone)}),(0,W.jsx)(`td`,{children:Ue(n.Username)}),(0,W.jsx)(`td`,{children:We(n)}),(0,W.jsx)(`td`,{children:n.DeviceCount}),(0,W.jsx)(`td`,{children:Ke(n.LastActiveAt)}),(0,W.jsx)(`td`,{children:n.PremiumUntil>0?(0,W.jsxs)(J,{tone:`good`,children:[t(`account.premium`),` `,K(n.PremiumUntil)]}):(0,W.jsx)(J,{children:t(`common.none`)})}),(0,W.jsx)(`td`,{children:n.Verified?(0,W.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,W.jsx)(J,{children:t(`account.notVerified`)})}),(0,W.jsx)(`td`,{children:n.Frozen?(0,W.jsx)(J,{tone:`danger`,children:t(`account.frozen`)}):(0,W.jsx)(J,{children:t(`common.normal`)})}),(0,W.jsx)(`td`,{children:Ke(n.UpdatedAt)}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,W.jsx)(nt,{colSpan:11})]})]})})]})}function mt({id:e,navigate:t}){let{t:n}=we(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,W.jsx)(Qe,{children:a});if(!r)return(0,W.jsx)(rt,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,W.jsx)(Je,{title:`${Ge(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,W.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,W.jsx)(Xe,{main:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,W.jsxs)(`div`,{className:`entity-subtitle`,children:[Ue(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[(0,W.jsx)(J,{children:Ge(c,n)}),c.Verified?(0,W.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,W.jsx)(J,{children:n(`account.notVerified`)}),c.Deleted?(0,W.jsx)(J,{tone:`danger`,children:n(`common.deleted`)}):(0,W.jsx)(J,{children:n(`common.valid`)})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,W.jsx)(Y,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,W.jsx)(Y,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,W.jsx)(Y,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,W.jsx)(Y,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,W.jsx)(Y,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,W.jsx)(Y,{label:n(`account.createdAt`),value:K(c.Date)||`-`}),(0,W.jsx)(Y,{label:n(`common.updatedAt`),value:Ke(c.UpdatedAt)||`-`})]}),c.About&&(0,W.jsx)(`p`,{className:`about-text`,children:c.About}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,W.jsx)(tt,{rows:r.AuditLogs})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,W.jsx)(it,{value:r.ChannelJSON})]})]}),side:(0,W.jsxs)(`section`,{className:`action-dock`,children:[(0,W.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,W.jsx)(st,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,W.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s})]})})})}function ht({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=ft(o?.rows??[]);return(0,W.jsxs)(Je,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,W.jsx)(B,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,W.jsx)(Qe,{children:f}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,W.jsx)(et,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,W.jsx)(et,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,W.jsx)(et,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,W.jsx)(Ye,{children:(0,W.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,W.jsxs)(`label`,{className:`field-inline`,children:[(0,W.jsx)(`span`,{children:t(`common.limit`)}),(0,W.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,W.jsx)(A,{size:15,className:`spin`}):(0,W.jsx)(V,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`channel.channelID`)}),(0,W.jsx)(`th`,{children:t(`channel.kind`)}),(0,W.jsx)(`th`,{children:t(`common.username`)}),(0,W.jsx)(`th`,{children:t(`channel.title`)}),(0,W.jsx)(`th`,{children:t(`common.members`)}),(0,W.jsx)(`th`,{children:t(`common.admins`)}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:t(`common.verified`)}),(0,W.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.ID}),(0,W.jsx)(`td`,{children:Ge(n,t)}),(0,W.jsx)(`td`,{children:Ue(n.Username)}),(0,W.jsx)(`td`,{children:n.Title}),(0,W.jsx)(`td`,{children:n.ParticipantsCount}),(0,W.jsx)(`td`,{children:n.AdminsCount}),(0,W.jsx)(`td`,{children:n.PTS}),(0,W.jsx)(`td`,{children:n.Verified?(0,W.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,W.jsx)(J,{children:t(`account.notVerified`)})}),(0,W.jsx)(`td`,{children:Ke(n.UpdatedAt)}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,W.jsx)(nt,{colSpan:10})]})]})})]})}function gt({navigate:e}){let{t}=we();return(0,W.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,W.jsxs)(`section`,{className:`overview-band`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,W.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,W.jsxs)(`div`,{className:`overview-metrics`,children:[(0,W.jsx)($e,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,W.jsx)($e,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,W.jsx)($e,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,W.jsxs)(`div`,{className:`command-grid`,children:[(0,W.jsx)(_t,{icon:(0,W.jsx)(ye,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,W.jsx)(_t,{icon:(0,W.jsx)(pe,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,W.jsx)(_t,{icon:(0,W.jsx)(ce,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,W.jsxs)(`section`,{className:`work-strip`,children:[(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(k,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(ae,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(L,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(te,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function _t({icon:e,title:t,text:n,href:r,navigate:i}){return(0,W.jsxs)(ze,{className:`launcher`,href:r,navigate:i,children:[(0,W.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,W.jsxs)(`span`,{className:`launcher-copy`,children:[(0,W.jsx)(`strong`,{children:t}),(0,W.jsx)(`span`,{children:n})]}),(0,W.jsx)(I,{size:16})]})}function vt({channelID:e,msgID:t,navigate:n}){let{t:r}=we(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,W.jsx)(Qe,{children:o});if(!i)return(0,W.jsx)(rt,{label:r(`common.loading`)});let l=i.Message;return(0,W.jsx)(Je,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,W.jsx)(M,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,W.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:K(l.Date)})})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,W.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,W.jsx)(J,{children:r(`common.survived`)}),l.Pinned&&(0,W.jsx)(J,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,W.jsx)(J,{children:r(`messages.channelPost`)}),(0,W.jsxs)(J,{children:[`pts `,l.PTS]})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,W.jsx)(Y,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,W.jsx)(Y,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,W.jsx)(Y,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,W.jsx)(it,{value:i.MessageJSON})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,W.jsx)(it,{value:i.ChannelJSON})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:r(`common.count`)}),(0,W.jsx)(`th`,{children:r(`common.type`)}),(0,W.jsx)(`th`,{children:r(`common.messageId`)}),(0,W.jsx)(`th`,{children:r(`common.sender`)}),(0,W.jsx)(`th`,{children:r(`common.time`)})]})}),(0,W.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.PTS}),(0,W.jsx)(`td`,{children:e.PTSCount}),(0,W.jsx)(`td`,{children:e.Type}),(0,W.jsx)(`td`,{children:e.MessageID}),(0,W.jsx)(`td`,{children:e.SenderUserID}),(0,W.jsx)(`td`,{children:K(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,W.jsx)(nt,{colSpan:6})]})]})})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.eventJson`)}),(0,W.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,W.jsx)(it,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,W.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function yt({label:e,value:t,onChange:n}){let{t:r}=we(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,W.jsxs)(`div`,{className:`entity-picker`,children:[(0,W.jsxs)(`div`,{className:`picker-head`,children:[(0,W.jsx)(`span`,{children:e}),t?(0,W.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,W.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,W.jsxs)(`div`,{className:`selected-entity`,children:[(0,W.jsx)(P,{size:15}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:We(t)}),(0,W.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,W.jsx)(`span`,{children:Ue(t.Username)||He(t.Phone)||`-`})]}):null,(0,W.jsxs)(`div`,{className:`picker-search`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,W.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,W.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,W.jsx)(`div`,{className:`picker-error`,children:u}),(0,W.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,W.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,W.jsx)(`span`,{className:`mono`,children:e.ID}),(0,W.jsx)(`strong`,{children:We(e)}),(0,W.jsx)(`span`,{children:Ue(e.Username)||He(e.Phone)||`-`}),e.Verified?(0,W.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,W.jsx)(J,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,W.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function bt({label:e,value:t,onChange:n}){let{t:r}=we(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,W.jsxs)(`div`,{className:`entity-picker`,children:[(0,W.jsxs)(`div`,{className:`picker-head`,children:[(0,W.jsx)(`span`,{children:e}),t?(0,W.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,W.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,W.jsxs)(`div`,{className:`selected-entity`,children:[(0,W.jsx)(P,{size:15}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:t.Title||`-`}),(0,W.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,W.jsx)(`span`,{children:Ue(t.Username)||Ge(t,r)})]}):null,(0,W.jsxs)(`div`,{className:`picker-search`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,W.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,W.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,W.jsx)(`div`,{className:`picker-error`,children:u}),(0,W.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,W.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,W.jsx)(`span`,{className:`mono`,children:e.ID}),(0,W.jsx)(`strong`,{children:e.Title||`-`}),(0,W.jsx)(`span`,{children:Ue(e.Username)||Ge(e,r)}),e.Verified?(0,W.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,W.jsx)(J,{children:Ge(e,r)})]},e.ID)),o.length===0&&!c?(0,W.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function xt({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,W.jsxs)(Je,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,W.jsx)(Qe,{children:f}),(0,W.jsxs)(Ye,{children:[(0,W.jsx)(`div`,{className:`message-selector-grid single`,children:(0,W.jsx)(bt,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,W.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,W.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,W.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,W.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,W.jsx)(V,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`messages.currentPage`),value:String(_.length)}),(0,W.jsx)(et,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,W.jsx)(et,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,W.jsx)(et,{label:t(`messages.channelGroup`),value:n?`${n.Title||Ge(n,t)} (${n.ID})`:`-`})]}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`common.messageId`)}),(0,W.jsx)(`th`,{children:t(`common.time`)}),(0,W.jsx)(`th`,{children:t(`common.sender`)}),(0,W.jsx)(`th`,{children:`From Peer`}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:t(`common.views`)}),(0,W.jsx)(`th`,{children:t(`common.status`)}),(0,W.jsx)(`th`,{children:t(`messages.body`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[_.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.ID}),(0,W.jsx)(`td`,{children:K(n.Date)}),(0,W.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,W.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,W.jsx)(`td`,{children:n.PTS}),(0,W.jsx)(`td`,{children:n.ViewsCount}),(0,W.jsx)(`td`,{children:n.Deleted?(0,W.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,W.jsx)(J,{tone:`warn`,children:t(`messages.pinned`)}):(0,W.jsx)(J,{children:t(`common.survived`)})}),(0,W.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,W.jsx)(nt,{colSpan:9})]})]})})]})}function St({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=we(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,W.jsx)(Qe,{children:o});if(!i)return(0,W.jsx)(rt,{label:r(`common.loading`)});let l=i.Message;return(0,W.jsx)(Je,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,W.jsx)(M,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,W.jsx)(Xe,{main:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,W.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:K(l.Date)})})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,W.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,W.jsx)(J,{children:r(`common.survived`)}),(0,W.jsxs)(J,{children:[`pts `,l.PTS]}),(0,W.jsx)(J,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,W.jsx)(Y,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,W.jsx)(Y,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,W.jsx)(Y,{label:r(`common.time`),value:K(l.Date)})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,W.jsx)(it,{value:i.MessageJSON})]}),(0,W.jsxs)(`div`,{className:`raw-grid`,children:[(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,W.jsx)(it,{value:i.DialogJSON})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,W.jsx)(it,{value:i.PrivateJSON})]})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:r(`common.count`)}),(0,W.jsx)(`th`,{children:r(`common.type`)}),(0,W.jsx)(`th`,{children:r(`common.time`)})]})}),(0,W.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.PTS}),(0,W.jsx)(`td`,{children:e.PTSCount}),(0,W.jsx)(`td`,{children:e.Type}),(0,W.jsx)(`td`,{children:K(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,W.jsx)(nt,{colSpan:4})]})]})})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`ID`}),(0,W.jsx)(`th`,{children:r(`account.userID`)}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:r(`common.type`)}),(0,W.jsx)(`th`,{children:r(`common.status`)}),(0,W.jsx)(`th`,{children:r(`messages.attempts`)}),(0,W.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,W.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.ID}),(0,W.jsx)(`td`,{children:e.TargetUserID}),(0,W.jsx)(`td`,{children:e.PTS}),(0,W.jsx)(`td`,{children:e.EventType}),(0,W.jsx)(`td`,{children:e.Status}),(0,W.jsx)(`td`,{children:e.Attempts}),(0,W.jsx)(`td`,{children:Ke(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,W.jsx)(nt,{colSpan:7})]})]})})]})]}),side:(0,W.jsxs)(`section`,{className:`action-dock`,children:[(0,W.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,W.jsx)(st,{label:r(`messages.deleteThis`),icon:(0,W.jsx)(_e,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function Ct({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,S]=(0,g.useState)(``),[C,w]=(0,g.useState)(`1`),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(``);async function k(e=!1){if(O(``),!n||!i){O(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&T?.rows.length){let e=T.rows[T.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{E(await x.messages(r))}catch(e){O(b(e))}}function A(e){r(e),s(``),l(``),E(null)}function j(e){a(e),s(``),l(``),E(null)}return(0,W.jsxs)(Je,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[D&&(0,W.jsx)(Qe,{children:D}),(0,W.jsxs)(Ye,{children:[(0,W.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,W.jsx)(yt,{label:t(`messages.ownerUser`),value:n,onChange:A}),(0,W.jsx)(yt,{label:t(`messages.peerUser`),value:i,onChange:j})]}),(0,W.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),k(!1)},children:[(0,W.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,W.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,W.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,W.jsx)(V,{size:15}),` `,t(`messages.searchMessages`)]}),T?.rows.length?(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>k(!0),children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`messages.currentPage`),value:String(T?.rows.length??0)}),(0,W.jsx)(et,{label:t(`messages.deleted`),value:String((T?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,W.jsx)(et,{label:t(`messages.outgoing`),value:String((T?.rows??[]).filter(e=>e.Outgoing).length)}),(0,W.jsx)(et,{label:t(`messages.ownerPeer`),value:n&&i?`${We(n)} / ${We(i)}`:`-`})]}),(0,W.jsxs)(`div`,{className:`operation-row`,children:[(0,W.jsxs)(`div`,{className:`operation-box`,children:[(0,W.jsxs)(`div`,{className:`operation-title`,children:[(0,W.jsx)(_e,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,W.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,W.jsxs)(`label`,{className:`checkline`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,W.jsx)(st,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:q(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,W.jsxs)(`div`,{className:`operation-box`,children:[(0,W.jsxs)(`div`,{className:`operation-title`,children:[(0,W.jsx)(ie,{size:15}),` `,t(`messages.clearHistory`)]}),(0,W.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,W.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,W.jsxs)(`label`,{className:`checkline`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,W.jsxs)(`label`,{className:`checkline`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,W.jsx)(st,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:qe(y),max_batches:qe(C),just_clear:_,revoke:m})})]})]}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`common.messageId`)}),(0,W.jsx)(`th`,{children:t(`common.time`)}),(0,W.jsx)(`th`,{children:t(`common.sender`)}),(0,W.jsx)(`th`,{children:t(`messages.direction`)}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:t(`common.status`)}),(0,W.jsx)(`th`,{children:t(`messages.body`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[T?.rows.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,W.jsx)(`td`,{children:K(n.Date)}),(0,W.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,W.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,W.jsx)(`td`,{children:n.PTS}),(0,W.jsx)(`td`,{children:n.Deleted?(0,W.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):(0,W.jsx)(J,{children:t(`common.survived`)})}),(0,W.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!T||T.rows.length===0)&&(0,W.jsx)(nt,{colSpan:8})]})]})})]})}var wt=c(o(((e,t)=>{typeof document<`u`&&typeof navigator<`u`&&(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.lottie=r())})(e,(function(){var n=``,r=!1,i=-999999,a=function(e){r=!!e},o=function(){return r},s=function(e){n=e},c=function(){return n};function l(e){return document.createElement(e)}function u(e,t){var n,r=e.length,i;for(n=0;n1?n[1]=1:n[1]<=0&&(n[1]=0),L(n[0],n[1],n[2])}function te(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),L(n[0],n[1],n[2])}function ne(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[0]+=t/360,n[0]>1?--n[0]:n[0]<0&&(n[0]+=1),L(n[0],n[1],n[2])}(function(){var e=[],t,n;for(t=0;t<256;t+=1)n=t.toString(16),e[t]=n.length===1?`0`+n:n;return function(t,n,r){return t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),`#`+e[t]+e[n]+e[r]}})();var re=function(e){g=!!e},ie=function(){return g},ae=function(e){_=e},oe=function(){return _},se=function(){return v},ce=function(e){E=e},le=function(){return E},ue=function(e){y=e};function z(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function de(e){"@babel/helpers - typeof";return de=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},de(e)}var B=function(){var e=1,t=[],n,r,i={onmessage:function(){},postMessage:function(e){n({data:e})}},a={postMessage:function(e){i.onmessage({data:e})}};function s(e){if(window.Worker&&window.Blob&&o()){var t=new Blob([`var _workerSelf = self; self.onmessage = `,e.toString()],{type:`text/javascript`}),r=URL.createObjectURL(t);return new Worker(r)}return n=e,i}function c(){r||(r=s(function(e){function t(){function e(t,n){var o,s,c=t.length,l,u,d,f;for(s=0;s=0;--t)if(e[t].ty===`sh`)if(e[t].ks.k.i)a(e[t].ks.k);else for(o=e[t].ks.k.length,r=0;rn[0]?!0:n[0]>e[0]?!1:e[1]>n[1]?!0:n[1]>e[1]?!1:e[2]>n[2]?!0:n[2]>e[2]?!1:null}var s=function(){var e=[4,4,14];function t(e){var t=e.t.d;e.t.d={k:[{s:t,t:0}]}}function n(e){var n,r=e.length;for(n=0;n=0;--n)if(e[n].ty===`sh`)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(a=e[n].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function a(t){var n=r(t,this.assetsPath,this.path),i=z(`image`);b?this.testImageLoaded(i):i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS(`http://www.w3.org/1999/xlink`,`href`,n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a}function o(t){var n=r(t,this.assetsPath,this.path),i=l(`img`);i.crossOrigin=`anonymous`,i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var a={img:i,assetData:t};return a}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return B.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function c(e,t){this.imagesLoadedCb=t;var n,r=e.length;for(n=0;nthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t=this.animationData.layers,n,r=t.length,i=e.layers,a,o=i.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(`enterFrame`),this.renderFrame(),this.trigger(`drawnFrame`)},H.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},H.prototype.play=function(e){e&&this.name!==e||this.isPaused===!0&&(this.isPaused=!1,this.trigger(`_play`),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger(`_active`)))},H.prototype.pause=function(e){e&&this.name!==e||this.isPaused===!1&&(this.isPaused=!0,this.trigger(`_pause`),this._idle=!0,this.trigger(`_idle`),this.audioController.pause())},H.prototype.togglePause=function(e){e&&this.name!==e||(this.isPaused===!0?this.play():this.pause())},H.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},H.prototype.getMarkerData=function(e){for(var t,n=0;n=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger(`loopComplete`))):this.setCurrentRawFrameValue(t):t<0?this.checkSegments(t%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger(`loopComplete`):this._completedLoop=!0):(n=!0,t=0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger(`complete`))}},H.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger(`segmentStart`)},H.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,n!==-1&&this.goToAndStop(n,!0)},H.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),ye(e[0])===`object`){var n,r=e.length;for(n=0;n=0;--n)t[n].animation.destroy(e)}function T(e,t,n){var r=[].concat([].slice.call(document.getElementsByClassName(`lottie`)),[].slice.call(document.getElementsByClassName(`bodymovin`))),i,a=r.length;for(i=0;i0?n=c:t=c;while(Math.abs(s)>a&&++l=i?g(e,d,t,n):f===0?d:h(e,a,a+c,t,n)}},e}(),be=function(){function e(e){return e.concat(m(e.length))}return{double:e}}(),xe=function(){return function(e,t,n){var r=0,i=e,a=m(i),o={newElement:s,release:c};function s(){var e;return r?(--r,e=a[r]):e=t(),e}function c(e){r===i&&(a=be.double(a),i*=2),n&&n(e),a[r]=e,r+=1}return o}}(),Se=function(){function e(){return{addedLength:0,percents:p(`float32`,le()),lengths:p(`float32`,le())}}return xe(8,e)}(),Ce=function(){function e(){return{lengths:[],totalLength:0}}function t(e){var t,n=e.lengths.length;for(t=0;t-.001&&o<.001}function n(n,r,i,a,o,s,c,l,u){if(i===0&&s===0&&u===0)return t(n,r,a,o,c,l);var d=e.sqrt(e.pow(a-n,2)+e.pow(o-r,2)+e.pow(s-i,2)),f=e.sqrt(e.pow(c-n,2)+e.pow(l-r,2)+e.pow(u-i,2)),p=e.sqrt(e.pow(c-a,2)+e.pow(l-o,2)+e.pow(u-s,2)),m=d>f?d>p?d-f-p:p-f-d:p>f?p-f-d:f-d-p;return m>-1e-4&&m<1e-4}var r=function(){return function(e,t,n,r){var i=le(),a,o,s,c,l,u=0,d,f=[],p=[],m=Se.newElement();for(s=n.length,a=0;ao?-1:1,l=!0;l;)if(r[a]<=o&&r[a+1]>o?(s=(o-r[a])/(r[a+1]-r[a]),l=!1):a+=c,a<0||a>=i-1){if(a===i-1)return n[a];l=!1}return n[a]+(n[a+1]-n[a])*s}function l(t,n,r,i,a,o){var s=c(a,o),l=1-s;return[e.round((l*l*l*t[0]+(s*l*l+l*s*l+l*l*s)*r[0]+(s*s*l+l*s*s+s*l*s)*i[0]+s*s*s*n[0])*1e3)/1e3,e.round((l*l*l*t[1]+(s*l*l+l*s*l+l*l*s)*r[1]+(s*s*l+l*s*s+s*l*s)*i[1]+s*s*s*n[1])*1e3)/1e3]}var u=p(`float32`,8);function d(t,n,r,i,a,o,s){a<0?a=0:a>1&&(a=1);var l=c(a,s);o=o>1?1:o;var d=c(o,s),f,p=t.length,m=1-l,h=1-d,g=m*m*m,_=l*m*m*3,v=l*l*m*3,y=l*l*l,b=m*m*h,x=l*m*h+m*l*h+m*m*d,S=l*l*h+m*l*d+l*m*d,C=l*l*d,w=m*h*h,T=l*h*h+m*d*h+m*h*d,E=l*d*h+m*d*d+l*h*d,D=l*d*d,O=h*h*h,k=d*h*h+h*d*h+h*h*d,A=d*d*h+h*d*d+d*h*d,j=d*d*d;for(f=0;f=l.t-n){c.h&&(c=l),i=0;break}if(l.t-n>e){i=a;break}a=v||e=v?x.points.length-1:0;for(f=x.points[S].point.length,d=0;d=T&&C=v)r[0]=b[0],r[1]=b[1],r[2]=b[2];else if(e<=y)r[0]=c.s[0],r[1]=c.s[1],r[2]=c.s[2];else{var j=je(c.s),M=je(b),N=(e-y)/(v-y);Ae(r,ke(j,M,N))}else for(a=0;a=v?m=1:e1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-n)*f)/m,g=Math.sin(n*f)/m):(h=1-n,g=n),r[0]=h*i+g*c,r[1]=h*a+g*l,r[2]=h*o+g*u,r[3]=h*s+g*d,r}function Ae(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i),s=Math.asin(2*n*r+2*i*a),c=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i);e[0]=o/D,e[1]=s/D,e[2]=c/D}function je(e){var t=e[0]*D,n=e[1]*D,r=e[2]*D,i=Math.cos(t/2),a=Math.cos(n/2),o=Math.cos(r/2),s=Math.sin(t/2),c=Math.sin(n/2),l=Math.sin(r/2),u=i*a*o-s*c*l;return[s*c*o+i*a*l,s*a*o+i*c*l,i*c*o-s*a*l,u]}function Me(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==Ee&&(this._caching.lastFrame>=n&&e>=n||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function Ne(e){var t;if(this.propType===`unidimensional`)t=e*this.mult,De(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var n=0,r=this.v.length;n1e-5&&(this.v[n]=t,this._mdf=!0),n+=1}function Pe(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),n){case`v`:a=this.v;break;case`i`:a=this.i;break;case`o`:a=this.o;break;default:a=[];break}(!a[r]||a[r]&&!i)&&(a[r]=Ve.newElement()),a[r][0]=e,a[r][1]=t},He.prototype.setTripleAt=function(e,t,n,r,i,a,o,s){this.setXYAt(e,t,`v`,o,s),this.setXYAt(n,r,`o`,o,s),this.setXYAt(i,a,`i`,o,s)},He.prototype.reverse=function(){var e=new He;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var a=this._length-1,o=this._length,s;for(s=i;s=p[p.length-1].t-this.offsetTime)i=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],o=!0;else{for(var m=r,h=p.length-1,g=!0,_,v,y;g&&(_=p[m],v=p[m+1],!(v.t-this.offsetTime>e));)m=v.t-this.offsetTime)d=1;else if(e<_.t-this.offsetTime)d=0;else{var b;y.__fnct?b=y.__fnct:(b=W.getBezierEasing(_.o.x,_.o.y,_.i.x,_.i.y).get,y.__fnct=b),d=b((e-(_.t-this.offsetTime))/(v.t-this.offsetTime-(_.t-this.offsetTime)))}a=v.s?v.s[0]:_.e[0]}i=_.s[0]}for(l=t._length,u=i.i[0].length,n.lastIndex=r,s=0;sr&&t>r)||(this._caching.lastIndex=i0||e>-1e-6&&e<0?r(e*t)/t:e}function P(){var e=this.props,t=N(e[0]),n=N(e[1]),r=N(e[4]),i=N(e[5]),a=N(e[12]),o=N(e[13]);return`matrix(`+t+`,`+n+`,`+r+`,`+i+`,`+a+`,`+o+`)`}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=c,this.skew=u,this.skewFromAxis=d,this.shear=l,this.scale=f,this.setTransform=m,this.translate=h,this.transform=g,this.multiply=_,this.applyToPoint=S,this.applyToX=C,this.applyToY=w,this.applyToZ=T,this.applyToPointArray=A,this.applyToTriplePoints=k,this.applyToPointStringified=j,this.toCSS=M,this.to2dCSS=P,this.clone=b,this.cloneFromProps=x,this.equals=y,this.inversePoints=O,this.inversePoint=D,this.getInverseMatrix=E,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=p(`float32`,16),this.reset()}}();function qe(e){"@babel/helpers - typeof";return qe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},qe(e)}var q={},Je=`__[STANDALONE]__`,Ye=`__[ANIMATIONDATA]__`,Xe=``;function Ze(e){s(e)}function Qe(){Je===!0?U.searchAnimations(Ye,Je,Xe):U.searchAnimations()}function J(e){re(e)}function $e(e){ue(e)}function et(e){return Je===!0&&(e.animationData=JSON.parse(Ye)),U.loadAnimation(e)}function Y(e){if(typeof e==`string`)switch(e){case`high`:ce(200);break;default:case`medium`:ce(50);break;case`low`:ce(10);break}else!isNaN(e)&&e>1&&ce(e)}function tt(){return typeof navigator<`u`}function nt(e,t){e===`expressions`&&ae(t)}function rt(e){switch(e){case`propertyFactory`:return G;case`shapePropertyFactory`:return Ke;case`matrix`:return K;default:return null}}q.play=U.play,q.pause=U.pause,q.setLocationHref=Ze,q.togglePause=U.togglePause,q.setSpeed=U.setSpeed,q.setDirection=U.setDirection,q.stop=U.stop,q.searchAnimations=Qe,q.registerAnimation=U.registerAnimation,q.loadAnimation=et,q.setSubframeRendering=J,q.resize=U.resize,q.goToAndStop=U.goToAndStop,q.destroy=U.destroy,q.setQuality=Y,q.inBrowser=tt,q.installPlugin=nt,q.freeze=U.freeze,q.unfreeze=U.unfreeze,q.setVolume=U.setVolume,q.mute=U.mute,q.unmute=U.unmute,q.getRegisteredAnimations=U.getRegisteredAnimations,q.useWebWorker=a,q.setIDPrefix=$e,q.__getFactory=rt,q.version=`5.13.0`;function it(){document.readyState===`complete`&&(clearInterval(lt),Qe())}function at(e){for(var t=ot.split(`&`),n=0;n=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o=[],s,c=a.length,l;for(s=0;sr+n)){var u=l.s*i<=r?0:(l.s*i-r)/n,d=l.e*i>=r+n?1:(l.e*i-r)/n;o.push([u,d])}return o.length||o.push([0,0]),o},ft.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1+r:this.s.v<0?0+r:this.s.v+r,n=this.e.v>1?1+r:this.e.v<0?0+r:this.e.v+r,t>n){var i=t;t=n,n=i}t=Math.round(t*1e4)*1e-4,n=Math.round(n*1e4)*1e-4,this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,o,s=this.shapes.length,c,l,u,d,f,p=0;if(n===t)for(o=0;o=0;--o)if(h=this.shapes[o],h.shape._mdf){for(g=h.localShapeCollection,g.releaseShapes(),this.m===2&&s>1?(b=this.calculateShapeEdges(t,n,h.totalShapeLength,y,p),y+=h.totalShapeLength):b=[[_,v]],l=b.length,c=0;c=1?m.push({s:h.totalShapeLength*(_-1),e:h.totalShapeLength*(v-1)}):(m.push({s:h.totalShapeLength*_,e:h.totalShapeLength}),m.push({s:0,e:h.totalShapeLength*(v-1)}));var x=this.addShapes(h,m[0]);if(m[0].s!==m[0].e){if(m.length>1)if(h.shape.paths.shapes[h.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,g),x=this.addShapes(h,m[1],S)}else this.addPaths(x,g),x=this.addShapes(h,m[1]);this.addPaths(x,g)}}h.shape.paths=g}}else if(this._mdf)for(o=0;ot.e){n.c=!1;break}else t.s<=l&&t.e>=l+u.addedLength?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[s],i[a].v[s],n,d,g),g=!1):(p=Te.getNewSegment(i[a].v[s-1],i[a].v[s],i[a].o[s-1],i[a].i[s],(t.s-l)/u.addedLength,(t.e-l)/u.addedLength,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1),l+=u.addedLength,d+=1;if(i[a].c&&f.length){if(u=f[s-1],l<=t.e){var _=f[s-1].addedLength;t.s<=l&&t.e>=l+_?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[0],i[a].v[0],n,d,g),g=!1):(p=Te.getNewSegment(i[a].v[s-1],i[a].v[0],i[a].o[s-1],i[a].i[0],(t.s-l)/_,(t.e-l)/_,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1)}else n.c=!1;l+=u.addedLength,d+=1}if(n._length&&(n.setXYAt(n.v[h][0],n.v[h][1],`i`,h),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],`o`,n._length-1)),l>t.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(r[0]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),r[1]=o.getValueAtTime((o.keyframes[0].t+.01)/n,0),i[0]=a.getValueAtTime(a.keyframes[0].t/n,0),i[1]=o.getValueAtTime(o.keyframes[0].t/n,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(r[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),r[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/n,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/n,0)):(r=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/n,o.offsetTime))}else i=e,r=i;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function r(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function i(){}function a(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0}function o(e,t,n){if(this.elem=e,this.frameId=-1,this.propType=`transform`,this.data=t,this.v=new K,this.pre=new K,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=G.getProp(e,t.p.x,0,0,this),this.py=G.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=G.getProp(e,t.p.z,0,0,this))):this.p=G.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=G.getProp(e,t.rx,0,D,this),this.ry=G.getProp(e,t.ry,0,D,this),this.rz=G.getProp(e,t.rz,0,D,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r0;)--n,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ht.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(f):Math.ceil(f),h=this.pMatrix.props,g=this.rMatrix.props,_=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v=0;if(f>0){for(;vm;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),--v;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),v-=p)}r=this.data.m===1?0:this._currentCopies-1,i=this.data.m===1?1:-1,a=this._currentCopies;for(var y,b;a;){if(t=this.elemsData[r].it,n=t[t.length-1].transform.mProps.v.props,b=n.length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),v!==0){for((r!==0&&i===1||r!==this._currentCopies-1&&i===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15]),this.matrix.transform(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]),y=0;y0&&r<1?[t]:[]:[t-r,t+r].filter(function(e){return e>0&&e<1})},wt.prototype.split=function(e){if(e<=0)return[Ct(this.points[0]),this];if(e>=1)return[this,Ct(this.points[this.points.length-1])];var t=bt(this.points[0],this.points[1],e),n=bt(this.points[1],this.points[2],e),r=bt(this.points[2],this.points[3],e),i=bt(t,n,e),a=bt(n,r,e),o=bt(i,a,e);return[new wt(this.points[0],t,i,o,!0),new wt(o,a,r,this.points[3],!0)]};function Tt(e,t){var n=e.points[0][t],r=e.points[e.points.length-1][t];if(n>r){var i=r;r=n,n=i}for(var a=xt(3*e.a[t],2*e.b[t],e.c[t]),o=0;o0&&a[o]<1){var s=e.point(a[o])[t];sr&&(r=s)}return{min:n,max:r}}wt.prototype.bounds=function(){return{x:Tt(this,0),y:Tt(this,1)}},wt.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}};function Et(e,t,n){var r=e.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:e,t:(t+n)/2,t1:t,t2:n}}function Dt(e){var t=e.bez.split(.5);return[Et(t[0],e.t1,e.t),Et(t[1],e.t,e.t2)]}function Ot(e,t){return Math.abs(e.cx-t.cx)*2=a||e.width<=r&&e.height<=r&&t.width<=r&&t.height<=r){i.push([e.t,t.t]);return}var o=Dt(e),s=Dt(t);kt(o[0],s[0],n+1,r,i,a),kt(o[0],s[1],n+1,r,i,a),kt(o[1],s[0],n+1,r,i,a),kt(o[1],s[1],n+1,r,i,a)}}wt.prototype.intersections=function(e,t,n){t===void 0&&(t=2),n===void 0&&(n=7);var r=[];return kt(Et(this,0,1),Et(e,0,1),0,t,r,n),r},wt.shapeSegment=function(e,t){var n=(t+1)%e.length();return new wt(e.v[t],e.o[t],e.i[n],e.v[n],!0)},wt.shapeSegmentInverted=function(e,t){var n=(t+1)%e.length();return new wt(e.v[n],e.i[n],e.o[t],e.v[t],!0)};function At(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function jt(e,t,n,r){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],s=[r[0],r[1],1],c=At(At(i,a),At(o,s));return vt(c[2])?null:[c[0]/c[2],c[1]/c[2]]}function X(e,t,n){return[e[0]+Math.cos(t)*n,e[1]-Math.sin(t)*n]}function Mt(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function Nt(e,t){return _t(e[0],t[0])&&_t(e[1],t[1])}function Pt(){}u([dt],Pt),Pt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=G.getProp(e,t.s,0,null,this),this.frequency=G.getProp(e,t.r,0,null,this),this.pointsType=G.getProp(e,t.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function Ft(e,t,n,r,i,a,o){var s=n-Math.PI/2,c=n+Math.PI/2,l=t[0]+Math.cos(n)*r*i,u=t[1]-Math.sin(n)*r*i;e.setTripleAt(l,u,l+Math.cos(s)*a,u-Math.sin(s)*a,l+Math.cos(c)*o,u-Math.sin(c)*o,e.length())}function It(e,t){var n=[t[0]-e[0],t[1]-e[1]],r=-Math.PI*.5;return[Math.cos(r)*n[0]-Math.sin(r)*n[1],Math.sin(r)*n[0]+Math.cos(r)*n[1]]}function Lt(e,t){var n=t===0?e.length()-1:t-1,r=(t+1)%e.length(),i=e.v[n],a=e.v[r],o=It(i,a);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function Rt(e,t,n,r,i,a,o){var s=Lt(t,n),c=t.v[n%t._length],l=t.v[n===0?t._length-1:n-1],u=t.v[(n+1)%t._length],d=a===2?Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2):0,f=a===2?Math.sqrt((c[0]-u[0])**2+(c[1]-u[1])**2):0;Ft(e,t.v[n%t._length],s,o,r,f/((i+1)*2),d/((i+1)*2),a)}function zt(e,t,n,r,i,a){for(var o=0;o1&&t.length>1&&(i=Ut(e[0],t[t.length-1]),i)?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[n,r]}function Gt(e){for(var t,n=1;n1&&(t=Wt(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function Kt(e,t){var n=e.inflectionPoints(),r,i,a,o;if(n.length===0)return[Vt(e,t)];if(n.length===1||_t(n[1],1))return a=e.split(n[0]),r=a[0],i=a[1],[Vt(r,t),Vt(i,t)];a=e.split(n[0]),r=a[0];var s=(n[1]-n[0])/(1-n[0]);return a=a[1].split(s),o=a[0],i=a[1],[Vt(r,t),Vt(o,t),Vt(i,t)]}function qt(){}u([dt],qt),qt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=G.getProp(e,t.a,0,null,this),this.miterLimit=G.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=this.amount.effectsSequence.length!==0},qt.prototype.processPath=function(e,t,n,r){var i=Ue.newElement();i.c=e.c;var a=e.length();e.c||--a;var o,s,c,l=[];for(o=0;o=0;--o)c=wt.shapeSegmentInverted(e,o),l.push(Kt(c,t));l=Gt(l);var u=null,d=null;for(o=0;o0&&(o=!1),o){var u=l(`style`);u.setAttribute(`f-forigin`,n[r].fOrigin),u.setAttribute(`f-origin`,n[r].origin),u.setAttribute(`f-family`,n[r].fFamily),u.type=`text/css`,u.innerText=`@font-face {font-family: `+n[r].fFamily+`; font-style: normal; src: url('`+n[r].fPath+`');}`,t.appendChild(u)}}else if(n[r].fOrigin===`g`||n[r].origin===1){for(s=document.querySelectorAll(`link[f-forigin="g"], link[f-origin="1"]`),c=0;c=55296&&n<=56319){var r=e.charCodeAt(1);r>=56320&&r<=57343&&(t=(n-55296)*1024+r-56320+65536)}return t}function S(e,t){var n=e.toString(16)+t.toString(16);return d.indexOf(n)!==-1}function C(e){return e===s}function w(e){return e===o}function T(e){var t=x(e);return t>=c&&t<=u}function E(e){return T(e.substr(0,2))&&T(e.substr(2,2))}function D(e){return t.indexOf(e)!==-1}function O(e,t){var o=x(e.substr(t,2));if(o!==n)return!1;var s=0;for(t+=2;s<5;){if(o=x(e.substr(t,2)),oa)return!1;s+=1,t+=2}return x(e.substr(t,2))===r}function k(){this.isLoaded=!0}var A=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return A.isModifier=S,A.isZeroWidthJoiner=C,A.isFlagEmoji=E,A.isRegionalCode=T,A.isCombinedCharacter=D,A.isRegionalFlag=O,A.isVariationSelector=w,A.BLACK_FLAG_CODE_POINT=n,A.prototype={addChars:_,addFonts:g,getCharData:v,getFontByName:b,measureText:y,checkLoadedFonts:m,setIsLoaded:k},A}();function Xt(e){this.animationData=e}Xt.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e};function Zt(e){return new Xt(e)}function Qt(){}Qt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},mn.prototype.show=function(){},mn.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},mn.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},mn.prototype.resume=function(){this._canPlay=!0},mn.prototype.setRate=function(e){this.audio.rate(e)},mn.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},mn.prototype.getBaseElement=function(){return null},mn.prototype.destroy=function(){},mn.prototype.sourceRectAtTime=function(){},mn.prototype.initExpressions=function(){};function hn(){}hn.prototype.checkLayers=function(e){var t,n=this.layers.length,r;for(this.completeLayers=!0,t=n-1;t>=0;--t)this.elements[t]||(r=this.layers[t],r.ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t)),this.completeLayers=this.elements[t]?this.completeLayers:!1;this.checkPendingElements()},hn.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},hn.prototype.createCamera=function(){throw Error(`You're using a 3d camera. Try the html renderer.`)},hn.prototype.createAudio=function(e){return new mn(e,this.globalData,this)},hn.prototype.createFootage=function(e){return new pn(e,this.globalData,this)},hn.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e0&&(this.maskElement.setAttribute(`id`,p),this.element.maskedElement.setAttribute(b,`url(`+c()+`#`+p+`)`),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}vn.prototype.getMaskProperty=function(e){return this.viewData[e].prop},vn.prototype.renderFrame=function(e){var t=this.element.finalTransform.mat,n,r=this.masksProperties.length;for(n=0;n1&&(r+=` C`+t.o[i-1][0]+`,`+t.o[i-1][1]+` `+t.i[0][0]+`,`+t.i[0][1]+` `+t.v[0][0]+`,`+t.v[0][1]),n.lastPath!==r){var o=``;n.elem&&(t.c&&(o=e.inv?this.solidPath+r:r),n.elem.setAttribute(`d`,o)),n.lastPath=r}},vn.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var yn=function(){var e={};e.createFilter=t,e.createAlphaToLuminanceFilter=n;function t(e,t){var n=z(`filter`);return n.setAttribute(`id`,e),t!==!0&&(n.setAttribute(`filterUnits`,`objectBoundingBox`),n.setAttribute(`x`,`0%`),n.setAttribute(`y`,`0%`),n.setAttribute(`width`,`100%`),n.setAttribute(`height`,`100%`)),n}function n(){var e=z(`feColorMatrix`);return e.setAttribute(`type`,`matrix`),e.setAttribute(`color-interpolation-filters`,`sRGB`),e.setAttribute(`values`,`0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1`),e}return e}(),bn=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<`u`};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),xn={},Sn=`filter_result_`;function Cn(e){var t,n=`SourceGraphic`,r=e.data.ef?e.data.ef.length:0,i=I(),a=yn.createFilter(i,!0),o=0;this.filters=[];var s;for(t=0;t=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);--e);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n.01)return!1;n+=1}return!0},Rn.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)c=r.transformers[g].mProps._mdf||c,--h,--g;if(c)for(h=f-r.styles[u].lvl,g=r.transformers.length-1;h>0;)m.multiply(r.transformers[g].mProps.v),--h,--g}else m=e;if(p=r.sh.paths,o=p._length,c){for(s=``,a=0;a=1?v=.99:v<=-1&&(v=-.99);var y=g*v,b=Math.cos(_+t.a.v)*y+a[0],x=Math.sin(_+t.a.v)*y+a[1];r.setAttribute(`fx`,b),r.setAttribute(`fy`,x),i&&!t.g._collapsable&&(t.of.setAttribute(`fx`,b),t.of.setAttribute(`fy`,x))}}}function u(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute(`stroke-dasharray`,i.dashStr),r.pElem.setAttribute(`stroke-dashoffset`,i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute(`stroke`,`rgb(`+C(t.c.v[0])+`,`+C(t.c.v[1])+`,`+C(t.c.v[2])+`)`),(t.o._mdf||n)&&r.pElem.setAttribute(`stroke-opacity`,t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute(`stroke-width`,t.w.v),r.msElem&&r.msElem.setAttribute(`stroke-width`,t.w.v))}return n}();function Gn(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}u([dn,_n,wn,kn,Tn,fn,En],Gn),Gn.prototype.initSecondaryElement=function(){},Gn.prototype.identityMatrix=new K,Gn.prototype.buildExpressionInterface=function(){},Gn.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Gn.prototype.filterUniqueShapes=function(){var e,t=this.shapes.length,n,r,i=this.stylesList.length,a,o=[],s=!1;for(r=0;r1&&s&&this.setShapesAsAnimated(o)}},Gn.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;--c){if(g=this.searchProcessedElement(e[c]),g?t[c]=n[g-1]:e[c]._render=o,e[c].ty===`fl`||e[c].ty===`st`||e[c].ty===`gf`||e[c].ty===`gs`||e[c].ty===`no`)g?t[c].style.closed=e[c].hd:t[c]=this.createStyleElement(e[c],i),e[c]._render&&t[c].style.pElem.parentNode!==r&&r.appendChild(t[c].style.pElem),f.push(t[c].style);else if(e[c].ty===`gr`){if(!g)t[c]=this.createGroupElement(e[c]);else for(d=t[c].it.length,u=0;u1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},qn.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},qn.prototype.getValue=function(e){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!e)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var r,i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(r=0;rt);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},qn.prototype.buildFinalText=function(e){for(var t=[],n=0,r=e.length,i,a,o=!1,s=!1,c=``;n=55296&&i<=56319?Yt.isRegionalFlag(e,n)?c=e.substr(n,14):(a=e.charCodeAt(n+1),a>=56320&&a<=57343&&(Yt.isModifier(i,a)?(c=e.substr(n,2),o=!0):c=Yt.isFlagEmoji(e.substr(n,4))?e.substr(n,4):e.substr(n,2))):i>56319?(a=e.charCodeAt(n+1),Yt.isVariationSelector(i)&&(o=!0)):Yt.isZeroWidthJoiner(i)&&(o=!0,s=!0),o?(t[t.length-1]+=c,o=!1):t.push(c),n+=c.length;return t},qn.prototype.completeTextData=function(e){e.__complete=!0;var t=this.elem.globalData.fontManager,n=this.data,r=[],i,a,o,s=0,c,l=n.m.g,u=0,d=0,f=0,p=[],m=0,h=0,g,_,v=t.getFontByName(e.f),y,b=0,x=Jt(v);e.fWeight=x.weight,e.fStyle=x.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),a=e.finalText.length,e.finalLineHeight=e.lh;var S=e.tr/1e3*e.finalSize,C;if(e.sz)for(var w=!0,T=e.sz[0],E=e.sz[1],D,O;w;){O=this.buildFinalText(e.t),D=0,m=0,a=O.length,S=e.tr/1e3*e.finalSize;var k=-1;for(i=0;iT&&O[i]!==` `?(k===-1?a+=1:i=k,D+=e.finalLineHeight||e.finalSize*1.2,O.splice(i,+(k===i),`\r`),k=-1,m=0):(m+=b,m+=S);D+=v.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Eh?m:h,m=-2*S,c=``,o=!0,f+=1):c=j,t.chars?(y=t.getCharData(j,v.fStyle,t.getFontByName(e.f).fFamily),b=o?0:y.w*e.finalSize/100):b=t.measureText(c,e.f,e.finalSize),j===` `?A+=b+S:(m+=b+S+A,A=0),r.push({l:b,an:b,add:u,n:o,anIndexes:[],val:c,line:f,animatorJustifyOffset:0}),l==2){if(u+=b,c===``||c===` `||i===a-1){for((c===``||c===` `)&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;s+=1,u=0}}else if(l==3){if(u+=b,c===``||i===a-1){for(c===``&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;u=0,s+=1}}else r[s].ind=s,r[s].extra=0,s+=1;if(e.l=r,h=m>h?m:h,p.push(m),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=h,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=p;var M=n.a,N,P;_=M.length;var F,I,L=[];for(g=0;g<_;g+=1){for(N=M[g],N.a.sc&&(e.strokeColorAnim=!0),N.a.sw&&(e.strokeWidthAnim=!0),(N.a.fc||N.a.fh||N.a.fs||N.a.fb)&&(e.fillColorAnim=!0),I=0,F=N.s.b,i=0;i0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var c=W.getBezierEasing(i,a,o,s).get,l=0,u=this.finalS,d=this.finalE,f=this.data.sh;if(f===2)l=d===u?+(r>=d):e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===3)l=d===u?r>=d?0:1:1-e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===4)d===u?l=0:(l=e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l<.5?l*=2:l=1-2*(l-.5)),l=c(l);else if(f===5){if(d===u)l=0;else{var p=d-u;r=t(e(0,r+.5-u),d-u);var m=-p/2+r,h=p/2;l=Math.sqrt(1-m*m/(h*h))}l=c(l)}else f===6?(d===u?l=0:(r=t(e(0,r+.5-u),d-u),l=(1+Math.cos(Math.PI+Math.PI*2*r/(d-u)))/2),l=c(l)):(r>=n(u)&&(l=r-u<0?e(0,t(t(d,1)-(u-r),1)):e(0,t(d-r,1))),l=c(l));if(this.sm.v!==100){var g=this.sm.v*.01;g===0&&(g=1e-8);var _=.5-g*.5;l<_?l=0:(l=(l-_)/g,l>1&&(l=1))}return l*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&this.data.r===2&&(this.e.v=this._currentTextLength);var t=this.data.r===2?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var a=r;r=i,i=a}this.finalS=r,this.finalE=i}},u([Be],r);function i(e,t,n){return new r(e,t,n)}return{getTextSelectorProp:i}}();function Yn(e,t,n){var r={propType:!1},i=G.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,D,n):r,rx:a.rx?i(e,a.rx,0,D,n):r,ry:a.ry?i(e,a.ry,0,D,n):r,sk:a.sk?i(e,a.sk,0,D,n):r,sa:a.sa?i(e,a.sa,0,D,n):r,s:a.s?i(e,a.s,1,.01,n):r,a:a.a?i(e,a.a,1,0,n):r,o:a.o?i(e,a.o,0,.01,n):r,p:a.p?i(e,a.p,1,0,n):r,sw:a.sw?i(e,a.sw,0,0,n):r,sc:a.sc?i(e,a.sc,1,0,n):r,fc:a.fc?i(e,a.fc,1,0,n):r,fh:a.fh?i(e,a.fh,0,0,n):r,fs:a.fs?i(e,a.fs,0,.01,n):r,fb:a.fb?i(e,a.fb,0,.01,n):r,t:a.t?i(e,a.t,0,0,n):r},this.s=Jn.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function Xn(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=m(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}Xn.prototype.searchProperties=function(){var e,t=this._textData.a.length,n,r=G.getProp;for(e=0;e=m+be||!x?(T=(m+be-g)/h.partialLength,ie=b.point[0]+(h.point[0]-b.point[0])*T,ae=b.point[1]+(h.point[1]-b.point[1])*T,a.translate(-n[0]*f[u].an*.005,-(n[1]*A)*.01),_=!1):x&&(g+=h.partialLength,v+=1,v>=x.length&&(v=0,y+=1,S[y]?x=S[y].points:D.v.c?(v=0,y=0,x=S[y].points):(g-=h.partialLength,x=null)),x&&(b=h,h=x[v],C=h.partialLength));re=f[u].an/2-f[u].add,a.translate(-re,0,0)}else re=f[u].an/2-f[u].add,a.translate(-re,0,0),a.translate(-n[0]*f[u].an*.005,-n[1]*A*.01,0);for(P=0;Pe?this.textSpans[e].span:z(s?`g`:`text`),b<=e){if(c.setAttribute(`stroke-linecap`,`butt`),c.setAttribute(`stroke-linejoin`,`round`),c.setAttribute(`stroke-miterlimit`,`4`),this.textSpans[e].span=c,s){var S=z(`g`);c.appendChild(S),this.textSpans[e].childSpan=S}this.textSpans[e].span=c,this.layerElement.appendChild(c)}c.style.display=`inherit`}if(l.reset(),d&&(o[e].n&&(f=-g,p+=n.yOffset,p+=+!!h,h=!1),this.applyTextPropertiesToMatrix(n,l,o[e].line,f,p),f+=o[e].l||0,f+=g),s){x=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily);var C;if(x.t===1)C=new ir(x.data,this.globalData,this);else{var w=Qn;x.data&&x.data.shapes&&(w=this.buildShapeData(x.data,n.finalSize)),C=new Gn(w,this.globalData,this)}if(this.textSpans[e].glyph){var T=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(T.layerElement),T.destroy()}this.textSpans[e].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[e].childSpan.appendChild(C.layerElement),x.t===1&&this.textSpans[e].childSpan.setAttribute(`transform`,`scale(`+n.finalSize/100+`,`+n.finalSize/100+`)`)}else d&&c.setAttribute(`transform`,`translate(`+l.props[12]+`,`+l.props[13]+`)`),c.textContent=o[e].val,c.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`)}d&&c&&c.setAttribute(`d`,u)}for(;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;--n)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},rr.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=0;--n)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t=1){this.buffers=[];var e=this.globalData.canvasContext,t=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&lr.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new dr(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=$t(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new fr(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(gn.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext(`2d`);this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext(`2d`);if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById(`tp`in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=lr.getLumaCanvas(this.canvasContext.canvas);n.getContext(`2d`).drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=mr[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation=`destination-over`,this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation=`source-over`}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&=!1}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new K},pr.prototype.hide=pr.prototype.hideElement,pr.prototype.show=pr.prototype.showElement;function hr(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i=4;t.ty===`rc`?i=5:t.ty===`el`?i=6:t.ty===`sr`&&(i=7),this.sh=Ke.getShapeProp(e,t,i,e);var a,o=n.length,s;for(a=0;a=0;--a){if(d=this.searchProcessedElement(e[a]),d?t[a]=n[d-1]:e[a]._shouldRender=r,e[a].ty===`fl`||e[a].ty===`st`||e[a].ty===`gf`||e[a].ty===`gs`)d?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],m),l.push(t[a].style);else if(e[a].ty===`gr`){if(!d)t[a]=this.createGroupElement(e[a]);else for(c=t[a].it.length,s=0;s=0;--i)t[i].ty===`tr`?(o=n[i].transform,this.renderShapeTransform(e,o)):t[i].ty===`sh`||t[i].ty===`el`||t[i].ty===`rc`||t[i].ty===`sr`?this.renderPath(t[i],n[i]):t[i].ty===`fl`?this.renderFill(t[i],n[i],o):t[i].ty===`st`?this.renderStroke(t[i],n[i],o):t[i].ty===`gf`||t[i].ty===`gs`?this.renderGradientFill(t[i],n[i],o):t[i].ty===`gr`?this.renderShape(o,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},gr.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n=e.trNodes,r=t.paths,i,a,o,s=r._length;n.length=0;var c=e.transforms.finalTransform;for(o=0;o=1?u=.99:u<=-1&&(u=-.99);var d=c*u,f=Math.cos(l+t.a.v)*d+o[0],p=Math.sin(l+t.a.v)*d+o[1];i=a.createRadialGradient(f,p,0,o[0],o[1],c)}var m,h=e.g.p,g=t.g.c,_=1;for(m=0;ma&&c===`xMidYMid slice`||ii&&s===`meet`||ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:l===`xMax`&&(ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u===`YMid`&&(a>i&&s===`meet`||ai&&s===`meet`||a=0;--e)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},Z.prototype.renderFrame=function(e,t){if(!(this.renderedFrame===e&&this.renderConfig.clearCanvas===!0&&!t||this.destroyed||e===-1)){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n,r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},Z.prototype.buildItem=function(e){var t=this.elements;if(!(t[e]||this.layers[e].ty===99)){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},Z.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},Z.prototype.hide=function(){this.animationItem.container.style.display=`none`},Z.prototype.show=function(){this.animationItem.container.style.display=`block`};function br(){this.opacity=-1,this.transform=p(`float32`,16),this.fillStyle=``,this.strokeStyle=``,this.lineWidth=``,this.lineCap=``,this.lineJoin=``,this.miterLimit=``,this.id=Math.random()}function xr(){this.stack=[],this.cArrPos=0,this.cTr=new K;var e,t=15;for(e=0;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Sr.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;--e)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},Sr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)};function Cr(e,t){this.animationItem=e,this.renderConfig={clearCanvas:t&&t.clearCanvas!==void 0?t.clearCanvas:!0,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||`xMidYMid meet`,imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||`xMidYMid slice`,contentVisibility:t&&t.contentVisibility||`visible`,className:t&&t.className||``,id:t&&t.id||``,runExpressions:!t||t.runExpressions===void 0||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new xr,this.elements=[],this.pendingElements=[],this.transformMat=new K,this.completeLayers=!1,this.rendererType=`canvas`,this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}return u([Z],Cr),Cr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)},ge(`canvas`,Cr),ut.registerModifier(`tm`,ft),ut.registerModifier(`pb`,pt),ut.registerModifier(`rp`,ht),ut.registerModifier(`rd`,gt),ut.registerModifier(`zz`,Pt),ut.registerModifier(`op`,qt),q}))}))(),1),Tt=0,Et=e=>`${e}-${++Tt}`,Dt=[{center:`#6f5bea`,edge:`#34278f`,pattern:`#a89df5`,text:`#ffffff`},{center:`#32a86b`,edge:`#17613e`,pattern:`#8ee0b3`,text:`#ffffff`},{center:`#df8d2f`,edge:`#8c421e`,pattern:`#ffd08a`,text:`#ffffff`},{center:`#d95878`,edge:`#7b2944`,pattern:`#f5a1b6`,text:`#ffffff`}];function Ot(e){if(!e.length)return e;let t=Math.floor(1e3/e.length),n=1e3%e.length;return e.map((e,r)=>({...e,rarity:String(t+ +(r({key:Et(e),name:``,rarity:`1`,sortOrder:String(t),file:null,animation:null,fileError:``});function At(e){let t=e.reduce((e,t)=>{let n=Number(t.backdropID);return Number.isInteger(n)?Math.max(e,n):e},0)+1,n=Dt[e.length%Dt.length];return{key:Et(`backdrop`),name:``,backdropID:String(t),rarity:`1`,sortOrder:String(e.length),...n}}var jt=e=>Ot([kt(e,0),kt(e,1)]),X=()=>{let e=At([]);return Ot([e,At([e])])};function Mt({data:e,compact:t=!1}){let n=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!n.current)return;let t=wt.default.loadAnimation({container:n.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)});return()=>t.destroy()},[e]),(0,W.jsx)(`div`,{className:`collectible-animation ${t?`compact`:``}`,ref:n})}function Nt({giftID:e,attribute:t}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let n=!1;return a(!1),x.giftCollectibleAnimation(e,t.kind,t.id).then(e=>{n||r(e)}).catch(()=>{n||a(!0)}),()=>{n=!0}},[e,t.id,t.kind]),i?(0,W.jsx)(`div`,{className:`collectible-animation compact failed`,children:`!`}):n?(0,W.jsx)(Mt,{data:n,compact:!0}):(0,W.jsx)(`div`,{className:`collectible-animation compact loading`,children:(0,W.jsx)(A,{className:`spin`,size:15})})}async function Pt(e){let t=new Uint8Array(await e.arrayBuffer()),n=t;if(t.length>=2&&t[0]===31&&t[1]===139){if(!(`DecompressionStream`in window))throw Error(`This browser cannot preview TGS files`);let e=new Blob([t]).stream().pipeThrough(new DecompressionStream(`gzip`));n=new Uint8Array(await new Response(e).arrayBuffer())}let r=JSON.parse(new TextDecoder().decode(n));if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`Invalid Lottie JSON`);return r}var Ft=e=>Number.parseInt(e.replace(`#`,``),16),It=e=>e.rarity_kind===`permille`?`${e.rarity_permille}‰`:e.rarity_kind;function Lt({gift:e,onClose:t,onPublished:n}){let{t:r}=we(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!0),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(`100`),[_,v]=(0,g.useState)(`1000`),[y,S]=(0,g.useState)(`gift-${e.GiftID}`),[C,w]=(0,g.useState)(``),[T,E]=(0,g.useState)(()=>jt(`model`)),[D,O]=(0,g.useState)(()=>jt(`pattern`)),[M,N]=(0,g.useState)(X);(0,g.useEffect)(()=>{let t=!1;return x.giftCollectibles(e.GiftID).then(n=>{t||(a(n),n.found&&(h(String(n.upgrade_stars??100)),v(String(n.supply_total??1e3)),S(n.slug_prefix??`gift-${e.GiftID}`)))}).catch(e=>d(b(e))).finally(()=>{t||s(!1)}),()=>{t=!0}},[e.GiftID]);let P=(0,g.useMemo)(()=>({models:T.reduce((e,t)=>e+Number(t.rarity||0),0),patterns:D.reduce((e,t)=>e+Number(t.rarity||0),0),backdrops:M.reduce((e,t)=>e+Number(t.rarity||0),0)}),[T,D,M]),F=()=>p(null),I=(e,t,n)=>{(e===`models`?E:O)(e=>e.map(e=>e.key===t?{...e,...n}:e)),F()};async function L(e,t,n){if(I(e,t.key,{file:n,animation:null,fileError:``}),n)try{let r=await Pt(n);I(e,t.key,{animation:r,fileError:``})}catch(n){I(e,t.key,{animation:null,fileError:b(n)})}}function ee(e,t=``){if(!C.trim())throw Error(r(`action.reasonRequired`));if(T.length<2||D.length<2||M.length<2)throw Error(r(`collectibles.minimumAttributes`));let n=M.map(e=>Number(e.backdropID));if(new Set(n).size!==n.length)throw Error(r(`collectibles.duplicateBackdropID`));for(let e of[...T,...D])if(!e.file)throw Error(r(`collectibles.fileRequired`));let i=new FormData,a=e=>e.map(e=>({name:e.name.trim(),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),file_key:e.key}));i.set(`metadata`,JSON.stringify({command_id:t,reason:C.trim(),confirm:e,upgrade_stars:m,supply_total:Number(_),slug_prefix:y.trim().toLowerCase(),models:a(T),patterns:a(D),backdrops:M.map(e=>({name:e.name.trim(),backdrop_id:Number(e.backdropID),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),center_color:Ft(e.center),edge_color:Ft(e.edge),pattern_color:Ft(e.pattern),text_color:Ft(e.text)}))}));for(let e of[...T,...D])i.set(e.key,e.file,e.file.name);return i}async function te(){l(!0),d(``),p(null);try{p(await x.publishGiftCollectibles(e.GiftID,ee(!1)))}catch(e){d(b(e))}finally{l(!1)}}async function re(){if(f){l(!0),d(``);try{await x.publishGiftCollectibles(e.GiftID,ee(!0,f.command_id)),n(),t()}catch(e){d(b(e))}finally{l(!1)}}}let ie=(e,t,n)=>(0,W.jsxs)(`section`,{className:`collectible-section`,children:[(0,W.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.${e}`)}),(0,W.jsx)(`span`,{children:r(`collectibles.rarityHint`)})]}),(0,W.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,W.jsxs)(J,{tone:P[e]>0?`good`:`neutral`,children:[P[e],`‰`]}),(0,W.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{n(Ot([...t,kt(e===`models`?`model`:`pattern`,t.length)])),F()},children:[(0,W.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,W.jsx)(`div`,{className:`collectible-rows`,children:t.map((i,a)=>(0,W.jsxs)(`div`,{className:`collectible-row animated`,children:[(0,W.jsx)(`div`,{className:`collectible-row-index`,children:a+1}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`common.name`)}),(0,W.jsx)(`input`,{value:i.name,maxLength:128,onChange:t=>I(e,i.key,{name:t.target.value})})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:i.rarity,onChange:t=>I(e,i.key,{rarity:t.target.value})})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,W.jsx)(`input`,{type:`number`,value:i.sortOrder,onChange:t=>I(e,i.key,{sortOrder:t.target.value})})]}),(0,W.jsxs)(`label`,{className:`collectible-file`,children:[(0,W.jsx)(`span`,{children:r(`gifts.animation`)}),(0,W.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:t=>void L(e,i,t.target.files?.[0]??null)}),(0,W.jsxs)(`em`,{children:[(0,W.jsx)(R,{size:13}),i.file?.name??r(`gifts.chooseFile`)]})]}),(0,W.jsx)(`div`,{className:`collectible-inline-preview`,children:i.animation?(0,W.jsx)(Mt,{data:i.animation,compact:!0}):(0,W.jsx)(j,{size:16})}),(0,W.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:t.length<=2,onClick:()=>{n(Ot(t.filter(e=>e.key!==i.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,W.jsx)(_e,{size:14})}),i.fileError&&(0,W.jsx)(`span`,{className:`collectible-file-error`,children:i.fileError})]},i.key))})]});return(0,ot.createPortal)((0,W.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,W.jsxs)(`section`,{className:`modal command-modal collectible-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`collectibles.title`,{id:e.GiftID}),children:[(0,W.jsxs)(`div`,{className:`modal-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:r(`collectibles.eyebrow`)}),(0,W.jsx)(`h2`,{children:r(`collectibles.title`,{id:e.GiftID})}),(0,W.jsx)(`p`,{children:e.Title||`Gift #${e.GiftID}`})]}),(0,W.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:t,disabled:c,"aria-label":r(`action.close`),children:(0,W.jsx)(H,{size:15})})]}),(0,W.jsxs)(`div`,{className:`command-body collectible-modal-body`,children:[o?(0,W.jsxs)(`div`,{className:`collectible-loading`,children:[(0,W.jsx)(A,{className:`spin`}),r(`common.loading`)]}):i?.found?(0,W.jsxs)(`section`,{className:`collectible-active`,children:[(0,W.jsxs)(`div`,{className:`collectible-active-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(ne,{size:18}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.activeRevision`,{revision:i.revision??0})}),(0,W.jsxs)(`span`,{children:[i.slug_prefix,` · ⭐ `,i.upgrade_stars,` · `,i.issued,` / `,i.supply_total]})]})]}),(0,W.jsx)(J,{tone:`good`,children:r(`collectibles.published`)})]}),(0,W.jsxs)(`div`,{className:`collectible-active-grid`,children:[[...i.models??[],...i.patterns??[]].map(t=>(0,W.jsxs)(`article`,{children:[(0,W.jsx)(Nt,{giftID:e.GiftID,attribute:t}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`strong`,{children:[t.name,t.crafted&&(0,W.jsx)(J,{children:`crafted`})]}),(0,W.jsxs)(`span`,{children:[r(`collectibles.${t.kind}`),` · `,It(t)]})]})]},`${t.kind}-${t.id}`)),(i.backdrops??[]).map(e=>(0,W.jsxs)(`article`,{children:[(0,W.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, #${(e.center_color??0).toString(16).padStart(6,`0`)}, #${(e.edge_color??0).toString(16).padStart(6,`0`)})`,color:`#${(e.text_color??16777215).toString(16).padStart(6,`0`)}`},children:`Aa`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:e.name}),(0,W.jsxs)(`span`,{children:[r(`collectibles.backdrop`),` · `,It(e)]})]})]},`backdrop-${e.id}`))]})]}):(0,W.jsxs)(`div`,{className:`collectible-empty`,children:[(0,W.jsx)(ne,{size:22}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.noPool`)}),(0,W.jsx)(`span`,{children:r(`collectibles.noPoolHint`)})]})]}),(0,W.jsxs)(`section`,{className:`collectible-definition`,children:[(0,W.jsxs)(`div`,{className:`collectible-definition-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.publishNew`)}),(0,W.jsx)(`span`,{children:r(`collectibles.immutableHint`)})]}),(0,W.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,W.jsx)(`span`,{children:`TGS`}),(0,W.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,W.jsxs)(`div`,{className:`gift-fields-grid collectible-main-fields`,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.upgradeStars`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:m,onChange:e=>{h(e.target.value),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.supply`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:_,onChange:e=>{v(e.target.value),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.slug`)}),(0,W.jsx)(`input`,{value:y,maxLength:48,onChange:e=>{S(e.target.value.toLowerCase()),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`gifts.reason`)}),(0,W.jsx)(`input`,{value:C,maxLength:1e3,placeholder:r(`gifts.reasonPlaceholder`),onChange:e=>w(e.target.value)})]})]}),ie(`models`,T,E),ie(`patterns`,D,O),(0,W.jsxs)(`section`,{className:`collectible-section`,children:[(0,W.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.backdrops`)}),(0,W.jsx)(`span`,{children:r(`collectibles.colorHint`)})]}),(0,W.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,W.jsxs)(J,{tone:P.backdrops>0?`good`:`neutral`,children:[P.backdrops,`‰`]}),(0,W.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{N(Ot([...M,At(M)])),F()},children:[(0,W.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,W.jsx)(`div`,{className:`collectible-rows`,children:M.map((e,t)=>(0,W.jsxs)(`div`,{className:`collectible-row backdrop`,children:[(0,W.jsx)(`div`,{className:`collectible-row-index`,children:t+1}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`common.name`)}),(0,W.jsx)(`input`,{value:e.name,maxLength:128,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,name:t.target.value}:n)),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.backdropID`)}),(0,W.jsx)(`input`,{type:`number`,min:`0`,value:e.backdropID,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,backdropID:t.target.value}:n)),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:e.rarity,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,rarity:t.target.value}:n)),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,W.jsx)(`input`,{type:`number`,value:e.sortOrder,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,sortOrder:t.target.value}:n)),F()}})]}),[`center`,`edge`,`pattern`,`text`].map(t=>(0,W.jsxs)(`label`,{className:`collectible-color`,children:[(0,W.jsx)(`span`,{children:r(`collectibles.color.${t}`)}),(0,W.jsx)(`input`,{type:`color`,value:e[t],onChange:n=>{N(M.map(r=>r.key===e.key?{...r,[t]:n.target.value}:r)),F()}})]},t)),(0,W.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, ${e.center}, ${e.edge})`,color:e.text},children:`Aa`}),(0,W.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:M.length<=2,onClick:()=>{N(Ot(M.filter(t=>t.key!==e.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,W.jsx)(_e,{size:14})})]},e.key))})]})]}),u&&(0,W.jsx)(Qe,{children:u}),f&&(0,W.jsxs)(`div`,{className:`gift-validation`,children:[(0,W.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,W.jsx)(k,{size:17}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.validationReady`)}),(0,W.jsx)(`span`,{children:r(`collectibles.validationHint`)})]})]}),(0,W.jsx)(`pre`,{children:JSON.stringify(f.details,null,2)})]})]}),(0,W.jsxs)(`div`,{className:`modal-actions`,children:[(0,W.jsx)(`button`,{className:`btn`,type:`button`,onClick:t,disabled:c,children:r(`common.close`)}),(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:te,disabled:c,children:[c?(0,W.jsx)(A,{className:`spin`,size:15}):(0,W.jsx)(pe,{size:15}),r(`gifts.validate`)]}),(0,W.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:re,disabled:c||!f,children:[(0,W.jsx)(ve,{size:15}),r(`collectibles.publish`)]})]})]})}),document.body)}function Rt(e){return e.model_count+e.pattern_count+e.backdrop_count}function zt(e){let t=Number(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Bt({giftID:e,revision:t,compact:n=!1}){let r=(0,g.useRef)(null),i=(0,g.useRef)(null),[a,o]=(0,g.useState)(!0),[s,c]=(0,g.useState)(``);(0,g.useEffect)(()=>{let t=!1;return x.giftAnimation(e).then(e=>{t||!r.current||(i.current?.destroy(),i.current=wt.default.loadAnimation({container:r.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(e=>c(b(e))),()=>{t=!0,i.current?.destroy(),i.current=null}},[e,t]);function l(){i.current&&(a?i.current.pause():i.current.play(),o(!a))}return(0,W.jsxs)(`div`,{className:`gift-animation-shell ${n?`compact`:``}`,children:[(0,W.jsx)(`div`,{className:`gift-animation`,ref:r,children:s&&(0,W.jsx)(`span`,{children:s})}),(0,W.jsx)(`button`,{className:`gift-play`,type:`button`,onClick:l,"aria-label":a?`Pause`:`Play`,children:a?(0,W.jsx)(ue,{size:14}):(0,W.jsx)(z,{size:14})})]})}function Vt({sourceGiftID:e}){let t=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let n=!1,r=null;return x.officialGiftAnimation(e).then(e=>{n||!t.current||(r=wt.default.loadAnimation({container:t.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(()=>void 0),()=>{n=!0,r?.destroy()}},[e]),(0,W.jsx)(`div`,{className:`gift-animation-shell`,children:(0,W.jsx)(`div`,{className:`gift-animation`,ref:t})})}function Ht(){let{t:e}=we(),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`official`),[p,m]=(0,g.useState)([]),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!0),[E,D]=(0,g.useState)(`0`),[O,j]=(0,g.useState)(`0`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(`0`),[I,L]=(0,g.useState)(``),[ee,te]=(0,g.useState)(`50`),[re,ie]=(0,g.useState)(`50`),[ae,oe]=(0,g.useState)(`0`),[se,ce]=(0,g.useState)(!0),[le,ue]=(0,g.useState)(``),[z,fe]=(0,g.useState)(null),[me,he]=(0,g.useState)(!1),[ge,_e]=(0,g.useState)(``),[ye,U]=(0,g.useState)(``);async function be(){_e(``);try{n((await x.gifts()).Gifts??[])}catch(e){_e(b(e))}}(0,g.useEffect)(()=>{be()},[]),(0,g.useEffect)(()=>{!a||d!==`official`||p.length>0||x.officialGifts().then(e=>m(e.gifts??[])).catch(e=>U(b(e)))},[a,d,p.length]);let xe=(0,g.useMemo)(()=>p.find(e=>e.source_gift_id===S)??null,[p,S]),Se=(0,g.useMemo)(()=>({all:p.length,upgrade:p.filter(e=>e.can_upgrade).length,craft:p.filter(e=>e.can_craft).length,basic:p.filter(e=>!e.can_upgrade).length}),[p]),Ce=(0,g.useMemo)(()=>{let e=h.trim().toLowerCase();return p.filter(t=>(v===`all`||v===`upgrade`&&t.can_upgrade||v===`craft`&&t.can_craft||v===`basic`&&!t.can_upgrade)&&(!e||t.source_gift_id.includes(e)||t.title.toLowerCase().includes(e)))},[p,h,v]),Te=(0,g.useMemo)(()=>{let e=r.trim().toLowerCase();return e?t.filter(t=>String(t.GiftID).includes(e)||t.Title.toLowerCase().includes(e)||t.SourceFormat.toLowerCase().includes(e)):t},[t,r]);function Ee(t,n=``){if(!l)throw Error(e(`gifts.fileRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));let r=new FormData;return r.set(`metadata`,JSON.stringify({command_id:n,reason:le.trim(),confirm:t,gift_id:P,title:I.trim(),stars:ee,convert_stars:re,enabled:se,sort_order:Number(ae)})),r.set(`file`,l,l.name),r}function De(t,n=``){if(!S)throw Error(e(`gifts.officialRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));return{command_id:n,reason:le.trim(),confirm:t,source_gift_id:S,gift_id:P,title:I.trim(),stars:ee,convert_stars:re,enabled:se,sort_order:Number(ae),include_collectible:w,upgrade_stars:E,supply_total:Number(O),slug_prefix:M.trim().toLowerCase()}}function Oe(t){C(t.source_gift_id),L(t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})),te(String(t.stars)),ie(String(t.convert_stars)),T(t.can_upgrade),D(t.upgrade_stars),j(String(t.availability_total||1)),N(`official-${t.source_gift_id}`),fe(null)}async function ke(){he(!0),U(``),fe(null);try{fe(d===`official`?await x.importOfficialGift(De(!1)):await x.importGift(Ee(!1)))}catch(e){U(b(e))}finally{he(!1)}}async function Ae(){if(z){he(!0),U(``);try{d===`official`?await x.importOfficialGift(De(!0,z.command_id)):await x.importGift(Ee(!0,z.command_id)),fe(null),u(null),F(`0`),L(``),C(``),await be(),o(!1)}catch(e){U(b(e))}finally{he(!1)}}}function je(){F(`0`),L(``),te(`50`),ie(`50`),oe(`0`),ce(!0),ue(``),u(null),fe(null),U(``),f(`official`),C(``),_(``),y(`all`),o(!0)}function Me(e){F(e.GiftID),L(e.Title),te(String(e.Stars)),ie(String(e.ConvertStars)),oe(String(e.SortOrder)),ce(e.Enabled),ue(``),u(null),fe(null),U(``),f(`official`),C(``),_(``),y(`all`),o(!0)}return(0,W.jsxs)(Je,{title:e(`gifts.pageTitle`),eyebrow:e(`gifts.eyebrow`),actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>be(),disabled:me,children:[(0,W.jsx)(B,{size:15}),` `,e(`common.refresh`)]}),(0,W.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:je,children:[(0,W.jsx)(de,{size:15}),` `,e(`gifts.add`)]})]}),children:[ge&&(0,W.jsx)(Qe,{children:ge}),(0,W.jsxs)(`div`,{className:`metric-row gift-metrics`,children:[(0,W.jsx)(et,{label:e(`gifts.total`),value:String(t.length)}),(0,W.jsx)(et,{label:e(`gifts.enabled`),value:String(t.filter(e=>e.Enabled).length),tone:`good`}),(0,W.jsx)(et,{label:e(`gifts.received`),value:t.reduce((e,t)=>e+BigInt(t.ReceivedCount),0n).toString()}),(0,W.jsx)(et,{label:e(`gifts.formats`),value:`TGS / Lottie`})]}),(0,W.jsx)(Ye,{children:(0,W.jsxs)(`div`,{className:`toolbar`,children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:e(`gifts.searchPlaceholder`)})]}),(0,W.jsx)(`span`,{className:`gift-list-summary`,children:e(`gifts.listSummary`,{shown:Te.length,total:t.length})})]})}),(0,W.jsx)(`div`,{className:`table-wrap gift-table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table gift-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:e(`gifts.animation`)}),(0,W.jsx)(`th`,{children:e(`gifts.idRevision`)}),(0,W.jsx)(`th`,{children:e(`gifts.title`)}),(0,W.jsx)(`th`,{children:e(`gifts.price`)}),(0,W.jsx)(`th`,{children:e(`gifts.source`)}),(0,W.jsx)(`th`,{children:e(`gifts.received`)}),(0,W.jsx)(`th`,{children:e(`common.status`)}),(0,W.jsx)(`th`,{children:e(`common.updatedAt`)}),(0,W.jsx)(`th`,{children:e(`common.actions`)})]})}),(0,W.jsxs)(`tbody`,{children:[Te.map(t=>(0,W.jsxs)(`tr`,{className:t.Enabled?``:`gift-row-disabled`,children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(Bt,{giftID:t.GiftID,revision:t.Revision,compact:!0})}),(0,W.jsxs)(`td`,{className:`mono`,children:[t.GiftID,` / `,t.Revision]}),(0,W.jsxs)(`td`,{children:[(0,W.jsx)(`strong`,{className:`gift-table-title`,children:t.Title||`Gift #${t.GiftID}`}),(0,W.jsxs)(`span`,{className:`gift-sort-order`,children:[e(`gifts.sortOrder`),`: `,t.SortOrder]})]}),(0,W.jsxs)(`td`,{children:[(0,W.jsxs)(`strong`,{className:`gift-table-price`,children:[`⭐ `,t.Stars]}),(0,W.jsxs)(`span`,{className:`gift-convert-price`,children:[`→ `,t.ConvertStars]})]}),(0,W.jsxs)(`td`,{children:[(0,W.jsx)(J,{children:t.SourceFormat}),(0,W.jsx)(`span`,{className:`gift-source-size`,children:zt(t.AnimationSize)})]}),(0,W.jsx)(`td`,{children:t.ReceivedCount}),(0,W.jsx)(`td`,{children:(0,W.jsx)(J,{tone:t.Enabled?`good`:`neutral`,children:t.Enabled?e(`common.enabled`):e(`common.disabled`)})}),(0,W.jsx)(`td`,{children:Ke(t.UpdatedAt)}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`div`,{className:`gift-table-actions`,children:[(0,W.jsxs)(`button`,{className:`btn compact-btn collectible-button`,type:`button`,onClick:()=>c(t),children:[(0,W.jsx)(ne,{size:13}),e(`collectibles.manage`)]}),(0,W.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>Me(t),children:e(`gifts.replace`)}),(0,W.jsx)(st,{compact:!0,tone:`neutral`,label:t.Enabled?e(`gifts.disable`):e(`gifts.enable`),path:`/api/actions/set-gift-enabled`,payload:()=>({gift_id:t.GiftID,enabled:!t.Enabled}),onDone:()=>void be()})]})})]},t.GiftID)),Te.length===0&&(0,W.jsx)(nt,{colSpan:9})]})]})}),a&&(0,ot.createPortal)((0,W.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,W.jsxs)(`section`,{className:`modal command-modal gift-import-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P}),children:[(0,W.jsxs)(`div`,{className:`modal-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:e(`gifts.importEyebrow`)}),(0,W.jsx)(`h2`,{children:P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P})})]}),(0,W.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>o(!1),disabled:me,"aria-label":e(`action.close`),children:(0,W.jsx)(H,{size:15})})]}),(0,W.jsxs)(`div`,{className:`command-body gift-import-modal-body`,children:[(0,W.jsxs)(`div`,{className:`command-steps`,children:[(0,W.jsxs)(`div`,{className:`command-step ${(d===`official`?S:l)?`done`:`active`}`,children:[(0,W.jsx)(`span`,{children:`1`}),(0,W.jsx)(`strong`,{children:e(`gifts.stepDetails`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${z?`done`:(d===`official`?S:l)?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`2`}),(0,W.jsx)(`strong`,{children:e(`gifts.stepValidate`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${z?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`3`}),(0,W.jsx)(`strong`,{children:e(`gifts.stepImport`)})]})]}),(0,W.jsxs)(`div`,{className:`gift-source-tabs`,children:[(0,W.jsx)(`button`,{className:`btn ${d===`official`?`primary`:``}`,type:`button`,onClick:()=>{f(`official`),fe(null)},children:e(`gifts.officialSource`)}),(0,W.jsx)(`button`,{className:`btn ${d===`file`?`primary`:``}`,type:`button`,onClick:()=>{f(`file`),fe(null)},children:e(`gifts.fileSource`)})]}),d===`official`?(0,W.jsxs)(`section`,{className:`official-gift-picker`,children:[(0,W.jsxs)(`div`,{className:`gift-import-note`,children:[(0,W.jsx)(`span`,{children:e(`gifts.officialHint`)}),(0,W.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,W.jsx)(`span`,{children:p.length}),(0,W.jsx)(`span`,{children:`SHA-256`})]})]}),(0,W.jsxs)(`div`,{className:`official-gift-tools`,children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),placeholder:e(`gifts.officialSearch`)})]}),(0,W.jsx)(`span`,{children:e(`gifts.officialResults`,{shown:Ce.length,total:p.length})})]}),(0,W.jsx)(`div`,{className:`official-gift-categories`,role:`group`,"aria-label":e(`gifts.officialCategoryLabel`),children:[`all`,`upgrade`,`craft`,`basic`].map(t=>(0,W.jsxs)(`button`,{className:v===t?`active`:``,type:`button`,"aria-pressed":v===t,onClick:()=>y(t),children:[e(`gifts.officialCategory.${t}`),(0,W.jsx)(`span`,{children:Se[t]})]},t))}),(0,W.jsxs)(`div`,{className:`official-gift-list`,role:`listbox`,"aria-label":e(`gifts.officialSelect`),children:[Ce.map(t=>{let n=t.source_gift_id===S;return(0,W.jsxs)(`button`,{className:`official-gift-option ${n?`selected`:``}`,type:`button`,role:`option`,"aria-selected":n,onClick:()=>Oe(t),children:[(0,W.jsxs)(`span`,{className:`official-gift-option-head`,children:[(0,W.jsx)(`strong`,{children:t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})}),(0,W.jsxs)(`span`,{className:`mono`,children:[`#`,t.source_gift_id]})]}),(0,W.jsxs)(`span`,{className:`official-gift-option-meta`,children:[(0,W.jsxs)(`span`,{children:[`⭐ `,t.stars]}),(0,W.jsx)(`span`,{children:e(`gifts.officialAttributes`,{count:Rt(t)})})]}),(0,W.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,W.jsx)(`span`,{className:t.can_upgrade?`yes`:`no`,children:t.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,W.jsx)(`span`,{className:t.can_craft?`craft`:`no`,children:t.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]},t.source_gift_id)}),Ce.length===0&&(0,W.jsx)(`div`,{className:`official-gift-empty`,children:e(`gifts.officialEmpty`)})]}),xe&&(0,W.jsxs)(`div`,{className:`official-gift-selected`,children:[(0,W.jsx)(Vt,{sourceGiftID:xe.source_gift_id}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:xe.title||e(`gifts.officialUnnamed`,{id:xe.source_gift_id})}),(0,W.jsx)(`span`,{className:`mono`,children:xe.source_gift_id}),(0,W.jsxs)(`small`,{children:[xe.model_count,` `,e(`collectibles.models`),` · `,xe.pattern_count,` `,e(`collectibles.patterns`),` · `,xe.backdrop_count,` `,e(`collectibles.backdrops`)]}),(0,W.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,W.jsx)(`span`,{className:xe.can_upgrade?`yes`:`no`,children:xe.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,W.jsx)(`span`,{className:xe.can_craft?`craft`:`no`,children:xe.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]})]}),xe?.can_upgrade&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`label`,{className:`gift-switch`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>{T(e.target.checked),fe(null)}}),(0,W.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{})}),(0,W.jsx)(`span`,{children:e(`gifts.includeCollectible`)})]}),w&&(0,W.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`collectibles.upgradeStars`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:E,onChange:e=>{D(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`collectibles.supply`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:O,onChange:e=>{j(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`collectibles.slug`)}),(0,W.jsx)(`input`,{value:M,maxLength:48,onChange:e=>{N(e.target.value.toLowerCase()),fe(null)}})]})]})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`gift-import-note`,children:[(0,W.jsx)(`span`,{children:e(`gifts.importHint`)}),(0,W.jsxs)(`div`,{className:`gift-format-chips`,"aria-label":e(`gifts.formats`),children:[(0,W.jsx)(`span`,{children:`TGS`}),(0,W.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,W.jsxs)(`label`,{className:`gift-file-picker ${l?`has-file`:``}`,children:[(0,W.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:e=>{u(e.target.files?.[0]??null),fe(null)}}),(0,W.jsx)(`span`,{className:`gift-file-icon`,children:(0,W.jsx)(R,{size:22})}),(0,W.jsxs)(`span`,{className:`gift-file-copy`,children:[(0,W.jsx)(`span`,{className:`gift-field-label`,children:e(`gifts.animation`)}),(0,W.jsx)(`strong`,{children:l?l.name:e(`gifts.filePrompt`)}),(0,W.jsx)(`small`,{children:l?zt(l.size):e(`gifts.fileHint`)})]}),(0,W.jsx)(`span`,{className:`gift-file-action`,children:e(l?`gifts.changeFile`:`gifts.chooseFile`)})]})]}),(0,W.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.title`)}),(0,W.jsx)(`input`,{value:I,maxLength:128,placeholder:e(`gifts.titlePlaceholder`),onChange:e=>{L(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.stars`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:ee,onChange:e=>{te(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.convertStars`)}),(0,W.jsx)(`input`,{type:`number`,min:`0`,value:re,onChange:e=>{ie(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.sortOrder`)}),(0,W.jsx)(`input`,{type:`number`,value:ae,onChange:e=>{oe(e.target.value),fe(null)}})]})]}),(0,W.jsxs)(`label`,{className:`gift-reason-field`,children:[(0,W.jsx)(`span`,{children:e(`gifts.reason`)}),(0,W.jsx)(`input`,{value:le,placeholder:e(`gifts.reasonPlaceholder`),onChange:e=>ue(e.target.value)})]}),(0,W.jsxs)(`label`,{className:`gift-switch`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:se,onChange:e=>{ce(e.target.checked),fe(null)}}),(0,W.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{})}),(0,W.jsx)(`span`,{children:e(`gifts.enableAfterImport`)})]}),ye&&(0,W.jsx)(Qe,{children:ye}),z&&(0,W.jsxs)(`div`,{className:`gift-validation`,children:[(0,W.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,W.jsx)(k,{size:17}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:e(`gifts.validationReady`)}),(0,W.jsx)(`span`,{children:e(`gifts.validationHint`)})]})]}),(0,W.jsx)(`pre`,{children:JSON.stringify(z.details,null,2)})]})]}),(0,W.jsxs)(`div`,{className:`modal-actions`,children:[(0,W.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>o(!1),disabled:me,children:e(`common.close`)}),(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:ke,disabled:me,children:[me?(0,W.jsx)(A,{className:`spin`,size:15}):(0,W.jsx)(pe,{size:15}),e(`gifts.validate`)]}),(0,W.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:Ae,disabled:me||!z,children:[(0,W.jsx)(ve,{size:15}),e(`gifts.confirmImport`)]})]})]})}),document.body),s&&(0,W.jsx)(Lt,{gift:s,onClose:()=>c(null),onPublished:()=>void be()})]})}function Ut({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1];return n?(0,W.jsx)(lt,{id:Number(n),navigate:t}):r?(0,W.jsx)(mt,{id:Number(r),navigate:t}):e.path===`/accounts`?(0,W.jsx)(pt,{navigate:t}):e.path===`/channels`?(0,W.jsx)(ht,{navigate:t}):e.path===`/gifts`?(0,W.jsx)(Ht,{}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,W.jsx)(St,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,W.jsx)(vt,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,W.jsx)(xt,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,W.jsx)(Ct,{navigate:t}):(0,W.jsx)(gt,{navigate:t})}function Wt(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>ke());(0,g.useEffect)(()=>{let e=()=>r(ke());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(ke())};return e===void 0?(0,W.jsx)(G,{}):e===null?(0,W.jsx)(at,{onLogin:t}):(0,W.jsx)(Be,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,W.jsx)(Ut,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,W.jsx)(g.StrictMode,{children:(0,W.jsx)(Fe,{children:(0,W.jsx)(Ce,{children:(0,W.jsx)(Wt,{})})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/assets/index-DHdrFM5j.css b/cmd/telesrv-admin/web/dist/assets/index-DHdrFM5j.css deleted file mode 100644 index f38bf9a5..00000000 --- a/cmd/telesrv-admin/web/dist/assets/index-DHdrFM5j.css +++ /dev/null @@ -1 +0,0 @@ -:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#f3f5f7;--panel:#fff;--panel-subtle:#f8fafb;--panel-strong:#eef2f5;--line:#d9e1e8;--line-strong:#c2ccd6;--text:#101828;--muted:#667085;--muted-2:#98a2b3;--brand:#176d61;--brand-2:#245b9d;--good:#167447;--warn:#a15c07;--danger:#b42318;--sidebar:#11161d;--sidebar-soft:#1b222b;--sidebar-line:#2c3541;--focus:#176d6129;--shadow:0 18px 52px #10182824}*{box-sizing:border-box}html,body,#root{min-height:100%}body{color:var(--text);background:var(--bg);margin:0;font:13px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}button,input,textarea{font:inherit}a{color:inherit;text-decoration:none}.shell{grid-template-columns:232px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{color:#eef2f6;background:var(--sidebar);border-right:1px solid var(--sidebar-line);flex-direction:column;gap:16px;height:100vh;padding:18px 12px;display:flex;position:sticky;top:0;overflow-y:auto}.brand{align-items:center;gap:10px;min-height:42px;padding:0 4px;display:flex}.brand.compact{justify-content:center}.brand-elevated .brand-mark{box-shadow:0 8px 24px #176d6142}.brand-mark{color:#fff;background:var(--brand);border:1px solid #fff3;border-radius:8px;place-items:center;width:34px;height:34px;font-weight:800;display:grid}.brand strong{font-size:14px;line-height:1.1;display:block}.brand small{color:#aeb8c4;margin-top:3px;font-size:11px;display:block}.sidebar-label{color:#8492a6;text-transform:uppercase;padding:0 8px;font-size:11px;font-weight:700}.nav-list,.nav-section{gap:4px;display:grid}.nav-section-toggle{color:#8fa0b4;cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;border-radius:7px;grid-template-columns:18px minmax(0,1fr) 16px;align-items:center;gap:9px;width:100%;min-height:38px;padding:0 10px;font-size:12px;font-weight:800;display:grid}.nav-section-toggle:hover,.nav-section.active .nav-section-toggle{color:#fff;background:var(--sidebar-soft);border-color:#34404d}.nav-section-chevron{color:#8fa0b4;justify-self:end;transition:transform .14s}.nav-section.open .nav-section-chevron{transform:rotate(180deg)}.nav-children{gap:4px;padding:2px 0 2px 18px;display:grid}.nav-item{color:#c6d0dc;border:1px solid #0000;border-radius:7px;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;min-height:38px;padding:0 10px;display:grid}.nav-dot{background:#687789;border-radius:999px;justify-self:center;width:6px;height:6px}.nav-item:hover,.nav-item.active{color:#fff;background:var(--sidebar-soft);border-color:#34404d}.nav-item.active .nav-dot{background:var(--brand)}.sidebar-status{gap:7px;margin-top:auto;display:grid}.runtime-row{color:#cbd5df;background:#171d25;border:1px solid #27313c;border-radius:7px;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;min-height:32px;padding:0 8px;display:grid}.runtime-row strong{color:#fff;font-size:11px}.workspace{min-width:0}.topbar{z-index:20;border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);background:#fffffff0;justify-content:space-between;align-items:center;gap:18px;min-height:66px;padding:12px 24px;display:flex;position:sticky;top:0}.topbar h1{margin:2px 0 0;font-size:20px;line-height:1.2}.topbar-actions,.page-actions,.section-action,.entity-badges,.row-actions,.modal-actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.language-switch{background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;min-height:30px;padding:2px;display:inline-flex}.language-switch button{min-width:42px;min-height:24px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:999px;padding:0 9px;font-weight:800}.language-switch button.active{color:#fff;background:var(--brand)}.language-switch button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.actor-pill{color:#344054;background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;min-height:30px;padding:0 10px;display:inline-flex}.content{gap:16px;padding:18px 24px 30px;display:grid}.eyebrow{color:var(--muted);text-transform:uppercase;font-size:11px;font-weight:800}.dashboard-layout,.stacked-sections{gap:14px;display:grid}.overview-band,.page-frame{background:var(--panel);border:1px solid var(--line);border-radius:8px;min-width:0}.overview-band{grid-template-columns:minmax(220px,1fr) minmax(420px,.9fr);align-items:center;gap:16px;padding:16px;display:grid}.overview-band h2,.page-title-row h2,.section-head h2,.modal h2{margin:0;font-size:18px;line-height:1.25}.overview-metrics,.metric-row{grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;display:grid}.overview-metrics{grid-template-columns:repeat(3,minmax(120px,1fr))}.status-item,.metric,.summary-item{background:var(--panel-subtle);border:1px solid var(--line);border-radius:7px;min-width:0;padding:10px}.status-item span,.metric span,.summary-item span{color:var(--muted);margin-bottom:6px;font-size:11px;display:block}.status-item strong,.metric strong,.summary-item strong{overflow-wrap:anywhere;color:var(--text);font-weight:800;display:block}.status-item.good,.metric.good{border-color:#afd8bf}.status-item.warn,.metric.warn{border-color:#e7c77e}.metric.danger{border-color:#efb4ad}.command-grid{grid-template-columns:repeat(3,minmax(220px,1fr));gap:12px;display:grid}.launcher{background:var(--panel);border:1px solid var(--line);border-radius:8px;grid-template-columns:38px minmax(0,1fr) 18px;align-items:center;gap:12px;min-height:94px;padding:14px;display:grid}.launcher:hover{border-color:var(--brand)}.launcher-icon{width:38px;height:38px;color:var(--brand);background:#edf7f4;border:1px solid #c9e2dc;border-radius:8px;place-items:center;display:grid}.launcher-copy{gap:4px;display:grid}.launcher-copy strong{font-size:15px}.launcher-copy span{color:var(--muted)}.work-strip{grid-template-columns:repeat(4,minmax(160px,1fr));gap:8px;display:grid}.strip-item{color:#344054;background:var(--panel);border:1px solid var(--line);border-radius:8px;align-items:center;gap:8px;min-height:38px;padding:0 10px;display:flex}.page-frame{gap:14px;padding:14px;display:grid}.page-title-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:14px;padding-bottom:12px;display:flex}.query-panel{background:var(--panel-subtle);border:1px solid var(--line);border-radius:8px;padding:10px}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.message-query input{width:150px}.message-selector-grid{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;margin-bottom:10px;display:grid}.message-selector-grid.single{grid-template-columns:minmax(320px,620px)}.entity-picker{border:1px solid var(--line);background:#fff;border-radius:8px;gap:8px;min-width:0;padding:10px;display:grid}.picker-head{color:#344054;justify-content:space-between;align-items:center;gap:8px;min-height:24px;font-weight:800;display:flex}.selected-entity{color:#0f3f38;background:#eef8f5;border:1px solid #b9dcd3;border-radius:7px;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:7px 9px;display:grid}.selected-entity strong,.selected-entity span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.selected-entity div{gap:2px;min-width:0;display:grid}.selected-entity div span{color:#52606d;font-size:11px}.picker-search{background:var(--panel-subtle);border:1px solid var(--line-strong);border-radius:7px;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;height:34px;padding:0 6px 0 9px;display:grid}.picker-search input{width:100%;height:30px;box-shadow:none;background:0 0;border:0;padding:0}.picker-results{border:1px solid var(--line);border-radius:7px;max-height:236px;display:grid;overflow:auto}.picker-row{min-height:36px;color:var(--text);border:0;border-bottom:1px solid var(--line);cursor:pointer;text-align:left;background:#fff;grid-template-columns:96px minmax(120px,1fr) minmax(120px,1fr) auto;align-items:center;gap:8px;padding:6px 8px;display:grid}.picker-row:last-child{border-bottom:0}.picker-row:hover,.picker-row.selected{background:#f3f8f6}.picker-row strong,.picker-row span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.picker-empty,.picker-error{color:var(--muted);text-align:center;padding:9px}.picker-error{color:var(--danger);background:#fff2f0;border:1px solid #efb4ad;border-radius:7px}input,textarea{color:var(--text);border:1px solid var(--line-strong);background:#fff;border-radius:7px;outline:none}input{width:190px;height:34px;padding:0 10px}textarea{resize:vertical;width:100%;padding:9px 10px}input:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus)}.small-input{width:88px}.field-inline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.field-inline span{font-size:11px;font-weight:700}.searchbox{border:1px solid var(--line-strong);background:#fff;border-radius:7px;align-items:center;gap:8px;width:min(380px,100%);height:34px;padding:0 10px;display:inline-flex}.searchbox input{width:100%;height:30px;box-shadow:none;border:0;padding:0}.btn{color:#1d2939;border:1px solid var(--line-strong);cursor:pointer;white-space:nowrap;background:#fff;border-radius:7px;justify-content:center;align-items:center;gap:6px;min-height:34px;padding:0 12px;display:inline-flex}.btn:hover:not(:disabled){background:#f7f9fb}.btn:disabled{color:var(--muted-2);cursor:not-allowed}.btn.primary{color:#fff;background:var(--brand);border-color:var(--brand)}.btn.primary:hover:not(:disabled){background:#12594f}.btn.ghost{background:var(--panel-subtle)}.btn.danger{color:var(--danger);background:#fff7f5;border-color:#efb4ad}.btn.danger:hover:not(:disabled){background:#ffeceb}.btn.warn{color:var(--warn);background:#fff8ec;border-color:#e7c77e}.btn.warn:hover:not(:disabled){background:#fff1d6}.btn:disabled,.btn.primary:disabled,.btn.warn:disabled,.btn.danger:disabled{color:var(--muted-2);border-color:var(--line);cursor:not-allowed;background:#f3f5f7}.btn.full{width:100%}.icon-text{gap:7px}.compact-btn{min-height:28px;padding:0 8px;font-size:12px}.row-link,.link-button{color:var(--brand-2);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:0;display:inline-flex}.table-wrap{border:1px solid var(--line);border-radius:8px;width:100%;overflow-x:auto}.data-table{border-collapse:collapse;width:100%;font-size:12.5px}.data-table th,.data-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;white-space:nowrap;height:38px;padding:7px 9px}.data-table th{z-index:0;color:#475467;background:var(--panel-strong);font-weight:800;position:sticky;top:0}.data-table tbody tr:hover{background:#fbfcfd}.data-table tr:last-child td{border-bottom:0}.mono{font-family:SFMono-Regular,Consolas,Liberation Mono,monospace}.truncate{text-overflow:ellipsis;max-width:380px;overflow:hidden}.badge{color:#4f5b68;white-space:nowrap;background:#f3f6f8;border:1px solid #d7e0e8;border-radius:999px;align-items:center;min-height:22px;padding:1px 8px;display:inline-flex}.badge.good{color:var(--good);background:#eef8f2;border-color:#b9dcc7}.badge.danger{color:var(--danger);background:#fff2f0;border-color:#efb4ad}.badge.warn{color:var(--warn);background:#fff8e7;border-color:#e7c77e}.empty-cell{color:var(--muted);text-align:center}.split-layout{grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:14px;display:grid}.split-main,.split-side{min-width:0}.entity-head{background:var(--panel-subtle);border:1px solid var(--line);border-radius:8px;justify-content:space-between;align-items:flex-start;gap:14px;padding:14px;display:flex}.entity-title{font-size:20px;font-weight:800;line-height:1.25}.entity-subtitle{color:var(--muted);margin-top:4px}.summary-grid{grid-template-columns:repeat(4,minmax(150px,1fr));gap:8px;display:grid}.about-text{color:#344054;border:1px solid var(--line);background:#fbfcfd;border-radius:8px;margin:0;padding:10px}.section-block,.action-dock,.surface{background:var(--panel);border:1px solid var(--line);border-radius:8px;min-width:0;padding:12px}.section-head{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.section-head p{color:var(--muted);margin:5px 0 0}.action-dock{gap:10px;display:grid;position:sticky;top:82px}.dock-title{color:#344054;border-bottom:1px solid var(--line);padding-bottom:4px;font-weight:800}.action-dock>.btn,.action-dock .action-stack .btn{justify-content:center;width:100%}.duration-field{gap:4px;display:grid}.duration-field span{color:var(--muted);font-size:11px;font-weight:800}.duration-field input{width:100%}.action-stack{gap:10px;display:grid}.action-stack .btn,.action-dock>.btn{min-height:42px}.danger-zone{border-top:1px solid var(--line);flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;display:flex}.authorization-block{gap:10px;display:grid}.authorization-table{table-layout:fixed;min-width:720px}.authorization-table th,.authorization-table td{height:46px}.device-text{text-overflow:ellipsis;max-width:260px;overflow:hidden}.device-actions-head{width:190px}.device-actions-cell{width:190px;min-width:190px}.device-actions{white-space:normal;grid-template-columns:repeat(2,minmax(82px,1fr));gap:6px;min-width:178px;display:grid}.device-actions .btn{justify-content:center;width:100%}.operation-row{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;display:grid}.operation-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:8px;flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}.operation-title{align-items:center;gap:6px;width:100%;font-weight:800;display:flex}.checkline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.checkline input{width:auto;height:auto}.alert{color:#8a251d;background:#fff2f0;border:1px solid #efb4ad;border-radius:8px;align-items:flex-start;gap:8px;padding:9px 10px;display:flex}.json-block{color:#d8e6f0;background:#141a22;border:1px solid #2a3542;border-radius:8px;max-height:520px;margin:0;padding:12px;font-size:12px;overflow:auto}.raw-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.loading-line{min-height:80px;color:var(--muted);place-items:center;display:grid}.empty-panel{min-height:92px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:8px;place-items:center;display:grid}.gift-metrics .metric{background:linear-gradient(145deg,#fff,#f6f9f9);min-height:68px;padding:12px}.gift-metrics .metric strong{font-size:17px}.gift-file-icon{color:var(--brand);background:#eaf6f3;border:1px solid #c7e3dc;flex:none;place-items:center;display:grid}.gift-format-chips{flex-wrap:wrap;flex:none;justify-content:flex-end;gap:6px;display:flex}.gift-format-chips span{color:#33645d;letter-spacing:.02em;background:#eef8f5;border:1px solid #cfe5df;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.gift-list-summary{color:var(--muted);margin-left:auto;font-size:11px;font-weight:700}.gift-import-modal{width:min(860px,100%)}.gift-import-modal-body{gap:14px}.gift-source-tabs{gap:8px;display:flex}.official-gift-picker{gap:12px;min-width:0;display:grid}.official-gift-tools{align-items:center;gap:12px;display:flex}.official-gift-tools .searchbox{width:100%}.official-gift-tools>span{color:var(--muted);flex:none;font-size:11px;font-weight:750}.official-gift-categories{flex-wrap:wrap;gap:7px;display:flex}.official-gift-categories button{color:#49605c;min-height:32px;font:inherit;cursor:pointer;background:#f7faf9;border:1px solid #d7e2df;border-radius:999px;align-items:center;gap:7px;padding:5px 10px;font-size:11px;font-weight:800;transition:color .15s,background .15s,border-color .15s,box-shadow .15s;display:inline-flex}.official-gift-categories button:hover{color:var(--brand);border-color:#9fc9c0}.official-gift-categories button.active{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:0 4px 12px #176d612b}.official-gift-categories button span{min-width:20px;height:20px;color:inherit;background:#ffffffa6;border-radius:999px;place-items:center;padding:0 5px;font-size:10px;display:grid}.official-gift-categories button.active span{color:var(--brand)}.official-gift-list{border:1px solid var(--line);scrollbar-gutter:stable;background:#f6f9f8;border-radius:14px;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-height:126px;max-height:314px;padding:8px;display:grid;overflow:auto}.official-gift-option{text-align:left;min-width:0;color:var(--text);cursor:pointer;background:#fff;border:1px solid #dce6e3;border-radius:11px;gap:8px;padding:11px 12px;transition:border-color .15s,box-shadow .15s,transform .15s;display:grid;box-shadow:0 1px 2px #20363208}.official-gift-option:hover{border-color:#9fc9c0;transform:translateY(-1px);box-shadow:0 5px 14px #204c4414}.official-gift-option.selected{border-color:var(--brand);box-shadow:0 0 0 2px #176d611f,0 5px 14px #204c4414}.official-gift-option-head{grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:8px;display:grid}.official-gift-option-head strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.official-gift-option-head .mono{color:var(--muted);font-size:9px}.official-gift-option-meta{color:#667773;flex-wrap:wrap;gap:10px;font-size:10px;font-weight:700;display:flex}.official-gift-capabilities{flex-wrap:wrap;gap:5px;display:flex}.official-gift-capabilities>span{letter-spacing:.01em;border:1px solid #0000;border-radius:999px;padding:3px 7px;font-size:9px;font-weight:850}.official-gift-capabilities>span.yes{color:#136b4d;background:#e9f8f0;border-color:#bde6cf}.official-gift-capabilities>span.craft{color:#6e3ca0;background:#f3ebfb;border-color:#d9c5ef}.official-gift-capabilities>span.no{color:#78837f;background:#f1f3f2;border-color:#dde2e0}.official-gift-empty{min-height:108px;color:var(--muted);text-align:center;grid-column:1/-1;place-items:center;padding:20px;font-size:12px;display:grid}.official-gift-selected{border:1px solid var(--line);background:var(--surface-soft);border-radius:14px;grid-template-columns:108px minmax(0,1fr);align-items:center;gap:14px;padding:12px;display:grid}.official-gift-selected .gift-animation-shell{width:96px;height:96px}.official-gift-selected>div:last-child{gap:5px;min-width:0;display:grid}.official-gift-selected small{color:var(--muted)}.gift-import-note{color:var(--muted);justify-content:space-between;align-items:center;gap:12px;line-height:1.45;display:flex}.gift-file-picker{min-height:78px;color:var(--text);cursor:pointer;background:#fff;border:1px dashed #b7ccc8;border-radius:10px;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;transition:border-color .16s,background .16s,box-shadow .16s;display:grid;position:relative}.gift-file-picker:hover,.gift-file-picker.has-file{border-color:var(--brand);background:#f8fcfb;box-shadow:0 0 0 2px #176d610d}.gift-file-picker input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.gift-file-icon{border-radius:9px;width:40px;height:40px}.gift-file-copy{gap:2px;min-width:0;display:grid}.gift-field-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10px;font-weight:800}.gift-file-copy strong{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.gift-file-copy small{color:var(--muted);font-size:11px;font-weight:500}.gift-file-action{color:var(--brand);background:#f0f8f6;border:1px solid #c7e3dc;border-radius:7px;padding:7px 10px;font-size:11px;font-weight:800}.gift-fields-grid{grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(120px,1fr));gap:10px;display:grid}.gift-fields-grid label,.gift-reason-field{color:var(--muted);gap:6px;font-size:11px;font-weight:700;display:grid}.gift-fields-grid input,.gift-reason-field input{width:100%;min-width:0;height:38px;color:var(--text);border:1px solid var(--line);background:#fff;border-radius:7px;padding:0 10px}.gift-fields-grid input:focus,.gift-reason-field input:focus{border-color:#77b6aa;outline:none;box-shadow:0 0 0 3px #176d6114}.gift-switch{color:#344054;cursor:pointer;align-items:center;gap:9px;font-size:12px;font-weight:700;display:inline-flex}.gift-switch input{opacity:0;width:1px;height:1px;position:absolute}.gift-switch-track{background:#c8d0d5;border-radius:999px;align-items:center;width:34px;height:19px;padding:2px;transition:background .16s;display:flex}.gift-switch-track span{background:#fff;border-radius:50%;width:15px;height:15px;transition:transform .16s;box-shadow:0 1px 3px #10182838}.gift-switch input:checked+.gift-switch-track{background:var(--brand)}.gift-switch input:checked+.gift-switch-track span{transform:translate(15px)}.gift-switch input:focus-visible+.gift-switch-track{outline-offset:2px;outline:3px solid #176d6129}.gift-validation{color:#d5fff5;background:#173631;border:1px solid #24564e;border-radius:9px;overflow:hidden}.gift-validation-head{color:#e3fff9;background:#ffffff09;border-bottom:1px solid #ffffff17;align-items:center;gap:9px;padding:10px 12px;display:flex}.gift-validation-head div{gap:2px;display:grid}.gift-validation-head span{color:#99cfc4;font-size:10px}.gift-validation pre{color:#d5fff5;max-height:180px;margin:0;padding:11px 12px;font-size:11px;overflow:auto}.gift-animation-shell{background:radial-gradient(circle,#f9f3ff,#eef8f5);place-items:center;min-height:210px;display:grid;position:relative}.gift-animation{width:200px;height:200px}.gift-animation canvas{width:100%!important;height:100%!important}.gift-play{width:30px;height:30px;color:var(--text);border:1px solid var(--line);background:#ffffffe6;border-radius:50%;place-items:center;display:grid;position:absolute;bottom:8px;right:8px}.gift-table-wrap{background:#fff}.gift-table{min-width:1080px}.gift-table th:first-child{width:74px}.gift-table td{vertical-align:middle}.gift-animation-shell.compact{border:1px solid var(--line);border-radius:9px;width:56px;min-height:56px;overflow:hidden}.gift-animation-shell.compact .gift-animation{width:54px;height:54px}.gift-animation-shell.compact .gift-play{width:20px;height:20px;bottom:3px;right:3px}.gift-row-disabled{opacity:.68}.gift-table-title,.gift-sort-order,.gift-source-size,.gift-convert-price{display:block}.gift-table-title{text-overflow:ellipsis;white-space:nowrap;max-width:220px;overflow:hidden}.gift-sort-order,.gift-source-size,.gift-convert-price{color:var(--muted);margin-top:3px;font-size:10px}.gift-table-price{color:#755b00}.gift-table-actions{align-items:center;gap:6px;display:flex}.collectible-button{color:#6548a8;background:#f7f3ff;border-color:#ddd2f5}.collectible-button:hover{background:#efe8ff;border-color:#cbbaf0}.collectible-modal{width:min(1180px,100%);max-height:min(92vh,980px)}.collectible-modal .modal-head p{color:var(--muted);margin:4px 0 0;font-size:11px}.collectible-modal-body{background:#f5f7fa;gap:16px;padding:16px 18px 22px;overflow:auto}.collectible-loading{min-height:90px;color:var(--muted);justify-content:center;align-items:center;gap:8px;display:flex}.collectible-empty{color:#66568c;background:linear-gradient(135deg,#fbf9ff,#f2f7ff);border:1px dashed #cfc3e9;border-radius:12px;align-items:center;gap:12px;padding:16px;display:flex}.collectible-empty div,.collectible-definition-head>div:first-child,.collectible-section-head>div:first-child{gap:3px;display:grid}.collectible-empty span,.collectible-definition-head span,.collectible-section-head span{color:var(--muted);font-size:10px;font-weight:500}.collectible-active{background:#fff;border:1px solid #ddd6ee;border-radius:12px;overflow:hidden;box-shadow:0 5px 16px #422e6e0d}.collectible-active-head{background:linear-gradient(100deg,#fbf9ff,#f4f9ff);border-bottom:1px solid #e9e4f3;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.collectible-active-head>div{color:#60458f;align-items:center;gap:9px;display:flex}.collectible-active-head>div>div{gap:2px;display:grid}.collectible-active-head span{color:var(--muted);font-size:10px}.collectible-active-grid{background:var(--line);grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:1px;display:grid}.collectible-active-grid article{background:#fff;align-items:center;gap:9px;min-width:0;padding:9px 11px;display:flex}.collectible-active-grid article>div:last-child{gap:2px;min-width:0;display:grid}.collectible-active-grid article strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.collectible-active-grid article span{color:var(--muted);font-size:9px}.collectible-definition{border:1px solid var(--line);background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 8px 24px #1018280a}.collectible-definition-head{border-bottom:1px solid var(--line);background:linear-gradient(110deg,#f8fbfa,#fbf9ff);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.collectible-main-fields{border-bottom:1px solid var(--line);background:#fbfcfd;padding:14px 16px}.collectible-section{border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section:last-child{border-bottom:0}.collectible-section-head{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.collectible-section-tools{align-items:center;gap:7px;display:flex}.collectible-rows{gap:7px;display:grid}.collectible-row{background:#fafbfc;border:1px solid #e1e6eb;border-radius:9px;align-items:end;gap:7px;padding:9px 9px 9px 36px;display:grid;position:relative}.collectible-row:hover{background:#fff;border-color:#cbd7dd;box-shadow:0 3px 10px #10182809}.collectible-row.animated{grid-template-columns:minmax(120px,1.2fr) 90px 78px minmax(160px,1.4fr) 48px 30px}.collectible-row.backdrop{grid-template-columns:minmax(110px,1.2fr) 70px 80px 70px repeat(4,52px) 48px 30px}.collectible-row-index{color:#71668c;background:#f0edf7;border-right:1px solid #e0d9ed;border-radius:8px 0 0 8px;place-items:center;width:27px;font-size:10px;font-weight:800;display:grid;position:absolute;top:0;bottom:0;left:0}.collectible-row label{gap:4px;min-width:0;display:grid}.collectible-row label>span{color:var(--muted);text-transform:uppercase;letter-spacing:.025em;font-size:9px;font-weight:800}.collectible-row input:not([type=file]){width:100%;min-width:0;height:32px;color:var(--text);font:inherit;background:#fff;border:1px solid #d5dde3;border-radius:7px;padding:0 8px;font-size:11px}.collectible-row input:focus{border-color:#8d7aba;outline:none;box-shadow:0 0 0 3px #6f5bae14}.collectible-file input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.collectible-file em{color:#625080;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;background:#f7f4fd;border:1px dashed #cfc4e1;border-radius:7px;align-items:center;gap:5px;min-width:0;height:32px;padding:0 8px;font-size:10px;font-style:normal;font-weight:700;display:flex;overflow:hidden}.collectible-inline-preview{color:#8c7cae;background:radial-gradient(circle,#fff,#eee8f8);border:1px solid #ded5ed;border-radius:8px;place-items:center;width:42px;height:42px;display:grid;overflow:hidden}.collectible-animation{width:100%;height:100%;overflow:hidden}.collectible-animation.compact{background:radial-gradient(circle,#fff,#f0ebfa);border:1px solid #e0d9ec;border-radius:8px;flex:0 0 42px;place-items:center;width:42px;height:42px;display:grid}.collectible-animation canvas{width:100%!important;height:100%!important}.collectible-animation.failed{color:#b42318;background:#fff4f2}.collectible-animation.loading{color:#807397}.collectible-file-error{color:#b42318;grid-column:1/-1;font-size:10px}.collectible-color input{cursor:pointer;height:32px!important;padding:3px!important}.collectible-backdrop-preview{border:1px solid #2a1f472e;border-radius:8px;flex:0 0 42px;place-items:center;width:42px;height:42px;font-size:11px;font-weight:900;display:grid;box-shadow:inset 0 0 0 1px #fff3}.collectible-row .icon-btn{align-self:center}.collectible-row .icon-btn:disabled{opacity:.28}@media (width<=900px){.gift-fields-grid,.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:repeat(2,minmax(0,1fr))}.collectible-inline-preview,.collectible-backdrop-preview,.collectible-row .icon-btn{place-self:center start}}@media (width<=620px){.gift-import-note{flex-direction:column;align-items:flex-start}.gift-format-chips{justify-content:flex-start}.gift-file-picker{grid-template-columns:40px minmax(0,1fr)}.gift-file-action{display:none}.gift-fields-grid{grid-template-columns:1fr}.gift-list-summary{width:100%;margin-left:0}.official-gift-tools{flex-direction:column;align-items:stretch}.official-gift-list{grid-template-columns:1fr;max-height:340px}.official-gift-selected{grid-template-columns:82px minmax(0,1fr)}.official-gift-selected .gift-animation-shell{width:72px;height:72px}.collectible-modal-body{padding:10px}.collectible-definition-head,.collectible-section-head{flex-direction:column;align-items:flex-start}.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:1fr}.collectible-active-grid{grid-template-columns:1fr 1fr}}.modal-backdrop{z-index:10000;background:#11182785;place-items:center;padding:24px;display:grid;position:fixed;inset:0}.modal{border:1px solid var(--line);width:min(760px,100%);max-height:min(820px,100vh - 48px);box-shadow:var(--shadow);background:#fff;border-radius:8px;padding:0;overflow:hidden}.command-modal{flex-direction:column;display:flex}.command-modal>.modal-head,.command-modal>.modal-actions{flex:none}.modal-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 18px 12px;display:flex}.icon-btn{background:var(--panel-subtle);border:1px solid var(--line);cursor:pointer;border-radius:7px;place-items:center;width:30px;height:30px;display:grid}.command-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.command-body{grid-auto-rows:max-content;gap:12px;min-height:0;padding:14px 18px;display:grid;overflow:auto}.command-step{min-height:38px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:8px;align-items:center;gap:8px;padding:0 10px;display:flex}.command-step span{border:1px solid var(--line);background:#fff;border-radius:999px;place-items:center;width:20px;height:20px;font-size:11px;font-weight:800;display:grid}.command-step.active{color:var(--brand);border-color:#a9d8ce}.command-step.done{color:var(--good);border-color:#b9dcc7}.form-field{gap:6px;display:grid}.form-field span,.form-stack span{color:#4b5563;font-weight:800}.command-preview{gap:8px;display:grid}.command-preview .json-block{max-height:150px}.preview-head,.result-title{color:#344054;align-items:center;gap:7px;font-weight:800;display:flex}.result-box{border:1px solid var(--line);background:#fbfcfd;border-radius:8px;gap:8px;padding:10px;display:grid}.result-line{grid-template-columns:92px minmax(0,1fr);gap:8px;display:grid}.result-line span{color:var(--muted)}.result-line strong{overflow-wrap:anywhere}.result-message{color:#344054}.modal-actions{border-top:1px solid var(--line);background:#fff;justify-content:flex-end;padding:12px 18px}.login-page{background:var(--bg);place-items:center;min-height:100vh;padding:24px;display:grid}.login-panel{border:1px solid var(--line);width:min(420px,100%);box-shadow:var(--shadow);background:#fff;border-radius:8px;gap:18px;padding:22px;display:grid}.login-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.login-head-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.login-chip{min-height:24px;color:var(--brand);background:#edf7f4;border:1px solid #c9e2dc;border-radius:999px;align-items:center;padding:0 8px;font-size:12px;display:inline-flex}.login-copy h1{margin:0;font-size:22px}.login-copy p{color:var(--muted);margin:8px 0 0}.form-stack{gap:12px;display:grid}.form-stack label{gap:6px;display:grid}.form-stack input{width:100%}.boot-screen{align-content:center;place-items:center;gap:18px;min-height:100vh;display:grid}.loader-bar{background:#d7dde4;border-radius:999px;width:180px;height:4px;overflow:hidden}.loader-bar:before{content:"";background:var(--brand);width:42%;height:100%;animation:1s ease-in-out infinite load;display:block}.spin{animation:.8s linear infinite spin}@keyframes load{0%{transform:translate(-120%)}to{transform:translate(260%)}}@keyframes spin{to{transform:rotate(360deg)}}@media (width<=1120px){.shell{grid-template-columns:1fr}.sidebar{height:auto;position:static}.nav-list{grid-template-columns:repeat(4,minmax(0,1fr))}.sidebar-status{display:none}.overview-band,.split-layout,.operation-row,.raw-grid,.message-selector-grid,.message-selector-grid.single{grid-template-columns:1fr}.action-dock{position:static}}@media (width<=760px){.content,.topbar{padding-left:14px;padding-right:14px}.command-grid,.work-strip,.overview-metrics,.metric-row,.summary-grid,.command-steps{grid-template-columns:1fr}.sidebar{gap:12px;padding:14px}.nav-list{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar,.page-title-row,.entity-head{flex-direction:column;align-items:flex-start}input,.searchbox{width:100%}.toolbar{align-items:stretch}.picker-row,.selected-entity{grid-template-columns:1fr}} diff --git a/cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css b/cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css new file mode 100644 index 00000000..f80a193d --- /dev/null +++ b/cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css @@ -0,0 +1 @@ +:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#eef1f5;--bg-accent:#e7ecf1;--panel:#fff;--panel-subtle:#f5f8fb;--panel-strong:#eef2f6;--surface-soft:#f2f7f6;--overlay:#18222f6b;--topbar-bg:#ffffffdb;--line:#e5eaf0;--line-strong:#d3dce4;--heading:#253040;--text:#333f4d;--text-soft:#45525f;--muted:#6d7885;--muted-2:#9aa4b1;--brand:#1f7d6f;--brand-strong:#196155;--brand-2:#3a6cae;--brand-tint:#e8f4f0;--brand-tint-border:#c8e2db;--brand-tint-text:#235d53;--good:#1f8a57;--good-tint:#eaf6ef;--good-border:#c1e1cf;--warn:#a86a12;--warn-tint:#fcf4e4;--warn-border:#e7d09e;--danger:#c0392b;--danger-tint:#fcefec;--danger-border:#eecac3;--danger-text:#8f2f27;--purple:#6a4fa3;--purple-tint:#f4effb;--purple-border:#dcd0f0;--purple-text:#5a4590;--input-bg:#fff;--btn-bg:#fff;--btn-text:#29323d;--btn-hover:#f4f7fa;--switch-track:#c8d0d6;--code-bg:#1b2733;--code-text:#d6e3ef;--code-border:#2b3a49;--sidebar:#1c2530;--sidebar-soft:#26313d;--sidebar-line:#313c4a;--sidebar-row:#232d38;--sidebar-text:#dbe3ec;--sidebar-muted:#8b98a8;--sidebar-faint:#7c8a9a;--sidebar-heading:#fff;--focus:#1f7d6f29;--shadow:0 12px 34px #1827381a;--shadow-sm:0 2px 10px #1827380d;--shadow-brand:0 8px 22px #1f7d6f38;--radius-xs:8px;--radius-sm:9px;--radius:11px;--radius-lg:14px}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0f141a;--bg-accent:#131a22;--panel:#171f28;--panel-subtle:#1c2530;--panel-strong:#212c38;--surface-soft:#1a232d;--overlay:#05080c9e;--topbar-bg:#151c24db;--line:#29333f;--line-strong:#38434f;--heading:#eef3f8;--text:#d5dde6;--text-soft:#c2ccd6;--muted:#98a4b1;--muted-2:#6d7885;--brand:#37a596;--brand-strong:#45b6a6;--brand-2:#6fa8e6;--brand-tint:#14322d;--brand-tint-border:#245349;--brand-tint-text:#7fd3c4;--good:#47c281;--good-tint:#12301f;--good-border:#245639;--warn:#e0aa4d;--warn-tint:#322810;--warn-border:#574413;--danger:#e6695c;--danger-tint:#35201d;--danger-border:#5c332d;--danger-text:#f0a49b;--purple:#ac90e2;--purple-tint:#221b31;--purple-border:#3d3357;--purple-text:#c9b6ef;--input-bg:#131a22;--btn-bg:#1e2731;--btn-text:#dbe2ea;--btn-hover:#26313d;--switch-track:#3a454f;--code-bg:#0c1218;--code-text:#cdd9e5;--code-border:#232f3b;--sidebar:#10151b;--sidebar-soft:#1c242f;--sidebar-line:#262f3a;--sidebar-row:#161d25;--sidebar-text:#cbd4de;--sidebar-muted:#7c8794;--sidebar-faint:#6f7b88;--sidebar-heading:#f0f4f8;--focus:#37a5963d;--shadow:0 16px 40px #00000075;--shadow-sm:0 2px 12px #00000061;--shadow-brand:0 8px 22px #37a59642}*{box-sizing:border-box}html,body,#root{min-height:100%}body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;margin:0;font:13px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;transition:background-color .2s,color .2s}button,input,textarea{font:inherit}a{color:inherit;text-decoration:none}.shell{grid-template-columns:232px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{height:100vh;color:var(--sidebar-text);background:var(--sidebar);border-right:1px solid var(--sidebar-line);flex-direction:column;gap:16px;padding:18px 12px;display:flex;position:sticky;top:0;overflow-y:auto}.brand{align-items:center;gap:10px;min-height:42px;padding:0 4px;display:flex}.brand.compact{justify-content:center}.brand-elevated .brand-mark{box-shadow:var(--shadow-brand)}.brand-mark{color:#fff;background:var(--brand);border-radius:var(--radius-sm);border:1px solid #fff3;place-items:center;width:34px;height:34px;font-weight:800;display:grid}.brand strong{font-size:14px;line-height:1.1;display:block}.brand small{color:var(--sidebar-muted);margin-top:3px;font-size:11px;display:block}.sidebar-label{color:var(--sidebar-faint);text-transform:uppercase;letter-spacing:.04em;padding:0 8px;font-size:11px;font-weight:700}.nav-list,.nav-section{gap:4px;display:grid}.nav-section-toggle{width:100%;min-height:38px;color:var(--sidebar-muted);border-radius:var(--radius-sm);cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;grid-template-columns:18px minmax(0,1fr) 16px;align-items:center;gap:9px;padding:0 10px;font-size:12px;font-weight:800;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-section-toggle:hover,.nav-section.active .nav-section-toggle{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-section-chevron{color:var(--sidebar-muted);justify-self:end;transition:transform .14s}.nav-section.open .nav-section-chevron{transform:rotate(180deg)}.nav-children{gap:4px;padding:2px 0 2px 18px;display:grid}.nav-item{min-height:38px;color:var(--sidebar-text);border-radius:var(--radius-sm);border:1px solid #0000;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;padding:0 10px;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-dot{background:var(--sidebar-faint);border-radius:999px;justify-self:center;width:6px;height:6px}.nav-item:hover,.nav-item.active{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-item.active .nav-dot{background:var(--brand)}.sidebar-status{gap:7px;margin-top:auto;display:grid}.runtime-row{min-height:32px;color:var(--sidebar-text);background:var(--sidebar-row);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;padding:0 8px;display:grid}.runtime-row strong{color:var(--sidebar-heading);font-size:11px}.workspace{min-width:0}.topbar{z-index:20;background:var(--topbar-bg);border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);justify-content:space-between;align-items:center;gap:18px;min-height:66px;padding:12px 24px;display:flex;position:sticky;top:0}.topbar h1{color:var(--heading);margin:2px 0 0;font-size:20px;line-height:1.2}.topbar-actions,.page-actions,.section-action,.entity-badges,.row-actions,.modal-actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.language-switch{background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;min-height:30px;padding:2px;display:inline-flex}.language-switch button{min-width:42px;min-height:24px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:999px;padding:0 9px;font-weight:800;transition:color .14s,background-color .14s}.language-switch button.active{color:#fff;background:var(--brand)}.language-switch button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.theme-toggle{width:34px;height:34px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);cursor:pointer;border-radius:999px;place-items:center;transition:color .16s,background-color .16s,border-color .16s;display:inline-grid}.theme-toggle:hover{color:var(--brand);border-color:var(--brand-tint-border);background:var(--brand-tint)}.theme-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.actor-pill{min-height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;padding:0 10px;display:inline-flex}.content{gap:16px;padding:18px 24px 30px;display:grid}.eyebrow{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:800}.dashboard-layout,.stacked-sections{gap:14px;display:grid}.overview-band,.page-frame{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm)}.overview-band{grid-template-columns:minmax(220px,1fr) minmax(420px,.9fr);align-items:center;gap:16px;padding:16px;display:grid}.overview-band h2,.page-title-row h2,.section-head h2,.modal h2{color:var(--heading);margin:0;font-size:18px;line-height:1.25}.overview-metrics,.metric-row{grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;display:grid}.overview-metrics{grid-template-columns:repeat(3,minmax(120px,1fr))}.status-item,.metric,.summary-item{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:0;padding:10px}.status-item span,.metric span,.summary-item span{color:var(--muted);margin-bottom:6px;font-size:11px;display:block}.status-item strong,.metric strong,.summary-item strong{overflow-wrap:anywhere;color:var(--text);font-weight:800;display:block}.status-item.good,.metric.good{border-color:var(--good-border)}.status-item.warn,.metric.warn{border-color:var(--warn-border)}.metric.danger{border-color:var(--danger-border)}.command-grid{grid-template-columns:repeat(3,minmax(220px,1fr));gap:12px;display:grid}.launcher{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-height:94px;box-shadow:var(--shadow-sm);grid-template-columns:38px minmax(0,1fr) 18px;align-items:center;gap:12px;padding:14px;transition:border-color .16s,box-shadow .16s,transform .16s;display:grid}.launcher:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.launcher-icon{width:38px;height:38px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);place-items:center;display:grid}.launcher-copy{gap:4px;display:grid}.launcher-copy strong{color:var(--heading);font-size:15px}.launcher-copy span{color:var(--muted)}.work-strip{grid-template-columns:repeat(4,minmax(160px,1fr));gap:8px;display:grid}.strip-item{min-height:38px;color:var(--text-soft);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.page-frame{gap:14px;padding:14px;display:grid}.page-title-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:14px;padding-bottom:12px;display:flex}.query-panel{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.message-query input{width:150px}.message-selector-grid{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;margin-bottom:10px;display:grid}.message-selector-grid.single{grid-template-columns:minmax(320px,620px)}.entity-picker{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);gap:8px;min-width:0;padding:10px;display:grid}.picker-head{min-height:24px;color:var(--text-soft);justify-content:space-between;align-items:center;gap:8px;font-weight:800;display:flex}.selected-entity{min-height:40px;color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 9px;display:grid}.selected-entity strong,.selected-entity span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.selected-entity div{gap:2px;min-width:0;display:grid}.selected-entity div span{color:var(--brand-tint-text);opacity:.85;font-size:11px}.picker-search{background:var(--panel-subtle);border:1px solid var(--line-strong);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;height:34px;padding:0 6px 0 9px;display:grid}.picker-search input{width:100%;height:30px;box-shadow:none;background:0 0;border:0;padding:0}.picker-results{border:1px solid var(--line);border-radius:var(--radius-sm);max-height:236px;display:grid;overflow:auto}.picker-row{min-height:36px;color:var(--text);background:var(--panel);border:0;border-bottom:1px solid var(--line);cursor:pointer;text-align:left;grid-template-columns:96px minmax(120px,1fr) minmax(120px,1fr) auto;align-items:center;gap:8px;padding:6px 8px;display:grid}.picker-row:last-child{border-bottom:0}.picker-row:hover,.picker-row.selected{background:var(--surface-soft)}.picker-row strong,.picker-row span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.picker-empty,.picker-error{color:var(--muted);text-align:center;padding:9px}.picker-error{color:var(--danger);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius-sm)}input,textarea{color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);outline:none;transition:border-color .14s,box-shadow .14s}input::placeholder,textarea::placeholder{color:var(--muted-2)}input{width:190px;height:34px;padding:0 10px}textarea{resize:vertical;width:100%;padding:9px 10px}input:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus)}.small-input{width:88px}.field-inline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.field-inline span{font-size:11px;font-weight:700}.searchbox{width:min(380px,100%);height:34px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:inline-flex}.searchbox input{width:100%;height:30px;box-shadow:none;border:0;padding:0}.btn{min-height:34px;color:var(--btn-text);background:var(--btn-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;justify-content:center;align-items:center;gap:6px;padding:0 12px;transition:background-color .14s,border-color .14s,color .14s,box-shadow .14s;display:inline-flex}.btn:hover:not(:disabled){background:var(--btn-hover)}.btn:disabled{color:var(--muted-2);cursor:not-allowed}.btn.primary{color:#fff;background:var(--brand);border-color:var(--brand)}.btn.primary:hover:not(:disabled){background:var(--brand-strong);border-color:var(--brand-strong)}.btn.ghost{background:var(--panel-subtle)}.btn.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.btn.danger:hover:not(:disabled){background:var(--danger-tint);border-color:var(--danger)}.btn.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.btn.warn:hover:not(:disabled){background:var(--warn-tint);border-color:var(--warn)}.btn:disabled,.btn.primary:disabled,.btn.warn:disabled,.btn.danger:disabled{color:var(--muted-2);background:var(--panel-strong);border-color:var(--line);cursor:not-allowed}.btn.full{width:100%}.icon-text{gap:7px}.compact-btn{min-height:28px;padding:0 8px;font-size:12px}.row-link,.link-button{color:var(--brand-2);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:0;display:inline-flex}.table-wrap{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);width:100%;overflow-x:auto}.data-table{border-collapse:collapse;width:100%;font-size:12.5px}.data-table th,.data-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;white-space:nowrap;height:38px;padding:7px 9px}.data-table th{z-index:0;color:var(--muted);background:var(--panel-strong);font-weight:800;position:sticky;top:0}.data-table tbody tr:hover{background:var(--panel-subtle)}.data-table tr:last-child td{border-bottom:0}.mono{font-family:SFMono-Regular,Consolas,Liberation Mono,monospace}.truncate{text-overflow:ellipsis;max-width:380px;overflow:hidden}.badge{min-height:22px;color:var(--muted);background:var(--panel-strong);border:1px solid var(--line-strong);white-space:nowrap;border-radius:999px;align-items:center;padding:1px 8px;display:inline-flex}.badge.good{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.badge.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.badge.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.empty-cell{color:var(--muted);text-align:center}.split-layout{grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:14px;display:grid}.split-main,.split-side{min-width:0}.entity-head{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);justify-content:space-between;align-items:flex-start;gap:14px;padding:14px;display:flex}.entity-title{color:var(--heading);font-size:20px;font-weight:800;line-height:1.25}.entity-subtitle{color:var(--muted);margin-top:4px}.summary-grid{grid-template-columns:repeat(4,minmax(150px,1fr));gap:8px;display:grid}.about-text{color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);margin:0;padding:10px}.section-block,.action-dock,.surface{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm);padding:12px}.section-head{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.section-head p{color:var(--muted);margin:5px 0 0}.action-dock{gap:10px;display:grid;position:sticky;top:82px}.dock-title{color:var(--text-soft);border-bottom:1px solid var(--line);padding-bottom:4px;font-weight:800}.action-dock>.btn,.action-dock .action-stack .btn{justify-content:center;width:100%}.duration-field{gap:4px;display:grid}.duration-field span{color:var(--muted);font-size:11px;font-weight:800}.duration-field input{width:100%}.action-stack{gap:10px;display:grid}.action-stack .btn,.action-dock>.btn{min-height:42px}.danger-zone{border-top:1px solid var(--line);flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;display:flex}.authorization-block{gap:10px;display:grid}.authorization-table{table-layout:fixed;min-width:720px}.authorization-table th,.authorization-table td{height:46px}.device-text{text-overflow:ellipsis;max-width:260px;overflow:hidden}.device-actions-head{width:190px}.device-actions-cell{width:190px;min-width:190px}.device-actions{white-space:normal;grid-template-columns:repeat(2,minmax(82px,1fr));gap:6px;min-width:178px;display:grid}.device-actions .btn{justify-content:center;width:100%}.operation-row{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;display:grid}.operation-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}.operation-title{width:100%;color:var(--heading);align-items:center;gap:6px;font-weight:800;display:flex}.checkline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.checkline input{width:auto;height:auto}.alert{color:var(--danger-text);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius);align-items:flex-start;gap:8px;padding:9px 10px;display:flex}.json-block{max-height:520px;color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius);margin:0;padding:12px;font-size:12px;overflow:auto}.raw-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.loading-line{min-height:80px;color:var(--muted);place-items:center;display:grid}.empty-panel{min-height:92px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);place-items:center;display:grid}.gift-metrics .metric{background:var(--panel-subtle);min-height:68px;padding:12px}.gift-metrics .metric strong{font-size:17px}.gift-file-icon{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);flex:none;place-items:center;display:grid}.gift-format-chips{flex-wrap:wrap;flex:none;justify-content:flex-end;gap:6px;display:flex}.gift-format-chips span{color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);letter-spacing:.02em;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.gift-list-summary{color:var(--muted);margin-left:auto;font-size:11px;font-weight:700}.gift-import-modal{width:min(860px,100%)}.gift-import-modal-body{gap:14px}.gift-source-tabs{gap:8px;display:flex}.official-gift-picker{gap:12px;min-width:0;display:grid}.official-gift-tools{align-items:center;gap:12px;display:flex}.official-gift-tools .searchbox{width:100%}.official-gift-tools>span{color:var(--muted);flex:none;font-size:11px;font-weight:750}.official-gift-categories{flex-wrap:wrap;gap:7px;display:flex}.official-gift-categories button{min-height:32px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line-strong);font:inherit;cursor:pointer;border-radius:999px;align-items:center;gap:7px;padding:5px 10px;font-size:11px;font-weight:800;transition:color .15s,background .15s,border-color .15s,box-shadow .15s;display:inline-flex}.official-gift-categories button:hover{color:var(--brand);border-color:var(--brand-tint-border)}.official-gift-categories button.active{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:var(--shadow-brand)}.official-gift-categories button span{min-width:20px;height:20px;color:inherit;background:#7d8c9b38;border-radius:999px;place-items:center;padding:0 5px;font-size:10px;display:grid}.official-gift-categories button.active span{color:var(--brand);background:#ffffffd9}.official-gift-list{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel-subtle);scrollbar-gutter:stable;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-height:126px;max-height:314px;padding:8px;display:grid;overflow:auto}.official-gift-option{text-align:left;min-width:0;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);cursor:pointer;box-shadow:var(--shadow-sm);gap:8px;padding:11px 12px;transition:border-color .15s,box-shadow .15s,transform .15s;display:grid}.official-gift-option:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.official-gift-option.selected{border-color:var(--brand);box-shadow:0 0 0 2px var(--focus), var(--shadow)}.official-gift-option-head{grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:8px;display:grid}.official-gift-option-head strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.official-gift-option-head .mono{color:var(--muted);font-size:9px}.official-gift-option-meta{color:var(--muted);flex-wrap:wrap;gap:10px;font-size:10px;font-weight:700;display:flex}.official-gift-capabilities{flex-wrap:wrap;gap:5px;display:flex}.official-gift-capabilities>span{letter-spacing:.01em;border:1px solid #0000;border-radius:999px;padding:3px 7px;font-size:9px;font-weight:850}.official-gift-capabilities>span.yes{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.official-gift-capabilities>span.craft{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.official-gift-capabilities>span.no{color:var(--muted);background:var(--panel-strong);border-color:var(--line-strong)}.official-gift-empty{min-height:108px;color:var(--muted);text-align:center;grid-column:1/-1;place-items:center;padding:20px;font-size:12px;display:grid}.official-gift-selected{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface-soft);grid-template-columns:108px minmax(0,1fr);align-items:center;gap:14px;padding:12px;display:grid}.official-gift-selected .gift-animation-shell{width:96px;height:96px}.official-gift-selected>div:last-child{gap:5px;min-width:0;display:grid}.official-gift-selected small{color:var(--muted)}.gift-import-note{color:var(--muted);justify-content:space-between;align-items:center;gap:12px;line-height:1.45;display:flex}.gift-file-picker{min-height:78px;color:var(--text);background:var(--panel);border:1px dashed var(--line-strong);border-radius:var(--radius);cursor:pointer;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;transition:border-color .16s,background .16s,box-shadow .16s;display:grid;position:relative}.gift-file-picker:hover,.gift-file-picker.has-file{background:var(--brand-tint);border-color:var(--brand);box-shadow:0 0 0 2px var(--focus)}.gift-file-picker input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.gift-file-icon{border-radius:var(--radius-sm);width:40px;height:40px}.gift-file-copy{gap:2px;min-width:0;display:grid}.gift-field-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10px;font-weight:800}.gift-file-copy strong{color:var(--heading);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.gift-file-copy small{color:var(--muted);font-size:11px;font-weight:500}.gift-file-action{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);padding:7px 10px;font-size:11px;font-weight:800}.gift-fields-grid{grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(120px,1fr));gap:10px;display:grid}.gift-fields-grid label,.gift-reason-field{color:var(--muted);gap:6px;font-size:11px;font-weight:700;display:grid}.gift-fields-grid input,.gift-reason-field input{width:100%;min-width:0;height:38px;color:var(--text);background:var(--input-bg);border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 10px}.gift-fields-grid input:focus,.gift-reason-field input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus);outline:none}.gift-switch{color:var(--text-soft);cursor:pointer;align-items:center;gap:9px;font-size:12px;font-weight:700;display:inline-flex}.gift-switch input{opacity:0;width:1px;height:1px;position:absolute}.gift-switch-track{background:var(--switch-track);border-radius:999px;align-items:center;width:34px;height:19px;padding:2px;transition:background .16s;display:flex}.gift-switch-track span{background:#fff;border-radius:50%;width:15px;height:15px;transition:transform .16s;box-shadow:0 1px 3px #10182838}.gift-switch input:checked+.gift-switch-track{background:var(--brand)}.gift-switch input:checked+.gift-switch-track span{transform:translate(15px)}.gift-switch input:focus-visible+.gift-switch-track{outline:3px solid var(--focus);outline-offset:2px}.gift-validation{color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius-sm);overflow:hidden}.gift-validation-head{color:var(--code-text);background:#ffffff09;border-bottom:1px solid #ffffff17;align-items:center;gap:9px;padding:10px 12px;display:flex}.gift-validation-head div{gap:2px;display:grid}.gift-validation-head span{color:var(--brand);font-size:10px}.gift-validation pre{max-height:180px;color:var(--code-text);margin:0;padding:11px 12px;font-size:11px;overflow:auto}.gift-animation-shell{background:var(--surface-soft);place-items:center;min-height:210px;display:grid;position:relative}.gift-animation{width:200px;height:200px}.gift-animation canvas{width:100%!important;height:100%!important}.gift-play{width:30px;height:30px;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:50%;place-items:center;display:grid;position:absolute;bottom:8px;right:8px}.gift-table-wrap{background:var(--panel)}.gift-table{min-width:1080px}.gift-table th:first-child{width:74px}.gift-table td{vertical-align:middle}.gift-animation-shell.compact{border:1px solid var(--line);border-radius:var(--radius-sm);width:56px;min-height:56px;overflow:hidden}.gift-animation-shell.compact .gift-animation{width:54px;height:54px}.gift-animation-shell.compact .gift-play{width:20px;height:20px;bottom:3px;right:3px}.gift-row-disabled{opacity:.68}.gift-table-title,.gift-sort-order,.gift-source-size,.gift-convert-price{display:block}.gift-table-title{text-overflow:ellipsis;white-space:nowrap;max-width:220px;overflow:hidden}.gift-sort-order,.gift-source-size,.gift-convert-price{color:var(--muted);margin-top:3px;font-size:10px}.gift-table-price{color:var(--warn)}.gift-table-actions{align-items:center;gap:6px;display:flex}.collectible-button{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.collectible-button:hover{background:var(--purple-tint);border-color:var(--purple)}.collectible-modal{width:min(1180px,100%);max-height:min(92vh,980px)}.collectible-modal .modal-head p{color:var(--muted);margin:4px 0 0;font-size:11px}.collectible-modal-body{background:var(--bg);gap:16px;padding:16px 18px 22px;overflow:auto}.collectible-loading{min-height:90px;color:var(--muted);justify-content:center;align-items:center;gap:8px;display:flex}.collectible-empty{color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius);align-items:center;gap:12px;padding:16px;display:flex}.collectible-empty div,.collectible-definition-head>div:first-child,.collectible-section-head>div:first-child{gap:3px;display:grid}.collectible-empty span,.collectible-definition-head span,.collectible-section-head span{color:var(--muted);font-size:10px;font-weight:500}.collectible-active{background:var(--panel);border:1px solid var(--purple-border);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-active-head{background:var(--purple-tint);border-bottom:1px solid var(--purple-border);justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.collectible-active-head>div{color:var(--purple-text);align-items:center;gap:9px;display:flex}.collectible-active-head>div>div{gap:2px;display:grid}.collectible-active-head span{color:var(--muted);font-size:10px}.collectible-active-grid{background:var(--line);grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:1px;display:grid}.collectible-active-grid article{background:var(--panel);align-items:center;gap:9px;min-width:0;padding:9px 11px;display:flex}.collectible-active-grid article>div:last-child{gap:2px;min-width:0;display:grid}.collectible-active-grid article strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.collectible-active-grid article span{color:var(--muted);font-size:9px}.collectible-definition{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-definition-head{background:var(--panel-subtle);border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.collectible-main-fields{background:var(--panel-subtle);border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section{border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section:last-child{border-bottom:0}.collectible-section-head{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.collectible-section-tools{align-items:center;gap:7px;display:flex}.collectible-rows{gap:7px;display:grid}.collectible-row{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:end;gap:7px;padding:9px 9px 9px 36px;display:grid;position:relative}.collectible-row:hover{background:var(--panel);border-color:var(--line-strong);box-shadow:var(--shadow-sm)}.collectible-row.animated{grid-template-columns:minmax(120px,1.2fr) 90px 78px minmax(160px,1.4fr) 48px 30px}.collectible-row.backdrop{grid-template-columns:minmax(110px,1.2fr) 70px 80px 70px repeat(4,52px) 48px 30px}.collectible-row-index{width:27px;color:var(--purple-text);background:var(--purple-tint);border-right:1px solid var(--purple-border);border-radius:var(--radius-xs) 0 0 var(--radius-xs);place-items:center;font-size:10px;font-weight:800;display:grid;position:absolute;top:0;bottom:0;left:0}.collectible-row label{gap:4px;min-width:0;display:grid}.collectible-row label>span{color:var(--muted);text-transform:uppercase;letter-spacing:.025em;font-size:9px;font-weight:800}.collectible-row input:not([type=file]){width:100%;min-width:0;height:32px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;padding:0 8px;font-size:11px}.collectible-row input:focus{border-color:var(--purple);box-shadow:0 0 0 3px var(--purple-tint);outline:none}.collectible-file input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.collectible-file em{min-width:0;height:32px;color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius-sm);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;align-items:center;gap:5px;padding:0 8px;font-size:10px;font-style:normal;font-weight:700;display:flex;overflow:hidden}.collectible-inline-preview{width:42px;height:42px;color:var(--purple);background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);place-items:center;display:grid;overflow:hidden}.collectible-animation{width:100%;height:100%;overflow:hidden}.collectible-animation.compact{background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);flex:0 0 42px;place-items:center;width:42px;height:42px;display:grid}.collectible-animation canvas{width:100%!important;height:100%!important}.collectible-animation.failed{color:var(--danger);background:var(--danger-tint)}.collectible-animation.loading{color:var(--purple-text)}.collectible-file-error{color:var(--danger);grid-column:1/-1;font-size:10px}.collectible-color input{cursor:pointer;height:32px!important;padding:3px!important}.collectible-backdrop-preview{border-radius:var(--radius-sm);border:1px solid #2a1f472e;flex:0 0 42px;place-items:center;width:42px;height:42px;font-size:11px;font-weight:900;display:grid;box-shadow:inset 0 0 0 1px #fff3}.collectible-row .icon-btn{align-self:center}.collectible-row .icon-btn:disabled{opacity:.28}@media (width<=900px){.gift-fields-grid,.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:repeat(2,minmax(0,1fr))}.collectible-inline-preview,.collectible-backdrop-preview,.collectible-row .icon-btn{place-self:center start}}@media (width<=620px){.gift-import-note{flex-direction:column;align-items:flex-start}.gift-format-chips{justify-content:flex-start}.gift-file-picker{grid-template-columns:40px minmax(0,1fr)}.gift-file-action{display:none}.gift-fields-grid{grid-template-columns:1fr}.gift-list-summary{width:100%;margin-left:0}.official-gift-tools{flex-direction:column;align-items:stretch}.official-gift-list{grid-template-columns:1fr;max-height:340px}.official-gift-selected{grid-template-columns:82px minmax(0,1fr)}.official-gift-selected .gift-animation-shell{width:72px;height:72px}.collectible-modal-body{padding:10px}.collectible-definition-head,.collectible-section-head{flex-direction:column;align-items:flex-start}.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:1fr}.collectible-active-grid{grid-template-columns:1fr 1fr}}.modal-backdrop{z-index:10000;background:var(--overlay);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);place-items:center;padding:24px;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(760px,100%);max-height:min(820px,100vh - 48px);box-shadow:var(--shadow);padding:0;overflow:hidden}.command-modal{flex-direction:column;display:flex}.command-modal>.modal-head,.command-modal>.modal-actions{flex:none}.modal-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 18px 12px;display:flex}.icon-btn{width:30px;height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;place-items:center;transition:background-color .14s,border-color .14s,color .14s;display:grid}.icon-btn:hover{background:var(--btn-hover);border-color:var(--line-strong)}.command-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.command-body{grid-auto-rows:max-content;gap:12px;min-height:0;padding:14px 18px;display:grid;overflow:auto}.command-step{min-height:38px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.command-step span{background:var(--panel);border:1px solid var(--line);border-radius:999px;place-items:center;width:20px;height:20px;font-size:11px;font-weight:800;display:grid}.command-step.active{color:var(--brand);border-color:var(--brand-tint-border)}.command-step.done{color:var(--good);border-color:var(--good-border)}.form-field{gap:6px;display:grid}.form-field span,.form-stack span{color:var(--text-soft);font-weight:800}.command-preview{gap:8px;display:grid}.command-preview .json-block{max-height:150px}.preview-head,.result-title{color:var(--text-soft);align-items:center;gap:7px;font-weight:800;display:flex}.result-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);gap:8px;padding:10px;display:grid}.result-line{grid-template-columns:92px minmax(0,1fr);gap:8px;display:grid}.result-line span{color:var(--muted)}.result-line strong{overflow-wrap:anywhere}.result-message{color:var(--text-soft)}.modal-actions{background:var(--panel);border-top:1px solid var(--line);justify-content:flex-end;padding:12px 18px}.login-page{background:var(--bg);place-items:center;min-height:100vh;padding:24px;display:grid}.login-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(420px,100%);box-shadow:var(--shadow);gap:18px;padding:22px;display:grid}.login-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.login-head-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.login-chip{min-height:24px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:999px;align-items:center;padding:0 8px;font-size:12px;display:inline-flex}.login-copy h1{color:var(--heading);margin:0;font-size:22px}.login-copy p{color:var(--muted);margin:8px 0 0}.form-stack{gap:12px;display:grid}.form-stack label{gap:6px;display:grid}.form-stack input{width:100%}.boot-screen{background:var(--bg);align-content:center;place-items:center;gap:18px;min-height:100vh;display:grid}.loader-bar{background:var(--line-strong);border-radius:999px;width:180px;height:4px;overflow:hidden}.loader-bar:before{content:"";background:var(--brand);width:42%;height:100%;animation:1s ease-in-out infinite load;display:block}.spin{animation:.8s linear infinite spin}@keyframes load{0%{transform:translate(-120%)}to{transform:translate(260%)}}@keyframes spin{to{transform:rotate(360deg)}}@media (width<=1120px){.shell{grid-template-columns:1fr}.sidebar{height:auto;position:static}.nav-list{grid-template-columns:repeat(4,minmax(0,1fr))}.sidebar-status{display:none}.overview-band,.split-layout,.operation-row,.raw-grid,.message-selector-grid,.message-selector-grid.single{grid-template-columns:1fr}.action-dock{position:static}}@media (width<=760px){.content,.topbar{padding-left:14px;padding-right:14px}.command-grid,.work-strip,.overview-metrics,.metric-row,.summary-grid,.command-steps{grid-template-columns:1fr}.sidebar{gap:12px;padding:14px}.nav-list{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar,.page-title-row,.entity-head{flex-direction:column;align-items:flex-start}input,.searchbox{width:100%}.toolbar{align-items:stretch}.picker-row,.selected-entity{grid-template-columns:1fr}} diff --git a/cmd/telesrv-admin/web/dist/assets/index-Duge82ST.js b/cmd/telesrv-admin/web/dist/assets/index-Duge82ST.js deleted file mode 100644 index 3c2389cf..00000000 --- a/cmd/telesrv-admin/web/dist/assets/index-Duge82ST.js +++ /dev/null @@ -1,9 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-Ee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` -`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{re=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ne(e):``}function ae(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return``}}function oe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function se(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return oe(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ce(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function le(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ue(e){var t=le(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function z(e){e._valueTracker||=ue(e)}function de(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=le(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function B(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function V(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ce(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function pe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function me(e,t){pe(e,t);var n=ce(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ge(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ge(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function he(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ge(e,t,n){(t!==`number`||B(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var _e=Array.isArray;function ve(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Te(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ee={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},De=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Ee).forEach(function(e){De.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ee[t]=Ee[e]})});function Oe(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Ee.hasOwnProperty(e)&&Ee[e]?(``+t).trim():t+`px`}function ke(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Oe(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ae=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function je(e,t){if(t){if(Ae[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Me(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Ne=null;function Pe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fe=null,Ie=null,Le=null;function Re(e){if(e=ji(e)){if(typeof Fe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ni(t),Fe(e.stateNode,e.type,t))}}function ze(e){Ie?Le?Le.push(e):Le=[e]:Ie=e}function Be(){if(Ie){var e=Ie,t=Le;if(Le=Ie=null,Re(e),t)for(e=0;e>>=0,e===0?32:31-(vt(e)/yt|0)|0}var xt=64,St=4194304;function Ct(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function wt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Ct(a))):r=Ct(s)}else o=n&~i,o===0?a!==0&&(r=Ct(a)):r=Ct(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function At(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_t(t),e[t]=n}function jt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=X),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Gn&&Xn(e,t)?(e=hn(),mn=pn=fn=null,Qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(){for(var e=window,t=B();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=B(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Er(e){var t=wr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cr(n.ownerDocument.documentElement,n)){if(r!==null&&Tr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Sr(n,a);var o=Sr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==B(r)||(r=Or,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&br(Ar,r)||(Ar=r,r=ii(kr,`onSelect`),0Fi||(e.current=Pi[Fi],Pi[Fi]=null,Fi--)}function Ri(e,t){Fi++,Pi[Fi]=e.current,e.current=t}var zi={},Bi=Ii(zi),Vi=Ii(!1),Hi=zi;function Ui(e,t){var n=e.type.contextTypes;if(!n)return zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Wi(e){return e=e.childContextTypes,e!=null}function Gi(){Li(Vi),Li(Bi)}function Ki(e,t,n){if(Bi.current!==zi)throw Error(r(168));Ri(Bi,t),Ri(Vi,n)}function qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,se(e)||`Unknown`,a));return R({},n,i)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zi,Hi=Bi.current,Ri(Bi,e),Ri(Vi,Vi.current),!0}function Yi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=qi(e,t,Hi),i.__reactInternalMemoizedMergedChildContext=e,Li(Vi),Li(Bi),Ri(Bi,e)):Li(Vi),Ri(Vi,n)}var Xi=null,Zi=!1,Qi=!1;function $i(e){Xi===null?Xi=[e]:Xi.push(e)}function ea(e){Zi=!0,$i(e)}function ta(){if(!Qi&&Xi!==null){Qi=!0;var e=0,t=Y;try{var n=Xi;for(Y=1;e>=o,i-=o,la=1<<32-_t(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),_a&&da(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),_a&&da(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return _a&&da(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),_a&&da(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&ja(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=ka(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=ka(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(_e(i))return h(e,r,i,o);if(ee(i))return g(e,r,i,o);Aa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Na=Ma(!0),Pa=Ma(!1),Fa=Ii(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Li(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e)if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(r(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e;return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mt(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{Y=n,vo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Z(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mt(e,n)}}var ds={readContext:Ua,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ua,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=bo,a=jo();if(_a){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Vc===null)throw Error(r(349));yo&30||Ro(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,i,o,e),[e]),i.flags|=2048,Wo(9,zo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(_a){var n=ua,r=la;n=(r&~(1<<32-_t(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[wi]=t,e[Ti]=i,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Me(n,i),n){case`dialog`:Zr(`cancel`,e),Zr(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:Zr(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;oel&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304)}else{if(!i)if(e=mo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!_a)return oc(t),null}else 2*st()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=st(),t.sibling=null,n=po.current,Ri(po,i?n&1|2:n&1),t);case 22:case 23:return wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function cc(e,t){switch(ma(t),t.tag){case 1:return Wi(t.type)&&Gi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),Li(Vi),Li(Bi),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fo(t),null;case 13:if(Li(po),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Li(po),null;case 4:return lo(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(fi=an,e=wr(),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(pi={focusedElem:e,selectionRange:n},an=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wi],delete t[Ti],delete t[Di],delete t[Oi],delete t[ki])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=di));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(ht&&typeof ht.onCommitFiberUnmount==`function`)try{ht.onCommitFiberUnmount(mt,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?bi(e.parentNode,n):e.nodeType===1&&bi(e,n),nn(e)):bi(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=st()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Lc(i/1960))-i,10e?16:e,ol===null)var i=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(r(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lst()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=St,St<<=1,!(St&130023424)&&(St=4194304)):t=1);var n=fl();e=qa(e,t),e!==null&&(At(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}else Ms=!1,_a&&t.flags&1048576&&fa(t,aa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;$s(e,t),e=t.pendingProps;var a=Ui(t,Bi.current);Ha(t,n),a=ko(null,t,i,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Wi(i)?(o=!0,Ji(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,i,e,n),t=Vs(null,t,i,!0,o,n)):(t.tag=0,_a&&o&&pa(t),Ns(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=hs(i,e),a){case 0:t=zs(null,t,i,e,n);break a;case 1:t=Bs(null,t,i,e,n);break a;case 11:t=Ps(null,t,i,e,n);break a;case 14:t=Fs(null,t,i,hs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),zs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Bs(e,t,i,a,n);case 3:a:{if(Hs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(r(423)),t),t=Us(e,t,i,n,a);break a}else if(i!==a){a=Ss(Error(r(424)),t),t=Us(e,t,i,n,a);break a}else for(ga=xi(t.stateNode.containerInfo.firstChild),ha=t,_a=!0,va=null,n=Pa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ea(),i===a){t=ec(e,t,n);break a}Ns(e,t,i,n)}t=t.child}return t;case 5:return uo(t),e===null&&Sa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,mi(i,a)?s=null:o!==null&&mi(i,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Sa(t),null;case 13:return Ks(e,t,n);case 4:return co(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Na(t,null,i,n):Ns(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Ps(e,t,i,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ri(Fa,i._currentValue),i._currentValue=s,o!==null)if(Z(o.value,s)){if(o.children===a.children&&!Vi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ha(t,n),a=Ua(a),i=i(a),t.flags|=1,Ns(e,t,i,n),t.child;case 14:return i=t.type,a=hs(i,t.pendingProps),a=hs(i.type,a),Fs(e,t,i,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),$s(e,t),t.tag=1,Wi(i)?(e=!0,Ji(t)):e=!1,Ha(t,n),ys(t,i,a),xs(t,i,a,n),Vs(null,t,i,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return rt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Kl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=kt(0),this.expirationTimes=kt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=typeof FormData<`u`&&t.body instanceof FormData,r=await fetch(e,{credentials:`same-origin`,headers:n?t.headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok){let e=a?.error||a?.Error||a?.message||r.statusText;throw new v(r.status,e)}return a}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),gifts:()=>y(`/api/gifts`),officialGifts:()=>y(`/api/official-gifts`),officialGiftAnimation:e=>y(`/api/official-gifts/${encodeURIComponent(e)}/animation`),giftAnimation:e=>y(`/api/gifts/${encodeURIComponent(e)}/animation`),giftCollectibles:e=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles`),giftCollectibleAnimation:(e,t,n)=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles/${t}/${encodeURIComponent(n)}/animation`),importGift:e=>y(`/api/actions/import-gift`,{method:`POST`,body:e}),importOfficialGift:e=>y(`/api/actions/import-official-gift`,{method:`POST`,body:JSON.stringify(e)}),publishGiftCollectibles:(e,t)=>y(`/api/actions/publish-gift-collectibles?gift_id=${encodeURIComponent(e)}`,{method:`POST`,body:t}),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},S=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),C=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...w,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),E=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(T,{ref:i,iconNode:t,className:C(`lucide-${S(e)}`,n),...r}));return n.displayName=`${e}`,n},D=E(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=E(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),k=E(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),A=E(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),j=E(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),M=E(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),N=E(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),P=E(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),F=E(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),I=E(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),L=E(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),ee=E(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),R=E(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),te=E(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),ne=E(`Gem`,[[`path`,{d:`M6 3h12l4 6-10 13L2 9Z`,key:`1pcd5k`}],[`path`,{d:`M11 3 8 9l4 13 4-13-3-6`,key:`1fcu3u`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),re=E(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),ie=E(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ae=E(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),oe=E(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),se=E(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),ce=E(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),le=E(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),ue=E(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),z=E(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),de=E(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),B=E(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),V=E(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),fe=E(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),pe=E(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),me=E(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),he=E(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),ge=E(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),_e=E(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),ve=E(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ye=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),H=o(((e,t)=>{t.exports=ye()}))(),U=`telesrv.admin.lang`,be={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"route.gifts":`Star Gifts`,"route.giftsSubtitle":`Console / Star Gifts`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.gifts":`Star Gifts`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.accountFrozen":`Account frozen`,"account.accountActive":`Account active`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeAccount":`Freeze account`,"account.updateFreeze":`Update freeze`,"account.unfreezeAccount":`Unfreeze account`,"account.freezeSince":`Frozen since`,"account.freezeUntil":`Appeal deadline`,"account.freezeUntilAria":`Freeze appeal deadline`,"account.freezeAppealURL":`Appeal URL`,"account.freezeAppealURLAria":`Freeze appeal URL`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"gifts.pageTitle":`Star Gift Catalog`,"gifts.eyebrow":`Catalog, immutable revisions and animation assets`,"gifts.total":`Catalog entries`,"gifts.enabled":`Enabled`,"gifts.received":`Received gifts`,"gifts.formats":`Accepted formats`,"gifts.add":`Add gift`,"gifts.searchPlaceholder":`Search gift ID, title or format`,"gifts.listSummary":`Showing {shown} of {total}`,"gifts.idRevision":`ID / Revision`,"gifts.price":`Price / Conversion`,"gifts.importTitle":`Import a Star Gift`,"gifts.importEyebrow":`Gift catalog operation`,"gifts.newRevision":`Create revision for gift #{id}`,"gifts.importHint":`Upload TGS or plain Lottie JSON. Lottie is normalized and compressed to TGS.`,"gifts.officialSource":`Official snapshot`,"gifts.fileSource":`Upload file`,"gifts.officialHint":`Choose a verified gift from data/official-gifts. Complete collectible pools are imported atomically.`,"gifts.officialSearch":`Search official gift ID or title`,"gifts.officialSelect":`Choose an official gift`,"gifts.officialRequired":`Choose an official gift first`,"gifts.officialResults":`Showing {shown} of {total}`,"gifts.officialCategoryLabel":`Official gift capability category`,"gifts.officialCategory.all":`All`,"gifts.officialCategory.upgrade":`Upgradable`,"gifts.officialCategory.craft":`Craftable`,"gifts.officialCategory.basic":`Not upgradable`,"gifts.officialUnnamed":`Unnamed official gift #{id}`,"gifts.officialAttributes":`{count} attributes`,"gifts.canUpgrade":`Can upgrade`,"gifts.cannotUpgrade":`Cannot upgrade`,"gifts.canCraft":`Can Craft`,"gifts.cannotCraft":`Cannot Craft`,"gifts.officialEmpty":`No official gifts match this category and search.`,"gifts.includeCollectible":`Import the complete collectible pool, including crafted models`,"gifts.animation":`Animation file`,"gifts.filePrompt":`Drop or choose a TGS / Lottie file`,"gifts.fileHint":`TGS, JSON or Lottie · validated before import`,"gifts.chooseFile":`Choose file`,"gifts.changeFile":`Change file`,"gifts.title":`Display title`,"gifts.titlePlaceholder":`e.g. Celebration Star`,"gifts.stars":`Price in Stars`,"gifts.convertStars":`Conversion Stars`,"gifts.sortOrder":`Sort order`,"gifts.reason":`Audit reason`,"gifts.reasonPlaceholder":`Briefly describe why this gift is being imported`,"gifts.enableAfterImport":`Enable after import`,"gifts.validate":`Dry-run validation`,"gifts.confirmImport":`Confirm import`,"gifts.stepDetails":`File and details`,"gifts.stepValidate":`Dry-run validation`,"gifts.stepImport":`Confirm import`,"gifts.fileRequired":`Choose a TGS or Lottie file first`,"gifts.source":`Source`,"gifts.replace":`New revision`,"gifts.disable":`Disable`,"gifts.enable":`Enable`,"gifts.empty":`No Star Gifts have been imported.`,"gifts.emptyHint":`Import the first animation above to build the gift catalog.`,"gifts.validationReady":`Validation passed`,"gifts.validationHint":`Review the normalized metadata, then confirm the import.`,"gifts.confirmState":`Apply the validated state change to gift #{id}?`,"collectibles.manage":`Attribute pool`,"collectibles.title":`Collectible pool · Gift #{id}`,"collectibles.eyebrow":`Unique gift attributes`,"collectibles.activeRevision":`Published revision {revision}`,"collectibles.published":`Published`,"collectibles.noPool":`No collectible pool published`,"collectibles.noPoolHint":`Publish models, patterns and backdrops to enable upgrades.`,"collectibles.publishNew":`Publish a new immutable revision`,"collectibles.immutableHint":`Dry-run checks every file and the attribute-pool structure before the revision becomes active.`,"collectibles.upgradeStars":`Upgrade price in Stars`,"collectibles.supply":`Unique supply`,"collectibles.slug":`Public slug prefix`,"collectibles.models":`Models`,"collectibles.patterns":`Patterns`,"collectibles.backdrops":`Backdrops`,"collectibles.model":`Model`,"collectibles.pattern":`Pattern`,"collectibles.backdrop":`Backdrop`,"collectibles.rarity":`Rarity ‰`,"collectibles.rarityHint":`Keep at least two attributes. Permille values are relative regular-upgrade weights; add/remove redistributes them to 1000.`,"collectibles.minimumAttributes":`Models, patterns, and backdrops must each contain at least two attributes.`,"collectibles.duplicateBackdropID":`Backdrop IDs must be unique within the pool.`,"collectibles.colorHint":`Colors are stored as 24-bit RGB values.`,"collectibles.addAttribute":`Add`,"collectibles.remove":`Remove attribute`,"collectibles.fileRequired":`Every model and pattern needs a TGS or Lottie file.`,"collectibles.backdropID":`Backdrop ID`,"collectibles.color.center":`Center`,"collectibles.color.edge":`Edge`,"collectibles.color.pattern":`Pattern`,"collectibles.color.text":`Text`,"collectibles.validationReady":`Attribute pool is valid`,"collectibles.validationHint":`Review the normalized assets, then publish this immutable revision.`,"collectibles.publish":`Publish revision`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"route.gifts":`星星礼物`,"route.giftsSubtitle":`控制台 / 星星礼物`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.gifts":`礼物目录`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.accountFrozen":`账号已冻结`,"account.accountActive":`账号正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeAccount":`冻结账号`,"account.updateFreeze":`更新冻结信息`,"account.unfreezeAccount":`解冻账号`,"account.freezeSince":`冻结开始时间`,"account.freezeUntil":`申诉截止时间`,"account.freezeUntilAria":`账号冻结申诉截止时间`,"account.freezeAppealURL":`申诉链接`,"account.freezeAppealURLAria":`账号冻结申诉链接`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"gifts.pageTitle":`星星礼物目录`,"gifts.eyebrow":`目录、不可变版本与动画资源`,"gifts.total":`目录条目`,"gifts.enabled":`已启用`,"gifts.received":`已领取礼物`,"gifts.formats":`支持格式`,"gifts.add":`添加礼物`,"gifts.searchPlaceholder":`搜索礼物 ID、标题或格式`,"gifts.listSummary":`显示 {shown} / {total} 项`,"gifts.idRevision":`ID / 版本`,"gifts.price":`售价 / 兑换`,"gifts.importTitle":`导入星星礼物`,"gifts.importEyebrow":`礼物目录操作`,"gifts.newRevision":`为礼物 #{id} 创建新版本`,"gifts.importHint":`支持 TGS 或纯 Lottie JSON;Lottie 会规范化并压缩成 TGS。`,"gifts.officialSource":`官方资源库`,"gifts.fileSource":`上传文件`,"gifts.officialHint":`从 data/official-gifts 的已校验快照中选择;完整 collectible 属性池会与礼物原子导入。`,"gifts.officialSearch":`搜索官方礼物 ID 或标题`,"gifts.officialSelect":`请选择官方礼物`,"gifts.officialRequired":`请先选择一个官方礼物`,"gifts.officialResults":`显示 {shown} / {total} 项`,"gifts.officialCategoryLabel":`官方礼物能力分类`,"gifts.officialCategory.all":`全部`,"gifts.officialCategory.upgrade":`可升级`,"gifts.officialCategory.craft":`可 Craft`,"gifts.officialCategory.basic":`不可升级`,"gifts.officialUnnamed":`未命名官方礼物 #{id}`,"gifts.officialAttributes":`{count} 个属性`,"gifts.canUpgrade":`可升级`,"gifts.cannotUpgrade":`不可升级`,"gifts.canCraft":`可 Craft`,"gifts.cannotCraft":`不可 Craft`,"gifts.officialEmpty":`当前分类和搜索条件下没有官方礼物。`,"gifts.includeCollectible":`完整导入 collectible 属性池(包含 crafted 模型)`,"gifts.animation":`动画文件`,"gifts.filePrompt":`拖放或选择 TGS / Lottie 文件`,"gifts.fileHint":`支持 TGS、JSON、Lottie,导入前会先进行校验`,"gifts.chooseFile":`选择文件`,"gifts.changeFile":`更换文件`,"gifts.title":`显示标题`,"gifts.titlePlaceholder":`例如:庆典星星`,"gifts.stars":`售价 Stars`,"gifts.convertStars":`可兑换 Stars`,"gifts.sortOrder":`排序值`,"gifts.reason":`审计原因`,"gifts.reasonPlaceholder":`简要说明本次导入礼物的原因`,"gifts.enableAfterImport":`导入后启用`,"gifts.validate":`Dry-run 校验`,"gifts.confirmImport":`确认导入`,"gifts.stepDetails":`文件与信息`,"gifts.stepValidate":`Dry-run 校验`,"gifts.stepImport":`确认导入`,"gifts.fileRequired":`请先选择 TGS 或 Lottie 文件`,"gifts.source":`来源`,"gifts.replace":`创建新版本`,"gifts.disable":`停用`,"gifts.enable":`启用`,"gifts.empty":`尚未导入星星礼物。`,"gifts.emptyHint":`从上方导入第一个动画,开始搭建礼物目录。`,"gifts.validationReady":`校验已通过`,"gifts.validationHint":`确认规范化后的元数据无误,再执行正式导入。`,"gifts.confirmState":`确认执行礼物 #{id} 的状态变更吗?`,"collectibles.manage":`属性池`,"collectibles.title":`Collectibles 属性池 · 礼物 #{id}`,"collectibles.eyebrow":`唯一礼物属性管理`,"collectibles.activeRevision":`已发布版本 {revision}`,"collectibles.published":`已发布`,"collectibles.noPool":`尚未发布 Collectibles 属性池`,"collectibles.noPoolHint":`发布模型、图案与背景后,客户端即可升级为唯一礼物。`,"collectibles.publishNew":`发布新的不可变版本`,"collectibles.immutableHint":`Dry-run 会校验全部文件和属性池结构,通过后才切换为当前版本。`,"collectibles.upgradeStars":`升级价格 Stars`,"collectibles.supply":`唯一礼物总量`,"collectibles.slug":`公开 Slug 前缀`,"collectibles.models":`模型`,"collectibles.patterns":`图案`,"collectibles.backdrops":`背景`,"collectibles.model":`模型`,"collectibles.pattern":`图案`,"collectibles.backdrop":`背景`,"collectibles.rarity":`稀有度 ‰`,"collectibles.rarityHint":`每类至少保留两项。Permille 是普通升级的相对权重,增删时会自动重新分配为 1000。`,"collectibles.minimumAttributes":`模型、图案和背景每类都必须至少包含两个属性。`,"collectibles.duplicateBackdropID":`同一属性池中的背景 ID 必须唯一。`,"collectibles.colorHint":`颜色会按 24 位 RGB 数值保存。`,"collectibles.addAttribute":`添加`,"collectibles.remove":`删除属性`,"collectibles.fileRequired":`每个模型和图案都必须选择 TGS 或 Lottie 文件。`,"collectibles.backdropID":`背景 ID`,"collectibles.color.center":`中心色`,"collectibles.color.edge":`边缘色`,"collectibles.color.pattern":`图案色`,"collectibles.color.text":`文字色`,"collectibles.validationReady":`属性池校验通过`,"collectibles.validationHint":`确认规范化资源无误后,即可发布这个不可变版本。`,"collectibles.publish":`发布版本`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`},ru:{"app.adminConsole":`Панель администратора`,"app.localAccess":`Локальный доступ`,"app.title":`telesrv admin`,"common.actions":`Действия`,"common.admins":`Администраторы`,"common.backToList":`Назад к списку`,"common.channel":`Канал`,"common.channelOrGroup":`Канал / Группа`,"common.clear":`Очистить`,"common.close":`Закрыть`,"common.count":`Количество`,"common.deleted":`Удалено`,"common.detail":`Детали`,"common.device":`Устройство`,"common.disabled":`Отключено`,"common.enabled":`Включено`,"common.fromPeer":`От пира`,"common.group":`Группа`,"common.id":`ID`,"common.limit":`Лимит`,"common.loading":`Загрузка...`,"common.member":`Участник`,"common.members":`Участники`,"common.messageId":`ID сообщения`,"common.name":`Имя`,"common.no":`Нет`,"common.noResults":`Нет результатов`,"common.none":`Нет`,"common.normal":`Обычный`,"common.operations":`Операции`,"common.owner":`Владелец`,"common.platform":`Платформа`,"common.refresh":`Обновить`,"common.search":`Поиск`,"common.sender":`Отправитель`,"common.status":`Статус`,"common.survived":`Уцелело`,"common.time":`Время`,"common.type":`Тип`,"common.updatedAt":`Обновлено`,"common.username":`Имя пользователя`,"common.valid":`Действителен`,"common.verified":`Подтвержден`,"common.views":`Просмотры`,"common.yes":`Да`,"route.accounts":`Аккаунты`,"route.accountsSubtitle":`Консоль / Аккаунты`,"route.channels":`Супергруппы и каналы`,"route.channelsSubtitle":`Консоль / Каналы`,"route.dashboard":`Панель управления`,"route.dashboardSubtitle":`Консоль / Обзор`,"route.messages":`Аудит сообщений`,"route.messagesSubtitle":`Консоль / Сообщения`,"route.gifts":`Звездные подарки`,"route.giftsSubtitle":`Консоль / Звездные подарки`,"layout.navigation":`Навигация`,"layout.primaryNav":`Основное меню`,"layout.dashboard":`Обзор`,"layout.accounts":`Аккаунты`,"layout.channels":`Супергруппы / Каналы`,"layout.messages":`Сообщения`,"layout.gifts":`Звездные подарки`,"layout.privateMessages":`Личные`,"layout.groupMessages":`Группы`,"layout.runtime":`Среда выполнения`,"layout.adminBackend":`Админ-бэкенд`,"layout.ready":`Готов`,"layout.pgRead":`Чтение из PG`,"layout.readOnly":`Только чтение`,"layout.writeOps":`Операции записи`,"layout.dryRun":`Тестовый запуск`,"layout.actor":`Вход выполнен как: {actor}`,"layout.logout":`Выйти`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"login.heading":`Панель администратора`,"login.body":`Введите учетные данные для входа в консоль.`,"login.secret":`Пароль или токен администратора`,"login.submit":`Войти`,"login.submitting":`Вход...`,"dashboard.eyebrow":`Состояние системы`,"dashboard.title":`Обзор консоли`,"dashboard.readPath":`Путь чтения`,"dashboard.readPathValue":`PG только для чтения`,"dashboard.writePath":`Путь записи`,"dashboard.executionPolicy":`Политика выполнения`,"dashboard.dryRunFirst":`Сначала тестовый запуск`,"dashboard.accountsText":`Статус аккаунтов, премиум, верификация, сессии.`,"dashboard.channelsText":`Публичные каналы и группы, количество участников, статус верификации.`,"dashboard.messagesText":`Ящики сообщений, обновления, состояние исходящих.`,"dashboard.strip.dryRun":`Все опасные действия начинаются с тестового запуска`,"dashboard.strip.token":`Браузер никогда не сохраняет внутренние токены`,"dashboard.strip.pagination":`Списки используют курсорную пагинацию`,"dashboard.strip.snapshot":`Детальные страницы сохраняют моментальные снимки исходного состояния`,"account.pageTitle":`Аккаунты`,"account.queryResults":`Результаты поиска`,"account.recentActive":`Недавно активные аккаунты`,"account.currentPage":`Аккаунты на странице`,"account.onlineDevices":`Активные сессии устройств`,"account.premium":`Premium`,"account.frozen":`Заморожен`,"account.searchPlaceholder":`ID пользователя / телефон / имя пользователя`,"account.userID":`ID пользователя`,"account.phone":`Телефон`,"account.lastActive":`Последняя активность`,"account.notVerified":`Не подтвержден`,"account.notPremium":`Без Premium`,"account.premiumUntil":`Premium истекает`,"account.starsBalance":`Баланс Звезд`,"account.startingGrantApplied":`стартовый бонус начислен`,"account.startingGrantPending":`ожидает стартового бонуса`,"account.activeSessions":`Авторизованные устройства`,"account.accountFlags":`Флаги аккаунта`,"account.restriction":`Ограничение`,"account.restricted":`Ограничен`,"account.createdAt":`Создан`,"account.detailTitle":`Аккаунт #{id}`,"account.profile":`Профиль аккаунта`,"account.loadingDetail":`Загрузка данных аккаунта`,"account.waitingData":`Ожидание данных`,"account.noUsername":`Нет имени пользователя`,"account.noPhone":`Нет телефона`,"account.accountFrozen":`Аккаунт заморожен`,"account.accountActive":`Аккаунт активен`,"account.authorizationsTitle":`Авторизованные устройства`,"account.authorizationsCount":`Авторизаций: {count}`,"account.recentAdminOps":`Последние действия администратора`,"account.recent30Audit":`Последние 30 записей аудита`,"account.actionDock":`Действия с аккаунтом`,"account.freezeAccount":`Заморозить аккаунт`,"account.updateFreeze":`Обновить параметры заморозки`,"account.unfreezeAccount":`Разморозить аккаунт`,"account.freezeSince":`Заморожен с`,"account.freezeUntil":`Срок подачи апелляции`,"account.freezeUntilAria":`Срок подачи апелляции на заморозку`,"account.freezeAppealURL":`URL для апелляции`,"account.freezeAppealURLAria":`URL для апелляции на заморозку`,"account.premiumMonths":`Срок действия Premium (в месяцах)`,"account.premiumMonthsAria":`Указать срок действия Premium в месяцах`,"account.setPremium":`Выдать Premium`,"account.clearPremium":`Снять Premium`,"account.starsAmount":`Количество звёзд`,"account.starsAmountAria":`Указать количество начисляемых звёзд`,"account.grantStars":`Начислить звёзды`,"account.setVerified":`Подтвердить аккаунт`,"account.clearVerified":`Снять подтверждение`,"channel.pageTitle":`Супергруппы и каналы`,"channel.recentUpdated":`Недавно обновленные`,"channel.currentPage":`Объекты на странице`,"channel.megagroups":`Супергруппы`,"channel.broadcasts":`Каналы`,"channel.verifiedCount":`Подтверждено`,"channel.searchPlaceholder":`ID канала / имя пользователя / название`,"channel.channelID":`ID канала`,"channel.kind":`Тип`,"channel.title":`Название`,"channel.pts":`PTS`,"channel.detailProfile":`Профиль канала`,"channel.loadingDetail":`Загрузка данных канала`,"channel.creator":`Создатель: {id}`,"channel.governance":`Модерация`,"channel.governanceValue":`Заблокировано {banned} / Исключено {kicked}`,"channel.flags":`Флаги канала`,"channel.rawRow":`Исходная строка БД`,"channel.rawRowText":`Снимок базы данных только для чтения`,"channel.actionDock":`Действия с каналом`,"channel.setVerified":`Подтвердить канал`,"channel.clearVerified":`Снять подтверждение`,"channel.kind.broadcast":`Канал`,"channel.kind.forum":`Супергруппа / Форум`,"channel.kind.megagroup":`Супергруппа`,"channel.kind.generic":`Канал / Группа`,"messages.privateTitle":`Личные сообщения`,"messages.privateEyebrow":`Личные ящики сообщений`,"messages.groupTitle":`Групповые сообщения`,"messages.groupEyebrow":`Сообщения супергрупп и каналов`,"messages.selectPrivatePeers":`Сначала найдите и выберите владельца и собеседника`,"messages.selectChannel":`Сначала найдите и выберите супергруппу или канал`,"messages.ownerUser":`Пользователь-владелец`,"messages.peerUser":`Собеседник`,"messages.beforeDatePlaceholder":`курсор before_date`,"messages.beforeIDPlaceholder":`курсор before_msg_id`,"messages.limitPlaceholder":`лимит <= 100`,"messages.searchMessages":`Поиск сообщений`,"messages.nextPage":`Следующая страница`,"messages.currentPage":`Сообщения на странице`,"messages.deleted":`Удалено`,"messages.outgoing":`Исходящее`,"messages.incoming":`Входящее`,"messages.ownerPeer":`Владелец / Собеседник`,"messages.deleteSelected":`Указать и удалить выбранные сообщения`,"messages.idsPlaceholder":`ID сообщений через запятую`,"messages.revoke":`Удалить для обеих сторон`,"messages.previewDelete":`Тестовое удаление`,"messages.clearHistory":`Очистить историю личной переписки`,"messages.maxIDPlaceholder":`граница max_id`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Очистить только у себя`,"messages.previewClearHistory":`Тестовая очистка истории`,"messages.direction":`Направление`,"messages.body":`Текст сообщения`,"messages.privateDetailTitle":`Сообщение #{id}`,"messages.detailEyebrow":`Детали сообщения`,"messages.backPrivate":`Назад к личным сообщениям`,"messages.backGroup":`Назад к групповым сообщениям`,"messages.ownerPeerTitle":`Владелец {owner} · Собеседник {peer}`,"messages.senderSubtitle":`Отправитель {sender} · {date}`,"messages.boxID":`ID ящика сообщений`,"messages.privateMessageID":`ID личного сообщения`,"messages.messageSender":`Отправитель сообщения`,"messages.messageBox":`Ящик сообщений`,"messages.dialogRow":`Строка диалога`,"messages.privateRow":`Строка личного сообщения`,"messages.channelMessageRow":`Строка сообщения канала`,"messages.channelRow":`Строка канала`,"messages.userUpdateEvents":`События обновления пользователей`,"messages.channelUpdateEvents":`События обновления каналов`,"messages.eventJson":`JSON события`,"messages.dispatchOutbox":`Очередь отправки (Outbox)`,"messages.messageBoxesSnapshot":`Снимок message_boxes только для чтения`,"messages.dialogSnapshot":`Снимок dialogs только для чтения`,"messages.privateSnapshot":`Снимок private_messages только для чтения`,"messages.channelMessagesSnapshot":`Снимок channel_messages только для чтения`,"messages.channelSnapshot":`Снимок channels только для чтения`,"messages.userEventsSource":`постоянные user_update_events`,"messages.channelEventsSource":`постоянные channel_update_events`,"messages.outboxSource":`онлайн/офлайн dispatch_outbox`,"messages.attempts":`Попытки`,"messages.deleteThis":`Удалить это сообщение`,"messages.groupDetailTitle":`Групповое сообщение #{id}`,"messages.channelGroupTitle":`Канал / Группа {id}`,"messages.mediaCount":`С медиафайлами`,"messages.channelPosts":`Посты канала`,"messages.channelGroup":`Канал / Группа`,"messages.pinned":`Закреплено`,"messages.channelPost":`Пост в канале`,"gifts.pageTitle":`Каталог звездных подарков`,"gifts.eyebrow":`Каталог, неизменяемые версии и файлы анимаций`,"gifts.total":`Подарков в каталоге`,"gifts.enabled":`Включено`,"gifts.received":`Полученные подарки`,"gifts.formats":`Поддерживаемые форматы`,"gifts.add":`Добавить подарок`,"gifts.searchPlaceholder":`Поиск по ID подарка, названию или формату`,"gifts.listSummary":`Показано {shown} из {total}`,"gifts.idRevision":`ID / Версия`,"gifts.price":`Цена / Конвертация`,"gifts.importTitle":`Импорт звездного подарка`,"gifts.importEyebrow":`Управление каталогом подарков`,"gifts.newRevision":`Создать версию для подарка #{id}`,"gifts.importHint":`Загрузите файл TGS или обычный Lottie JSON. Lottie нормализуется и сжимается в формат TGS.`,"gifts.officialSource":`Официальный снимок`,"gifts.fileSource":`Загрузить файл`,"gifts.officialHint":`Выберите проверенный подарок из data/official-gifts. Полные пулы коллекционных предметов импортируются атомарно.`,"gifts.officialSearch":`Поиск по ID или названию официального подарка`,"gifts.officialSelect":`Выберите официальный подарок`,"gifts.officialRequired":`Сначала выберите официальный подарок`,"gifts.officialResults":`Показано {shown} из {total}`,"gifts.officialCategoryLabel":`Категория возможностей официального подарка`,"gifts.officialCategory.all":`Все`,"gifts.officialCategory.upgrade":`Можно улучшить`,"gifts.officialCategory.craft":`Можно создать`,"gifts.officialCategory.basic":`Нельзя улучшить`,"gifts.officialUnnamed":`Официальный подарок без названия #{id}`,"gifts.officialAttributes":`Атрибутов: {count}`,"gifts.canUpgrade":`Можно улучшить`,"gifts.cannotUpgrade":`Нельзя улучшить`,"gifts.canCraft":`Можно создать`,"gifts.cannotCraft":`Нельзя создать`,"gifts.officialEmpty":`Нет подарков, соответствующих категории и поиску.`,"gifts.includeCollectible":`Импортировать полный пул коллекционных предметов, включая созданные модели`,"gifts.animation":`Файл анимации`,"gifts.filePrompt":`Перетащите или выберите файл TGS / Lottie`,"gifts.fileHint":`TGS, JSON или Lottie · файл проверяется перед импортом`,"gifts.chooseFile":`Выбрать файл`,"gifts.changeFile":`Изменить файл`,"gifts.title":`Отображаемое название`,"gifts.titlePlaceholder":`например, Праздничная звезда`,"gifts.stars":`Цена в Звездах`,"gifts.convertStars":`Звезд при конвертации`,"gifts.sortOrder":`Порядок сортировки`,"gifts.reason":`Причина для аудита`,"gifts.reasonPlaceholder":`Кратко опишите причину импорта этого подарка`,"gifts.enableAfterImport":`Включить после импорта`,"gifts.validate":`Тестовая проверка`,"gifts.confirmImport":`Подтвердить импорт`,"gifts.stepDetails":`Файл и описание`,"gifts.stepValidate":`Тестовая проверка`,"gifts.stepImport":`Подтверждение импорта`,"gifts.fileRequired":`Сначала выберите файл TGS или Lottie`,"gifts.source":`Источник`,"gifts.replace":`Новая версия`,"gifts.disable":`Отключить`,"gifts.enable":`Включить`,"gifts.empty":`Звездные подарки еще не импортированы.`,"gifts.emptyHint":`Импортируйте первую анимацию, чтобы начать наполнение каталога.`,"gifts.validationReady":`Проверка пройдена`,"gifts.validationHint":`Проверьте нормализованные метаданные и подтвердите импорт.`,"gifts.confirmState":`Применить проверенные изменения состояния к подарку #{id}?`,"collectibles.manage":`Пул атрибутов`,"collectibles.title":`Пул коллекционных предметов · Подарок #{id}`,"collectibles.eyebrow":`Уникальные атрибуты подарка`,"collectibles.activeRevision":`Опубликованная версия {revision}`,"collectibles.published":`Опубликовано`,"collectibles.noPool":`Нет опубликованного пула коллекционных предметов`,"collectibles.noPoolHint":`Опубликуйте модели, узоры и фоны для активации улучшений.`,"collectibles.publishNew":`Опубликовать новую неизменяемую версию`,"collectibles.immutableHint":`Тестовый запуск проверяет каждый файл и структуру набора атрибутов перед активацией версии.`,"collectibles.upgradeStars":`Цена улучшения в Звездах`,"collectibles.supply":`Уникальный тираж`,"collectibles.slug":`Публичный префикс ссылки (slug)`,"collectibles.models":`Модели`,"collectibles.patterns":`Узоры`,"collectibles.backdrops":`Фоны`,"collectibles.model":`Модель`,"collectibles.pattern":`Узор`,"collectibles.backdrop":`Фон`,"collectibles.rarity":`Редкость ‰`,"collectibles.rarityHint":`В каждой категории должно быть не менее двух атрибутов. При добавлении и удалении веса permille перераспределяются до 1000.`,"collectibles.minimumAttributes":`Модели, узоры и фоны должны содержать не менее двух атрибутов в каждой категории.`,"collectibles.duplicateBackdropID":`ID фонов в одном наборе должны быть уникальными.`,"collectibles.colorHint":`Цвета сохраняются как 24-битные RGB-значения.`,"collectibles.addAttribute":`Добавить`,"collectibles.remove":`Удалить атрибут`,"collectibles.fileRequired":`Для каждой модели и узора требуется файл TGS или Lottie.`,"collectibles.backdropID":`ID фона`,"collectibles.color.center":`Центр`,"collectibles.color.edge":`Край`,"collectibles.color.pattern":`Узор`,"collectibles.color.text":`Текст`,"collectibles.validationReady":`Пул атрибутов корректен`,"collectibles.validationHint":`Проверьте нормализованные ресурсы и опубликуйте эту неизменяемую версию.`,"collectibles.publish":`Опубликовать версию`,"messages.msgIDsInvalid":`Некорректные ID сообщений`,"auth.device":`Устройство`,"auth.platform":`Платформа`,"auth.ip":`IP-адрес`,"auth.lastActive":`Последняя активность`,"auth.revokeCurrent":`Отозвать текущую`,"auth.keepCurrent":`Оставить текущую`,"auth.revokeAll":`Разлогинить все устройства`,"picker.userPlaceholder":`Поиск по user_id / телефону / имени пользователя`,"picker.channelPlaceholder":`Поиск по channel_id / имени пользователя / названию`,"picker.verified":`Подтвержденные`,"picker.regular":`Обычные`,"action.reasonRequired":`Пожалуйста, укажите причину операции`,"action.flow":`Процесс выполнения`,"action.close":`Закрыть`,"action.stepReason":`Укажите причину`,"action.stepDryRun":`Тестовый запуск`,"action.stepConfirm":`Подтверждение выполнения`,"action.reason":`Причина операции`,"action.reasonPlaceholder":`Опишите, почему выполняется эта операция`,"action.requestPreview":`Запросить предпросмотр`,"action.result":`Результат действия`,"action.commandID":`ID команды`,"action.status":`Статус`,"action.dryRun":`Тестовый запуск`,"action.runAgain":`Запустить тестовый запуск снова`,"action.runDry":`Сначала выполните тестовый запуск`,"action.confirm":`Подтвердить выполнение`,"audit.id":`ID`,"audit.commandID":`ID команды`,"audit.action":`Действие`,"audit.actor":`Исполнитель`,"audit.status":`Статус`,"audit.dryRun":`Тестовый запуск`,"audit.reason":`Причина`,"audit.time":`Время`}},xe=(0,g.createContext)(null);function Se({children:e}){let[t,n]=(0,g.useState)(()=>Ee());(0,g.useEffect)(()=>{try{localStorage.setItem(U,t)}catch{}let e=t===`zh`?`zh-CN`:t===`ru`?`ru`:`en`;document.documentElement.lang=e,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=Te(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>Te(t,e,n)}),[t]);return(0,H.jsx)(xe.Provider,{value:r,children:e})}function Ce(){let e=(0,g.useContext)(xe);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function we(){let{lang:e,setLang:t,t:n}=Ce();return(0,H.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`,`ru`].map(r=>(0,H.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function Te(e,t,n){let r=be[e][t]??be.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function Ee(){try{let e=De(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=De(localStorage.getItem(U));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=De(t);if(e)return e}return`en`}function De(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:t===`ru`||t.startsWith(`ru-`)?`ru`:null}function Oe(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function ke(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/messages`)?t(`route.messages`):e.startsWith(`/gifts`)?t(`route.gifts`):t(`route.dashboard`)}function Ae(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):e.startsWith(`/gifts`)?t(`route.giftsSubtitle`):t(`route.dashboardSubtitle`)}function je({href:e,navigate:t,className:n,children:r}){return(0,H.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function Me(){let{t:e}=Ce();return(0,H.jsxs)(`div`,{className:`boot-screen`,children:[(0,H.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,H.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`strong`,{children:`telesrv`}),(0,H.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,H.jsx)(`div`,{className:`loader-bar`})]})}function Ne({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=Ce(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,H.jsxs)(`div`,{className:`shell`,children:[(0,H.jsxs)(`aside`,{className:`sidebar`,children:[(0,H.jsxs)(je,{className:`brand`,href:`/`,navigate:n,children:[(0,H.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`strong`,{children:`telesrv`}),(0,H.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,H.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,H.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,H.jsx)(Pe,{icon:(0,H.jsx)(oe,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,H.jsx)(Pe,{icon:(0,H.jsx)(_e,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,H.jsx)(Pe,{icon:(0,H.jsx)(fe,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,H.jsx)(Pe,{icon:(0,H.jsx)(re,{size:16}),href:`/gifts`,route:t,navigate:n,children:a(`layout.gifts`)}),(0,H.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,H.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,H.jsx)(ce,{size:16}),(0,H.jsx)(`span`,{children:a(`layout.messages`)}),(0,H.jsx)(F,{className:`nav-section-chevron`,size:15})]}),s&&(0,H.jsxs)(`div`,{className:`nav-children`,children:[(0,H.jsx)(Pe,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,H.jsx)(Pe,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,H.jsxs)(`div`,{className:`sidebar-status`,children:[(0,H.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,H.jsxs)(`div`,{className:`runtime-row`,children:[(0,H.jsx)(V,{size:14}),(0,H.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,H.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,H.jsxs)(`div`,{className:`runtime-row`,children:[(0,H.jsx)(ee,{size:14}),(0,H.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,H.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,H.jsxs)(`div`,{className:`runtime-row`,children:[(0,H.jsx)(pe,{size:14}),(0,H.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,H.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,H.jsxs)(`div`,{className:`workspace`,children:[(0,H.jsxs)(`header`,{className:`topbar`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`eyebrow`,children:Ae(t.path,a)}),(0,H.jsx)(`h1`,{children:ke(t.path,a)})]}),(0,H.jsxs)(`div`,{className:`topbar-actions`,children:[(0,H.jsx)(we,{}),(0,H.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,H.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,H.jsx)(se,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,H.jsx)(`main`,{className:`content`,children:i})]})]})}function Pe({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,H.jsxs)(je,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,H.jsx)(`span`,{children:i})]})}function Fe(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function Ie(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function Le(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function Re(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function ze(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function Be(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function W(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function Ve(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function He({title:e,eyebrow:t,children:n,actions:r}){return(0,H.jsxs)(`div`,{className:`page-frame`,children:[(0,H.jsxs)(`div`,{className:`page-title-row`,children:[(0,H.jsxs)(`div`,{children:[t&&(0,H.jsx)(`div`,{className:`eyebrow`,children:t}),(0,H.jsx)(`h2`,{children:e})]}),r&&(0,H.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function Ue({children:e}){return(0,H.jsx)(`div`,{className:`query-panel`,children:e})}function We({main:e,side:t}){return(0,H.jsxs)(`div`,{className:`split-layout`,children:[(0,H.jsx)(`div`,{className:`split-main`,children:e}),(0,H.jsx)(`aside`,{className:`split-side`,children:t})]})}function Ge({title:e,text:t,action:n}){return(0,H.jsxs)(`div`,{className:`section-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{children:e}),t&&(0,H.jsx)(`p`,{children:t})]}),n&&(0,H.jsx)(`div`,{className:`section-action`,children:n})]})}function Ke({children:e}){return(0,H.jsxs)(`div`,{className:`alert`,children:[(0,H.jsx)(O,{size:16}),` `,(0,H.jsx)(`span`,{children:e})]})}function G({children:e,tone:t=`neutral`}){return(0,H.jsx)(`span`,{className:`badge ${t}`,children:e})}function K({label:e,value:t,tone:n}){return(0,H.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,H.jsx)(`span`,{children:e}),(0,H.jsx)(`strong`,{children:t})]})}function q({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,H.jsxs)(`div`,{className:`metric ${n}`,children:[(0,H.jsx)(`span`,{children:e}),(0,H.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function J({label:e,value:t,mono:n=!1}){return(0,H.jsxs)(`div`,{className:`summary-item`,children:[(0,H.jsx)(`span`,{children:e}),(0,H.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function qe({rows:e}){let{t}=Ce();return(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:t(`audit.id`)}),(0,H.jsx)(`th`,{children:t(`audit.commandID`)}),(0,H.jsx)(`th`,{children:t(`audit.action`)}),(0,H.jsx)(`th`,{children:t(`audit.actor`)}),(0,H.jsx)(`th`,{children:t(`audit.status`)}),(0,H.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,H.jsx)(`th`,{children:t(`audit.reason`)}),(0,H.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,H.jsxs)(`tbody`,{children:[e.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:e.ID}),(0,H.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,H.jsx)(`td`,{children:e.Action}),(0,H.jsx)(`td`,{children:e.Actor}),(0,H.jsx)(`td`,{children:e.Status}),(0,H.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,H.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,H.jsx)(`td`,{children:ze(e.CreatedAt)})]},e.ID)),e.length===0&&(0,H.jsx)(Je,{colSpan:8})]})]})})}function Je({colSpan:e}){let{t}=Ce();return(0,H.jsx)(`tr`,{children:(0,H.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function Ye({label:e}){return(0,H.jsx)(`section`,{className:`surface`,children:(0,H.jsx)(`div`,{className:`loading-line`,children:e})})}function Xe({value:e}){return(0,H.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function Ze({onLogin:e}){let{t}=Ce(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,H.jsx)(`main`,{className:`login-page`,children:(0,H.jsxs)(`section`,{className:`login-panel`,children:[(0,H.jsxs)(`div`,{className:`login-head`,children:[(0,H.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,H.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`strong`,{children:`telesrv`}),(0,H.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,H.jsxs)(`div`,{className:`login-head-actions`,children:[(0,H.jsx)(we,{}),(0,H.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,H.jsxs)(`div`,{className:`login-copy`,children:[(0,H.jsx)(`h1`,{children:t(`login.heading`)}),(0,H.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,H.jsx)(Ke,{children:i}),(0,H.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:t(`login.secret`)}),(0,H.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,H.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var Qe=m();function $e({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=Ce(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function S(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let C=f?.dry_run&&!f.error,w=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,T=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{className:w,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,Qe.createPortal)((0,H.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,H.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,H.jsxs)(`div`,{className:`modal-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,H.jsx)(`h2`,{children:e})]}),(0,H.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,H.jsx)(ve,{size:15})})]}),(0,H.jsxs)(`div`,{className:`command-body`,children:[(0,H.jsxs)(`div`,{className:`command-steps`,children:[(0,H.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,H.jsx)(`span`,{children:`1`}),(0,H.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,H.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,H.jsx)(`span`,{children:`2`}),(0,H.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,H.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:C?`active`:``}`,children:[(0,H.jsx)(`span`,{children:`3`}),(0,H.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,H.jsxs)(`label`,{className:`form-field`,children:[(0,H.jsx)(`span`,{children:s(`action.reason`)}),(0,H.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,H.jsxs)(`div`,{className:`command-preview`,children:[(0,H.jsxs)(`div`,{className:`preview-head`,children:[(0,H.jsx)(te,{size:14}),` `,s(`action.requestPreview`)]}),(0,H.jsx)(Xe,{value:JSON.stringify(T,null,2)})]}),m&&(0,H.jsx)(Ke,{children:m}),f&&(0,H.jsxs)(`div`,{className:`result-box`,children:[(0,H.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,H.jsx)(O,{size:16}):(0,H.jsx)(k,{size:16}),(0,H.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,H.jsxs)(`div`,{className:`result-line`,children:[(0,H.jsx)(`span`,{children:s(`action.commandID`)}),(0,H.jsx)(`strong`,{children:f.command_id})]}),(0,H.jsxs)(`div`,{className:`result-line`,children:[(0,H.jsx)(`span`,{children:s(`action.status`)}),(0,H.jsx)(`strong`,{children:f.status})]}),(0,H.jsxs)(`div`,{className:`result-line`,children:[(0,H.jsx)(`span`,{children:s(`action.dryRun`)}),(0,H.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,H.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,H.jsx)(Xe,{value:JSON.stringify(f.details,null,2)})]})]}),(0,H.jsxs)(`div`,{className:`modal-actions`,children:[(0,H.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,H.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>S(!1),disabled:_,children:[_?(0,H.jsx)(A,{size:15,className:`spin`}):(0,H.jsx)(ue,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,H.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>S(!0),disabled:_||!C,children:[(0,H.jsx)(k,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function et({rows:e,userID:t,onDone:n}){let{t:r}=Ce(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,H.jsxs)(`div`,{className:`authorization-block`,children:[(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:r(`auth.device`)}),(0,H.jsx)(`th`,{children:r(`auth.platform`)}),(0,H.jsx)(`th`,{children:r(`auth.ip`)}),(0,H.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,H.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,H.jsxs)(`tbody`,{children:[o.map(n=>(0,H.jsxs)(`tr`,{children:[(0,H.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,H.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,H.jsx)(`td`,{children:n.IP}),(0,H.jsx)(`td`,{children:ze(n.ActiveAt)}),(0,H.jsx)(`td`,{className:`device-actions-cell`,children:(0,H.jsxs)(`div`,{className:`device-actions`,children:[(0,H.jsx)($e,{label:r(`auth.revokeCurrent`),icon:(0,H.jsx)(se,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,H.jsx)($e,{label:r(`auth.keepCurrent`),icon:(0,H.jsx)(fe,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,H.jsx)(Je,{colSpan:5})]})]})}),(0,H.jsx)(`div`,{className:`danger-zone`,children:(0,H.jsx)($e,{label:r(`auth.revokeAll`),icon:(0,H.jsx)(N,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function tt({id:e,navigate:t}){let{t:n}=Ce(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`),[p,m]=(0,g.useState)(()=>nt(new Date(Date.now()+7*864e5))),[h,_]=(0,g.useState)(``);async function v(){c(!0),o(``);try{let t=await x.account(e);i(t),t.Restriction.Frozen&&(t.Restriction.Until&&m(nt(new Date(t.Restriction.Until))),_(t.Restriction.AppealURL||``))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{v()},[e]),a)return(0,H.jsx)(Ke,{children:a});if(!r)return(0,H.jsx)(Ye,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let y=r.Account;return(0,H.jsx)(He,{title:n(`account.detailTitle`,{id:y.ID}),eyebrow:n(`account.profile`),actions:(0,H.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,H.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,H.jsx)(We,{main:(0,H.jsxs)(`div`,{className:`stacked-sections`,children:[(0,H.jsxs)(`section`,{className:`entity-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`entity-title`,children:Le(y)}),(0,H.jsxs)(`div`,{className:`entity-subtitle`,children:[Ie(y.Username)||n(`account.noUsername`),` · `,Fe(y.Phone)||n(`account.noPhone`)]})]}),(0,H.jsxs)(`div`,{className:`entity-badges`,children:[y.PremiumUntil>0?(0,H.jsx)(G,{tone:`good`,children:n(`account.premium`)}):(0,H.jsx)(G,{children:n(`account.notPremium`)}),r.Verified?(0,H.jsx)(G,{tone:`good`,children:n(`common.verified`)}):(0,H.jsx)(G,{children:n(`account.notVerified`)}),y.Frozen?(0,H.jsx)(G,{tone:`danger`,children:n(`account.accountFrozen`)}):(0,H.jsx)(G,{children:n(`account.accountActive`)})]})]}),(0,H.jsxs)(`div`,{className:`summary-grid`,children:[(0,H.jsx)(J,{label:n(`account.userID`),value:String(y.ID),mono:!0}),(0,H.jsx)(J,{label:n(`account.lastActive`),value:Be(r.LastSeenAt)||`-`}),(0,H.jsx)(J,{label:n(`account.premiumUntil`),value:y.PremiumUntil>0?Be(y.PremiumUntil):n(`common.none`)}),(0,H.jsx)(J,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,H.jsx)(J,{label:n(`common.updatedAt`),value:ze(y.UpdatedAt)||`-`}),(0,H.jsx)(J,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,H.jsx)(J,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,H.jsx)(J,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,H.jsx)(J,{label:n(`account.freezeSince`),value:r.Restriction.Since?ze(r.Restriction.Since):n(`common.none`)}),(0,H.jsx)(J,{label:n(`account.freezeUntil`),value:r.Restriction.Until?ze(r.Restriction.Until):n(`common.none`)}),(0,H.jsx)(J,{label:n(`account.freezeAppealURL`),value:r.Restriction.AppealURL||n(`common.none`)}),(0,H.jsx)(J,{label:n(`account.createdAt`),value:ze(y.CreatedAt)||`-`})]}),r.About&&(0,H.jsx)(`p`,{className:`about-text`,children:r.About}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,H.jsx)(et,{rows:r.Authorizations,userID:y.ID,onDone:v})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,H.jsx)(qe,{rows:r.AuditLogs})]})]}),side:(0,H.jsxs)(`section`,{className:`action-dock`,children:[(0,H.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,H.jsxs)(`label`,{className:`duration-field`,children:[(0,H.jsx)(`span`,{children:n(`account.freezeUntil`)}),(0,H.jsx)(`input`,{"aria-label":n(`account.freezeUntilAria`),value:p,onChange:e=>m(e.target.value),type:`datetime-local`})]}),(0,H.jsxs)(`label`,{className:`duration-field`,children:[(0,H.jsx)(`span`,{children:n(`account.freezeAppealURL`)}),(0,H.jsx)(`input`,{"aria-label":n(`account.freezeAppealURLAria`),value:h,onChange:e=>_(e.target.value),type:`url`,placeholder:`https://...`})]}),(0,H.jsx)($e,{label:y.Frozen?n(`account.updateFreeze`):n(`account.freezeAccount`),icon:(0,H.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!0,freeze_until:new Date(p).toISOString(),freeze_appeal_url:h.trim()}),onDone:v}),y.Frozen&&(0,H.jsx)($e,{label:n(`account.unfreezeAccount`),icon:(0,H.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!1}),onDone:v}),(0,H.jsxs)(`label`,{className:`duration-field`,children:[(0,H.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,H.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,H.jsxs)(`div`,{className:`action-stack`,children:[(0,H.jsx)($e,{label:n(`account.setPremium`),icon:(0,H.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:W(l)}),onDone:v}),(0,H.jsx)($e,{label:n(`account.clearPremium`),icon:(0,H.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:0}),onDone:v}),(0,H.jsxs)(`label`,{className:`duration-field`,children:[(0,H.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,H.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,H.jsx)($e,{label:n(`account.grantStars`),icon:(0,H.jsx)(me,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:y.ID,amount:W(d)}),onDone:v}),(0,H.jsx)($e,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,H.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:y.ID,verified:!r.Verified}),onDone:v})]})]})})})}function nt(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function rt(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function it(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function at({navigate:e}){let{t}=Ce(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=rt(o?.rows??[]);return(0,H.jsxs)(He,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,H.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,H.jsx)(de,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,H.jsx)(Ke,{children:f}),(0,H.jsxs)(`div`,{className:`metric-row`,children:[(0,H.jsx)(q,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,H.jsx)(q,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,H.jsx)(q,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,H.jsx)(q,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,H.jsx)(Ue,{children:(0,H.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,H.jsxs)(`label`,{className:`searchbox`,children:[(0,H.jsx)(B,{size:15}),(0,H.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,H.jsxs)(`label`,{className:`field-inline`,children:[(0,H.jsx)(`span`,{children:t(`common.limit`)}),(0,H.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,H.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,H.jsx)(A,{size:15,className:`spin`}):(0,H.jsx)(B,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,H.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,H.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:t(`account.userID`)}),(0,H.jsx)(`th`,{children:t(`account.phone`)}),(0,H.jsx)(`th`,{children:t(`common.username`)}),(0,H.jsx)(`th`,{children:t(`common.name`)}),(0,H.jsx)(`th`,{children:t(`common.device`)}),(0,H.jsx)(`th`,{children:t(`account.lastActive`)}),(0,H.jsx)(`th`,{children:t(`account.premium`)}),(0,H.jsx)(`th`,{children:t(`common.verified`)}),(0,H.jsx)(`th`,{children:t(`account.frozen`)}),(0,H.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,H.jsx)(`th`,{})]})}),(0,H.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{className:`mono`,children:n.ID}),(0,H.jsx)(`td`,{children:Fe(n.Phone)}),(0,H.jsx)(`td`,{children:Ie(n.Username)}),(0,H.jsx)(`td`,{children:Le(n)}),(0,H.jsx)(`td`,{children:n.DeviceCount}),(0,H.jsx)(`td`,{children:ze(n.LastActiveAt)}),(0,H.jsx)(`td`,{children:n.PremiumUntil>0?(0,H.jsxs)(G,{tone:`good`,children:[t(`account.premium`),` `,Be(n.PremiumUntil)]}):(0,H.jsx)(G,{children:t(`common.none`)})}),(0,H.jsx)(`td`,{children:n.Verified?(0,H.jsx)(G,{tone:`good`,children:t(`common.verified`)}):(0,H.jsx)(G,{children:t(`account.notVerified`)})}),(0,H.jsx)(`td`,{children:n.Frozen?(0,H.jsx)(G,{tone:`danger`,children:t(`account.frozen`)}):(0,H.jsx)(G,{children:t(`common.normal`)})}),(0,H.jsx)(`td`,{children:ze(n.UpdatedAt)}),(0,H.jsx)(`td`,{children:(0,H.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,H.jsx)(I,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,H.jsx)(Je,{colSpan:11})]})]})})]})}function ot({id:e,navigate:t}){let{t:n}=Ce(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,H.jsx)(Ke,{children:a});if(!r)return(0,H.jsx)(Ye,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,H.jsx)(He,{title:`${Re(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,H.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,H.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,H.jsx)(We,{main:(0,H.jsxs)(`div`,{className:`stacked-sections`,children:[(0,H.jsxs)(`section`,{className:`entity-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,H.jsxs)(`div`,{className:`entity-subtitle`,children:[Ie(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,H.jsxs)(`div`,{className:`entity-badges`,children:[(0,H.jsx)(G,{children:Re(c,n)}),c.Verified?(0,H.jsx)(G,{tone:`good`,children:n(`common.verified`)}):(0,H.jsx)(G,{children:n(`account.notVerified`)}),c.Deleted?(0,H.jsx)(G,{tone:`danger`,children:n(`common.deleted`)}):(0,H.jsx)(G,{children:n(`common.valid`)})]})]}),(0,H.jsxs)(`div`,{className:`summary-grid`,children:[(0,H.jsx)(J,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,H.jsx)(J,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,H.jsx)(J,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,H.jsx)(J,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,H.jsx)(J,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,H.jsx)(J,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,H.jsx)(J,{label:n(`account.createdAt`),value:Be(c.Date)||`-`}),(0,H.jsx)(J,{label:n(`common.updatedAt`),value:ze(c.UpdatedAt)||`-`})]}),c.About&&(0,H.jsx)(`p`,{className:`about-text`,children:c.About}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,H.jsx)(qe,{rows:r.AuditLogs})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,H.jsx)(Xe,{value:r.ChannelJSON})]})]}),side:(0,H.jsxs)(`section`,{className:`action-dock`,children:[(0,H.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,H.jsx)($e,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,H.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s})]})})})}function st({navigate:e}){let{t}=Ce(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=it(o?.rows??[]);return(0,H.jsxs)(He,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,H.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,H.jsx)(de,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,H.jsx)(Ke,{children:f}),(0,H.jsxs)(`div`,{className:`metric-row`,children:[(0,H.jsx)(q,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,H.jsx)(q,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,H.jsx)(q,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,H.jsx)(q,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,H.jsx)(Ue,{children:(0,H.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,H.jsxs)(`label`,{className:`searchbox`,children:[(0,H.jsx)(B,{size:15}),(0,H.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,H.jsxs)(`label`,{className:`field-inline`,children:[(0,H.jsx)(`span`,{children:t(`common.limit`)}),(0,H.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,H.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,H.jsx)(A,{size:15,className:`spin`}):(0,H.jsx)(B,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,H.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,H.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:t(`channel.channelID`)}),(0,H.jsx)(`th`,{children:t(`channel.kind`)}),(0,H.jsx)(`th`,{children:t(`common.username`)}),(0,H.jsx)(`th`,{children:t(`channel.title`)}),(0,H.jsx)(`th`,{children:t(`common.members`)}),(0,H.jsx)(`th`,{children:t(`common.admins`)}),(0,H.jsx)(`th`,{children:`PTS`}),(0,H.jsx)(`th`,{children:t(`common.verified`)}),(0,H.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,H.jsx)(`th`,{})]})}),(0,H.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{className:`mono`,children:n.ID}),(0,H.jsx)(`td`,{children:Re(n,t)}),(0,H.jsx)(`td`,{children:Ie(n.Username)}),(0,H.jsx)(`td`,{children:n.Title}),(0,H.jsx)(`td`,{children:n.ParticipantsCount}),(0,H.jsx)(`td`,{children:n.AdminsCount}),(0,H.jsx)(`td`,{children:n.PTS}),(0,H.jsx)(`td`,{children:n.Verified?(0,H.jsx)(G,{tone:`good`,children:t(`common.verified`)}):(0,H.jsx)(G,{children:t(`account.notVerified`)})}),(0,H.jsx)(`td`,{children:ze(n.UpdatedAt)}),(0,H.jsx)(`td`,{children:(0,H.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,H.jsx)(I,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,H.jsx)(Je,{colSpan:10})]})]})})]})}function ct({navigate:e}){let{t}=Ce();return(0,H.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,H.jsxs)(`section`,{className:`overview-band`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,H.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,H.jsxs)(`div`,{className:`overview-metrics`,children:[(0,H.jsx)(K,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,H.jsx)(K,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,H.jsx)(K,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,H.jsxs)(`div`,{className:`command-grid`,children:[(0,H.jsx)(lt,{icon:(0,H.jsx)(_e,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,H.jsx)(lt,{icon:(0,H.jsx)(fe,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,H.jsx)(lt,{icon:(0,H.jsx)(ce,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,H.jsxs)(`section`,{className:`work-strip`,children:[(0,H.jsxs)(`div`,{className:`strip-item`,children:[(0,H.jsx)(k,{size:16}),(0,H.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,H.jsxs)(`div`,{className:`strip-item`,children:[(0,H.jsx)(ae,{size:16}),(0,H.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,H.jsxs)(`div`,{className:`strip-item`,children:[(0,H.jsx)(L,{size:16}),(0,H.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,H.jsxs)(`div`,{className:`strip-item`,children:[(0,H.jsx)(te,{size:16}),(0,H.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function lt({icon:e,title:t,text:n,href:r,navigate:i}){return(0,H.jsxs)(je,{className:`launcher`,href:r,navigate:i,children:[(0,H.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,H.jsxs)(`span`,{className:`launcher-copy`,children:[(0,H.jsx)(`strong`,{children:t}),(0,H.jsx)(`span`,{children:n})]}),(0,H.jsx)(I,{size:16})]})}function ut({channelID:e,msgID:t,navigate:n}){let{t:r}=Ce(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,H.jsx)(Ke,{children:o});if(!i)return(0,H.jsx)(Ye,{label:r(`common.loading`)});let l=i.Message;return(0,H.jsx)(He,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,H.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,H.jsx)(M,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,H.jsxs)(`div`,{className:`stacked-sections`,children:[(0,H.jsxs)(`section`,{className:`entity-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,H.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:Be(l.Date)})})]}),(0,H.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,H.jsx)(G,{tone:`danger`,children:r(`common.deleted`)}):(0,H.jsx)(G,{children:r(`common.survived`)}),l.Pinned&&(0,H.jsx)(G,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,H.jsx)(G,{children:r(`messages.channelPost`)}),(0,H.jsxs)(G,{children:[`pts `,l.PTS]})]})]}),(0,H.jsxs)(`div`,{className:`summary-grid`,children:[(0,H.jsx)(J,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,H.jsx)(J,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,H.jsx)(J,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,H.jsx)(J,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,H.jsx)(Xe,{value:i.MessageJSON})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,H.jsx)(Xe,{value:i.ChannelJSON})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`PTS`}),(0,H.jsx)(`th`,{children:r(`common.count`)}),(0,H.jsx)(`th`,{children:r(`common.type`)}),(0,H.jsx)(`th`,{children:r(`common.messageId`)}),(0,H.jsx)(`th`,{children:r(`common.sender`)}),(0,H.jsx)(`th`,{children:r(`common.time`)})]})}),(0,H.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:e.PTS}),(0,H.jsx)(`td`,{children:e.PTSCount}),(0,H.jsx)(`td`,{children:e.Type}),(0,H.jsx)(`td`,{children:e.MessageID}),(0,H.jsx)(`td`,{children:e.SenderUserID}),(0,H.jsx)(`td`,{children:Be(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,H.jsx)(Je,{colSpan:6})]})]})})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.eventJson`)}),(0,H.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,H.jsx)(Xe,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,H.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function dt({label:e,value:t,onChange:n}){let{t:r}=Ce(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,H.jsxs)(`div`,{className:`entity-picker`,children:[(0,H.jsxs)(`div`,{className:`picker-head`,children:[(0,H.jsx)(`span`,{children:e}),t?(0,H.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,H.jsx)(ve,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,H.jsxs)(`div`,{className:`selected-entity`,children:[(0,H.jsx)(P,{size:15}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:Le(t)}),(0,H.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,H.jsx)(`span`,{children:Ie(t.Username)||Fe(t.Phone)||`-`})]}):null,(0,H.jsxs)(`div`,{className:`picker-search`,children:[(0,H.jsx)(B,{size:15}),(0,H.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,H.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,H.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,H.jsx)(`div`,{className:`picker-error`,children:u}),(0,H.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,H.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,H.jsx)(`span`,{className:`mono`,children:e.ID}),(0,H.jsx)(`strong`,{children:Le(e)}),(0,H.jsx)(`span`,{children:Ie(e.Username)||Fe(e.Phone)||`-`}),e.Verified?(0,H.jsx)(G,{tone:`good`,children:r(`picker.verified`)}):(0,H.jsx)(G,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,H.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function ft({label:e,value:t,onChange:n}){let{t:r}=Ce(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,H.jsxs)(`div`,{className:`entity-picker`,children:[(0,H.jsxs)(`div`,{className:`picker-head`,children:[(0,H.jsx)(`span`,{children:e}),t?(0,H.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,H.jsx)(ve,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,H.jsxs)(`div`,{className:`selected-entity`,children:[(0,H.jsx)(P,{size:15}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:t.Title||`-`}),(0,H.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,H.jsx)(`span`,{children:Ie(t.Username)||Re(t,r)})]}):null,(0,H.jsxs)(`div`,{className:`picker-search`,children:[(0,H.jsx)(B,{size:15}),(0,H.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,H.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,H.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,H.jsx)(`div`,{className:`picker-error`,children:u}),(0,H.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,H.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,H.jsx)(`span`,{className:`mono`,children:e.ID}),(0,H.jsx)(`strong`,{children:e.Title||`-`}),(0,H.jsx)(`span`,{children:Ie(e.Username)||Re(e,r)}),e.Verified?(0,H.jsx)(G,{tone:`good`,children:r(`picker.verified`)}):(0,H.jsx)(G,{children:Re(e,r)})]},e.ID)),o.length===0&&!c?(0,H.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function pt({navigate:e}){let{t}=Ce(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,H.jsxs)(He,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,H.jsx)(Ke,{children:f}),(0,H.jsxs)(Ue,{children:[(0,H.jsx)(`div`,{className:`message-selector-grid single`,children:(0,H.jsx)(ft,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,H.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,H.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,H.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,H.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,H.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,H.jsx)(B,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,H.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,H.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,H.jsxs)(`div`,{className:`metric-row`,children:[(0,H.jsx)(q,{label:t(`messages.currentPage`),value:String(_.length)}),(0,H.jsx)(q,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,H.jsx)(q,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,H.jsx)(q,{label:t(`messages.channelGroup`),value:n?`${n.Title||Re(n,t)} (${n.ID})`:`-`})]}),(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:t(`common.messageId`)}),(0,H.jsx)(`th`,{children:t(`common.time`)}),(0,H.jsx)(`th`,{children:t(`common.sender`)}),(0,H.jsx)(`th`,{children:`From Peer`}),(0,H.jsx)(`th`,{children:`PTS`}),(0,H.jsx)(`th`,{children:t(`common.views`)}),(0,H.jsx)(`th`,{children:t(`common.status`)}),(0,H.jsx)(`th`,{children:t(`messages.body`)}),(0,H.jsx)(`th`,{})]})}),(0,H.jsxs)(`tbody`,{children:[_.map(n=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{className:`mono`,children:n.ID}),(0,H.jsx)(`td`,{children:Be(n.Date)}),(0,H.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,H.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,H.jsx)(`td`,{children:n.PTS}),(0,H.jsx)(`td`,{children:n.ViewsCount}),(0,H.jsx)(`td`,{children:n.Deleted?(0,H.jsx)(G,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,H.jsx)(G,{tone:`warn`,children:t(`messages.pinned`)}):(0,H.jsx)(G,{children:t(`common.survived`)})}),(0,H.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,H.jsx)(`td`,{children:(0,H.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,H.jsx)(I,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,H.jsx)(Je,{colSpan:9})]})]})})]})}function mt({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=Ce(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,H.jsx)(Ke,{children:o});if(!i)return(0,H.jsx)(Ye,{label:r(`common.loading`)});let l=i.Message;return(0,H.jsx)(He,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,H.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,H.jsx)(M,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,H.jsx)(We,{main:(0,H.jsxs)(`div`,{className:`stacked-sections`,children:[(0,H.jsxs)(`section`,{className:`entity-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,H.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:Be(l.Date)})})]}),(0,H.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,H.jsx)(G,{tone:`danger`,children:r(`common.deleted`)}):(0,H.jsx)(G,{children:r(`common.survived`)}),(0,H.jsxs)(G,{children:[`pts `,l.PTS]}),(0,H.jsx)(G,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,H.jsxs)(`div`,{className:`summary-grid`,children:[(0,H.jsx)(J,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,H.jsx)(J,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,H.jsx)(J,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,H.jsx)(J,{label:r(`common.time`),value:Be(l.Date)})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,H.jsx)(Xe,{value:i.MessageJSON})]}),(0,H.jsxs)(`div`,{className:`raw-grid`,children:[(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,H.jsx)(Xe,{value:i.DialogJSON})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,H.jsx)(Xe,{value:i.PrivateJSON})]})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`PTS`}),(0,H.jsx)(`th`,{children:r(`common.count`)}),(0,H.jsx)(`th`,{children:r(`common.type`)}),(0,H.jsx)(`th`,{children:r(`common.time`)})]})}),(0,H.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:e.PTS}),(0,H.jsx)(`td`,{children:e.PTSCount}),(0,H.jsx)(`td`,{children:e.Type}),(0,H.jsx)(`td`,{children:Be(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,H.jsx)(Je,{colSpan:4})]})]})})]}),(0,H.jsxs)(`section`,{className:`section-block`,children:[(0,H.jsx)(Ge,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:`ID`}),(0,H.jsx)(`th`,{children:r(`account.userID`)}),(0,H.jsx)(`th`,{children:`PTS`}),(0,H.jsx)(`th`,{children:r(`common.type`)}),(0,H.jsx)(`th`,{children:r(`common.status`)}),(0,H.jsx)(`th`,{children:r(`messages.attempts`)}),(0,H.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,H.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{children:e.ID}),(0,H.jsx)(`td`,{children:e.TargetUserID}),(0,H.jsx)(`td`,{children:e.PTS}),(0,H.jsx)(`td`,{children:e.EventType}),(0,H.jsx)(`td`,{children:e.Status}),(0,H.jsx)(`td`,{children:e.Attempts}),(0,H.jsx)(`td`,{children:ze(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,H.jsx)(Je,{colSpan:7})]})]})})]})]}),side:(0,H.jsxs)(`section`,{className:`action-dock`,children:[(0,H.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,H.jsx)($e,{label:r(`messages.deleteThis`),icon:(0,H.jsx)(he,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function ht({navigate:e}){let{t}=Ce(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,S]=(0,g.useState)(``),[C,w]=(0,g.useState)(`1`),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(``);async function k(e=!1){if(O(``),!n||!i){O(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&T?.rows.length){let e=T.rows[T.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{E(await x.messages(r))}catch(e){O(b(e))}}function A(e){r(e),s(``),l(``),E(null)}function j(e){a(e),s(``),l(``),E(null)}return(0,H.jsxs)(He,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[D&&(0,H.jsx)(Ke,{children:D}),(0,H.jsxs)(Ue,{children:[(0,H.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,H.jsx)(dt,{label:t(`messages.ownerUser`),value:n,onChange:A}),(0,H.jsx)(dt,{label:t(`messages.peerUser`),value:i,onChange:j})]}),(0,H.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),k(!1)},children:[(0,H.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,H.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,H.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,H.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,H.jsx)(B,{size:15}),` `,t(`messages.searchMessages`)]}),T?.rows.length?(0,H.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>k(!0),children:[(0,H.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,H.jsxs)(`div`,{className:`metric-row`,children:[(0,H.jsx)(q,{label:t(`messages.currentPage`),value:String(T?.rows.length??0)}),(0,H.jsx)(q,{label:t(`messages.deleted`),value:String((T?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,H.jsx)(q,{label:t(`messages.outgoing`),value:String((T?.rows??[]).filter(e=>e.Outgoing).length)}),(0,H.jsx)(q,{label:t(`messages.ownerPeer`),value:n&&i?`${Le(n)} / ${Le(i)}`:`-`})]}),(0,H.jsxs)(`div`,{className:`operation-row`,children:[(0,H.jsxs)(`div`,{className:`operation-box`,children:[(0,H.jsxs)(`div`,{className:`operation-title`,children:[(0,H.jsx)(he,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,H.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,H.jsxs)(`label`,{className:`checkline`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,H.jsx)($e,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:Ve(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,H.jsxs)(`div`,{className:`operation-box`,children:[(0,H.jsxs)(`div`,{className:`operation-title`,children:[(0,H.jsx)(ie,{size:15}),` `,t(`messages.clearHistory`)]}),(0,H.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,H.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,H.jsxs)(`label`,{className:`checkline`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,H.jsxs)(`label`,{className:`checkline`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,H.jsx)($e,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:W(y),max_batches:W(C),just_clear:_,revoke:m})})]})]}),(0,H.jsx)(`div`,{className:`table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:t(`common.messageId`)}),(0,H.jsx)(`th`,{children:t(`common.time`)}),(0,H.jsx)(`th`,{children:t(`common.sender`)}),(0,H.jsx)(`th`,{children:t(`messages.direction`)}),(0,H.jsx)(`th`,{children:`PTS`}),(0,H.jsx)(`th`,{children:t(`common.status`)}),(0,H.jsx)(`th`,{children:t(`messages.body`)}),(0,H.jsx)(`th`,{})]})}),(0,H.jsxs)(`tbody`,{children:[T?.rows.map(n=>(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,H.jsx)(`td`,{children:Be(n.Date)}),(0,H.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,H.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,H.jsx)(`td`,{children:n.PTS}),(0,H.jsx)(`td`,{children:n.Deleted?(0,H.jsx)(G,{tone:`danger`,children:t(`common.deleted`)}):(0,H.jsx)(G,{children:t(`common.survived`)})}),(0,H.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,H.jsx)(`td`,{children:(0,H.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,H.jsx)(I,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!T||T.rows.length===0)&&(0,H.jsx)(Je,{colSpan:8})]})]})})]})}var gt=c(o(((e,t)=>{typeof document<`u`&&typeof navigator<`u`&&(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.lottie=r())})(e,(function(){var n=``,r=!1,i=-999999,a=function(e){r=!!e},o=function(){return r},s=function(e){n=e},c=function(){return n};function l(e){return document.createElement(e)}function u(e,t){var n,r=e.length,i;for(n=0;n1?n[1]=1:n[1]<=0&&(n[1]=0),L(n[0],n[1],n[2])}function te(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),L(n[0],n[1],n[2])}function ne(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[0]+=t/360,n[0]>1?--n[0]:n[0]<0&&(n[0]+=1),L(n[0],n[1],n[2])}(function(){var e=[],t,n;for(t=0;t<256;t+=1)n=t.toString(16),e[t]=n.length===1?`0`+n:n;return function(t,n,r){return t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),`#`+e[t]+e[n]+e[r]}})();var re=function(e){g=!!e},ie=function(){return g},ae=function(e){_=e},oe=function(){return _},se=function(){return v},ce=function(e){E=e},le=function(){return E},ue=function(e){y=e};function z(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function de(e){"@babel/helpers - typeof";return de=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},de(e)}var B=function(){var e=1,t=[],n,r,i={onmessage:function(){},postMessage:function(e){n({data:e})}},a={postMessage:function(e){i.onmessage({data:e})}};function s(e){if(window.Worker&&window.Blob&&o()){var t=new Blob([`var _workerSelf = self; self.onmessage = `,e.toString()],{type:`text/javascript`}),r=URL.createObjectURL(t);return new Worker(r)}return n=e,i}function c(){r||(r=s(function(e){function t(){function e(t,n){var o,s,c=t.length,l,u,d,f;for(s=0;s=0;--t)if(e[t].ty===`sh`)if(e[t].ks.k.i)a(e[t].ks.k);else for(o=e[t].ks.k.length,r=0;rn[0]?!0:n[0]>e[0]?!1:e[1]>n[1]?!0:n[1]>e[1]?!1:e[2]>n[2]?!0:n[2]>e[2]?!1:null}var s=function(){var e=[4,4,14];function t(e){var t=e.t.d;e.t.d={k:[{s:t,t:0}]}}function n(e){var n,r=e.length;for(n=0;n=0;--n)if(e[n].ty===`sh`)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(a=e[n].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function a(t){var n=r(t,this.assetsPath,this.path),i=z(`image`);b?this.testImageLoaded(i):i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS(`http://www.w3.org/1999/xlink`,`href`,n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a}function o(t){var n=r(t,this.assetsPath,this.path),i=l(`img`);i.crossOrigin=`anonymous`,i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var a={img:i,assetData:t};return a}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return B.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function c(e,t){this.imagesLoadedCb=t;var n,r=e.length;for(n=0;nthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t=this.animationData.layers,n,r=t.length,i=e.layers,a,o=i.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(`enterFrame`),this.renderFrame(),this.trigger(`drawnFrame`)},H.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},H.prototype.play=function(e){e&&this.name!==e||this.isPaused===!0&&(this.isPaused=!1,this.trigger(`_play`),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger(`_active`)))},H.prototype.pause=function(e){e&&this.name!==e||this.isPaused===!1&&(this.isPaused=!0,this.trigger(`_pause`),this._idle=!0,this.trigger(`_idle`),this.audioController.pause())},H.prototype.togglePause=function(e){e&&this.name!==e||(this.isPaused===!0?this.play():this.pause())},H.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},H.prototype.getMarkerData=function(e){for(var t,n=0;n=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger(`loopComplete`))):this.setCurrentRawFrameValue(t):t<0?this.checkSegments(t%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger(`loopComplete`):this._completedLoop=!0):(n=!0,t=0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger(`complete`))}},H.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger(`segmentStart`)},H.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,n!==-1&&this.goToAndStop(n,!0)},H.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),ye(e[0])===`object`){var n,r=e.length;for(n=0;n=0;--n)t[n].animation.destroy(e)}function T(e,t,n){var r=[].concat([].slice.call(document.getElementsByClassName(`lottie`)),[].slice.call(document.getElementsByClassName(`bodymovin`))),i,a=r.length;for(i=0;i0?n=c:t=c;while(Math.abs(s)>a&&++l=i?g(e,d,t,n):f===0?d:h(e,a,a+c,t,n)}},e}(),xe=function(){function e(e){return e.concat(m(e.length))}return{double:e}}(),Se=function(){return function(e,t,n){var r=0,i=e,a=m(i),o={newElement:s,release:c};function s(){var e;return r?(--r,e=a[r]):e=t(),e}function c(e){r===i&&(a=xe.double(a),i*=2),n&&n(e),a[r]=e,r+=1}return o}}(),Ce=function(){function e(){return{addedLength:0,percents:p(`float32`,le()),lengths:p(`float32`,le())}}return Se(8,e)}(),we=function(){function e(){return{lengths:[],totalLength:0}}function t(e){var t,n=e.lengths.length;for(t=0;t-.001&&o<.001}function n(n,r,i,a,o,s,c,l,u){if(i===0&&s===0&&u===0)return t(n,r,a,o,c,l);var d=e.sqrt(e.pow(a-n,2)+e.pow(o-r,2)+e.pow(s-i,2)),f=e.sqrt(e.pow(c-n,2)+e.pow(l-r,2)+e.pow(u-i,2)),p=e.sqrt(e.pow(c-a,2)+e.pow(l-o,2)+e.pow(u-s,2)),m=d>f?d>p?d-f-p:p-f-d:p>f?p-f-d:f-d-p;return m>-1e-4&&m<1e-4}var r=function(){return function(e,t,n,r){var i=le(),a,o,s,c,l,u=0,d,f=[],p=[],m=Ce.newElement();for(s=n.length,a=0;ao?-1:1,l=!0;l;)if(r[a]<=o&&r[a+1]>o?(s=(o-r[a])/(r[a+1]-r[a]),l=!1):a+=c,a<0||a>=i-1){if(a===i-1)return n[a];l=!1}return n[a]+(n[a+1]-n[a])*s}function l(t,n,r,i,a,o){var s=c(a,o),l=1-s;return[e.round((l*l*l*t[0]+(s*l*l+l*s*l+l*l*s)*r[0]+(s*s*l+l*s*s+s*l*s)*i[0]+s*s*s*n[0])*1e3)/1e3,e.round((l*l*l*t[1]+(s*l*l+l*s*l+l*l*s)*r[1]+(s*s*l+l*s*s+s*l*s)*i[1]+s*s*s*n[1])*1e3)/1e3]}var u=p(`float32`,8);function d(t,n,r,i,a,o,s){a<0?a=0:a>1&&(a=1);var l=c(a,s);o=o>1?1:o;var d=c(o,s),f,p=t.length,m=1-l,h=1-d,g=m*m*m,_=l*m*m*3,v=l*l*m*3,y=l*l*l,b=m*m*h,x=l*m*h+m*l*h+m*m*d,S=l*l*h+m*l*d+l*m*d,C=l*l*d,w=m*h*h,T=l*h*h+m*d*h+m*h*d,E=l*d*h+m*d*d+l*h*d,D=l*d*d,O=h*h*h,k=d*h*h+h*d*h+h*h*d,A=d*d*h+h*d*d+d*h*d,j=d*d*d;for(f=0;f=l.t-n){c.h&&(c=l),i=0;break}if(l.t-n>e){i=a;break}a=v||e=v?x.points.length-1:0;for(f=x.points[S].point.length,d=0;d=T&&C=v)r[0]=b[0],r[1]=b[1],r[2]=b[2];else if(e<=y)r[0]=c.s[0],r[1]=c.s[1],r[2]=c.s[2];else{var j=Me(c.s),M=Me(b),N=(e-y)/(v-y);je(r,Ae(j,M,N))}else for(a=0;a=v?m=1:e1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-n)*f)/m,g=Math.sin(n*f)/m):(h=1-n,g=n),r[0]=h*i+g*c,r[1]=h*a+g*l,r[2]=h*o+g*u,r[3]=h*s+g*d,r}function je(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i),s=Math.asin(2*n*r+2*i*a),c=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i);e[0]=o/D,e[1]=s/D,e[2]=c/D}function Me(e){var t=e[0]*D,n=e[1]*D,r=e[2]*D,i=Math.cos(t/2),a=Math.cos(n/2),o=Math.cos(r/2),s=Math.sin(t/2),c=Math.sin(n/2),l=Math.sin(r/2),u=i*a*o-s*c*l;return[s*c*o+i*a*l,s*a*o+i*c*l,i*c*o-s*a*l,u]}function Ne(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==De&&(this._caching.lastFrame>=n&&e>=n||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function Pe(e){var t;if(this.propType===`unidimensional`)t=e*this.mult,Oe(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var n=0,r=this.v.length;n1e-5&&(this.v[n]=t,this._mdf=!0),n+=1}function Fe(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),n){case`v`:a=this.v;break;case`i`:a=this.i;break;case`o`:a=this.o;break;default:a=[];break}(!a[r]||a[r]&&!i)&&(a[r]=He.newElement()),a[r][0]=e,a[r][1]=t},Ue.prototype.setTripleAt=function(e,t,n,r,i,a,o,s){this.setXYAt(e,t,`v`,o,s),this.setXYAt(n,r,`o`,o,s),this.setXYAt(i,a,`i`,o,s)},Ue.prototype.reverse=function(){var e=new Ue;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var a=this._length-1,o=this._length,s;for(s=i;s=p[p.length-1].t-this.offsetTime)i=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],o=!0;else{for(var m=r,h=p.length-1,g=!0,_,v,y;g&&(_=p[m],v=p[m+1],!(v.t-this.offsetTime>e));)m=v.t-this.offsetTime)d=1;else if(e<_.t-this.offsetTime)d=0;else{var b;y.__fnct?b=y.__fnct:(b=be.getBezierEasing(_.o.x,_.o.y,_.i.x,_.i.y).get,y.__fnct=b),d=b((e-(_.t-this.offsetTime))/(v.t-this.offsetTime-(_.t-this.offsetTime)))}a=v.s?v.s[0]:_.e[0]}i=_.s[0]}for(l=t._length,u=i.i[0].length,n.lastIndex=r,s=0;sr&&t>r)||(this._caching.lastIndex=i0||e>-1e-6&&e<0?r(e*t)/t:e}function P(){var e=this.props,t=N(e[0]),n=N(e[1]),r=N(e[4]),i=N(e[5]),a=N(e[12]),o=N(e[13]);return`matrix(`+t+`,`+n+`,`+r+`,`+i+`,`+a+`,`+o+`)`}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=c,this.skew=u,this.skewFromAxis=d,this.shear=l,this.scale=f,this.setTransform=m,this.translate=h,this.transform=g,this.multiply=_,this.applyToPoint=S,this.applyToX=C,this.applyToY=w,this.applyToZ=T,this.applyToPointArray=A,this.applyToTriplePoints=k,this.applyToPointStringified=j,this.toCSS=M,this.to2dCSS=P,this.clone=b,this.cloneFromProps=x,this.equals=y,this.inversePoints=O,this.inversePoint=D,this.getInverseMatrix=E,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=p(`float32`,16),this.reset()}}();function q(e){"@babel/helpers - typeof";return q=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},q(e)}var J={},qe=`__[STANDALONE]__`,Je=`__[ANIMATIONDATA]__`,Ye=``;function Xe(e){s(e)}function Ze(){qe===!0?U.searchAnimations(Je,qe,Ye):U.searchAnimations()}function Qe(e){re(e)}function $e(e){ue(e)}function et(e){return qe===!0&&(e.animationData=JSON.parse(Je)),U.loadAnimation(e)}function tt(e){if(typeof e==`string`)switch(e){case`high`:ce(200);break;default:case`medium`:ce(50);break;case`low`:ce(10);break}else!isNaN(e)&&e>1&&ce(e)}function nt(){return typeof navigator<`u`}function rt(e,t){e===`expressions`&&ae(t)}function it(e){switch(e){case`propertyFactory`:return W;case`shapePropertyFactory`:return G;case`matrix`:return K;default:return null}}J.play=U.play,J.pause=U.pause,J.setLocationHref=Xe,J.togglePause=U.togglePause,J.setSpeed=U.setSpeed,J.setDirection=U.setDirection,J.stop=U.stop,J.searchAnimations=Ze,J.registerAnimation=U.registerAnimation,J.loadAnimation=et,J.setSubframeRendering=Qe,J.resize=U.resize,J.goToAndStop=U.goToAndStop,J.destroy=U.destroy,J.setQuality=tt,J.inBrowser=nt,J.installPlugin=rt,J.freeze=U.freeze,J.unfreeze=U.unfreeze,J.setVolume=U.setVolume,J.mute=U.mute,J.unmute=U.unmute,J.getRegisteredAnimations=U.getRegisteredAnimations,J.useWebWorker=a,J.setIDPrefix=$e,J.__getFactory=it,J.version=`5.13.0`;function at(){document.readyState===`complete`&&(clearInterval(ut),Ze())}function ot(e){for(var t=st.split(`&`),n=0;n=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o=[],s,c=a.length,l;for(s=0;sr+n)){var u=l.s*i<=r?0:(l.s*i-r)/n,d=l.e*i>=r+n?1:(l.e*i-r)/n;o.push([u,d])}return o.length||o.push([0,0]),o},pt.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1+r:this.s.v<0?0+r:this.s.v+r,n=this.e.v>1?1+r:this.e.v<0?0+r:this.e.v+r,t>n){var i=t;t=n,n=i}t=Math.round(t*1e4)*1e-4,n=Math.round(n*1e4)*1e-4,this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,o,s=this.shapes.length,c,l,u,d,f,p=0;if(n===t)for(o=0;o=0;--o)if(h=this.shapes[o],h.shape._mdf){for(g=h.localShapeCollection,g.releaseShapes(),this.m===2&&s>1?(b=this.calculateShapeEdges(t,n,h.totalShapeLength,y,p),y+=h.totalShapeLength):b=[[_,v]],l=b.length,c=0;c=1?m.push({s:h.totalShapeLength*(_-1),e:h.totalShapeLength*(v-1)}):(m.push({s:h.totalShapeLength*_,e:h.totalShapeLength}),m.push({s:0,e:h.totalShapeLength*(v-1)}));var x=this.addShapes(h,m[0]);if(m[0].s!==m[0].e){if(m.length>1)if(h.shape.paths.shapes[h.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,g),x=this.addShapes(h,m[1],S)}else this.addPaths(x,g),x=this.addShapes(h,m[1]);this.addPaths(x,g)}}h.shape.paths=g}}else if(this._mdf)for(o=0;ot.e){n.c=!1;break}else t.s<=l&&t.e>=l+u.addedLength?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[s],i[a].v[s],n,d,g),g=!1):(p=Ee.getNewSegment(i[a].v[s-1],i[a].v[s],i[a].o[s-1],i[a].i[s],(t.s-l)/u.addedLength,(t.e-l)/u.addedLength,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1),l+=u.addedLength,d+=1;if(i[a].c&&f.length){if(u=f[s-1],l<=t.e){var _=f[s-1].addedLength;t.s<=l&&t.e>=l+_?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[0],i[a].v[0],n,d,g),g=!1):(p=Ee.getNewSegment(i[a].v[s-1],i[a].v[0],i[a].o[s-1],i[a].i[0],(t.s-l)/_,(t.e-l)/_,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1)}else n.c=!1;l+=u.addedLength,d+=1}if(n._length&&(n.setXYAt(n.v[h][0],n.v[h][1],`i`,h),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],`o`,n._length-1)),l>t.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(r[0]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),r[1]=o.getValueAtTime((o.keyframes[0].t+.01)/n,0),i[0]=a.getValueAtTime(a.keyframes[0].t/n,0),i[1]=o.getValueAtTime(o.keyframes[0].t/n,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(r[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),r[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/n,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/n,0)):(r=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/n,o.offsetTime))}else i=e,r=i;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function r(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function i(){}function a(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0}function o(e,t,n){if(this.elem=e,this.frameId=-1,this.propType=`transform`,this.data=t,this.v=new K,this.pre=new K,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=W.getProp(e,t.p.x,0,0,this),this.py=W.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=W.getProp(e,t.p.z,0,0,this))):this.p=W.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=W.getProp(e,t.rx,0,D,this),this.ry=W.getProp(e,t.ry,0,D,this),this.rz=W.getProp(e,t.rz,0,D,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r0;)--n,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},gt.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(f):Math.ceil(f),h=this.pMatrix.props,g=this.rMatrix.props,_=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v=0;if(f>0){for(;vm;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),--v;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),v-=p)}r=this.data.m===1?0:this._currentCopies-1,i=this.data.m===1?1:-1,a=this._currentCopies;for(var y,b;a;){if(t=this.elemsData[r].it,n=t[t.length-1].transform.mProps.v.props,b=n.length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),v!==0){for((r!==0&&i===1||r!==this._currentCopies-1&&i===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15]),this.matrix.transform(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]),y=0;y0&&r<1?[t]:[]:[t-r,t+r].filter(function(e){return e>0&&e<1})},Tt.prototype.split=function(e){if(e<=0)return[wt(this.points[0]),this];if(e>=1)return[this,wt(this.points[this.points.length-1])];var t=xt(this.points[0],this.points[1],e),n=xt(this.points[1],this.points[2],e),r=xt(this.points[2],this.points[3],e),i=xt(t,n,e),a=xt(n,r,e),o=xt(i,a,e);return[new Tt(this.points[0],t,i,o,!0),new Tt(o,a,r,this.points[3],!0)]};function Et(e,t){var n=e.points[0][t],r=e.points[e.points.length-1][t];if(n>r){var i=r;r=n,n=i}for(var a=St(3*e.a[t],2*e.b[t],e.c[t]),o=0;o0&&a[o]<1){var s=e.point(a[o])[t];sr&&(r=s)}return{min:n,max:r}}Tt.prototype.bounds=function(){return{x:Et(this,0),y:Et(this,1)}},Tt.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}};function Dt(e,t,n){var r=e.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:e,t:(t+n)/2,t1:t,t2:n}}function Ot(e){var t=e.bez.split(.5);return[Dt(t[0],e.t1,e.t),Dt(t[1],e.t,e.t2)]}function kt(e,t){return Math.abs(e.cx-t.cx)*2=a||e.width<=r&&e.height<=r&&t.width<=r&&t.height<=r){i.push([e.t,t.t]);return}var o=Ot(e),s=Ot(t);At(o[0],s[0],n+1,r,i,a),At(o[0],s[1],n+1,r,i,a),At(o[1],s[0],n+1,r,i,a),At(o[1],s[1],n+1,r,i,a)}}Tt.prototype.intersections=function(e,t,n){t===void 0&&(t=2),n===void 0&&(n=7);var r=[];return At(Dt(this,0,1),Dt(e,0,1),0,t,r,n),r},Tt.shapeSegment=function(e,t){var n=(t+1)%e.length();return new Tt(e.v[t],e.o[t],e.i[n],e.v[n],!0)},Tt.shapeSegmentInverted=function(e,t){var n=(t+1)%e.length();return new Tt(e.v[n],e.i[n],e.o[t],e.v[t],!0)};function jt(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Mt(e,t,n,r){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],s=[r[0],r[1],1],c=jt(jt(i,a),jt(o,s));return yt(c[2])?null:[c[0]/c[2],c[1]/c[2]]}function Y(e,t,n){return[e[0]+Math.cos(t)*n,e[1]-Math.sin(t)*n]}function Nt(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function Pt(e,t){return vt(e[0],t[0])&&vt(e[1],t[1])}function Ft(){}u([ft],Ft),Ft.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=W.getProp(e,t.s,0,null,this),this.frequency=W.getProp(e,t.r,0,null,this),this.pointsType=W.getProp(e,t.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function It(e,t,n,r,i,a,o){var s=n-Math.PI/2,c=n+Math.PI/2,l=t[0]+Math.cos(n)*r*i,u=t[1]-Math.sin(n)*r*i;e.setTripleAt(l,u,l+Math.cos(s)*a,u-Math.sin(s)*a,l+Math.cos(c)*o,u-Math.sin(c)*o,e.length())}function Lt(e,t){var n=[t[0]-e[0],t[1]-e[1]],r=-Math.PI*.5;return[Math.cos(r)*n[0]-Math.sin(r)*n[1],Math.sin(r)*n[0]+Math.cos(r)*n[1]]}function Rt(e,t){var n=t===0?e.length()-1:t-1,r=(t+1)%e.length(),i=e.v[n],a=e.v[r],o=Lt(i,a);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function zt(e,t,n,r,i,a,o){var s=Rt(t,n),c=t.v[n%t._length],l=t.v[n===0?t._length-1:n-1],u=t.v[(n+1)%t._length],d=a===2?Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2):0,f=a===2?Math.sqrt((c[0]-u[0])**2+(c[1]-u[1])**2):0;It(e,t.v[n%t._length],s,o,r,f/((i+1)*2),d/((i+1)*2),a)}function Bt(e,t,n,r,i,a){for(var o=0;o1&&t.length>1&&(i=Wt(e[0],t[t.length-1]),i)?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[n,r]}function Kt(e){for(var t,n=1;n1&&(t=Gt(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function qt(e,t){var n=e.inflectionPoints(),r,i,a,o;if(n.length===0)return[Ht(e,t)];if(n.length===1||vt(n[1],1))return a=e.split(n[0]),r=a[0],i=a[1],[Ht(r,t),Ht(i,t)];a=e.split(n[0]),r=a[0];var s=(n[1]-n[0])/(1-n[0]);return a=a[1].split(s),o=a[0],i=a[1],[Ht(r,t),Ht(o,t),Ht(i,t)]}function Jt(){}u([ft],Jt),Jt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=W.getProp(e,t.a,0,null,this),this.miterLimit=W.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=this.amount.effectsSequence.length!==0},Jt.prototype.processPath=function(e,t,n,r){var i=We.newElement();i.c=e.c;var a=e.length();e.c||--a;var o,s,c,l=[];for(o=0;o=0;--o)c=Tt.shapeSegmentInverted(e,o),l.push(qt(c,t));l=Kt(l);var u=null,d=null;for(o=0;o0&&(o=!1),o){var u=l(`style`);u.setAttribute(`f-forigin`,n[r].fOrigin),u.setAttribute(`f-origin`,n[r].origin),u.setAttribute(`f-family`,n[r].fFamily),u.type=`text/css`,u.innerText=`@font-face {font-family: `+n[r].fFamily+`; font-style: normal; src: url('`+n[r].fPath+`');}`,t.appendChild(u)}}else if(n[r].fOrigin===`g`||n[r].origin===1){for(s=document.querySelectorAll(`link[f-forigin="g"], link[f-origin="1"]`),c=0;c=55296&&n<=56319){var r=e.charCodeAt(1);r>=56320&&r<=57343&&(t=(n-55296)*1024+r-56320+65536)}return t}function S(e,t){var n=e.toString(16)+t.toString(16);return d.indexOf(n)!==-1}function C(e){return e===s}function w(e){return e===o}function T(e){var t=x(e);return t>=c&&t<=u}function E(e){return T(e.substr(0,2))&&T(e.substr(2,2))}function D(e){return t.indexOf(e)!==-1}function O(e,t){var o=x(e.substr(t,2));if(o!==n)return!1;var s=0;for(t+=2;s<5;){if(o=x(e.substr(t,2)),oa)return!1;s+=1,t+=2}return x(e.substr(t,2))===r}function k(){this.isLoaded=!0}var A=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return A.isModifier=S,A.isZeroWidthJoiner=C,A.isFlagEmoji=E,A.isRegionalCode=T,A.isCombinedCharacter=D,A.isRegionalFlag=O,A.isVariationSelector=w,A.BLACK_FLAG_CODE_POINT=n,A.prototype={addChars:_,addFonts:g,getCharData:v,getFontByName:b,measureText:y,checkLoadedFonts:m,setIsLoaded:k},A}();function Zt(e){this.animationData=e}Zt.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e};function Qt(e){return new Zt(e)}function $t(){}$t.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},hn.prototype.show=function(){},hn.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},hn.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},hn.prototype.resume=function(){this._canPlay=!0},hn.prototype.setRate=function(e){this.audio.rate(e)},hn.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},hn.prototype.getBaseElement=function(){return null},hn.prototype.destroy=function(){},hn.prototype.sourceRectAtTime=function(){},hn.prototype.initExpressions=function(){};function gn(){}gn.prototype.checkLayers=function(e){var t,n=this.layers.length,r;for(this.completeLayers=!0,t=n-1;t>=0;--t)this.elements[t]||(r=this.layers[t],r.ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t)),this.completeLayers=this.elements[t]?this.completeLayers:!1;this.checkPendingElements()},gn.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},gn.prototype.createCamera=function(){throw Error(`You're using a 3d camera. Try the html renderer.`)},gn.prototype.createAudio=function(e){return new hn(e,this.globalData,this)},gn.prototype.createFootage=function(e){return new mn(e,this.globalData,this)},gn.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e0&&(this.maskElement.setAttribute(`id`,p),this.element.maskedElement.setAttribute(b,`url(`+c()+`#`+p+`)`),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}yn.prototype.getMaskProperty=function(e){return this.viewData[e].prop},yn.prototype.renderFrame=function(e){var t=this.element.finalTransform.mat,n,r=this.masksProperties.length;for(n=0;n1&&(r+=` C`+t.o[i-1][0]+`,`+t.o[i-1][1]+` `+t.i[0][0]+`,`+t.i[0][1]+` `+t.v[0][0]+`,`+t.v[0][1]),n.lastPath!==r){var o=``;n.elem&&(t.c&&(o=e.inv?this.solidPath+r:r),n.elem.setAttribute(`d`,o)),n.lastPath=r}},yn.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var bn=function(){var e={};e.createFilter=t,e.createAlphaToLuminanceFilter=n;function t(e,t){var n=z(`filter`);return n.setAttribute(`id`,e),t!==!0&&(n.setAttribute(`filterUnits`,`objectBoundingBox`),n.setAttribute(`x`,`0%`),n.setAttribute(`y`,`0%`),n.setAttribute(`width`,`100%`),n.setAttribute(`height`,`100%`)),n}function n(){var e=z(`feColorMatrix`);return e.setAttribute(`type`,`matrix`),e.setAttribute(`color-interpolation-filters`,`sRGB`),e.setAttribute(`values`,`0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1`),e}return e}(),xn=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<`u`};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),Sn={},Cn=`filter_result_`;function wn(e){var t,n=`SourceGraphic`,r=e.data.ef?e.data.ef.length:0,i=I(),a=bn.createFilter(i,!0),o=0;this.filters=[];var s;for(t=0;t=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);--e);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n.01)return!1;n+=1}return!0},zn.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)c=r.transformers[g].mProps._mdf||c,--h,--g;if(c)for(h=f-r.styles[u].lvl,g=r.transformers.length-1;h>0;)m.multiply(r.transformers[g].mProps.v),--h,--g}else m=e;if(p=r.sh.paths,o=p._length,c){for(s=``,a=0;a=1?v=.99:v<=-1&&(v=-.99);var y=g*v,b=Math.cos(_+t.a.v)*y+a[0],x=Math.sin(_+t.a.v)*y+a[1];r.setAttribute(`fx`,b),r.setAttribute(`fy`,x),i&&!t.g._collapsable&&(t.of.setAttribute(`fx`,b),t.of.setAttribute(`fy`,x))}}}function u(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute(`stroke-dasharray`,i.dashStr),r.pElem.setAttribute(`stroke-dashoffset`,i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute(`stroke`,`rgb(`+C(t.c.v[0])+`,`+C(t.c.v[1])+`,`+C(t.c.v[2])+`)`),(t.o._mdf||n)&&r.pElem.setAttribute(`stroke-opacity`,t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute(`stroke-width`,t.w.v),r.msElem&&r.msElem.setAttribute(`stroke-width`,t.w.v))}return n}();function X(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}u([fn,vn,Tn,An,En,pn,Dn],X),X.prototype.initSecondaryElement=function(){},X.prototype.identityMatrix=new K,X.prototype.buildExpressionInterface=function(){},X.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},X.prototype.filterUniqueShapes=function(){var e,t=this.shapes.length,n,r,i=this.stylesList.length,a,o=[],s=!1;for(r=0;r1&&s&&this.setShapesAsAnimated(o)}},X.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;--c){if(g=this.searchProcessedElement(e[c]),g?t[c]=n[g-1]:e[c]._render=o,e[c].ty===`fl`||e[c].ty===`st`||e[c].ty===`gf`||e[c].ty===`gs`||e[c].ty===`no`)g?t[c].style.closed=e[c].hd:t[c]=this.createStyleElement(e[c],i),e[c]._render&&t[c].style.pElem.parentNode!==r&&r.appendChild(t[c].style.pElem),f.push(t[c].style);else if(e[c].ty===`gr`){if(!g)t[c]=this.createGroupElement(e[c]);else for(d=t[c].it.length,u=0;u1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},qn.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},qn.prototype.getValue=function(e){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!e)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var r,i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(r=0;rt);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},qn.prototype.buildFinalText=function(e){for(var t=[],n=0,r=e.length,i,a,o=!1,s=!1,c=``;n=55296&&i<=56319?Xt.isRegionalFlag(e,n)?c=e.substr(n,14):(a=e.charCodeAt(n+1),a>=56320&&a<=57343&&(Xt.isModifier(i,a)?(c=e.substr(n,2),o=!0):c=Xt.isFlagEmoji(e.substr(n,4))?e.substr(n,4):e.substr(n,2))):i>56319?(a=e.charCodeAt(n+1),Xt.isVariationSelector(i)&&(o=!0)):Xt.isZeroWidthJoiner(i)&&(o=!0,s=!0),o?(t[t.length-1]+=c,o=!1):t.push(c),n+=c.length;return t},qn.prototype.completeTextData=function(e){e.__complete=!0;var t=this.elem.globalData.fontManager,n=this.data,r=[],i,a,o,s=0,c,l=n.m.g,u=0,d=0,f=0,p=[],m=0,h=0,g,_,v=t.getFontByName(e.f),y,b=0,x=Yt(v);e.fWeight=x.weight,e.fStyle=x.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),a=e.finalText.length,e.finalLineHeight=e.lh;var S=e.tr/1e3*e.finalSize,C;if(e.sz)for(var w=!0,T=e.sz[0],E=e.sz[1],D,O;w;){O=this.buildFinalText(e.t),D=0,m=0,a=O.length,S=e.tr/1e3*e.finalSize;var k=-1;for(i=0;iT&&O[i]!==` `?(k===-1?a+=1:i=k,D+=e.finalLineHeight||e.finalSize*1.2,O.splice(i,+(k===i),`\r`),k=-1,m=0):(m+=b,m+=S);D+=v.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Eh?m:h,m=-2*S,c=``,o=!0,f+=1):c=j,t.chars?(y=t.getCharData(j,v.fStyle,t.getFontByName(e.f).fFamily),b=o?0:y.w*e.finalSize/100):b=t.measureText(c,e.f,e.finalSize),j===` `?A+=b+S:(m+=b+S+A,A=0),r.push({l:b,an:b,add:u,n:o,anIndexes:[],val:c,line:f,animatorJustifyOffset:0}),l==2){if(u+=b,c===``||c===` `||i===a-1){for((c===``||c===` `)&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;s+=1,u=0}}else if(l==3){if(u+=b,c===``||i===a-1){for(c===``&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;u=0,s+=1}}else r[s].ind=s,r[s].extra=0,s+=1;if(e.l=r,h=m>h?m:h,p.push(m),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=h,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=p;var M=n.a,N,P;_=M.length;var F,I,L=[];for(g=0;g<_;g+=1){for(N=M[g],N.a.sc&&(e.strokeColorAnim=!0),N.a.sw&&(e.strokeWidthAnim=!0),(N.a.fc||N.a.fh||N.a.fs||N.a.fb)&&(e.fillColorAnim=!0),I=0,F=N.s.b,i=0;i0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var c=be.getBezierEasing(i,a,o,s).get,l=0,u=this.finalS,d=this.finalE,f=this.data.sh;if(f===2)l=d===u?+(r>=d):e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===3)l=d===u?r>=d?0:1:1-e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===4)d===u?l=0:(l=e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l<.5?l*=2:l=1-2*(l-.5)),l=c(l);else if(f===5){if(d===u)l=0;else{var p=d-u;r=t(e(0,r+.5-u),d-u);var m=-p/2+r,h=p/2;l=Math.sqrt(1-m*m/(h*h))}l=c(l)}else f===6?(d===u?l=0:(r=t(e(0,r+.5-u),d-u),l=(1+Math.cos(Math.PI+Math.PI*2*r/(d-u)))/2),l=c(l)):(r>=n(u)&&(l=r-u<0?e(0,t(t(d,1)-(u-r),1)):e(0,t(d-r,1))),l=c(l));if(this.sm.v!==100){var g=this.sm.v*.01;g===0&&(g=1e-8);var _=.5-g*.5;l<_?l=0:(l=(l-_)/g,l>1&&(l=1))}return l*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&this.data.r===2&&(this.e.v=this._currentTextLength);var t=this.data.r===2?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var a=r;r=i,i=a}this.finalS=r,this.finalE=i}},u([Ve],r);function i(e,t,n){return new r(e,t,n)}return{getTextSelectorProp:i}}();function Yn(e,t,n){var r={propType:!1},i=W.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,D,n):r,rx:a.rx?i(e,a.rx,0,D,n):r,ry:a.ry?i(e,a.ry,0,D,n):r,sk:a.sk?i(e,a.sk,0,D,n):r,sa:a.sa?i(e,a.sa,0,D,n):r,s:a.s?i(e,a.s,1,.01,n):r,a:a.a?i(e,a.a,1,0,n):r,o:a.o?i(e,a.o,0,.01,n):r,p:a.p?i(e,a.p,1,0,n):r,sw:a.sw?i(e,a.sw,0,0,n):r,sc:a.sc?i(e,a.sc,1,0,n):r,fc:a.fc?i(e,a.fc,1,0,n):r,fh:a.fh?i(e,a.fh,0,0,n):r,fs:a.fs?i(e,a.fs,0,.01,n):r,fb:a.fb?i(e,a.fb,0,.01,n):r,t:a.t?i(e,a.t,0,0,n):r},this.s=Jn.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function Xn(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=m(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}Xn.prototype.searchProperties=function(){var e,t=this._textData.a.length,n,r=W.getProp;for(e=0;e=m+xe||!x?(T=(m+xe-g)/h.partialLength,ie=b.point[0]+(h.point[0]-b.point[0])*T,ae=b.point[1]+(h.point[1]-b.point[1])*T,a.translate(-n[0]*f[u].an*.005,-(n[1]*A)*.01),_=!1):x&&(g+=h.partialLength,v+=1,v>=x.length&&(v=0,y+=1,S[y]?x=S[y].points:D.v.c?(v=0,y=0,x=S[y].points):(g-=h.partialLength,x=null)),x&&(b=h,h=x[v],C=h.partialLength));re=f[u].an/2-f[u].add,a.translate(-re,0,0)}else re=f[u].an/2-f[u].add,a.translate(-re,0,0),a.translate(-n[0]*f[u].an*.005,-n[1]*A*.01,0);for(P=0;Pe?this.textSpans[e].span:z(s?`g`:`text`),b<=e){if(c.setAttribute(`stroke-linecap`,`butt`),c.setAttribute(`stroke-linejoin`,`round`),c.setAttribute(`stroke-miterlimit`,`4`),this.textSpans[e].span=c,s){var S=z(`g`);c.appendChild(S),this.textSpans[e].childSpan=S}this.textSpans[e].span=c,this.layerElement.appendChild(c)}c.style.display=`inherit`}if(l.reset(),d&&(o[e].n&&(f=-g,p+=n.yOffset,p+=+!!h,h=!1),this.applyTextPropertiesToMatrix(n,l,o[e].line,f,p),f+=o[e].l||0,f+=g),s){x=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily);var C;if(x.t===1)C=new ir(x.data,this.globalData,this);else{var w=Qn;x.data&&x.data.shapes&&(w=this.buildShapeData(x.data,n.finalSize)),C=new X(w,this.globalData,this)}if(this.textSpans[e].glyph){var T=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(T.layerElement),T.destroy()}this.textSpans[e].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[e].childSpan.appendChild(C.layerElement),x.t===1&&this.textSpans[e].childSpan.setAttribute(`transform`,`scale(`+n.finalSize/100+`,`+n.finalSize/100+`)`)}else d&&c.setAttribute(`transform`,`translate(`+l.props[12]+`,`+l.props[13]+`)`),c.textContent=o[e].val,c.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`)}d&&c&&c.setAttribute(`d`,u)}for(;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;--n)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},rr.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=0;--n)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t=1){this.buffers=[];var e=this.globalData.canvasContext,t=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&lr.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new dr(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=en(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new fr(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(_n.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext(`2d`);this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext(`2d`);if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById(`tp`in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=lr.getLumaCanvas(this.canvasContext.canvas);n.getContext(`2d`).drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=mr[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation=`destination-over`,this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation=`source-over`}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&=!1}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new K},pr.prototype.hide=pr.prototype.hideElement,pr.prototype.show=pr.prototype.showElement;function hr(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i=4;t.ty===`rc`?i=5:t.ty===`el`?i=6:t.ty===`sr`&&(i=7),this.sh=G.getShapeProp(e,t,i,e);var a,o=n.length,s;for(a=0;a=0;--a){if(d=this.searchProcessedElement(e[a]),d?t[a]=n[d-1]:e[a]._shouldRender=r,e[a].ty===`fl`||e[a].ty===`st`||e[a].ty===`gf`||e[a].ty===`gs`)d?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],m),l.push(t[a].style);else if(e[a].ty===`gr`){if(!d)t[a]=this.createGroupElement(e[a]);else for(c=t[a].it.length,s=0;s=0;--i)t[i].ty===`tr`?(o=n[i].transform,this.renderShapeTransform(e,o)):t[i].ty===`sh`||t[i].ty===`el`||t[i].ty===`rc`||t[i].ty===`sr`?this.renderPath(t[i],n[i]):t[i].ty===`fl`?this.renderFill(t[i],n[i],o):t[i].ty===`st`?this.renderStroke(t[i],n[i],o):t[i].ty===`gf`||t[i].ty===`gs`?this.renderGradientFill(t[i],n[i],o):t[i].ty===`gr`?this.renderShape(o,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},gr.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n=e.trNodes,r=t.paths,i,a,o,s=r._length;n.length=0;var c=e.transforms.finalTransform;for(o=0;o=1?u=.99:u<=-1&&(u=-.99);var d=c*u,f=Math.cos(l+t.a.v)*d+o[0],p=Math.sin(l+t.a.v)*d+o[1];i=a.createRadialGradient(f,p,0,o[0],o[1],c)}var m,h=e.g.p,g=t.g.c,_=1;for(m=0;ma&&c===`xMidYMid slice`||ii&&s===`meet`||ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:l===`xMax`&&(ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u===`YMid`&&(a>i&&s===`meet`||ai&&s===`meet`||a=0;--e)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},Z.prototype.renderFrame=function(e,t){if(!(this.renderedFrame===e&&this.renderConfig.clearCanvas===!0&&!t||this.destroyed||e===-1)){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n,r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},Z.prototype.buildItem=function(e){var t=this.elements;if(!(t[e]||this.layers[e].ty===99)){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},Z.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},Z.prototype.hide=function(){this.animationItem.container.style.display=`none`},Z.prototype.show=function(){this.animationItem.container.style.display=`block`};function br(){this.opacity=-1,this.transform=p(`float32`,16),this.fillStyle=``,this.strokeStyle=``,this.lineWidth=``,this.lineCap=``,this.lineJoin=``,this.miterLimit=``,this.id=Math.random()}function xr(){this.stack=[],this.cArrPos=0,this.cTr=new K;var e,t=15;for(e=0;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Sr.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;--e)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},Sr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)};function Cr(e,t){this.animationItem=e,this.renderConfig={clearCanvas:t&&t.clearCanvas!==void 0?t.clearCanvas:!0,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||`xMidYMid meet`,imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||`xMidYMid slice`,contentVisibility:t&&t.contentVisibility||`visible`,className:t&&t.className||``,id:t&&t.id||``,runExpressions:!t||t.runExpressions===void 0||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new xr,this.elements=[],this.pendingElements=[],this.transformMat=new K,this.completeLayers=!1,this.rendererType=`canvas`,this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}return u([Z],Cr),Cr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)},ge(`canvas`,Cr),dt.registerModifier(`tm`,pt),dt.registerModifier(`pb`,mt),dt.registerModifier(`rp`,gt),dt.registerModifier(`rd`,_t),dt.registerModifier(`zz`,Ft),dt.registerModifier(`op`,Jt),J}))}))(),1),_t=0,vt=e=>`${e}-${++_t}`,yt=[{center:`#6f5bea`,edge:`#34278f`,pattern:`#a89df5`,text:`#ffffff`},{center:`#32a86b`,edge:`#17613e`,pattern:`#8ee0b3`,text:`#ffffff`},{center:`#df8d2f`,edge:`#8c421e`,pattern:`#ffd08a`,text:`#ffffff`},{center:`#d95878`,edge:`#7b2944`,pattern:`#f5a1b6`,text:`#ffffff`}];function bt(e){if(!e.length)return e;let t=Math.floor(1e3/e.length),n=1e3%e.length;return e.map((e,r)=>({...e,rarity:String(t+ +(r({key:vt(e),name:``,rarity:`1`,sortOrder:String(t),file:null,animation:null,fileError:``});function St(e){let t=e.reduce((e,t)=>{let n=Number(t.backdropID);return Number.isInteger(n)?Math.max(e,n):e},0)+1,n=yt[e.length%yt.length];return{key:vt(`backdrop`),name:``,backdropID:String(t),rarity:`1`,sortOrder:String(e.length),...n}}var Ct=e=>bt([xt(e,0),xt(e,1)]),wt=()=>{let e=St([]);return bt([e,St([e])])};function Tt({data:e,compact:t=!1}){let n=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!n.current)return;let t=gt.default.loadAnimation({container:n.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)});return()=>t.destroy()},[e]),(0,H.jsx)(`div`,{className:`collectible-animation ${t?`compact`:``}`,ref:n})}function Et({giftID:e,attribute:t}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let n=!1;return a(!1),x.giftCollectibleAnimation(e,t.kind,t.id).then(e=>{n||r(e)}).catch(()=>{n||a(!0)}),()=>{n=!0}},[e,t.id,t.kind]),i?(0,H.jsx)(`div`,{className:`collectible-animation compact failed`,children:`!`}):n?(0,H.jsx)(Tt,{data:n,compact:!0}):(0,H.jsx)(`div`,{className:`collectible-animation compact loading`,children:(0,H.jsx)(A,{className:`spin`,size:15})})}async function Dt(e){let t=new Uint8Array(await e.arrayBuffer()),n=t;if(t.length>=2&&t[0]===31&&t[1]===139){if(!(`DecompressionStream`in window))throw Error(`This browser cannot preview TGS files`);let e=new Blob([t]).stream().pipeThrough(new DecompressionStream(`gzip`));n=new Uint8Array(await new Response(e).arrayBuffer())}let r=JSON.parse(new TextDecoder().decode(n));if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`Invalid Lottie JSON`);return r}var Ot=e=>Number.parseInt(e.replace(`#`,``),16),kt=e=>e.rarity_kind===`permille`?`${e.rarity_permille}‰`:e.rarity_kind;function At({gift:e,onClose:t,onPublished:n}){let{t:r}=Ce(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!0),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(`100`),[_,v]=(0,g.useState)(`1000`),[y,S]=(0,g.useState)(`gift-${e.GiftID}`),[C,w]=(0,g.useState)(``),[T,E]=(0,g.useState)(()=>Ct(`model`)),[D,O]=(0,g.useState)(()=>Ct(`pattern`)),[M,N]=(0,g.useState)(wt);(0,g.useEffect)(()=>{let t=!1;return x.giftCollectibles(e.GiftID).then(n=>{t||(a(n),n.found&&(h(String(n.upgrade_stars??100)),v(String(n.supply_total??1e3)),S(n.slug_prefix??`gift-${e.GiftID}`)))}).catch(e=>d(b(e))).finally(()=>{t||s(!1)}),()=>{t=!0}},[e.GiftID]);let P=(0,g.useMemo)(()=>({models:T.reduce((e,t)=>e+Number(t.rarity||0),0),patterns:D.reduce((e,t)=>e+Number(t.rarity||0),0),backdrops:M.reduce((e,t)=>e+Number(t.rarity||0),0)}),[T,D,M]),F=()=>p(null),I=(e,t,n)=>{(e===`models`?E:O)(e=>e.map(e=>e.key===t?{...e,...n}:e)),F()};async function L(e,t,n){if(I(e,t.key,{file:n,animation:null,fileError:``}),n)try{let r=await Dt(n);I(e,t.key,{animation:r,fileError:``})}catch(n){I(e,t.key,{animation:null,fileError:b(n)})}}function ee(e,t=``){if(!C.trim())throw Error(r(`action.reasonRequired`));if(T.length<2||D.length<2||M.length<2)throw Error(r(`collectibles.minimumAttributes`));let n=M.map(e=>Number(e.backdropID));if(new Set(n).size!==n.length)throw Error(r(`collectibles.duplicateBackdropID`));for(let e of[...T,...D])if(!e.file)throw Error(r(`collectibles.fileRequired`));let i=new FormData,a=e=>e.map(e=>({name:e.name.trim(),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),file_key:e.key}));i.set(`metadata`,JSON.stringify({command_id:t,reason:C.trim(),confirm:e,upgrade_stars:m,supply_total:Number(_),slug_prefix:y.trim().toLowerCase(),models:a(T),patterns:a(D),backdrops:M.map(e=>({name:e.name.trim(),backdrop_id:Number(e.backdropID),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),center_color:Ot(e.center),edge_color:Ot(e.edge),pattern_color:Ot(e.pattern),text_color:Ot(e.text)}))}));for(let e of[...T,...D])i.set(e.key,e.file,e.file.name);return i}async function te(){l(!0),d(``),p(null);try{p(await x.publishGiftCollectibles(e.GiftID,ee(!1)))}catch(e){d(b(e))}finally{l(!1)}}async function re(){if(f){l(!0),d(``);try{await x.publishGiftCollectibles(e.GiftID,ee(!0,f.command_id)),n(),t()}catch(e){d(b(e))}finally{l(!1)}}}let ie=(e,t,n)=>(0,H.jsxs)(`section`,{className:`collectible-section`,children:[(0,H.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:r(`collectibles.${e}`)}),(0,H.jsx)(`span`,{children:r(`collectibles.rarityHint`)})]}),(0,H.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,H.jsxs)(G,{tone:P[e]>0?`good`:`neutral`,children:[P[e],`‰`]}),(0,H.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{n(bt([...t,xt(e===`models`?`model`:`pattern`,t.length)])),F()},children:[(0,H.jsx)(z,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,H.jsx)(`div`,{className:`collectible-rows`,children:t.map((i,a)=>(0,H.jsxs)(`div`,{className:`collectible-row animated`,children:[(0,H.jsx)(`div`,{className:`collectible-row-index`,children:a+1}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`common.name`)}),(0,H.jsx)(`input`,{value:i.name,maxLength:128,onChange:t=>I(e,i.key,{name:t.target.value})})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,H.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:i.rarity,onChange:t=>I(e,i.key,{rarity:t.target.value})})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,H.jsx)(`input`,{type:`number`,value:i.sortOrder,onChange:t=>I(e,i.key,{sortOrder:t.target.value})})]}),(0,H.jsxs)(`label`,{className:`collectible-file`,children:[(0,H.jsx)(`span`,{children:r(`gifts.animation`)}),(0,H.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:t=>void L(e,i,t.target.files?.[0]??null)}),(0,H.jsxs)(`em`,{children:[(0,H.jsx)(R,{size:13}),i.file?.name??r(`gifts.chooseFile`)]})]}),(0,H.jsx)(`div`,{className:`collectible-inline-preview`,children:i.animation?(0,H.jsx)(Tt,{data:i.animation,compact:!0}):(0,H.jsx)(j,{size:16})}),(0,H.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:t.length<=2,onClick:()=>{n(bt(t.filter(e=>e.key!==i.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,H.jsx)(he,{size:14})}),i.fileError&&(0,H.jsx)(`span`,{className:`collectible-file-error`,children:i.fileError})]},i.key))})]});return(0,Qe.createPortal)((0,H.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,H.jsxs)(`section`,{className:`modal command-modal collectible-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`collectibles.title`,{id:e.GiftID}),children:[(0,H.jsxs)(`div`,{className:`modal-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`eyebrow`,children:r(`collectibles.eyebrow`)}),(0,H.jsx)(`h2`,{children:r(`collectibles.title`,{id:e.GiftID})}),(0,H.jsx)(`p`,{children:e.Title||`Gift #${e.GiftID}`})]}),(0,H.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:t,disabled:c,"aria-label":r(`action.close`),children:(0,H.jsx)(ve,{size:15})})]}),(0,H.jsxs)(`div`,{className:`command-body collectible-modal-body`,children:[o?(0,H.jsxs)(`div`,{className:`collectible-loading`,children:[(0,H.jsx)(A,{className:`spin`}),r(`common.loading`)]}):i?.found?(0,H.jsxs)(`section`,{className:`collectible-active`,children:[(0,H.jsxs)(`div`,{className:`collectible-active-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(ne,{size:18}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:r(`collectibles.activeRevision`,{revision:i.revision??0})}),(0,H.jsxs)(`span`,{children:[i.slug_prefix,` · ⭐ `,i.upgrade_stars,` · `,i.issued,` / `,i.supply_total]})]})]}),(0,H.jsx)(G,{tone:`good`,children:r(`collectibles.published`)})]}),(0,H.jsxs)(`div`,{className:`collectible-active-grid`,children:[[...i.models??[],...i.patterns??[]].map(t=>(0,H.jsxs)(`article`,{children:[(0,H.jsx)(Et,{giftID:e.GiftID,attribute:t}),(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`strong`,{children:[t.name,t.crafted&&(0,H.jsx)(G,{children:`crafted`})]}),(0,H.jsxs)(`span`,{children:[r(`collectibles.${t.kind}`),` · `,kt(t)]})]})]},`${t.kind}-${t.id}`)),(i.backdrops??[]).map(e=>(0,H.jsxs)(`article`,{children:[(0,H.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, #${(e.center_color??0).toString(16).padStart(6,`0`)}, #${(e.edge_color??0).toString(16).padStart(6,`0`)})`,color:`#${(e.text_color??16777215).toString(16).padStart(6,`0`)}`},children:`Aa`}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:e.name}),(0,H.jsxs)(`span`,{children:[r(`collectibles.backdrop`),` · `,kt(e)]})]})]},`backdrop-${e.id}`))]})]}):(0,H.jsxs)(`div`,{className:`collectible-empty`,children:[(0,H.jsx)(ne,{size:22}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:r(`collectibles.noPool`)}),(0,H.jsx)(`span`,{children:r(`collectibles.noPoolHint`)})]})]}),(0,H.jsxs)(`section`,{className:`collectible-definition`,children:[(0,H.jsxs)(`div`,{className:`collectible-definition-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:r(`collectibles.publishNew`)}),(0,H.jsx)(`span`,{children:r(`collectibles.immutableHint`)})]}),(0,H.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,H.jsx)(`span`,{children:`TGS`}),(0,H.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,H.jsxs)(`div`,{className:`gift-fields-grid collectible-main-fields`,children:[(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`collectibles.upgradeStars`)}),(0,H.jsx)(`input`,{type:`number`,min:`1`,value:m,onChange:e=>{h(e.target.value),F()}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`collectibles.supply`)}),(0,H.jsx)(`input`,{type:`number`,min:`1`,value:_,onChange:e=>{v(e.target.value),F()}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`collectibles.slug`)}),(0,H.jsx)(`input`,{value:y,maxLength:48,onChange:e=>{S(e.target.value.toLowerCase()),F()}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`gifts.reason`)}),(0,H.jsx)(`input`,{value:C,maxLength:1e3,placeholder:r(`gifts.reasonPlaceholder`),onChange:e=>w(e.target.value)})]})]}),ie(`models`,T,E),ie(`patterns`,D,O),(0,H.jsxs)(`section`,{className:`collectible-section`,children:[(0,H.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:r(`collectibles.backdrops`)}),(0,H.jsx)(`span`,{children:r(`collectibles.colorHint`)})]}),(0,H.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,H.jsxs)(G,{tone:P.backdrops>0?`good`:`neutral`,children:[P.backdrops,`‰`]}),(0,H.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{N(bt([...M,St(M)])),F()},children:[(0,H.jsx)(z,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,H.jsx)(`div`,{className:`collectible-rows`,children:M.map((e,t)=>(0,H.jsxs)(`div`,{className:`collectible-row backdrop`,children:[(0,H.jsx)(`div`,{className:`collectible-row-index`,children:t+1}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`common.name`)}),(0,H.jsx)(`input`,{value:e.name,maxLength:128,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,name:t.target.value}:n)),F()}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`collectibles.backdropID`)}),(0,H.jsx)(`input`,{type:`number`,min:`0`,value:e.backdropID,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,backdropID:t.target.value}:n)),F()}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,H.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:e.rarity,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,rarity:t.target.value}:n)),F()}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,H.jsx)(`input`,{type:`number`,value:e.sortOrder,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,sortOrder:t.target.value}:n)),F()}})]}),[`center`,`edge`,`pattern`,`text`].map(t=>(0,H.jsxs)(`label`,{className:`collectible-color`,children:[(0,H.jsx)(`span`,{children:r(`collectibles.color.${t}`)}),(0,H.jsx)(`input`,{type:`color`,value:e[t],onChange:n=>{N(M.map(r=>r.key===e.key?{...r,[t]:n.target.value}:r)),F()}})]},t)),(0,H.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, ${e.center}, ${e.edge})`,color:e.text},children:`Aa`}),(0,H.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:M.length<=2,onClick:()=>{N(bt(M.filter(t=>t.key!==e.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,H.jsx)(he,{size:14})})]},e.key))})]})]}),u&&(0,H.jsx)(Ke,{children:u}),f&&(0,H.jsxs)(`div`,{className:`gift-validation`,children:[(0,H.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,H.jsx)(k,{size:17}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:r(`collectibles.validationReady`)}),(0,H.jsx)(`span`,{children:r(`collectibles.validationHint`)})]})]}),(0,H.jsx)(`pre`,{children:JSON.stringify(f.details,null,2)})]})]}),(0,H.jsxs)(`div`,{className:`modal-actions`,children:[(0,H.jsx)(`button`,{className:`btn`,type:`button`,onClick:t,disabled:c,children:r(`common.close`)}),(0,H.jsxs)(`button`,{className:`btn`,type:`button`,onClick:te,disabled:c,children:[c?(0,H.jsx)(A,{className:`spin`,size:15}):(0,H.jsx)(fe,{size:15}),r(`gifts.validate`)]}),(0,H.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:re,disabled:c||!f,children:[(0,H.jsx)(ge,{size:15}),r(`collectibles.publish`)]})]})]})}),document.body)}function jt(e){return e.model_count+e.pattern_count+e.backdrop_count}function Mt(e){let t=Number(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Y({giftID:e,revision:t,compact:n=!1}){let r=(0,g.useRef)(null),i=(0,g.useRef)(null),[a,o]=(0,g.useState)(!0),[s,c]=(0,g.useState)(``);(0,g.useEffect)(()=>{let t=!1;return x.giftAnimation(e).then(e=>{t||!r.current||(i.current?.destroy(),i.current=gt.default.loadAnimation({container:r.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(e=>c(b(e))),()=>{t=!0,i.current?.destroy(),i.current=null}},[e,t]);function l(){i.current&&(a?i.current.pause():i.current.play(),o(!a))}return(0,H.jsxs)(`div`,{className:`gift-animation-shell ${n?`compact`:``}`,children:[(0,H.jsx)(`div`,{className:`gift-animation`,ref:r,children:s&&(0,H.jsx)(`span`,{children:s})}),(0,H.jsx)(`button`,{className:`gift-play`,type:`button`,onClick:l,"aria-label":a?`Pause`:`Play`,children:a?(0,H.jsx)(le,{size:14}):(0,H.jsx)(ue,{size:14})})]})}function Nt({sourceGiftID:e}){let t=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let n=!1,r=null;return x.officialGiftAnimation(e).then(e=>{n||!t.current||(r=gt.default.loadAnimation({container:t.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(()=>void 0),()=>{n=!0,r?.destroy()}},[e]),(0,H.jsx)(`div`,{className:`gift-animation-shell`,children:(0,H.jsx)(`div`,{className:`gift-animation`,ref:t})})}function Pt(){let{t:e}=Ce(),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`official`),[p,m]=(0,g.useState)([]),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!0),[E,D]=(0,g.useState)(`0`),[O,j]=(0,g.useState)(`0`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(`0`),[I,L]=(0,g.useState)(``),[ee,te]=(0,g.useState)(`50`),[re,ie]=(0,g.useState)(`50`),[ae,oe]=(0,g.useState)(`0`),[se,ce]=(0,g.useState)(!0),[le,ue]=(0,g.useState)(``),[V,pe]=(0,g.useState)(null),[me,he]=(0,g.useState)(!1),[_e,ye]=(0,g.useState)(``),[U,be]=(0,g.useState)(``);async function xe(){ye(``);try{n((await x.gifts()).Gifts??[])}catch(e){ye(b(e))}}(0,g.useEffect)(()=>{xe()},[]),(0,g.useEffect)(()=>{!a||d!==`official`||p.length>0||x.officialGifts().then(e=>m(e.gifts??[])).catch(e=>be(b(e)))},[a,d,p.length]);let Se=(0,g.useMemo)(()=>p.find(e=>e.source_gift_id===S)??null,[p,S]),we=(0,g.useMemo)(()=>({all:p.length,upgrade:p.filter(e=>e.can_upgrade).length,craft:p.filter(e=>e.can_craft).length,basic:p.filter(e=>!e.can_upgrade).length}),[p]),Te=(0,g.useMemo)(()=>{let e=h.trim().toLowerCase();return p.filter(t=>(v===`all`||v===`upgrade`&&t.can_upgrade||v===`craft`&&t.can_craft||v===`basic`&&!t.can_upgrade)&&(!e||t.source_gift_id.includes(e)||t.title.toLowerCase().includes(e)))},[p,h,v]),Ee=(0,g.useMemo)(()=>{let e=r.trim().toLowerCase();return e?t.filter(t=>String(t.GiftID).includes(e)||t.Title.toLowerCase().includes(e)||t.SourceFormat.toLowerCase().includes(e)):t},[t,r]);function De(t,n=``){if(!l)throw Error(e(`gifts.fileRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));let r=new FormData;return r.set(`metadata`,JSON.stringify({command_id:n,reason:le.trim(),confirm:t,gift_id:P,title:I.trim(),stars:ee,convert_stars:re,enabled:se,sort_order:Number(ae)})),r.set(`file`,l,l.name),r}function Oe(t,n=``){if(!S)throw Error(e(`gifts.officialRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));return{command_id:n,reason:le.trim(),confirm:t,source_gift_id:S,gift_id:P,title:I.trim(),stars:ee,convert_stars:re,enabled:se,sort_order:Number(ae),include_collectible:w,upgrade_stars:E,supply_total:Number(O),slug_prefix:M.trim().toLowerCase()}}function ke(t){C(t.source_gift_id),L(t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})),te(String(t.stars)),ie(String(t.convert_stars)),T(t.can_upgrade),D(t.upgrade_stars),j(String(t.availability_total||1)),N(`official-${t.source_gift_id}`),pe(null)}async function Ae(){he(!0),be(``),pe(null);try{pe(d===`official`?await x.importOfficialGift(Oe(!1)):await x.importGift(De(!1)))}catch(e){be(b(e))}finally{he(!1)}}async function je(){if(V){he(!0),be(``);try{d===`official`?await x.importOfficialGift(Oe(!0,V.command_id)):await x.importGift(De(!0,V.command_id)),pe(null),u(null),F(`0`),L(``),C(``),await xe(),o(!1)}catch(e){be(b(e))}finally{he(!1)}}}function Me(){F(`0`),L(``),te(`50`),ie(`50`),oe(`0`),ce(!0),ue(``),u(null),pe(null),be(``),f(`official`),C(``),_(``),y(`all`),o(!0)}function Ne(e){F(e.GiftID),L(e.Title),te(String(e.Stars)),ie(String(e.ConvertStars)),oe(String(e.SortOrder)),ce(e.Enabled),ue(``),u(null),pe(null),be(``),f(`official`),C(``),_(``),y(`all`),o(!0)}return(0,H.jsxs)(He,{title:e(`gifts.pageTitle`),eyebrow:e(`gifts.eyebrow`),actions:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>xe(),disabled:me,children:[(0,H.jsx)(de,{size:15}),` `,e(`common.refresh`)]}),(0,H.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:Me,children:[(0,H.jsx)(z,{size:15}),` `,e(`gifts.add`)]})]}),children:[_e&&(0,H.jsx)(Ke,{children:_e}),(0,H.jsxs)(`div`,{className:`metric-row gift-metrics`,children:[(0,H.jsx)(q,{label:e(`gifts.total`),value:String(t.length)}),(0,H.jsx)(q,{label:e(`gifts.enabled`),value:String(t.filter(e=>e.Enabled).length),tone:`good`}),(0,H.jsx)(q,{label:e(`gifts.received`),value:t.reduce((e,t)=>e+BigInt(t.ReceivedCount),0n).toString()}),(0,H.jsx)(q,{label:e(`gifts.formats`),value:`TGS / Lottie`})]}),(0,H.jsx)(Ue,{children:(0,H.jsxs)(`div`,{className:`toolbar`,children:[(0,H.jsxs)(`label`,{className:`searchbox`,children:[(0,H.jsx)(B,{size:15}),(0,H.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:e(`gifts.searchPlaceholder`)})]}),(0,H.jsx)(`span`,{className:`gift-list-summary`,children:e(`gifts.listSummary`,{shown:Ee.length,total:t.length})})]})}),(0,H.jsx)(`div`,{className:`table-wrap gift-table-wrap`,children:(0,H.jsxs)(`table`,{className:`data-table gift-table`,children:[(0,H.jsx)(`thead`,{children:(0,H.jsxs)(`tr`,{children:[(0,H.jsx)(`th`,{children:e(`gifts.animation`)}),(0,H.jsx)(`th`,{children:e(`gifts.idRevision`)}),(0,H.jsx)(`th`,{children:e(`gifts.title`)}),(0,H.jsx)(`th`,{children:e(`gifts.price`)}),(0,H.jsx)(`th`,{children:e(`gifts.source`)}),(0,H.jsx)(`th`,{children:e(`gifts.received`)}),(0,H.jsx)(`th`,{children:e(`common.status`)}),(0,H.jsx)(`th`,{children:e(`common.updatedAt`)}),(0,H.jsx)(`th`,{children:e(`common.actions`)})]})}),(0,H.jsxs)(`tbody`,{children:[Ee.map(t=>(0,H.jsxs)(`tr`,{className:t.Enabled?``:`gift-row-disabled`,children:[(0,H.jsx)(`td`,{children:(0,H.jsx)(Y,{giftID:t.GiftID,revision:t.Revision,compact:!0})}),(0,H.jsxs)(`td`,{className:`mono`,children:[t.GiftID,` / `,t.Revision]}),(0,H.jsxs)(`td`,{children:[(0,H.jsx)(`strong`,{className:`gift-table-title`,children:t.Title||`Gift #${t.GiftID}`}),(0,H.jsxs)(`span`,{className:`gift-sort-order`,children:[e(`gifts.sortOrder`),`: `,t.SortOrder]})]}),(0,H.jsxs)(`td`,{children:[(0,H.jsxs)(`strong`,{className:`gift-table-price`,children:[`⭐ `,t.Stars]}),(0,H.jsxs)(`span`,{className:`gift-convert-price`,children:[`→ `,t.ConvertStars]})]}),(0,H.jsxs)(`td`,{children:[(0,H.jsx)(G,{children:t.SourceFormat}),(0,H.jsx)(`span`,{className:`gift-source-size`,children:Mt(t.AnimationSize)})]}),(0,H.jsx)(`td`,{children:t.ReceivedCount}),(0,H.jsx)(`td`,{children:(0,H.jsx)(G,{tone:t.Enabled?`good`:`neutral`,children:t.Enabled?e(`common.enabled`):e(`common.disabled`)})}),(0,H.jsx)(`td`,{children:ze(t.UpdatedAt)}),(0,H.jsx)(`td`,{children:(0,H.jsxs)(`div`,{className:`gift-table-actions`,children:[(0,H.jsxs)(`button`,{className:`btn compact-btn collectible-button`,type:`button`,onClick:()=>c(t),children:[(0,H.jsx)(ne,{size:13}),e(`collectibles.manage`)]}),(0,H.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>Ne(t),children:e(`gifts.replace`)}),(0,H.jsx)($e,{compact:!0,tone:`neutral`,label:t.Enabled?e(`gifts.disable`):e(`gifts.enable`),path:`/api/actions/set-gift-enabled`,payload:()=>({gift_id:t.GiftID,enabled:!t.Enabled}),onDone:()=>void xe()})]})})]},t.GiftID)),Ee.length===0&&(0,H.jsx)(Je,{colSpan:9})]})]})}),a&&(0,Qe.createPortal)((0,H.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,H.jsxs)(`section`,{className:`modal command-modal gift-import-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P}),children:[(0,H.jsxs)(`div`,{className:`modal-head`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`eyebrow`,children:e(`gifts.importEyebrow`)}),(0,H.jsx)(`h2`,{children:P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P})})]}),(0,H.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>o(!1),disabled:me,"aria-label":e(`action.close`),children:(0,H.jsx)(ve,{size:15})})]}),(0,H.jsxs)(`div`,{className:`command-body gift-import-modal-body`,children:[(0,H.jsxs)(`div`,{className:`command-steps`,children:[(0,H.jsxs)(`div`,{className:`command-step ${(d===`official`?S:l)?`done`:`active`}`,children:[(0,H.jsx)(`span`,{children:`1`}),(0,H.jsx)(`strong`,{children:e(`gifts.stepDetails`)})]}),(0,H.jsxs)(`div`,{className:`command-step ${V?`done`:(d===`official`?S:l)?`active`:``}`,children:[(0,H.jsx)(`span`,{children:`2`}),(0,H.jsx)(`strong`,{children:e(`gifts.stepValidate`)})]}),(0,H.jsxs)(`div`,{className:`command-step ${V?`active`:``}`,children:[(0,H.jsx)(`span`,{children:`3`}),(0,H.jsx)(`strong`,{children:e(`gifts.stepImport`)})]})]}),(0,H.jsxs)(`div`,{className:`gift-source-tabs`,children:[(0,H.jsx)(`button`,{className:`btn ${d===`official`?`primary`:``}`,type:`button`,onClick:()=>{f(`official`),pe(null)},children:e(`gifts.officialSource`)}),(0,H.jsx)(`button`,{className:`btn ${d===`file`?`primary`:``}`,type:`button`,onClick:()=>{f(`file`),pe(null)},children:e(`gifts.fileSource`)})]}),d===`official`?(0,H.jsxs)(`section`,{className:`official-gift-picker`,children:[(0,H.jsxs)(`div`,{className:`gift-import-note`,children:[(0,H.jsx)(`span`,{children:e(`gifts.officialHint`)}),(0,H.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,H.jsx)(`span`,{children:p.length}),(0,H.jsx)(`span`,{children:`SHA-256`})]})]}),(0,H.jsxs)(`div`,{className:`official-gift-tools`,children:[(0,H.jsxs)(`label`,{className:`searchbox`,children:[(0,H.jsx)(B,{size:15}),(0,H.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),placeholder:e(`gifts.officialSearch`)})]}),(0,H.jsx)(`span`,{children:e(`gifts.officialResults`,{shown:Te.length,total:p.length})})]}),(0,H.jsx)(`div`,{className:`official-gift-categories`,role:`group`,"aria-label":e(`gifts.officialCategoryLabel`),children:[`all`,`upgrade`,`craft`,`basic`].map(t=>(0,H.jsxs)(`button`,{className:v===t?`active`:``,type:`button`,"aria-pressed":v===t,onClick:()=>y(t),children:[e(`gifts.officialCategory.${t}`),(0,H.jsx)(`span`,{children:we[t]})]},t))}),(0,H.jsxs)(`div`,{className:`official-gift-list`,role:`listbox`,"aria-label":e(`gifts.officialSelect`),children:[Te.map(t=>{let n=t.source_gift_id===S;return(0,H.jsxs)(`button`,{className:`official-gift-option ${n?`selected`:``}`,type:`button`,role:`option`,"aria-selected":n,onClick:()=>ke(t),children:[(0,H.jsxs)(`span`,{className:`official-gift-option-head`,children:[(0,H.jsx)(`strong`,{children:t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})}),(0,H.jsxs)(`span`,{className:`mono`,children:[`#`,t.source_gift_id]})]}),(0,H.jsxs)(`span`,{className:`official-gift-option-meta`,children:[(0,H.jsxs)(`span`,{children:[`⭐ `,t.stars]}),(0,H.jsx)(`span`,{children:e(`gifts.officialAttributes`,{count:jt(t)})})]}),(0,H.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,H.jsx)(`span`,{className:t.can_upgrade?`yes`:`no`,children:t.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,H.jsx)(`span`,{className:t.can_craft?`craft`:`no`,children:t.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]},t.source_gift_id)}),Te.length===0&&(0,H.jsx)(`div`,{className:`official-gift-empty`,children:e(`gifts.officialEmpty`)})]}),Se&&(0,H.jsxs)(`div`,{className:`official-gift-selected`,children:[(0,H.jsx)(Nt,{sourceGiftID:Se.source_gift_id}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:Se.title||e(`gifts.officialUnnamed`,{id:Se.source_gift_id})}),(0,H.jsx)(`span`,{className:`mono`,children:Se.source_gift_id}),(0,H.jsxs)(`small`,{children:[Se.model_count,` `,e(`collectibles.models`),` · `,Se.pattern_count,` `,e(`collectibles.patterns`),` · `,Se.backdrop_count,` `,e(`collectibles.backdrops`)]}),(0,H.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,H.jsx)(`span`,{className:Se.can_upgrade?`yes`:`no`,children:Se.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,H.jsx)(`span`,{className:Se.can_craft?`craft`:`no`,children:Se.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]})]}),Se?.can_upgrade&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`label`,{className:`gift-switch`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>{T(e.target.checked),pe(null)}}),(0,H.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,H.jsx)(`span`,{})}),(0,H.jsx)(`span`,{children:e(`gifts.includeCollectible`)})]}),w&&(0,H.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:e(`collectibles.upgradeStars`)}),(0,H.jsx)(`input`,{type:`number`,min:`1`,value:E,onChange:e=>{D(e.target.value),pe(null)}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:e(`collectibles.supply`)}),(0,H.jsx)(`input`,{type:`number`,min:`1`,value:O,onChange:e=>{j(e.target.value),pe(null)}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:e(`collectibles.slug`)}),(0,H.jsx)(`input`,{value:M,maxLength:48,onChange:e=>{N(e.target.value.toLowerCase()),pe(null)}})]})]})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`gift-import-note`,children:[(0,H.jsx)(`span`,{children:e(`gifts.importHint`)}),(0,H.jsxs)(`div`,{className:`gift-format-chips`,"aria-label":e(`gifts.formats`),children:[(0,H.jsx)(`span`,{children:`TGS`}),(0,H.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,H.jsxs)(`label`,{className:`gift-file-picker ${l?`has-file`:``}`,children:[(0,H.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:e=>{u(e.target.files?.[0]??null),pe(null)}}),(0,H.jsx)(`span`,{className:`gift-file-icon`,children:(0,H.jsx)(R,{size:22})}),(0,H.jsxs)(`span`,{className:`gift-file-copy`,children:[(0,H.jsx)(`span`,{className:`gift-field-label`,children:e(`gifts.animation`)}),(0,H.jsx)(`strong`,{children:l?l.name:e(`gifts.filePrompt`)}),(0,H.jsx)(`small`,{children:l?Mt(l.size):e(`gifts.fileHint`)})]}),(0,H.jsx)(`span`,{className:`gift-file-action`,children:e(l?`gifts.changeFile`:`gifts.chooseFile`)})]})]}),(0,H.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:e(`gifts.title`)}),(0,H.jsx)(`input`,{value:I,maxLength:128,placeholder:e(`gifts.titlePlaceholder`),onChange:e=>{L(e.target.value),pe(null)}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:e(`gifts.stars`)}),(0,H.jsx)(`input`,{type:`number`,min:`1`,value:ee,onChange:e=>{te(e.target.value),pe(null)}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:e(`gifts.convertStars`)}),(0,H.jsx)(`input`,{type:`number`,min:`0`,value:re,onChange:e=>{ie(e.target.value),pe(null)}})]}),(0,H.jsxs)(`label`,{children:[(0,H.jsx)(`span`,{children:e(`gifts.sortOrder`)}),(0,H.jsx)(`input`,{type:`number`,value:ae,onChange:e=>{oe(e.target.value),pe(null)}})]})]}),(0,H.jsxs)(`label`,{className:`gift-reason-field`,children:[(0,H.jsx)(`span`,{children:e(`gifts.reason`)}),(0,H.jsx)(`input`,{value:le,placeholder:e(`gifts.reasonPlaceholder`),onChange:e=>ue(e.target.value)})]}),(0,H.jsxs)(`label`,{className:`gift-switch`,children:[(0,H.jsx)(`input`,{type:`checkbox`,checked:se,onChange:e=>{ce(e.target.checked),pe(null)}}),(0,H.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,H.jsx)(`span`,{})}),(0,H.jsx)(`span`,{children:e(`gifts.enableAfterImport`)})]}),U&&(0,H.jsx)(Ke,{children:U}),V&&(0,H.jsxs)(`div`,{className:`gift-validation`,children:[(0,H.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,H.jsx)(k,{size:17}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`strong`,{children:e(`gifts.validationReady`)}),(0,H.jsx)(`span`,{children:e(`gifts.validationHint`)})]})]}),(0,H.jsx)(`pre`,{children:JSON.stringify(V.details,null,2)})]})]}),(0,H.jsxs)(`div`,{className:`modal-actions`,children:[(0,H.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>o(!1),disabled:me,children:e(`common.close`)}),(0,H.jsxs)(`button`,{className:`btn`,type:`button`,onClick:Ae,disabled:me,children:[me?(0,H.jsx)(A,{className:`spin`,size:15}):(0,H.jsx)(fe,{size:15}),e(`gifts.validate`)]}),(0,H.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:je,disabled:me||!V,children:[(0,H.jsx)(ge,{size:15}),e(`gifts.confirmImport`)]})]})]})}),document.body),s&&(0,H.jsx)(At,{gift:s,onClose:()=>c(null),onPublished:()=>void xe()})]})}function Ft({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1];return n?(0,H.jsx)(tt,{id:Number(n),navigate:t}):r?(0,H.jsx)(ot,{id:Number(r),navigate:t}):e.path===`/accounts`?(0,H.jsx)(at,{navigate:t}):e.path===`/channels`?(0,H.jsx)(st,{navigate:t}):e.path===`/gifts`?(0,H.jsx)(Pt,{}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,H.jsx)(mt,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,H.jsx)(ut,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,H.jsx)(pt,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,H.jsx)(ht,{navigate:t}):(0,H.jsx)(ct,{navigate:t})}function It(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>Oe());(0,g.useEffect)(()=>{let e=()=>r(Oe());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(Oe())};return e===void 0?(0,H.jsx)(Me,{}):e===null?(0,H.jsx)(Ze,{onLogin:t}):(0,H.jsx)(Ne,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,H.jsx)(Ft,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,H.jsx)(g.StrictMode,{children:(0,H.jsx)(Se,{children:(0,H.jsx)(It,{})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/index.html b/cmd/telesrv-admin/web/dist/index.html index 18651f58..8da7a220 100644 --- a/cmd/telesrv-admin/web/dist/index.html +++ b/cmd/telesrv-admin/web/dist/index.html @@ -1,13 +1,30 @@ - - - - - - telesrv admin - - - - -
- - + + + + + + telesrv admin + + + + + +
+ + diff --git a/cmd/telesrv-admin/web/index.html b/cmd/telesrv-admin/web/index.html index 81352931..3f63af1f 100644 --- a/cmd/telesrv-admin/web/index.html +++ b/cmd/telesrv-admin/web/index.html @@ -4,6 +4,23 @@ telesrv admin +
diff --git a/cmd/telesrv-admin/web/src/components/Layout.tsx b/cmd/telesrv-admin/web/src/components/Layout.tsx index 41c81c64..d9600970 100644 --- a/cmd/telesrv-admin/web/src/components/Layout.tsx +++ b/cmd/telesrv-admin/web/src/components/Layout.tsx @@ -14,6 +14,7 @@ import { useEffect, useState, type ReactNode } from "react"; import { api } from "../api"; import { LanguageSwitch, useI18n } from "../i18n"; import { type Navigate, type RouteState, routeSubtitle, routeTitle } from "../routing"; +import { ThemeSwitch } from "../theme"; import { AppLink } from "./AppLink"; export function BootScreen() { @@ -123,6 +124,7 @@ export function Shell({

{routeTitle(route.path, t)}

+ {t("layout.actor", { actor })}
+ {t("app.localAccess")}
diff --git a/cmd/telesrv-admin/web/src/styles/01-foundation.css b/cmd/telesrv-admin/web/src/styles/01-foundation.css index c8b7f42d..f80b1285 100644 --- a/cmd/telesrv-admin/web/src/styles/01-foundation.css +++ b/cmd/telesrv-admin/web/src/styles/01-foundation.css @@ -1,24 +1,155 @@ :root { color-scheme: light; - --bg: #f3f5f7; + + /* Surfaces */ + --bg: #eef1f5; + --bg-accent: #e7ecf1; --panel: #ffffff; - --panel-subtle: #f8fafb; - --panel-strong: #eef2f5; - --line: #d9e1e8; - --line-strong: #c2ccd6; - --text: #101828; - --muted: #667085; - --muted-2: #98a2b3; - --brand: #176d61; - --brand-2: #245b9d; - --good: #167447; - --warn: #a15c07; - --danger: #b42318; - --sidebar: #11161d; - --sidebar-soft: #1b222b; - --sidebar-line: #2c3541; - --focus: rgba(23, 109, 97, 0.16); - --shadow: 0 18px 52px rgba(16, 24, 40, 0.14); + --panel-subtle: #f5f8fb; + --panel-strong: #eef2f6; + --surface-soft: #f2f7f6; + --overlay: rgba(24, 34, 47, 0.42); + --topbar-bg: rgba(255, 255, 255, 0.86); + + /* Lines */ + --line: #e5eaf0; + --line-strong: #d3dce4; + + /* Text */ + --heading: #253040; + --text: #333f4d; + --text-soft: #45525f; + --muted: #6d7885; + --muted-2: #9aa4b1; + + /* Brand */ + --brand: #1f7d6f; + --brand-strong: #196155; + --brand-2: #3a6cae; + --brand-tint: #e8f4f0; + --brand-tint-border: #c8e2db; + --brand-tint-text: #235d53; + + /* Semantic */ + --good: #1f8a57; + --good-tint: #eaf6ef; + --good-border: #c1e1cf; + --warn: #a86a12; + --warn-tint: #fcf4e4; + --warn-border: #e7d09e; + --danger: #c0392b; + --danger-tint: #fcefec; + --danger-border: #eecac3; + --danger-text: #8f2f27; + + /* Accent (collectibles / craft) */ + --purple: #6a4fa3; + --purple-tint: #f4effb; + --purple-border: #dcd0f0; + --purple-text: #5a4590; + + /* Inputs & controls */ + --input-bg: #ffffff; + --btn-bg: #ffffff; + --btn-text: #29323d; + --btn-hover: #f4f7fa; + --switch-track: #c8d0d6; + + /* Code / JSON blocks */ + --code-bg: #1b2733; + --code-text: #d6e3ef; + --code-border: #2b3a49; + + /* Sidebar */ + --sidebar: #1c2530; + --sidebar-soft: #26313d; + --sidebar-line: #313c4a; + --sidebar-row: #232d38; + --sidebar-text: #dbe3ec; + --sidebar-muted: #8b98a8; + --sidebar-faint: #7c8a9a; + --sidebar-heading: #ffffff; + + /* Effects */ + --focus: rgba(31, 125, 111, 0.16); + --shadow: 0 12px 34px rgba(24, 39, 56, 0.1); + --shadow-sm: 0 2px 10px rgba(24, 39, 56, 0.05); + --shadow-brand: 0 8px 22px rgba(31, 125, 111, 0.22); + + /* Radii */ + --radius-xs: 8px; + --radius-sm: 9px; + --radius: 11px; + --radius-lg: 14px; +} + +[data-theme="dark"] { + color-scheme: dark; + + --bg: #0f141a; + --bg-accent: #131a22; + --panel: #171f28; + --panel-subtle: #1c2530; + --panel-strong: #212c38; + --surface-soft: #1a232d; + --overlay: rgba(5, 8, 12, 0.62); + --topbar-bg: rgba(21, 28, 36, 0.86); + + --line: #29333f; + --line-strong: #38434f; + + --heading: #eef3f8; + --text: #d5dde6; + --text-soft: #c2ccd6; + --muted: #98a4b1; + --muted-2: #6d7885; + + --brand: #37a596; + --brand-strong: #45b6a6; + --brand-2: #6fa8e6; + --brand-tint: #14322d; + --brand-tint-border: #245349; + --brand-tint-text: #7fd3c4; + + --good: #47c281; + --good-tint: #12301f; + --good-border: #245639; + --warn: #e0aa4d; + --warn-tint: #322810; + --warn-border: #574413; + --danger: #e6695c; + --danger-tint: #35201d; + --danger-border: #5c332d; + --danger-text: #f0a49b; + + --purple: #ac90e2; + --purple-tint: #221b31; + --purple-border: #3d3357; + --purple-text: #c9b6ef; + + --input-bg: #131a22; + --btn-bg: #1e2731; + --btn-text: #dbe2ea; + --btn-hover: #26313d; + --switch-track: #3a454f; + + --code-bg: #0c1218; + --code-text: #cdd9e5; + --code-border: #232f3b; + + --sidebar: #10151b; + --sidebar-soft: #1c242f; + --sidebar-line: #262f3a; + --sidebar-row: #161d25; + --sidebar-text: #cbd4de; + --sidebar-muted: #7c8794; + --sidebar-faint: #6f7b88; + --sidebar-heading: #f0f4f8; + + --focus: rgba(55, 165, 150, 0.24); + --shadow: 0 16px 40px rgba(0, 0, 0, 0.46); + --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.38); + --shadow-brand: 0 8px 22px rgba(55, 165, 150, 0.26); } * { @@ -35,7 +166,10 @@ body { margin: 0; color: var(--text); background: var(--bg); - font: 13px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + font: 13px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + transition: background-color 200ms ease, color 200ms ease; } button, @@ -64,7 +198,7 @@ a { gap: 16px; overflow-y: auto; padding: 18px 12px; - color: #eef2f6; + color: var(--sidebar-text); background: var(--sidebar); border-right: 1px solid var(--sidebar-line); } @@ -82,7 +216,7 @@ a { } .brand-elevated .brand-mark { - box-shadow: 0 8px 24px rgba(23, 109, 97, 0.26); + box-shadow: var(--shadow-brand); } .brand-mark { @@ -93,7 +227,7 @@ a { color: #ffffff; background: var(--brand); border: 1px solid rgba(255, 255, 255, 0.2); - border-radius: 8px; + border-radius: var(--radius-sm); font-weight: 800; } @@ -106,16 +240,17 @@ a { .brand small { display: block; margin-top: 3px; - color: #aeb8c4; + color: var(--sidebar-muted); font-size: 11px; } .sidebar-label { padding: 0 8px; - color: #8492a6; + color: var(--sidebar-faint); font-size: 11px; font-weight: 700; text-transform: uppercase; + letter-spacing: 0.04em; } .nav-list { @@ -136,26 +271,27 @@ a { align-items: center; gap: 9px; padding: 0 10px; - color: #8fa0b4; + color: var(--sidebar-muted); background: transparent; border: 1px solid transparent; - border-radius: 7px; + border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 800; text-align: left; + transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; } .nav-section-toggle:hover, .nav-section.active .nav-section-toggle { - color: #ffffff; + color: var(--sidebar-heading); background: var(--sidebar-soft); - border-color: #34404d; + border-color: var(--sidebar-line); } .nav-section-chevron { justify-self: end; - color: #8fa0b4; + color: var(--sidebar-muted); transition: transform 140ms ease; } @@ -176,24 +312,25 @@ a { align-items: center; gap: 9px; padding: 0 10px; - color: #c6d0dc; + color: var(--sidebar-text); border: 1px solid transparent; - border-radius: 7px; + border-radius: var(--radius-sm); + transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; } .nav-dot { width: 6px; height: 6px; justify-self: center; - background: #687789; + background: var(--sidebar-faint); border-radius: 999px; } .nav-item:hover, .nav-item.active { - color: #ffffff; + color: var(--sidebar-heading); background: var(--sidebar-soft); - border-color: #34404d; + border-color: var(--sidebar-line); } .nav-item.active .nav-dot { @@ -213,14 +350,14 @@ a { align-items: center; gap: 7px; padding: 0 8px; - color: #cbd5df; - background: #171d25; - border: 1px solid #27313c; - border-radius: 7px; + color: var(--sidebar-text); + background: var(--sidebar-row); + border: 1px solid var(--sidebar-line); + border-radius: var(--radius-sm); } .runtime-row strong { - color: #ffffff; + color: var(--sidebar-heading); font-size: 11px; } @@ -238,13 +375,14 @@ a { justify-content: space-between; gap: 18px; padding: 12px 24px; - background: rgba(255, 255, 255, 0.94); + background: var(--topbar-bg); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); } .topbar h1 { margin: 2px 0 0; + color: var(--heading); font-size: 20px; line-height: 1.2; } @@ -281,6 +419,7 @@ a { border-radius: 999px; cursor: pointer; font-weight: 800; + transition: color 140ms ease, background-color 140ms ease; } .language-switch button.active { @@ -293,12 +432,36 @@ a { outline-offset: 2px; } +.theme-toggle { + display: inline-grid; + width: 34px; + height: 34px; + place-items: center; + color: var(--muted); + background: var(--panel-subtle); + border: 1px solid var(--line); + border-radius: 999px; + cursor: pointer; + transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; +} + +.theme-toggle:hover { + color: var(--brand); + border-color: var(--brand-tint-border); + background: var(--brand-tint); +} + +.theme-toggle:focus-visible { + outline: 2px solid var(--brand); + outline-offset: 2px; +} + .actor-pill { display: inline-flex; min-height: 30px; align-items: center; padding: 0 10px; - color: #344054; + color: var(--text-soft); background: var(--panel-subtle); border: 1px solid var(--line); border-radius: 999px; @@ -315,4 +478,5 @@ a { font-size: 11px; font-weight: 800; text-transform: uppercase; + letter-spacing: 0.04em; } diff --git a/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css b/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css index ea86437d..2c3e0be3 100644 --- a/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css +++ b/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css @@ -9,7 +9,8 @@ min-width: 0; background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); + box-shadow: var(--shadow-sm); } .overview-band { @@ -25,6 +26,7 @@ .section-head h2, .modal h2 { margin: 0; + color: var(--heading); font-size: 18px; line-height: 1.25; } @@ -47,7 +49,7 @@ padding: 10px; background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 7px; + border-radius: var(--radius-sm); } .status-item span, @@ -70,16 +72,16 @@ .status-item.good, .metric.good { - border-color: #afd8bf; + border-color: var(--good-border); } .status-item.warn, .metric.warn { - border-color: #e7c77e; + border-color: var(--warn-border); } .metric.danger { - border-color: #efb4ad; + border-color: var(--danger-border); } .command-grid { @@ -97,11 +99,15 @@ padding: 14px; background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); + box-shadow: var(--shadow-sm); + transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; } .launcher:hover { - border-color: var(--brand); + border-color: var(--brand-tint-border); + box-shadow: var(--shadow); + transform: translateY(-1px); } .launcher-icon { @@ -110,9 +116,9 @@ height: 38px; place-items: center; color: var(--brand); - background: #edf7f4; - border: 1px solid #c9e2dc; - border-radius: 8px; + background: var(--brand-tint); + border: 1px solid var(--brand-tint-border); + border-radius: var(--radius-sm); } .launcher-copy { @@ -121,6 +127,7 @@ } .launcher-copy strong { + color: var(--heading); font-size: 15px; } @@ -140,10 +147,10 @@ align-items: center; gap: 8px; padding: 0 10px; - color: #344054; + color: var(--text-soft); background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-sm); } .page-frame { @@ -165,7 +172,7 @@ padding: 10px; background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-sm); } .toolbar { @@ -195,9 +202,9 @@ min-width: 0; gap: 8px; padding: 10px; - background: #ffffff; + background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-sm); } .picker-head { @@ -206,7 +213,7 @@ align-items: center; justify-content: space-between; gap: 8px; - color: #344054; + color: var(--text-soft); font-weight: 800; } @@ -217,10 +224,10 @@ align-items: center; gap: 8px; padding: 7px 9px; - color: #0f3f38; - background: #eef8f5; - border: 1px solid #b9dcd3; - border-radius: 7px; + color: var(--brand-tint-text); + background: var(--brand-tint); + border: 1px solid var(--brand-tint-border); + border-radius: var(--radius-sm); } .selected-entity strong, @@ -237,8 +244,9 @@ } .selected-entity div span { - color: #52606d; + color: var(--brand-tint-text); font-size: 11px; + opacity: 0.85; } .picker-search { @@ -250,7 +258,7 @@ padding: 0 6px 0 9px; background: var(--panel-subtle); border: 1px solid var(--line-strong); - border-radius: 7px; + border-radius: var(--radius-sm); } .picker-search input { @@ -267,7 +275,7 @@ max-height: 236px; overflow: auto; border: 1px solid var(--line); - border-radius: 7px; + border-radius: var(--radius-sm); } .picker-row { @@ -278,7 +286,7 @@ gap: 8px; padding: 6px 8px; color: var(--text); - background: #ffffff; + background: var(--panel); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; @@ -291,7 +299,7 @@ .picker-row:hover, .picker-row.selected { - background: #f3f8f6; + background: var(--surface-soft); } .picker-row strong, @@ -311,18 +319,24 @@ .picker-error { color: var(--danger); - background: #fff2f0; - border: 1px solid #efb4ad; - border-radius: 7px; + background: var(--danger-tint); + border: 1px solid var(--danger-border); + border-radius: var(--radius-sm); } input, textarea { color: var(--text); - background: #ffffff; + background: var(--input-bg); border: 1px solid var(--line-strong); - border-radius: 7px; + border-radius: var(--radius-sm); outline: none; + transition: border-color 140ms ease, box-shadow 140ms ease; +} + +input::placeholder, +textarea::placeholder { + color: var(--muted-2); } input { @@ -366,9 +380,10 @@ textarea:focus { width: min(380px, 100%); height: 34px; padding: 0 10px; - background: #ffffff; + color: var(--text); + background: var(--input-bg); border: 1px solid var(--line-strong); - border-radius: 7px; + border-radius: var(--radius-sm); } .searchbox input { @@ -386,16 +401,17 @@ textarea:focus { justify-content: center; gap: 6px; padding: 0 12px; - color: #1d2939; - background: #ffffff; + color: var(--btn-text); + background: var(--btn-bg); border: 1px solid var(--line-strong); - border-radius: 7px; + border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; + transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease; } .btn:hover:not(:disabled) { - background: #f7f9fb; + background: var(--btn-hover); } .btn:disabled { @@ -410,7 +426,8 @@ textarea:focus { } .btn.primary:hover:not(:disabled) { - background: #12594f; + background: var(--brand-strong); + border-color: var(--brand-strong); } .btn.ghost { @@ -419,22 +436,24 @@ textarea:focus { .btn.danger { color: var(--danger); - background: #fff7f5; - border-color: #efb4ad; + background: var(--danger-tint); + border-color: var(--danger-border); } .btn.danger:hover:not(:disabled) { - background: #ffeceb; + background: var(--danger-tint); + border-color: var(--danger); } .btn.warn { color: var(--warn); - background: #fff8ec; - border-color: #e7c77e; + background: var(--warn-tint); + border-color: var(--warn-border); } .btn.warn:hover:not(:disabled) { - background: #fff1d6; + background: var(--warn-tint); + border-color: var(--warn); } .btn:disabled, @@ -442,7 +461,7 @@ textarea:focus { .btn.warn:disabled, .btn.danger:disabled { color: var(--muted-2); - background: #f3f5f7; + background: var(--panel-strong); border-color: var(--line); cursor: not-allowed; } @@ -476,8 +495,9 @@ textarea:focus { .table-wrap { width: 100%; overflow-x: auto; + background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); } .data-table { @@ -500,13 +520,13 @@ textarea:focus { position: sticky; top: 0; z-index: 0; - color: #475467; + color: var(--muted); background: var(--panel-strong); font-weight: 800; } .data-table tbody tr:hover { - background: #fbfcfd; + background: var(--panel-subtle); } .data-table tr:last-child td { @@ -528,29 +548,29 @@ textarea:focus { min-height: 22px; align-items: center; padding: 1px 8px; - color: #4f5b68; - background: #f3f6f8; - border: 1px solid #d7e0e8; + color: var(--muted); + background: var(--panel-strong); + border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap; } .badge.good { color: var(--good); - background: #eef8f2; - border-color: #b9dcc7; + background: var(--good-tint); + border-color: var(--good-border); } .badge.danger { color: var(--danger); - background: #fff2f0; - border-color: #efb4ad; + background: var(--danger-tint); + border-color: var(--danger-border); } .badge.warn { color: var(--warn); - background: #fff8e7; - border-color: #e7c77e; + background: var(--warn-tint); + border-color: var(--warn-border); } .empty-cell { diff --git a/cmd/telesrv-admin/web/src/styles/03-entities-and-actions.css b/cmd/telesrv-admin/web/src/styles/03-entities-and-actions.css index 9d1b5684..d29fe88e 100644 --- a/cmd/telesrv-admin/web/src/styles/03-entities-and-actions.css +++ b/cmd/telesrv-admin/web/src/styles/03-entities-and-actions.css @@ -18,10 +18,11 @@ padding: 14px; background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); } .entity-title { + color: var(--heading); font-size: 20px; font-weight: 800; line-height: 1.25; @@ -41,10 +42,10 @@ .about-text { margin: 0; padding: 10px; - color: #344054; - background: #fbfcfd; + color: var(--text-soft); + background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); } .section-block, @@ -54,7 +55,8 @@ padding: 12px; background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); + box-shadow: var(--shadow-sm); } .section-head { @@ -79,7 +81,7 @@ .dock-title { padding-bottom: 4px; - color: #344054; + color: var(--text-soft); font-weight: 800; border-bottom: 1px solid var(--line); } @@ -184,7 +186,7 @@ padding: 10px; background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); } .operation-title { @@ -192,6 +194,7 @@ width: 100%; align-items: center; gap: 6px; + color: var(--heading); font-weight: 800; } @@ -212,10 +215,10 @@ align-items: flex-start; gap: 8px; padding: 9px 10px; - color: #8a251d; - background: #fff2f0; - border: 1px solid #efb4ad; - border-radius: 8px; + color: var(--danger-text); + background: var(--danger-tint); + border: 1px solid var(--danger-border); + border-radius: var(--radius); } .json-block { @@ -223,10 +226,10 @@ overflow: auto; margin: 0; padding: 12px; - color: #d8e6f0; - background: #141a22; - border: 1px solid #2a3542; - border-radius: 8px; + color: var(--code-text); + background: var(--code-bg); + border: 1px solid var(--code-border); + border-radius: var(--radius); font-size: 12px; } @@ -250,12 +253,12 @@ color: var(--muted); background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); } .gift-metrics .metric { min-height: 68px; padding: 12px; - background: linear-gradient(145deg, #ffffff, #f6f9f9); + background: var(--panel-subtle); } .gift-metrics .metric strong { font-size: 17px; } @@ -265,12 +268,12 @@ flex: 0 0 auto; place-items: center; color: var(--brand); - background: #eaf6f3; - border: 1px solid #c7e3dc; + background: var(--brand-tint); + border: 1px solid var(--brand-tint-border); } .gift-format-chips { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; } -.gift-format-chips span { padding: 4px 8px; color: #33645d; background: #eef8f5; border: 1px solid #cfe5df; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em; } +.gift-format-chips span { padding: 4px 8px; color: var(--brand-tint-text); background: var(--brand-tint); border: 1px solid var(--brand-tint-border); border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .02em; } .gift-list-summary { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; } @@ -284,48 +287,48 @@ .official-gift-categories { display: flex; flex-wrap: wrap; gap: 7px; } .official-gift-categories button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 10px; - color: #49605c; background: #f7faf9; border: 1px solid #d7e2df; border-radius: 999px; + color: var(--text-soft); background: var(--panel-subtle); border: 1px solid var(--line-strong); border-radius: 999px; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease; } -.official-gift-categories button:hover { color: var(--brand); border-color: #9fc9c0; } -.official-gift-categories button.active { color: #ffffff; background: var(--brand); border-color: var(--brand); box-shadow: 0 4px 12px rgba(23, 109, 97, .17); } +.official-gift-categories button:hover { color: var(--brand); border-color: var(--brand-tint-border); } +.official-gift-categories button.active { color: #ffffff; background: var(--brand); border-color: var(--brand); box-shadow: var(--shadow-brand); } .official-gift-categories button span { display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; - color: inherit; background: rgba(255,255,255,.65); border-radius: 999px; font-size: 10px; + color: inherit; background: rgba(125, 140, 155, .22); border-radius: 999px; font-size: 10px; } -.official-gift-categories button.active span { color: var(--brand); } +.official-gift-categories button.active span { color: var(--brand); background: rgba(255, 255, 255, .85); } .official-gift-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 314px; - min-height: 126px; padding: 8px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; - background: #f6f9f8; scrollbar-gutter: stable; + min-height: 126px; padding: 8px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); + background: var(--panel-subtle); scrollbar-gutter: stable; } .official-gift-option { display: grid; min-width: 0; gap: 8px; padding: 11px 12px; text-align: left; color: var(--text); - background: #ffffff; border: 1px solid #dce6e3; border-radius: 11px; cursor: pointer; - box-shadow: 0 1px 2px rgba(32, 54, 50, .03); + background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; + box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; } -.official-gift-option:hover { border-color: #9fc9c0; box-shadow: 0 5px 14px rgba(32, 76, 68, .08); transform: translateY(-1px); } -.official-gift-option.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(23, 109, 97, .12), 0 5px 14px rgba(32, 76, 68, .08); } +.official-gift-option:hover { border-color: var(--brand-tint-border); box-shadow: var(--shadow); transform: translateY(-1px); } +.official-gift-option.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--focus), var(--shadow); } .official-gift-option-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; } .official-gift-option-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; } .official-gift-option-head .mono { color: var(--muted); font-size: 9px; } -.official-gift-option-meta { display: flex; flex-wrap: wrap; gap: 10px; color: #667773; font-size: 10px; font-weight: 700; } +.official-gift-option-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 700; } .official-gift-capabilities { display: flex; flex-wrap: wrap; gap: 5px; } .official-gift-capabilities > span { padding: 3px 7px; border: 1px solid transparent; border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: .01em; } -.official-gift-capabilities > span.yes { color: #136b4d; background: #e9f8f0; border-color: #bde6cf; } -.official-gift-capabilities > span.craft { color: #6e3ca0; background: #f3ebfb; border-color: #d9c5ef; } -.official-gift-capabilities > span.no { color: #78837f; background: #f1f3f2; border-color: #dde2e0; } +.official-gift-capabilities > span.yes { color: var(--good); background: var(--good-tint); border-color: var(--good-border); } +.official-gift-capabilities > span.craft { color: var(--purple); background: var(--purple-tint); border-color: var(--purple-border); } +.official-gift-capabilities > span.no { color: var(--muted); background: var(--panel-strong); border-color: var(--line-strong); } .official-gift-empty { display: grid; grid-column: 1 / -1; min-height: 108px; place-items: center; padding: 20px; color: var(--muted); text-align: center; font-size: 12px; } .official-gift-selected { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 14px; align-items: center; - padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); + padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-soft); } .official-gift-selected .gift-animation-shell { width: 96px; height: 96px; } .official-gift-selected > div:last-child { display: grid; gap: 5px; min-width: 0; } @@ -341,22 +344,22 @@ gap: 12px; padding: 12px 14px; color: var(--text); - background: #ffffff; - border: 1px dashed #b7ccc8; - border-radius: 10px; + background: var(--panel); + border: 1px dashed var(--line-strong); + border-radius: var(--radius); cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; } .gift-file-picker:hover, -.gift-file-picker.has-file { background: #f8fcfb; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(23, 109, 97, .05); } +.gift-file-picker.has-file { background: var(--brand-tint); border-color: var(--brand); box-shadow: 0 0 0 2px var(--focus); } .gift-file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; } -.gift-file-icon { width: 40px; height: 40px; border-radius: 9px; } +.gift-file-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); } .gift-file-copy { display: grid; min-width: 0; gap: 2px; } .gift-field-label { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; } -.gift-file-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; } +.gift-file-copy strong { overflow: hidden; color: var(--heading); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; } .gift-file-copy small { color: var(--muted); font-size: 11px; font-weight: 500; } -.gift-file-action { padding: 7px 10px; color: var(--brand); background: #f0f8f6; border: 1px solid #c7e3dc; border-radius: 7px; font-size: 11px; font-weight: 800; } +.gift-file-action { padding: 7px 10px; color: var(--brand); background: var(--brand-tint); border: 1px solid var(--brand-tint-border); border-radius: var(--radius-sm); font-size: 11px; font-weight: 800; } .gift-fields-grid { display: grid; @@ -380,37 +383,37 @@ height: 38px; padding: 0 10px; color: var(--text); - background: #fff; + background: var(--input-bg); border: 1px solid var(--line); - border-radius: 7px; + border-radius: var(--radius-sm); } .gift-fields-grid input:focus, -.gift-reason-field input:focus { border-color: #77b6aa; box-shadow: 0 0 0 3px rgba(23, 109, 97, .08); outline: none; } +.gift-reason-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); outline: none; } -.gift-switch { display: inline-flex; align-items: center; gap: 9px; color: #344054; font-size: 12px; font-weight: 700; cursor: pointer; } +.gift-switch { display: inline-flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: 12px; font-weight: 700; cursor: pointer; } .gift-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; } -.gift-switch-track { display: flex; width: 34px; height: 19px; align-items: center; padding: 2px; background: #c8d0d5; border-radius: 999px; transition: background .16s ease; } +.gift-switch-track { display: flex; width: 34px; height: 19px; align-items: center; padding: 2px; background: var(--switch-track); border-radius: 999px; transition: background .16s ease; } .gift-switch-track span { width: 15px; height: 15px; background: #ffffff; border-radius: 50%; box-shadow: 0 1px 3px rgba(16, 24, 40, .22); transition: transform .16s ease; } .gift-switch input:checked + .gift-switch-track { background: var(--brand); } .gift-switch input:checked + .gift-switch-track span { transform: translateX(15px); } -.gift-switch input:focus-visible + .gift-switch-track { outline: 3px solid rgba(23, 109, 97, .16); outline-offset: 2px; } -.gift-validation { overflow: hidden; color: #d5fff5; background: #173631; border: 1px solid #24564e; border-radius: 9px; } -.gift-validation-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; color: #e3fff9; background: rgba(255, 255, 255, .035); border-bottom: 1px solid rgba(255, 255, 255, .09); } +.gift-switch input:focus-visible + .gift-switch-track { outline: 3px solid var(--focus); outline-offset: 2px; } +.gift-validation { overflow: hidden; color: var(--code-text); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius-sm); } +.gift-validation-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; color: var(--code-text); background: rgba(255, 255, 255, .035); border-bottom: 1px solid rgba(255, 255, 255, .09); } .gift-validation-head div { display: grid; gap: 2px; } -.gift-validation-head span { color: #99cfc4; font-size: 10px; } -.gift-validation pre { max-height: 180px; overflow: auto; margin: 0; padding: 11px 12px; color: #d5fff5; font-size: 11px; } +.gift-validation-head span { color: var(--brand); font-size: 10px; } +.gift-validation pre { max-height: 180px; overflow: auto; margin: 0; padding: 11px 12px; color: var(--code-text); font-size: 11px; } -.gift-animation-shell { position: relative; display: grid; min-height: 210px; place-items: center; background: radial-gradient(circle, #f9f3ff, #eef8f5); } +.gift-animation-shell { position: relative; display: grid; min-height: 210px; place-items: center; background: var(--surface-soft); } .gift-animation { width: 200px; height: 200px; } .gift-animation canvas { width: 100% !important; height: 100% !important; } -.gift-play { position: absolute; right: 8px; bottom: 8px; display: grid; width: 30px; height: 30px; place-items: center; color: var(--text); background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 50%; } +.gift-play { position: absolute; right: 8px; bottom: 8px; display: grid; width: 30px; height: 30px; place-items: center; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 50%; } -.gift-table-wrap { background: #ffffff; } +.gift-table-wrap { background: var(--panel); } .gift-table { min-width: 1080px; } .gift-table th:first-child { width: 74px; } .gift-table td { vertical-align: middle; } -.gift-animation-shell.compact { width: 56px; min-height: 56px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; } +.gift-animation-shell.compact { width: 56px; min-height: 56px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); } .gift-animation-shell.compact .gift-animation { width: 54px; height: 54px; } .gift-animation-shell.compact .gift-play { right: 3px; bottom: 3px; width: 20px; height: 20px; } .gift-row-disabled { opacity: .68; } @@ -422,60 +425,60 @@ .gift-sort-order, .gift-source-size, .gift-convert-price { margin-top: 3px; color: var(--muted); font-size: 10px; } -.gift-table-price { color: #755b00; } +.gift-table-price { color: var(--warn); } .gift-table-actions { display: flex; align-items: center; gap: 6px; } -.collectible-button { color: #6548a8; background: #f7f3ff; border-color: #ddd2f5; } -.collectible-button:hover { background: #efe8ff; border-color: #cbbaf0; } +.collectible-button { color: var(--purple); background: var(--purple-tint); border-color: var(--purple-border); } +.collectible-button:hover { background: var(--purple-tint); border-color: var(--purple); } .collectible-modal { width: min(1180px, 100%); max-height: min(92vh, 980px); } .collectible-modal .modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; } -.collectible-modal-body { gap: 16px; overflow: auto; padding: 16px 18px 22px; background: #f5f7fa; } +.collectible-modal-body { gap: 16px; overflow: auto; padding: 16px 18px 22px; background: var(--bg); } .collectible-loading { display: flex; min-height: 90px; align-items: center; justify-content: center; gap: 8px; color: var(--muted); } -.collectible-empty { display: flex; align-items: center; gap: 12px; padding: 16px; color: #66568c; background: linear-gradient(135deg, #fbf9ff, #f2f7ff); border: 1px dashed #cfc3e9; border-radius: 12px; } +.collectible-empty { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--purple-text); background: var(--purple-tint); border: 1px dashed var(--purple-border); border-radius: var(--radius); } .collectible-empty div, .collectible-definition-head > div:first-child, .collectible-section-head > div:first-child { display: grid; gap: 3px; } .collectible-empty span, .collectible-definition-head span, .collectible-section-head span { color: var(--muted); font-size: 10px; font-weight: 500; } -.collectible-active { overflow: hidden; background: #ffffff; border: 1px solid #ddd6ee; border-radius: 12px; box-shadow: 0 5px 16px rgba(66, 46, 110, .05); } -.collectible-active-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: linear-gradient(100deg, #fbf9ff, #f4f9ff); border-bottom: 1px solid #e9e4f3; } -.collectible-active-head > div { display: flex; align-items: center; gap: 9px; color: #60458f; } +.collectible-active { overflow: hidden; background: var(--panel); border: 1px solid var(--purple-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); } +.collectible-active-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--purple-tint); border-bottom: 1px solid var(--purple-border); } +.collectible-active-head > div { display: flex; align-items: center; gap: 9px; color: var(--purple-text); } .collectible-active-head > div > div { display: grid; gap: 2px; } .collectible-active-head span { color: var(--muted); font-size: 10px; } .collectible-active-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 1px; background: var(--line); } -.collectible-active-grid article { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px 11px; background: #ffffff; } +.collectible-active-grid article { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px 11px; background: var(--panel); } .collectible-active-grid article > div:last-child { display: grid; min-width: 0; gap: 2px; } .collectible-active-grid article strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; } .collectible-active-grid article span { color: var(--muted); font-size: 9px; } -.collectible-definition { overflow: hidden; background: #ffffff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(16, 24, 40, .04); } -.collectible-definition-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: linear-gradient(110deg, #f8fbfa, #fbf9ff); border-bottom: 1px solid var(--line); } -.collectible-main-fields { padding: 14px 16px; background: #fbfcfd; border-bottom: 1px solid var(--line); } +.collectible-definition { overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); } +.collectible-definition-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--panel-subtle); border-bottom: 1px solid var(--line); } +.collectible-main-fields { padding: 14px 16px; background: var(--panel-subtle); border-bottom: 1px solid var(--line); } .collectible-section { padding: 14px 16px; border-bottom: 1px solid var(--line); } .collectible-section:last-child { border-bottom: 0; } .collectible-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; } .collectible-section-tools { display: flex; align-items: center; gap: 7px; } .collectible-rows { display: grid; gap: 7px; } -.collectible-row { position: relative; display: grid; align-items: end; gap: 7px; padding: 9px 9px 9px 36px; background: #fafbfc; border: 1px solid #e1e6eb; border-radius: 9px; } -.collectible-row:hover { background: #ffffff; border-color: #cbd7dd; box-shadow: 0 3px 10px rgba(16, 24, 40, .035); } +.collectible-row { position: relative; display: grid; align-items: end; gap: 7px; padding: 9px 9px 9px 36px; background: var(--panel-subtle); border: 1px solid var(--line); border-radius: var(--radius-sm); } +.collectible-row:hover { background: var(--panel); border-color: var(--line-strong); box-shadow: var(--shadow-sm); } .collectible-row.animated { grid-template-columns: minmax(120px, 1.2fr) 90px 78px minmax(160px, 1.4fr) 48px 30px; } .collectible-row.backdrop { grid-template-columns: minmax(110px, 1.2fr) 70px 80px 70px repeat(4, 52px) 48px 30px; } -.collectible-row-index { position: absolute; top: 0; bottom: 0; left: 0; display: grid; width: 27px; place-items: center; color: #71668c; background: #f0edf7; border-right: 1px solid #e0d9ed; border-radius: 8px 0 0 8px; font-size: 10px; font-weight: 800; } +.collectible-row-index { position: absolute; top: 0; bottom: 0; left: 0; display: grid; width: 27px; place-items: center; color: var(--purple-text); background: var(--purple-tint); border-right: 1px solid var(--purple-border); border-radius: var(--radius-xs) 0 0 var(--radius-xs); font-size: 10px; font-weight: 800; } .collectible-row label { display: grid; min-width: 0; gap: 4px; } .collectible-row label > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .025em; } -.collectible-row input:not([type="file"]) { width: 100%; min-width: 0; height: 32px; padding: 0 8px; color: var(--text); background: #ffffff; border: 1px solid #d5dde3; border-radius: 7px; font: inherit; font-size: 11px; } -.collectible-row input:focus { border-color: #8d7aba; box-shadow: 0 0 0 3px rgba(111, 91, 174, .08); outline: none; } +.collectible-row input:not([type="file"]) { width: 100%; min-width: 0; height: 32px; padding: 0 8px; color: var(--text); background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 11px; } +.collectible-row input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-tint); outline: none; } .collectible-file input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; } -.collectible-file em { display: flex; min-width: 0; height: 32px; align-items: center; gap: 5px; overflow: hidden; padding: 0 8px; color: #625080; background: #f7f4fd; border: 1px dashed #cfc4e1; border-radius: 7px; font-size: 10px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; } -.collectible-inline-preview { display: grid; width: 42px; height: 42px; place-items: center; overflow: hidden; color: #8c7cae; background: radial-gradient(circle, #ffffff, #eee8f8); border: 1px solid #ded5ed; border-radius: 8px; } +.collectible-file em { display: flex; min-width: 0; height: 32px; align-items: center; gap: 5px; overflow: hidden; padding: 0 8px; color: var(--purple-text); background: var(--purple-tint); border: 1px dashed var(--purple-border); border-radius: var(--radius-sm); font-size: 10px; font-style: normal; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; } +.collectible-inline-preview { display: grid; width: 42px; height: 42px; place-items: center; overflow: hidden; color: var(--purple); background: var(--purple-tint); border: 1px solid var(--purple-border); border-radius: var(--radius-sm); } .collectible-animation { width: 100%; height: 100%; overflow: hidden; } -.collectible-animation.compact { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; background: radial-gradient(circle, #ffffff, #f0ebfa); border: 1px solid #e0d9ec; border-radius: 8px; } +.collectible-animation.compact { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; background: var(--purple-tint); border: 1px solid var(--purple-border); border-radius: var(--radius-sm); } .collectible-animation canvas { width: 100% !important; height: 100% !important; } -.collectible-animation.failed { color: #b42318; background: #fff4f2; } -.collectible-animation.loading { color: #807397; } -.collectible-file-error { grid-column: 1 / -1; color: #b42318; font-size: 10px; } +.collectible-animation.failed { color: var(--danger); background: var(--danger-tint); } +.collectible-animation.loading { color: var(--purple-text); } +.collectible-file-error { grid-column: 1 / -1; color: var(--danger); font-size: 10px; } .collectible-color input { height: 32px !important; padding: 3px !important; cursor: pointer; } -.collectible-backdrop-preview { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid rgba(42, 31, 71, .18); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); font-size: 11px; font-weight: 900; } +.collectible-backdrop-preview { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid rgba(42, 31, 71, .18); border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); font-size: 11px; font-weight: 900; } .collectible-row .icon-btn { align-self: center; } .collectible-row .icon-btn:disabled { opacity: .28; } diff --git a/cmd/telesrv-admin/web/src/styles/04-modal-and-login.css b/cmd/telesrv-admin/web/src/styles/04-modal-and-login.css index 60a3cc84..1e51094c 100644 --- a/cmd/telesrv-admin/web/src/styles/04-modal-and-login.css +++ b/cmd/telesrv-admin/web/src/styles/04-modal-and-login.css @@ -5,7 +5,8 @@ display: grid; place-items: center; padding: 24px; - background: rgba(17, 24, 39, 0.52); + background: var(--overlay); + backdrop-filter: blur(2px); } .modal { @@ -13,9 +14,9 @@ max-height: min(820px, calc(100vh - 48px)); overflow: hidden; padding: 0; - background: #ffffff; + background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-lg); box-shadow: var(--shadow); } @@ -43,10 +44,17 @@ width: 30px; height: 30px; place-items: center; + color: var(--text-soft); background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 7px; + border-radius: var(--radius-sm); cursor: pointer; + transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; +} + +.icon-btn:hover { + background: var(--btn-hover); + border-color: var(--line-strong); } .command-steps { @@ -73,7 +81,7 @@ color: var(--muted); background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-sm); } .command-step span { @@ -81,7 +89,7 @@ width: 20px; height: 20px; place-items: center; - background: #ffffff; + background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; @@ -90,12 +98,12 @@ .command-step.active { color: var(--brand); - border-color: #a9d8ce; + border-color: var(--brand-tint-border); } .command-step.done { color: var(--good); - border-color: #b9dcc7; + border-color: var(--good-border); } .form-field { @@ -105,7 +113,7 @@ .form-field span, .form-stack span { - color: #4b5563; + color: var(--text-soft); font-weight: 800; } @@ -123,7 +131,7 @@ display: flex; align-items: center; gap: 7px; - color: #344054; + color: var(--text-soft); font-weight: 800; } @@ -131,9 +139,9 @@ display: grid; gap: 8px; padding: 10px; - background: #fbfcfd; + background: var(--panel-subtle); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius); } .result-line { @@ -151,13 +159,13 @@ } .result-message { - color: #344054; + color: var(--text-soft); } .modal-actions { justify-content: flex-end; padding: 12px 18px; - background: #ffffff; + background: var(--panel); border-top: 1px solid var(--line); } @@ -174,9 +182,9 @@ width: min(420px, 100%); gap: 18px; padding: 22px; - background: #ffffff; + background: var(--panel); border: 1px solid var(--line); - border-radius: 8px; + border-radius: var(--radius-lg); box-shadow: var(--shadow); } @@ -201,14 +209,15 @@ align-items: center; padding: 0 8px; color: var(--brand); - background: #edf7f4; - border: 1px solid #c9e2dc; + background: var(--brand-tint); + border: 1px solid var(--brand-tint-border); border-radius: 999px; font-size: 12px; } .login-copy h1 { margin: 0; + color: var(--heading); font-size: 22px; } @@ -237,13 +246,14 @@ place-items: center; align-content: center; gap: 18px; + background: var(--bg); } .loader-bar { width: 180px; height: 4px; overflow: hidden; - background: #d7dde4; + background: var(--line-strong); border-radius: 999px; } diff --git a/cmd/telesrv-admin/web/src/theme.tsx b/cmd/telesrv-admin/web/src/theme.tsx new file mode 100644 index 00000000..bb0dddfd --- /dev/null +++ b/cmd/telesrv-admin/web/src/theme.tsx @@ -0,0 +1,106 @@ +import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from "react"; +import { Moon, Sun } from "lucide-react"; +import { useI18n } from "./i18n"; + +export type Theme = "light" | "dark"; + +const storageKey = "telesrv.admin.theme"; + +type ThemeContextValue = { + theme: Theme; + setTheme: (theme: Theme) => void; + toggleTheme: () => void; +}; + +const ThemeContext = createContext(null); + +export function applyTheme(theme: Theme) { + document.documentElement.setAttribute("data-theme", theme); + document.documentElement.style.colorScheme = theme; +} + +export function ThemeProvider({ children }: { children: ReactNode }) { + const [theme, setThemeState] = useState(() => initialTheme()); + + useEffect(() => { + applyTheme(theme); + try { + localStorage.setItem(storageKey, theme); + } catch { + // Theme persistence is best-effort. + } + }, [theme]); + + // Follow the OS preference until the user makes an explicit choice. + useEffect(() => { + if (!window.matchMedia) { + return; + } + const media = window.matchMedia("(prefers-color-scheme: dark)"); + const onChange = (event: MediaQueryListEvent) => { + let stored: string | null = null; + try { + stored = localStorage.getItem(storageKey); + } catch { + stored = null; + } + if (stored !== "light" && stored !== "dark") { + setThemeState(event.matches ? "dark" : "light"); + } + }; + media.addEventListener("change", onChange); + return () => media.removeEventListener("change", onChange); + }, []); + + const setTheme = useCallback((next: Theme) => setThemeState(next), []); + const toggleTheme = useCallback(() => setThemeState((current) => (current === "dark" ? "light" : "dark")), []); + + const value = useMemo(() => ({ theme, setTheme, toggleTheme }), [theme, setTheme, toggleTheme]); + + return {children}; +} + +export function useTheme(): ThemeContextValue { + const value = useContext(ThemeContext); + if (!value) { + throw new Error("useTheme must be used inside ThemeProvider"); + } + return value; +} + +export function ThemeSwitch() { + const { theme, toggleTheme } = useTheme(); + const { t } = useI18n(); + const nextIsDark = theme === "light"; + const label = t(nextIsDark ? "theme.switchToDark" : "theme.switchToLight"); + return ( + + ); +} + +function initialTheme(): Theme { + try { + const stored = localStorage.getItem(storageKey); + if (stored === "light" || stored === "dark") { + return stored; + } + } catch { + // Storage is optional. + } + try { + if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) { + return "dark"; + } + } catch { + // matchMedia can be unavailable in unusual embedded contexts. + } + return "light"; +} From 9e45da69efaa5500b97757b7e00b57f14f2d8f7b Mon Sep 17 00:00:00 2001 From: epilepticseizureee Date: Thu, 23 Jul 2026 00:34:05 +0300 Subject: [PATCH 2/5] feat(admin): bot management (list, verify, create, delete) - Add a Bots admin tab: list/search bots with a dedicated read query (users.is_bot, excluded from the accounts list), showing owner and system-vs-user type - Create system bots from the admin via a new bot.create command that reuses the existing bot provisioning flow; the token is shown once - Delete user-created bots via a new bot.delete command backed by a dedicated Postgres DeleteBotAccount (revokes sessions, purges private state, releases username, drops the bots row, tombstones the user); system service bots are rejected - Verified badge toggling reuses the existing set-verified command - All write paths go through the dry-run/confirm + audit command pipeline - Rebuild dist bundle --- cmd/telesrv-admin/readstore.go | 132 ++++++++++++++ cmd/telesrv-admin/server.go | 106 +++++++++++ .../web/dist/assets/index-BB8hN3NX.js | 9 + .../web/dist/assets/index-BlWlOvtx.css | 1 + .../web/dist/assets/index-CqgHld2y.js | 9 - .../web/dist/assets/index-DuOdm70q.css | 1 - cmd/telesrv-admin/web/dist/index.html | 4 +- cmd/telesrv-admin/web/src/api.ts | 4 + .../web/src/components/Layout.tsx | 2 + cmd/telesrv-admin/web/src/i18n.tsx | 111 ++++++++++++ .../web/src/pages/BotDetailPage.tsx | 108 +++++++++++ cmd/telesrv-admin/web/src/pages/BotsPage.tsx | 167 ++++++++++++++++++ cmd/telesrv-admin/web/src/pages/Routes.tsx | 9 + cmd/telesrv-admin/web/src/routing.ts | 2 + .../web/src/styles/02-pages-and-forms.css | 37 ++++ cmd/telesrv-admin/web/src/types.ts | 28 +++ cmd/telesrv/main.go | 1 + internal/admin/service.go | 114 ++++++++++++ internal/adminapi/server.go | 22 +++ internal/adminapi/server_test.go | 8 + internal/app/bots/service.go | 36 ++++ internal/store/postgres/bot.go | 86 +++++++++ 22 files changed, 985 insertions(+), 12 deletions(-) create mode 100644 cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js create mode 100644 cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css delete mode 100644 cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js delete mode 100644 cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css create mode 100644 cmd/telesrv-admin/web/src/pages/BotDetailPage.tsx create mode 100644 cmd/telesrv-admin/web/src/pages/BotsPage.tsx diff --git a/cmd/telesrv-admin/readstore.go b/cmd/telesrv-admin/readstore.go index 6ebd08e6..c16387bf 100644 --- a/cmd/telesrv-admin/readstore.go +++ b/cmd/telesrv-admin/readstore.go @@ -232,6 +232,138 @@ LIMIT $5`, id, phone, phoneRaw, username, accountSearchLimit) return out, rows.Err() } +type BotRow struct { + ID int64 + Username string + FirstName string + Verified bool + System bool + OwnerUserID int64 + CreatedAt time.Time + UpdatedAt time.Time +} + +type BotDetail struct { + Bot BotRow + About string + Description string + OwnerUsername string + AuditLogs []AuditLogRow +} + +// ListBots pages over live bot accounts (users.is_bot, not tombstoned) by +// descending id. Bots are excluded from ListAccounts, so this is the dedicated +// projection for them. +func (s *readStore) ListBots(ctx context.Context, beforeID int64, limit int) ([]BotRow, bool, error) { + if limit <= 0 { + limit = accountListDefaultLimit + } + if limit > accountListMaxLimit { + limit = accountListMaxLimit + } + rows, err := s.pool.Query(ctx, ` +SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.verified, + COALESCE(b.owner_user_id, 0), u.created_at, u.updated_at +FROM users u +LEFT JOIN bots b ON b.bot_user_id = u.id +LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id +WHERE u.is_bot AND u.deleted_at IS NULL AND ($1::bigint = 0 OR u.id < $1) +ORDER BY u.id DESC +LIMIT $2`, beforeID, limit+1) + if err != nil { + return nil, false, fmt.Errorf("list bots: %w", err) + } + defer rows.Close() + out := make([]BotRow, 0, limit+1) + for rows.Next() { + var item BotRow + if err := rows.Scan(&item.ID, &item.Username, &item.FirstName, &item.Verified, &item.OwnerUserID, &item.CreatedAt, &item.UpdatedAt); err != nil { + return nil, false, err + } + item.System = domain.IsSystemUserID(item.ID) + out = append(out, item) + } + if err := rows.Err(); err != nil { + return nil, false, err + } + hasMore := len(out) > limit + if hasMore { + out = out[:limit] + } + return out, hasMore, nil +} + +func (s *readStore) SearchBots(ctx context.Context, q string) ([]BotRow, error) { + q = strings.TrimSpace(q) + if q == "" { + return nil, nil + } + id := int64(-1) + if n, err := strconv.ParseInt(q, 10, 64); err == nil { + id = n + } + username := strings.ToLower(strings.TrimPrefix(q, "@")) + rows, err := s.pool.Query(ctx, ` +SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.verified, + COALESCE(b.owner_user_id, 0), u.created_at, u.updated_at +FROM users u +LEFT JOIN bots b ON b.bot_user_id = u.id +LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id +WHERE u.is_bot AND u.deleted_at IS NULL AND (u.id = $1 OR lower(u.username) = $2 OR p.username_lower = $2) +ORDER BY u.id DESC +LIMIT $3`, id, username, accountSearchLimit) + if err != nil { + return nil, fmt.Errorf("search bots: %w", err) + } + defer rows.Close() + out := make([]BotRow, 0) + for rows.Next() { + var item BotRow + if err := rows.Scan(&item.ID, &item.Username, &item.FirstName, &item.Verified, &item.OwnerUserID, &item.CreatedAt, &item.UpdatedAt); err != nil { + return nil, err + } + item.System = domain.IsSystemUserID(item.ID) + out = append(out, item) + } + return out, rows.Err() +} + +func (s *readStore) BotDetail(ctx context.Context, botUserID int64) (BotDetail, error) { + var out BotDetail + err := s.pool.QueryRow(ctx, ` +SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.about, u.verified, + COALESCE(b.owner_user_id, 0), COALESCE(b.description, ''), + u.created_at, u.updated_at +FROM users u +LEFT JOIN bots b ON b.bot_user_id = u.id +LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id +WHERE u.id = $1 AND u.is_bot AND u.deleted_at IS NULL`, botUserID).Scan( + &out.Bot.ID, &out.Bot.Username, &out.Bot.FirstName, &out.About, &out.Bot.Verified, + &out.Bot.OwnerUserID, &out.Description, &out.Bot.CreatedAt, &out.Bot.UpdatedAt, + ) + if err != nil { + return out, fmt.Errorf("get bot: %w", err) + } + out.Bot.System = domain.IsSystemUserID(out.Bot.ID) + if out.Bot.OwnerUserID > 0 { + var ownerUsername string + if err := s.pool.QueryRow(ctx, ` +SELECT COALESCE(NULLIF(u.username, ''), p.username_lower, '') +FROM users u +LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id +WHERE u.id = $1`, out.Bot.OwnerUserID).Scan(&ownerUsername); err != nil && err != pgx.ErrNoRows { + return out, fmt.Errorf("get bot owner: %w", err) + } else { + out.OwnerUsername = ownerUsername + } + } + out.AuditLogs, err = s.auditLogs(ctx, botUserID) + if err != nil { + return out, err + } + return out, nil +} + func (s *readStore) SearchChannels(ctx context.Context, q string) ([]ChannelRow, error) { q = strings.TrimSpace(q) if q == "" { diff --git a/cmd/telesrv-admin/server.go b/cmd/telesrv-admin/server.go index 8318ae2e..e1ee773f 100644 --- a/cmd/telesrv-admin/server.go +++ b/cmd/telesrv-admin/server.go @@ -53,6 +53,8 @@ func (s *server) routes() http.Handler { mux.Handle("GET /api/accounts/{id}", s.requireAuthAPI(http.HandlerFunc(s.handleAccountDetailAPI))) mux.Handle("GET /api/channels", s.requireAuthAPI(http.HandlerFunc(s.handleChannelsAPI))) mux.Handle("GET /api/channels/{id}", s.requireAuthAPI(http.HandlerFunc(s.handleChannelDetailAPI))) + mux.Handle("GET /api/bots", s.requireAuthAPI(http.HandlerFunc(s.handleBotsAPI))) + mux.Handle("GET /api/bots/{id}", s.requireAuthAPI(http.HandlerFunc(s.handleBotDetailAPI))) mux.Handle("GET /api/messages", s.requireAuthAPI(http.HandlerFunc(s.handleMessagesAPI))) mux.Handle("GET /api/messages/detail", s.requireAuthAPI(http.HandlerFunc(s.handleMessageDetailAPI))) mux.Handle("GET /api/messages/groups", s.requireAuthAPI(http.HandlerFunc(s.handleGroupMessagesAPI))) @@ -67,6 +69,8 @@ func (s *server) routes() http.Handler { mux.Handle("POST /api/actions/grant-premium", s.requireAuthAPI(http.HandlerFunc(s.handleGrantPremiumAPI))) mux.Handle("POST /api/actions/grant-stars", s.requireAuthAPI(http.HandlerFunc(s.handleGrantStarsAPI))) mux.Handle("POST /api/actions/set-verified", s.requireAuthAPI(http.HandlerFunc(s.handleSetVerifiedAPI))) + mux.Handle("POST /api/actions/create-bot", s.requireAuthAPI(http.HandlerFunc(s.handleCreateBotAPI))) + mux.Handle("POST /api/actions/delete-bot", s.requireAuthAPI(http.HandlerFunc(s.handleDeleteBotAPI))) mux.Handle("POST /api/actions/set-channel-verified", s.requireAuthAPI(http.HandlerFunc(s.handleSetChannelVerifiedAPI))) mux.Handle("POST /api/actions/revoke-sessions", s.requireAuthAPI(http.HandlerFunc(s.handleRevokeSessionsAPI))) mux.Handle("POST /api/actions/delete-messages", s.requireAuthAPI(http.HandlerFunc(s.handleDeleteMessagesAPI))) @@ -346,6 +350,108 @@ func (s *server) handleAccountDetailAPI(w http.ResponseWriter, r *http.Request) writeJSON(w, http.StatusOK, detail) } +func (s *server) handleBotsAPI(w http.ResponseWriter, r *http.Request) { + if s.read == nil { + writeAPIError(w, http.StatusServiceUnavailable, "read store is not configured") + return + } + q := r.URL.Query().Get("q") + beforeID, _ := parseInt64(r.URL.Query().Get("before_id")) + limit, _ := parseInt(r.URL.Query().Get("limit")) + rows := []BotRow{} + hasMore := false + var err error + if strings.TrimSpace(q) != "" { + rows, err = s.read.SearchBots(r.Context(), q) + } else { + rows, hasMore, err = s.read.ListBots(r.Context(), beforeID, limit) + } + if err != nil { + writeAPIError(w, http.StatusInternalServerError, err.Error()) + return + } + nextBeforeID := int64(0) + if hasMore && len(rows) > 0 { + nextBeforeID = rows[len(rows)-1].ID + } + if limit <= 0 { + limit = accountListDefaultLimit + } + if limit > accountListMaxLimit { + limit = accountListMaxLimit + } + writeJSON(w, http.StatusOK, map[string]any{ + "query": q, + "limit": limit, + "rows": rows, + "has_more": hasMore, + "next_before_id": nextBeforeID, + "listing": strings.TrimSpace(q) == "", + }) +} + +func (s *server) handleBotDetailAPI(w http.ResponseWriter, r *http.Request) { + if s.read == nil { + writeAPIError(w, http.StatusServiceUnavailable, "read store is not configured") + return + } + botID, err := parseInt64(r.PathValue("id")) + if err != nil || botID <= 0 { + writeAPIError(w, http.StatusBadRequest, "invalid id") + return + } + detail, err := s.read.BotDetail(r.Context(), botID) + if err != nil { + writeAPIError(w, http.StatusInternalServerError, err.Error()) + return + } + writeJSON(w, http.StatusOK, detail) +} + +type createBotAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + OwnerUserID int64 `json:"owner_user_id"` + Name string `json:"name"` + Username string `json:"username"` +} + +func (s *server) handleCreateBotAPI(w http.ResponseWriter, r *http.Request) { + var body createBotAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.CreateBotRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "create-bot"), + OwnerUserID: body.OwnerUserID, + Name: body.Name, + Username: body.Username, + } + result, err := s.callAdminAPI(r.Context(), "/v1/bots/create", req) + writeCommandResultAPI(w, result, err) +} + +type deleteBotAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + BotUserID int64 `json:"bot_user_id"` +} + +func (s *server) handleDeleteBotAPI(w http.ResponseWriter, r *http.Request) { + var body deleteBotAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.DeleteBotRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "delete-bot"), + BotUserID: body.BotUserID, + } + result, err := s.callAdminAPI(r.Context(), "/v1/bots/delete", req) + writeCommandResultAPI(w, result, err) +} + func (s *server) handleChannelsAPI(w http.ResponseWriter, r *http.Request) { if s.read == nil { writeAPIError(w, http.StatusServiceUnavailable, "read store is not configured") diff --git a/cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js b/cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js new file mode 100644 index 00000000..3278d88a --- /dev/null +++ b/cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js @@ -0,0 +1,9 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-Ee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` +`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{re=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ne(e):``}function ae(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return``}}function oe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function se(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return oe(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ce(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function le(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ue(e){var t=le(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function z(e){e._valueTracker||=ue(e)}function B(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=le(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function de(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function fe(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ce(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function me(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function he(e,t){me(e,t);var n=ce(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?_e(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&_e(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ge(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function _e(e,t,n){(t!==`number`||de(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var ve=Array.isArray;function ye(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Te(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var W={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(W).forEach(function(e){Ee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),W[t]=W[e]})});function De(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||W.hasOwnProperty(e)&&W[e]?(``+t).trim():t+`px`}function Oe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=De(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var ke=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ae(e,t){if(t){if(ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function je(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Me=null;function Ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pe=null,Fe=null,Ie=null;function Le(e){if(e=ji(e)){if(typeof Pe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ni(t),Pe(e.stateNode,e.type,t))}}function Re(e){Fe?Ie?Ie.push(e):Ie=[e]:Fe=e}function ze(){if(Fe){var e=Fe,t=Ie;if(Ie=Fe=null,Le(e),t)for(e=0;e>>=0,e===0?32:31-(_t(e)/vt|0)|0}var bt=64,xt=4194304;function St(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ct(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=St(a))):r=St(s)}else o=n&~i,o===0?a!==0&&(r=St(a)):r=St(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function kt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function At(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=mn(),pn=fn=dn=null,Qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(){for(var e=window,t=de();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=de(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Er(e){var t=wr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cr(n.ownerDocument.documentElement,n)){if(r!==null&&Tr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Sr(n,a);var o=Sr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==de(r)||(r=Or,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&br(Ar,r)||(Ar=r,r=ii(kr,`onSelect`),0Fi||(e.current=Pi[Fi],Pi[Fi]=null,Fi--)}function Ri(e,t){Fi++,Pi[Fi]=e.current,e.current=t}var zi={},Bi=Ii(zi),Vi=Ii(!1),Hi=zi;function Ui(e,t){var n=e.type.contextTypes;if(!n)return zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Wi(e){return e=e.childContextTypes,e!=null}function Gi(){Li(Vi),Li(Bi)}function Ki(e,t,n){if(Bi.current!==zi)throw Error(r(168));Ri(Bi,t),Ri(Vi,n)}function qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,se(e)||`Unknown`,a));return R({},n,i)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zi,Hi=Bi.current,Ri(Bi,e),Ri(Vi,Vi.current),!0}function Yi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=qi(e,t,Hi),i.__reactInternalMemoizedMergedChildContext=e,Li(Vi),Li(Bi),Ri(Bi,e)):Li(Vi),Ri(Vi,n)}var Xi=null,Zi=!1,Qi=!1;function $i(e){Xi===null?Xi=[e]:Xi.push(e)}function ea(e){Zi=!0,$i(e)}function ta(){if(!Qi&&Xi!==null){Qi=!0;var e=0,t=X;try{var n=Xi;for(X=1;e>=o,i-=o,la=1<<32-gt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),_a&&da(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),_a&&da(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return _a&&da(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),_a&&da(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&ja(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=ka(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=ka(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(ve(i))return h(e,r,i,o);if(ee(i))return g(e,r,i,o);Aa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Na=Ma(!0),Pa=Ma(!1),Fa=Ii(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Li(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e)if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(r(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e;return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{X=n,vo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Z(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}var ds={readContext:Ua,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ua,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=bo,a=jo();if(_a){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Vc===null)throw Error(r(349));yo&30||Ro(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,i,o,e),[e]),i.flags|=2048,Wo(9,zo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(_a){var n=ua,r=la;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[wi]=t,e[Ti]=i,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=je(n,i),n){case`dialog`:Zr(`cancel`,e),Zr(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:Zr(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;oel&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304)}else{if(!i)if(e=mo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!_a)return oc(t),null}else 2*ot()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ot(),t.sibling=null,n=po.current,Ri(po,i?n&1|2:n&1),t);case 22:case 23:return wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function cc(e,t){switch(ma(t),t.tag){case 1:return Wi(t.type)&&Gi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),Li(Vi),Li(Bi),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fo(t),null;case 13:if(Li(po),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Li(po),null;case 4:return lo(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(fi=rn,e=wr(),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(pi={focusedElem:e,selectionRange:n},rn=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wi],delete t[Ti],delete t[Di],delete t[Oi],delete t[ki])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=di));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount==`function`)try{mt.onCommitFiberUnmount(pt,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?bi(e.parentNode,n):e.nodeType===1&&bi(e,n),tn(e)):bi(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=ot()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Lc(i/1960))-i,10e?16:e,ol===null)var i=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(r(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lot()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=xt,xt<<=1,!(xt&130023424)&&(xt=4194304)):t=1);var n=fl();e=qa(e,t),e!==null&&(kt(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}else Ms=!1,_a&&t.flags&1048576&&fa(t,aa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;$s(e,t),e=t.pendingProps;var a=Ui(t,Bi.current);Ha(t,n),a=ko(null,t,i,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Wi(i)?(o=!0,Ji(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,i,e,n),t=Vs(null,t,i,!0,o,n)):(t.tag=0,_a&&o&&pa(t),Ns(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=hs(i,e),a){case 0:t=zs(null,t,i,e,n);break a;case 1:t=Bs(null,t,i,e,n);break a;case 11:t=Ps(null,t,i,e,n);break a;case 14:t=Fs(null,t,i,hs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),zs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Bs(e,t,i,a,n);case 3:a:{if(Hs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(r(423)),t),t=Us(e,t,i,n,a);break a}else if(i!==a){a=Ss(Error(r(424)),t),t=Us(e,t,i,n,a);break a}else for(ga=xi(t.stateNode.containerInfo.firstChild),ha=t,_a=!0,va=null,n=Pa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ea(),i===a){t=ec(e,t,n);break a}Ns(e,t,i,n)}t=t.child}return t;case 5:return uo(t),e===null&&Sa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,mi(i,a)?s=null:o!==null&&mi(i,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Sa(t),null;case 13:return Ks(e,t,n);case 4:return co(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Na(t,null,i,n):Ns(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Ps(e,t,i,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ri(Fa,i._currentValue),i._currentValue=s,o!==null)if(Z(o.value,s)){if(o.children===a.children&&!Vi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ha(t,n),a=Ua(a),i=i(a),t.flags|=1,Ns(e,t,i,n),t.child;case 14:return i=t.type,a=hs(i,t.pendingProps),a=hs(i.type,a),Fs(e,t,i,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),$s(e,t),t.tag=1,Wi(i)?(e=!0,Ji(t)):e=!1,Ha(t,n),ys(t,i,a),xs(t,i,a,n),Vs(null,t,i,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return nt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Kl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ot(0),this.expirationTimes=Ot(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ot(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=typeof FormData<`u`&&t.body instanceof FormData,r=await fetch(e,{credentials:`same-origin`,headers:n?t.headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok){let e=a?.error||a?.Error||a?.message||r.statusText;throw new v(r.status,e)}return a}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),bots:e=>y(`/api/bots?${e.toString()}`),bot:e=>y(`/api/bots/${e}`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),gifts:()=>y(`/api/gifts`),officialGifts:()=>y(`/api/official-gifts`),officialGiftAnimation:e=>y(`/api/official-gifts/${encodeURIComponent(e)}/animation`),giftAnimation:e=>y(`/api/gifts/${encodeURIComponent(e)}/animation`),giftCollectibles:e=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles`),giftCollectibleAnimation:(e,t,n)=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles/${t}/${encodeURIComponent(n)}/animation`),importGift:e=>y(`/api/actions/import-gift`,{method:`POST`,body:e}),importOfficialGift:e=>y(`/api/actions/import-official-gift`,{method:`POST`,body:JSON.stringify(e)}),publishGiftCollectibles:(e,t)=>y(`/api/actions/publish-gift-collectibles?gift_id=${encodeURIComponent(e)}`,{method:`POST`,body:t}),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},S=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),C=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...w,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),E=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(T,{ref:i,iconNode:t,className:C(`lucide-${S(e)}`,n),...r}));return n.displayName=`${e}`,n},D=E(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=E(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),k=E(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),A=E(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),j=E(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),M=E(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),N=E(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),P=E(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),F=E(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),I=E(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),L=E(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ee=E(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),R=E(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),te=E(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),ne=E(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),re=E(`Gem`,[[`path`,{d:`M6 3h12l4 6-10 13L2 9Z`,key:`1pcd5k`}],[`path`,{d:`M11 3 8 9l4 13 4-13-3-6`,key:`1fcu3u`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),ie=E(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),ae=E(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),oe=E(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),se=E(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),ce=E(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),le=E(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),ue=E(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),z=E(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),B=E(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),de=E(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),fe=E(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),pe=E(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),me=E(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),he=E(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ge=E(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),_e=E(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ve=E(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),ye=E(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),be=E(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),V=E(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),H=E(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),xe=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),U=o(((e,t)=>{t.exports=xe()}))(),Se=`telesrv.admin.lang`,Ce={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"route.gifts":`Star Gifts`,"route.giftsSubtitle":`Console / Star Gifts`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.gifts":`Star Gifts`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Switch to dark theme`,"theme.switchToLight":`Switch to light theme`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.accountFrozen":`Account frozen`,"account.accountActive":`Account active`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeAccount":`Freeze account`,"account.updateFreeze":`Update freeze`,"account.unfreezeAccount":`Unfreeze account`,"account.freezeSince":`Frozen since`,"account.freezeUntil":`Appeal deadline`,"account.freezeUntilAria":`Freeze appeal deadline`,"account.freezeAppealURL":`Appeal URL`,"account.freezeAppealURLAria":`Freeze appeal URL`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"route.bots":`Bots`,"route.botsSubtitle":`Console / Bots`,"layout.bots":`Bots`,"bots.pageTitle":`Bots`,"bots.queryResults":`Search results`,"bots.recent":`Recently created bots`,"bots.currentPage":`Bots on page`,"bots.banned":`Banned`,"bots.active":`Active`,"bots.createTitle":`Create a system bot`,"bots.createHint":`Provision a bot account owned by the given user. The token is shown once after confirmation.`,"bots.ownerUserID":`Owner user ID`,"bots.name":`Display name`,"bots.namePlaceholder":`e.g. Service Bot`,"bots.username":`Username`,"bots.usernameHint":`Username must be 5-32 characters and end with 'bot'.`,"bots.create":`Create bot`,"bots.searchPlaceholder":`Bot ID / username`,"bots.botID":`Bot ID`,"bots.owner":`Owner`,"bots.status":`Status`,"bots.detailTitle":`Bot #{id}`,"bots.profile":`Bot Profile`,"bots.loadingDetail":`Loading bot detail`,"bots.unnamed":`Unnamed bot`,"bots.restriction":`Restriction`,"bots.actionDock":`Bot Actions`,"bots.banUntil":`Ban until`,"bots.ban":`Ban bot`,"bots.updateBan":`Update ban`,"bots.unban":`Unban bot`,"bots.type":`Type`,"bots.system":`System`,"bots.user":`User`,"bots.delete":`Delete bot`,"bots.deleteHint":`Permanently deletes this user-created bot and invalidates its token. This cannot be undone.`,"bots.systemHint":`System bots are built in and cannot be deleted.`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"gifts.pageTitle":`Star Gift Catalog`,"gifts.eyebrow":`Catalog, immutable revisions and animation assets`,"gifts.total":`Catalog entries`,"gifts.enabled":`Enabled`,"gifts.received":`Received gifts`,"gifts.formats":`Accepted formats`,"gifts.add":`Add gift`,"gifts.searchPlaceholder":`Search gift ID, title or format`,"gifts.listSummary":`Showing {shown} of {total}`,"gifts.idRevision":`ID / Revision`,"gifts.price":`Price / Conversion`,"gifts.importTitle":`Import a Star Gift`,"gifts.importEyebrow":`Gift catalog operation`,"gifts.newRevision":`Create revision for gift #{id}`,"gifts.importHint":`Upload TGS or plain Lottie JSON. Lottie is normalized and compressed to TGS.`,"gifts.officialSource":`Official snapshot`,"gifts.fileSource":`Upload file`,"gifts.officialHint":`Choose a verified gift from data/official-gifts. Complete collectible pools are imported atomically.`,"gifts.officialSearch":`Search official gift ID or title`,"gifts.officialSelect":`Choose an official gift`,"gifts.officialRequired":`Choose an official gift first`,"gifts.officialResults":`Showing {shown} of {total}`,"gifts.officialCategoryLabel":`Official gift capability category`,"gifts.officialCategory.all":`All`,"gifts.officialCategory.upgrade":`Upgradable`,"gifts.officialCategory.craft":`Craftable`,"gifts.officialCategory.basic":`Not upgradable`,"gifts.officialUnnamed":`Unnamed official gift #{id}`,"gifts.officialAttributes":`{count} attributes`,"gifts.canUpgrade":`Can upgrade`,"gifts.cannotUpgrade":`Cannot upgrade`,"gifts.canCraft":`Can Craft`,"gifts.cannotCraft":`Cannot Craft`,"gifts.officialEmpty":`No official gifts match this category and search.`,"gifts.includeCollectible":`Import the complete collectible pool, including crafted models`,"gifts.animation":`Animation file`,"gifts.filePrompt":`Drop or choose a TGS / Lottie file`,"gifts.fileHint":`TGS, JSON or Lottie · validated before import`,"gifts.chooseFile":`Choose file`,"gifts.changeFile":`Change file`,"gifts.title":`Display title`,"gifts.titlePlaceholder":`e.g. Celebration Star`,"gifts.stars":`Price in Stars`,"gifts.convertStars":`Conversion Stars`,"gifts.sortOrder":`Sort order`,"gifts.reason":`Audit reason`,"gifts.reasonPlaceholder":`Briefly describe why this gift is being imported`,"gifts.enableAfterImport":`Enable after import`,"gifts.validate":`Dry-run validation`,"gifts.confirmImport":`Confirm import`,"gifts.stepDetails":`File and details`,"gifts.stepValidate":`Dry-run validation`,"gifts.stepImport":`Confirm import`,"gifts.fileRequired":`Choose a TGS or Lottie file first`,"gifts.source":`Source`,"gifts.replace":`New revision`,"gifts.disable":`Disable`,"gifts.enable":`Enable`,"gifts.empty":`No Star Gifts have been imported.`,"gifts.emptyHint":`Import the first animation above to build the gift catalog.`,"gifts.validationReady":`Validation passed`,"gifts.validationHint":`Review the normalized metadata, then confirm the import.`,"gifts.confirmState":`Apply the validated state change to gift #{id}?`,"collectibles.manage":`Attribute pool`,"collectibles.title":`Collectible pool · Gift #{id}`,"collectibles.eyebrow":`Unique gift attributes`,"collectibles.activeRevision":`Published revision {revision}`,"collectibles.published":`Published`,"collectibles.noPool":`No collectible pool published`,"collectibles.noPoolHint":`Publish models, patterns and backdrops to enable upgrades.`,"collectibles.publishNew":`Publish a new immutable revision`,"collectibles.immutableHint":`Dry-run checks every file and the attribute-pool structure before the revision becomes active.`,"collectibles.upgradeStars":`Upgrade price in Stars`,"collectibles.supply":`Unique supply`,"collectibles.slug":`Public slug prefix`,"collectibles.models":`Models`,"collectibles.patterns":`Patterns`,"collectibles.backdrops":`Backdrops`,"collectibles.model":`Model`,"collectibles.pattern":`Pattern`,"collectibles.backdrop":`Backdrop`,"collectibles.rarity":`Rarity ‰`,"collectibles.rarityHint":`Keep at least two attributes. Permille values are relative regular-upgrade weights; add/remove redistributes them to 1000.`,"collectibles.minimumAttributes":`Models, patterns, and backdrops must each contain at least two attributes.`,"collectibles.duplicateBackdropID":`Backdrop IDs must be unique within the pool.`,"collectibles.colorHint":`Colors are stored as 24-bit RGB values.`,"collectibles.addAttribute":`Add`,"collectibles.remove":`Remove attribute`,"collectibles.fileRequired":`Every model and pattern needs a TGS or Lottie file.`,"collectibles.backdropID":`Backdrop ID`,"collectibles.color.center":`Center`,"collectibles.color.edge":`Edge`,"collectibles.color.pattern":`Pattern`,"collectibles.color.text":`Text`,"collectibles.validationReady":`Attribute pool is valid`,"collectibles.validationHint":`Review the normalized assets, then publish this immutable revision.`,"collectibles.publish":`Publish revision`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"route.gifts":`星星礼物`,"route.giftsSubtitle":`控制台 / 星星礼物`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.gifts":`礼物目录`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`切换到深色主题`,"theme.switchToLight":`切换到浅色主题`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.accountFrozen":`账号已冻结`,"account.accountActive":`账号正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeAccount":`冻结账号`,"account.updateFreeze":`更新冻结信息`,"account.unfreezeAccount":`解冻账号`,"account.freezeSince":`冻结开始时间`,"account.freezeUntil":`申诉截止时间`,"account.freezeUntilAria":`账号冻结申诉截止时间`,"account.freezeAppealURL":`申诉链接`,"account.freezeAppealURLAria":`账号冻结申诉链接`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"route.bots":`机器人`,"route.botsSubtitle":`控制台 / 机器人`,"layout.bots":`机器人`,"bots.pageTitle":`机器人`,"bots.queryResults":`查询结果`,"bots.recent":`最近创建的机器人`,"bots.currentPage":`当前页机器人`,"bots.banned":`已封禁`,"bots.active":`正常`,"bots.createTitle":`创建系统机器人`,"bots.createHint":`为指定用户创建机器人账号。确认后 token 只显示一次。`,"bots.ownerUserID":`所属用户 ID`,"bots.name":`显示名称`,"bots.namePlaceholder":`例如:服务机器人`,"bots.username":`用户名`,"bots.usernameHint":`用户名需 5-32 个字符,且以 bot 结尾。`,"bots.create":`创建机器人`,"bots.searchPlaceholder":`机器人 ID / 用户名`,"bots.botID":`机器人 ID`,"bots.owner":`所属用户`,"bots.status":`状态`,"bots.detailTitle":`机器人 #{id}`,"bots.profile":`机器人档案`,"bots.loadingDetail":`加载机器人详情`,"bots.unnamed":`未命名机器人`,"bots.restriction":`限制状态`,"bots.actionDock":`机器人操作`,"bots.banUntil":`封禁至`,"bots.ban":`封禁机器人`,"bots.updateBan":`更新封禁`,"bots.unban":`解封机器人`,"bots.type":`类型`,"bots.system":`系统`,"bots.user":`用户`,"bots.delete":`删除机器人`,"bots.deleteHint":`永久删除该用户创建的机器人并使其 token 失效。此操作不可撤销。`,"bots.systemHint":`系统内置机器人不可删除。`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"gifts.pageTitle":`星星礼物目录`,"gifts.eyebrow":`目录、不可变版本与动画资源`,"gifts.total":`目录条目`,"gifts.enabled":`已启用`,"gifts.received":`已领取礼物`,"gifts.formats":`支持格式`,"gifts.add":`添加礼物`,"gifts.searchPlaceholder":`搜索礼物 ID、标题或格式`,"gifts.listSummary":`显示 {shown} / {total} 项`,"gifts.idRevision":`ID / 版本`,"gifts.price":`售价 / 兑换`,"gifts.importTitle":`导入星星礼物`,"gifts.importEyebrow":`礼物目录操作`,"gifts.newRevision":`为礼物 #{id} 创建新版本`,"gifts.importHint":`支持 TGS 或纯 Lottie JSON;Lottie 会规范化并压缩成 TGS。`,"gifts.officialSource":`官方资源库`,"gifts.fileSource":`上传文件`,"gifts.officialHint":`从 data/official-gifts 的已校验快照中选择;完整 collectible 属性池会与礼物原子导入。`,"gifts.officialSearch":`搜索官方礼物 ID 或标题`,"gifts.officialSelect":`请选择官方礼物`,"gifts.officialRequired":`请先选择一个官方礼物`,"gifts.officialResults":`显示 {shown} / {total} 项`,"gifts.officialCategoryLabel":`官方礼物能力分类`,"gifts.officialCategory.all":`全部`,"gifts.officialCategory.upgrade":`可升级`,"gifts.officialCategory.craft":`可 Craft`,"gifts.officialCategory.basic":`不可升级`,"gifts.officialUnnamed":`未命名官方礼物 #{id}`,"gifts.officialAttributes":`{count} 个属性`,"gifts.canUpgrade":`可升级`,"gifts.cannotUpgrade":`不可升级`,"gifts.canCraft":`可 Craft`,"gifts.cannotCraft":`不可 Craft`,"gifts.officialEmpty":`当前分类和搜索条件下没有官方礼物。`,"gifts.includeCollectible":`完整导入 collectible 属性池(包含 crafted 模型)`,"gifts.animation":`动画文件`,"gifts.filePrompt":`拖放或选择 TGS / Lottie 文件`,"gifts.fileHint":`支持 TGS、JSON、Lottie,导入前会先进行校验`,"gifts.chooseFile":`选择文件`,"gifts.changeFile":`更换文件`,"gifts.title":`显示标题`,"gifts.titlePlaceholder":`例如:庆典星星`,"gifts.stars":`售价 Stars`,"gifts.convertStars":`可兑换 Stars`,"gifts.sortOrder":`排序值`,"gifts.reason":`审计原因`,"gifts.reasonPlaceholder":`简要说明本次导入礼物的原因`,"gifts.enableAfterImport":`导入后启用`,"gifts.validate":`Dry-run 校验`,"gifts.confirmImport":`确认导入`,"gifts.stepDetails":`文件与信息`,"gifts.stepValidate":`Dry-run 校验`,"gifts.stepImport":`确认导入`,"gifts.fileRequired":`请先选择 TGS 或 Lottie 文件`,"gifts.source":`来源`,"gifts.replace":`创建新版本`,"gifts.disable":`停用`,"gifts.enable":`启用`,"gifts.empty":`尚未导入星星礼物。`,"gifts.emptyHint":`从上方导入第一个动画,开始搭建礼物目录。`,"gifts.validationReady":`校验已通过`,"gifts.validationHint":`确认规范化后的元数据无误,再执行正式导入。`,"gifts.confirmState":`确认执行礼物 #{id} 的状态变更吗?`,"collectibles.manage":`属性池`,"collectibles.title":`Collectibles 属性池 · 礼物 #{id}`,"collectibles.eyebrow":`唯一礼物属性管理`,"collectibles.activeRevision":`已发布版本 {revision}`,"collectibles.published":`已发布`,"collectibles.noPool":`尚未发布 Collectibles 属性池`,"collectibles.noPoolHint":`发布模型、图案与背景后,客户端即可升级为唯一礼物。`,"collectibles.publishNew":`发布新的不可变版本`,"collectibles.immutableHint":`Dry-run 会校验全部文件和属性池结构,通过后才切换为当前版本。`,"collectibles.upgradeStars":`升级价格 Stars`,"collectibles.supply":`唯一礼物总量`,"collectibles.slug":`公开 Slug 前缀`,"collectibles.models":`模型`,"collectibles.patterns":`图案`,"collectibles.backdrops":`背景`,"collectibles.model":`模型`,"collectibles.pattern":`图案`,"collectibles.backdrop":`背景`,"collectibles.rarity":`稀有度 ‰`,"collectibles.rarityHint":`每类至少保留两项。Permille 是普通升级的相对权重,增删时会自动重新分配为 1000。`,"collectibles.minimumAttributes":`模型、图案和背景每类都必须至少包含两个属性。`,"collectibles.duplicateBackdropID":`同一属性池中的背景 ID 必须唯一。`,"collectibles.colorHint":`颜色会按 24 位 RGB 数值保存。`,"collectibles.addAttribute":`添加`,"collectibles.remove":`删除属性`,"collectibles.fileRequired":`每个模型和图案都必须选择 TGS 或 Lottie 文件。`,"collectibles.backdropID":`背景 ID`,"collectibles.color.center":`中心色`,"collectibles.color.edge":`边缘色`,"collectibles.color.pattern":`图案色`,"collectibles.color.text":`文字色`,"collectibles.validationReady":`属性池校验通过`,"collectibles.validationHint":`确认规范化资源无误后,即可发布这个不可变版本。`,"collectibles.publish":`发布版本`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`},ru:{"app.adminConsole":`Панель администратора`,"app.localAccess":`Локальный доступ`,"app.title":`telesrv admin`,"common.actions":`Действия`,"common.admins":`Администраторы`,"common.backToList":`Назад к списку`,"common.channel":`Канал`,"common.channelOrGroup":`Канал / Группа`,"common.clear":`Очистить`,"common.close":`Закрыть`,"common.count":`Количество`,"common.deleted":`Удалено`,"common.detail":`Детали`,"common.device":`Устройство`,"common.disabled":`Отключено`,"common.enabled":`Включено`,"common.fromPeer":`От пира`,"common.group":`Группа`,"common.id":`ID`,"common.limit":`Лимит`,"common.loading":`Загрузка…`,"common.member":`Участник`,"common.members":`Участники`,"common.messageId":`ID сообщения`,"common.name":`Имя`,"common.no":`Нет`,"common.noResults":`Нет результатов`,"common.none":`Нет`,"common.normal":`Обычный`,"common.operations":`Операции`,"common.owner":`Владелец`,"common.platform":`Платформа`,"common.refresh":`Обновить`,"common.search":`Поиск`,"common.sender":`Отправитель`,"common.status":`Статус`,"common.survived":`Уцелело`,"common.time":`Время`,"common.type":`Тип`,"common.updatedAt":`Обновлено`,"common.username":`Имя пользователя`,"common.valid":`Действителен`,"common.verified":`Подтверждён`,"common.views":`Просмотры`,"common.yes":`Да`,"route.accounts":`Аккаунты`,"route.accountsSubtitle":`Консоль / Аккаунты`,"route.channels":`Супергруппы и каналы`,"route.channelsSubtitle":`Консоль / Каналы`,"route.dashboard":`Панель управления`,"route.dashboardSubtitle":`Консоль / Обзор`,"route.messages":`Аудит сообщений`,"route.messagesSubtitle":`Консоль / Сообщения`,"route.gifts":`Звёздные подарки`,"route.giftsSubtitle":`Консоль / Звёздные подарки`,"layout.navigation":`Навигация`,"layout.primaryNav":`Основное меню`,"layout.dashboard":`Обзор`,"layout.accounts":`Аккаунты`,"layout.channels":`Супергруппы / Каналы`,"layout.messages":`Сообщения`,"layout.gifts":`Звёздные подарки`,"layout.privateMessages":`Личные`,"layout.groupMessages":`Группы`,"layout.runtime":`Среда выполнения`,"layout.adminBackend":`Админ-бэкенд`,"layout.ready":`Готов`,"layout.pgRead":`Чтение из PG`,"layout.readOnly":`Только чтение`,"layout.writeOps":`Операции записи`,"layout.dryRun":`Тестовый запуск`,"layout.actor":`Вы вошли как: {actor}`,"layout.logout":`Выйти`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Тёмная тема`,"theme.switchToLight":`Светлая тема`,"login.heading":`Панель администратора`,"login.body":`Введите учётные данные для входа в консоль.`,"login.secret":`Пароль или токен администратора`,"login.submit":`Войти`,"login.submitting":`Вход…`,"dashboard.eyebrow":`Состояние системы`,"dashboard.title":`Обзор консоли`,"dashboard.readPath":`Путь чтения`,"dashboard.readPathValue":`PG только для чтения`,"dashboard.writePath":`Путь записи`,"dashboard.executionPolicy":`Политика выполнения`,"dashboard.dryRunFirst":`Сначала тестовый запуск`,"dashboard.accountsText":`Статус аккаунтов, Premium, подтверждение, сессии.`,"dashboard.channelsText":`Публичные каналы и группы, число участников, статус подтверждения.`,"dashboard.messagesText":`Ящики сообщений, обновления, состояние исходящих.`,"dashboard.strip.dryRun":`Все опасные действия начинаются с тестового запуска`,"dashboard.strip.token":`Браузер никогда не сохраняет внутренние токены`,"dashboard.strip.pagination":`Списки используют курсорную пагинацию`,"dashboard.strip.snapshot":`Детальные страницы сохраняют моментальные снимки исходного состояния`,"account.pageTitle":`Аккаунты`,"account.queryResults":`Результаты поиска`,"account.recentActive":`Недавно активные аккаунты`,"account.currentPage":`Аккаунты на странице`,"account.onlineDevices":`Активные сессии устройств`,"account.premium":`Premium`,"account.frozen":`Заморожен`,"account.searchPlaceholder":`ID пользователя / телефон / имя пользователя`,"account.userID":`ID пользователя`,"account.phone":`Телефон`,"account.lastActive":`Последняя активность`,"account.notVerified":`Не подтверждён`,"account.notPremium":`Без Premium`,"account.premiumUntil":`Premium истекает`,"account.starsBalance":`Баланс Звёзд`,"account.startingGrantApplied":`стартовый бонус начислен`,"account.startingGrantPending":`ожидает стартового бонуса`,"account.activeSessions":`Авторизованные устройства`,"account.accountFlags":`Флаги аккаунта`,"account.restriction":`Ограничение`,"account.restricted":`Ограничен`,"account.createdAt":`Создан`,"account.detailTitle":`Аккаунт #{id}`,"account.profile":`Профиль аккаунта`,"account.loadingDetail":`Загрузка данных аккаунта`,"account.waitingData":`Ожидание данных`,"account.noUsername":`Нет имени пользователя`,"account.noPhone":`Нет телефона`,"account.accountFrozen":`Аккаунт заморожен`,"account.accountActive":`Аккаунт активен`,"account.authorizationsTitle":`Авторизованные устройства`,"account.authorizationsCount":`Авторизаций: {count}`,"account.recentAdminOps":`Последние действия администратора`,"account.recent30Audit":`Последние 30 записей аудита`,"account.actionDock":`Действия с аккаунтом`,"account.freezeAccount":`Заморозить аккаунт`,"account.updateFreeze":`Обновить параметры заморозки`,"account.unfreezeAccount":`Разморозить аккаунт`,"account.freezeSince":`Заморожен с`,"account.freezeUntil":`Срок подачи апелляции`,"account.freezeUntilAria":`Срок подачи апелляции на заморозку`,"account.freezeAppealURL":`URL для апелляции`,"account.freezeAppealURLAria":`URL для апелляции на заморозку`,"account.premiumMonths":`Срок действия Premium (в месяцах)`,"account.premiumMonthsAria":`Указать срок действия Premium в месяцах`,"account.setPremium":`Выдать Premium`,"account.clearPremium":`Снять Premium`,"account.starsAmount":`Количество Звёзд`,"account.starsAmountAria":`Указать количество начисляемых Звёзд`,"account.grantStars":`Начислить Звёзды`,"account.setVerified":`Подтвердить аккаунт`,"account.clearVerified":`Снять подтверждение`,"channel.pageTitle":`Супергруппы и каналы`,"channel.recentUpdated":`Недавно обновлённые`,"channel.currentPage":`Объекты на странице`,"channel.megagroups":`Супергруппы`,"channel.broadcasts":`Каналы`,"channel.verifiedCount":`Подтверждённые`,"channel.searchPlaceholder":`ID канала / имя пользователя / название`,"channel.channelID":`ID канала`,"channel.kind":`Тип`,"channel.title":`Название`,"channel.pts":`PTS`,"channel.detailProfile":`Профиль канала`,"channel.loadingDetail":`Загрузка данных канала`,"channel.creator":`Создатель: {id}`,"channel.governance":`Модерация`,"channel.governanceValue":`Заблокировано {banned} / Исключено {kicked}`,"channel.flags":`Флаги канала`,"channel.rawRow":`Исходная строка БД`,"channel.rawRowText":`Снимок базы данных только для чтения`,"channel.actionDock":`Действия с каналом`,"channel.setVerified":`Подтвердить канал`,"channel.clearVerified":`Снять подтверждение`,"channel.kind.broadcast":`Канал`,"channel.kind.forum":`Супергруппа / Форум`,"channel.kind.megagroup":`Супергруппа`,"channel.kind.generic":`Канал / Группа`,"route.bots":`Боты`,"route.botsSubtitle":`Консоль / Боты`,"layout.bots":`Боты`,"bots.pageTitle":`Боты`,"bots.queryResults":`Результаты поиска`,"bots.recent":`Недавно созданные боты`,"bots.currentPage":`Боты на странице`,"bots.banned":`Забанен`,"bots.active":`Активен`,"bots.createTitle":`Создать системного бота`,"bots.createHint":`Создаёт бота, принадлежащего указанному пользователю. Токен показывается один раз после подтверждения.`,"bots.ownerUserID":`ID владельца`,"bots.name":`Отображаемое имя`,"bots.namePlaceholder":`например, Service Bot`,"bots.username":`Имя пользователя`,"bots.usernameHint":`Имя пользователя: 5–32 символа, обязательно оканчивается на «bot».`,"bots.create":`Создать бота`,"bots.searchPlaceholder":`ID бота / имя пользователя`,"bots.botID":`ID бота`,"bots.owner":`Владелец`,"bots.status":`Статус`,"bots.detailTitle":`Бот #{id}`,"bots.profile":`Профиль бота`,"bots.loadingDetail":`Загрузка данных бота`,"bots.unnamed":`Без имени`,"bots.restriction":`Ограничение`,"bots.actionDock":`Действия с ботом`,"bots.banUntil":`Забанить до`,"bots.ban":`Забанить бота`,"bots.updateBan":`Обновить бан`,"bots.unban":`Разбанить бота`,"bots.type":`Тип`,"bots.system":`Системный`,"bots.user":`Пользовательский`,"bots.delete":`Удалить бота`,"bots.deleteHint":`Безвозвратно удаляет созданного пользователем бота и аннулирует его токен. Действие необратимо.`,"bots.systemHint":`Системные боты встроены и не могут быть удалены.`,"messages.privateTitle":`Личные сообщения`,"messages.privateEyebrow":`Личные ящики сообщений`,"messages.groupTitle":`Групповые сообщения`,"messages.groupEyebrow":`Сообщения супергрупп и каналов`,"messages.selectPrivatePeers":`Сначала найдите и выберите владельца и собеседника`,"messages.selectChannel":`Сначала найдите и выберите супергруппу или канал`,"messages.ownerUser":`Пользователь-владелец`,"messages.peerUser":`Собеседник`,"messages.beforeDatePlaceholder":`курсор before_date`,"messages.beforeIDPlaceholder":`курсор before_msg_id`,"messages.limitPlaceholder":`лимит <= 100`,"messages.searchMessages":`Поиск сообщений`,"messages.nextPage":`Следующая страница`,"messages.currentPage":`Сообщения на странице`,"messages.deleted":`Удалено`,"messages.outgoing":`Исходящее`,"messages.incoming":`Входящее`,"messages.ownerPeer":`Владелец / Собеседник`,"messages.deleteSelected":`Удалить выбранные сообщения`,"messages.idsPlaceholder":`ID сообщений через запятую`,"messages.revoke":`Удалить для обеих сторон`,"messages.previewDelete":`Тестовое удаление`,"messages.clearHistory":`Очистить историю личной переписки`,"messages.maxIDPlaceholder":`граница max_id`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Очистить только у себя`,"messages.previewClearHistory":`Тестовая очистка истории`,"messages.direction":`Направление`,"messages.body":`Текст сообщения`,"messages.privateDetailTitle":`Сообщение #{id}`,"messages.detailEyebrow":`Детали сообщения`,"messages.backPrivate":`Назад к личным сообщениям`,"messages.backGroup":`Назад к групповым сообщениям`,"messages.ownerPeerTitle":`Владелец {owner} · Собеседник {peer}`,"messages.senderSubtitle":`Отправитель {sender} · {date}`,"messages.boxID":`ID ящика сообщений`,"messages.privateMessageID":`ID личного сообщения`,"messages.messageSender":`Отправитель сообщения`,"messages.messageBox":`Ящик сообщений`,"messages.dialogRow":`Строка диалога`,"messages.privateRow":`Строка личного сообщения`,"messages.channelMessageRow":`Строка сообщения канала`,"messages.channelRow":`Строка канала`,"messages.userUpdateEvents":`События обновления пользователей`,"messages.channelUpdateEvents":`События обновления каналов`,"messages.eventJson":`JSON события`,"messages.dispatchOutbox":`Очередь отправки (Outbox)`,"messages.messageBoxesSnapshot":`Снимок message_boxes только для чтения`,"messages.dialogSnapshot":`Снимок dialogs только для чтения`,"messages.privateSnapshot":`Снимок private_messages только для чтения`,"messages.channelMessagesSnapshot":`Снимок channel_messages только для чтения`,"messages.channelSnapshot":`Снимок channels только для чтения`,"messages.userEventsSource":`постоянные user_update_events`,"messages.channelEventsSource":`постоянные channel_update_events`,"messages.outboxSource":`онлайн/офлайн dispatch_outbox`,"messages.attempts":`Попытки`,"messages.deleteThis":`Удалить это сообщение`,"messages.groupDetailTitle":`Групповое сообщение #{id}`,"messages.channelGroupTitle":`Канал / Группа {id}`,"messages.mediaCount":`С медиафайлами`,"messages.channelPosts":`Посты канала`,"messages.channelGroup":`Канал / Группа`,"messages.pinned":`Закреплено`,"messages.channelPost":`Пост в канале`,"gifts.pageTitle":`Каталог звёздных подарков`,"gifts.eyebrow":`Каталог, неизменяемые версии и файлы анимаций`,"gifts.total":`Подарков в каталоге`,"gifts.enabled":`Включено`,"gifts.received":`Полученные подарки`,"gifts.formats":`Поддерживаемые форматы`,"gifts.add":`Добавить подарок`,"gifts.searchPlaceholder":`Поиск по ID подарка, названию или формату`,"gifts.listSummary":`Показано {shown} из {total}`,"gifts.idRevision":`ID / Версия`,"gifts.price":`Цена / Конвертация`,"gifts.importTitle":`Импорт звёздного подарка`,"gifts.importEyebrow":`Управление каталогом подарков`,"gifts.newRevision":`Создать версию для подарка #{id}`,"gifts.importHint":`Загрузите файл TGS или обычный Lottie JSON. Lottie нормализуется и сжимается в формат TGS.`,"gifts.officialSource":`Официальный снимок`,"gifts.fileSource":`Загрузить файл`,"gifts.officialHint":`Выберите проверенный подарок из data/official-gifts. Полные пулы коллекционных предметов импортируются атомарно.`,"gifts.officialSearch":`Поиск по ID или названию официального подарка`,"gifts.officialSelect":`Выберите официальный подарок`,"gifts.officialRequired":`Сначала выберите официальный подарок`,"gifts.officialResults":`Показано {shown} из {total}`,"gifts.officialCategoryLabel":`Категория возможностей официального подарка`,"gifts.officialCategory.all":`Все`,"gifts.officialCategory.upgrade":`Можно улучшить`,"gifts.officialCategory.craft":`Можно создать`,"gifts.officialCategory.basic":`Нельзя улучшить`,"gifts.officialUnnamed":`Официальный подарок без названия #{id}`,"gifts.officialAttributes":`Атрибутов: {count}`,"gifts.canUpgrade":`Можно улучшить`,"gifts.cannotUpgrade":`Нельзя улучшить`,"gifts.canCraft":`Можно создать`,"gifts.cannotCraft":`Нельзя создать`,"gifts.officialEmpty":`Нет подарков, соответствующих категории и поиску.`,"gifts.includeCollectible":`Импортировать полный пул коллекционных предметов, включая созданные модели`,"gifts.animation":`Файл анимации`,"gifts.filePrompt":`Перетащите или выберите файл TGS / Lottie`,"gifts.fileHint":`TGS, JSON или Lottie · файл проверяется перед импортом`,"gifts.chooseFile":`Выбрать файл`,"gifts.changeFile":`Изменить файл`,"gifts.title":`Отображаемое название`,"gifts.titlePlaceholder":`например, Праздничная звезда`,"gifts.stars":`Цена в Звёздах`,"gifts.convertStars":`Звёзд при конвертации`,"gifts.sortOrder":`Порядок сортировки`,"gifts.reason":`Причина для аудита`,"gifts.reasonPlaceholder":`Кратко опишите причину импорта этого подарка`,"gifts.enableAfterImport":`Включить после импорта`,"gifts.validate":`Тестовая проверка`,"gifts.confirmImport":`Подтвердить импорт`,"gifts.stepDetails":`Файл и описание`,"gifts.stepValidate":`Тестовая проверка`,"gifts.stepImport":`Подтверждение импорта`,"gifts.fileRequired":`Сначала выберите файл TGS или Lottie`,"gifts.source":`Источник`,"gifts.replace":`Новая версия`,"gifts.disable":`Отключить`,"gifts.enable":`Включить`,"gifts.empty":`Звёздные подарки ещё не импортированы.`,"gifts.emptyHint":`Импортируйте первую анимацию, чтобы начать наполнение каталога.`,"gifts.validationReady":`Проверка пройдена`,"gifts.validationHint":`Проверьте нормализованные метаданные и подтвердите импорт.`,"gifts.confirmState":`Применить проверенные изменения состояния к подарку #{id}?`,"collectibles.manage":`Пул атрибутов`,"collectibles.title":`Пул коллекционных предметов · Подарок #{id}`,"collectibles.eyebrow":`Уникальные атрибуты подарка`,"collectibles.activeRevision":`Опубликованная версия {revision}`,"collectibles.published":`Опубликовано`,"collectibles.noPool":`Нет опубликованного пула коллекционных предметов`,"collectibles.noPoolHint":`Опубликуйте модели, узоры и фоны для активации улучшений.`,"collectibles.publishNew":`Опубликовать новую неизменяемую версию`,"collectibles.immutableHint":`Тестовый запуск проверяет каждый файл и структуру набора атрибутов перед активацией версии.`,"collectibles.upgradeStars":`Цена улучшения в Звёздах`,"collectibles.supply":`Уникальный тираж`,"collectibles.slug":`Публичный префикс ссылки (slug)`,"collectibles.models":`Модели`,"collectibles.patterns":`Узоры`,"collectibles.backdrops":`Фоны`,"collectibles.model":`Модель`,"collectibles.pattern":`Узор`,"collectibles.backdrop":`Фон`,"collectibles.rarity":`Редкость ‰`,"collectibles.rarityHint":`В каждой категории должно быть не менее двух атрибутов. Значения в промилле задают относительные веса обычного улучшения; при добавлении или удалении они перераспределяются до суммы 1000.`,"collectibles.minimumAttributes":`Модели, узоры и фоны должны содержать не менее двух атрибутов в каждой категории.`,"collectibles.duplicateBackdropID":`ID фонов в одном наборе должны быть уникальными.`,"collectibles.colorHint":`Цвета сохраняются как 24-битные RGB-значения.`,"collectibles.addAttribute":`Добавить`,"collectibles.remove":`Удалить атрибут`,"collectibles.fileRequired":`Для каждой модели и узора требуется файл TGS или Lottie.`,"collectibles.backdropID":`ID фона`,"collectibles.color.center":`Центр`,"collectibles.color.edge":`Край`,"collectibles.color.pattern":`Узор`,"collectibles.color.text":`Текст`,"collectibles.validationReady":`Пул атрибутов корректен`,"collectibles.validationHint":`Проверьте нормализованные ресурсы и опубликуйте эту неизменяемую версию.`,"collectibles.publish":`Опубликовать версию`,"messages.msgIDsInvalid":`Некорректные ID сообщений`,"auth.device":`Устройство`,"auth.platform":`Платформа`,"auth.ip":`IP-адрес`,"auth.lastActive":`Последняя активность`,"auth.revokeCurrent":`Отозвать текущую`,"auth.keepCurrent":`Оставить текущую`,"auth.revokeAll":`Отозвать все устройства`,"picker.userPlaceholder":`Поиск по user_id / телефону / имени пользователя`,"picker.channelPlaceholder":`Поиск по channel_id / имени пользователя / названию`,"picker.verified":`Подтверждённые`,"picker.regular":`Обычные`,"action.reasonRequired":`Пожалуйста, укажите причину операции`,"action.flow":`Процесс выполнения`,"action.close":`Закрыть`,"action.stepReason":`Укажите причину`,"action.stepDryRun":`Тестовый запуск`,"action.stepConfirm":`Подтверждение выполнения`,"action.reason":`Причина операции`,"action.reasonPlaceholder":`Опишите, почему выполняется эта операция`,"action.requestPreview":`Запросить предпросмотр`,"action.result":`Результат действия`,"action.commandID":`ID команды`,"action.status":`Статус`,"action.dryRun":`Тестовый запуск`,"action.runAgain":`Повторить тестовый запуск`,"action.runDry":`Сначала выполните тестовый запуск`,"action.confirm":`Подтвердить выполнение`,"audit.id":`ID`,"audit.commandID":`ID команды`,"audit.action":`Действие`,"audit.actor":`Исполнитель`,"audit.status":`Статус`,"audit.dryRun":`Тестовый запуск`,"audit.reason":`Причина`,"audit.time":`Время`}},we=(0,g.createContext)(null);function Te({children:e}){let[t,n]=(0,g.useState)(()=>Oe());(0,g.useEffect)(()=>{try{localStorage.setItem(Se,t)}catch{}let e=t===`zh`?`zh-CN`:t===`ru`?`ru`:`en`;document.documentElement.lang=e,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=De(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>De(t,e,n)}),[t]);return(0,U.jsx)(we.Provider,{value:r,children:e})}function W(){let e=(0,g.useContext)(we);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function Ee(){let{lang:e,setLang:t,t:n}=W();return(0,U.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`,`ru`].map(r=>(0,U.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function De(e,t,n){let r=Ce[e][t]??Ce.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function Oe(){try{let e=ke(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=ke(localStorage.getItem(Se));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=ke(t);if(e)return e}return`en`}function ke(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:t===`ru`||t.startsWith(`ru-`)?`ru`:null}function Ae(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function je(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/bots`)?t(`route.bots`):e.startsWith(`/messages`)?t(`route.messages`):e.startsWith(`/gifts`)?t(`route.gifts`):t(`route.dashboard`)}function Me(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/bots`)?t(`route.botsSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):e.startsWith(`/gifts`)?t(`route.giftsSubtitle`):t(`route.dashboardSubtitle`)}var Ne=`telesrv.admin.theme`,Pe=(0,g.createContext)(null);function Fe(e){document.documentElement.setAttribute(`data-theme`,e),document.documentElement.style.colorScheme=e}function Ie({children:e}){let[t,n]=(0,g.useState)(()=>ze());(0,g.useEffect)(()=>{Fe(t);try{localStorage.setItem(Ne,t)}catch{}},[t]),(0,g.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>{let t=null;try{t=localStorage.getItem(Ne)}catch{t=null}t!==`light`&&t!==`dark`&&n(e.matches?`dark`:`light`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let r=(0,g.useCallback)(e=>n(e),[]),i=(0,g.useCallback)(()=>n(e=>e===`dark`?`light`:`dark`),[]),a=(0,g.useMemo)(()=>({theme:t,setTheme:r,toggleTheme:i}),[t,r,i]);return(0,U.jsx)(Pe.Provider,{value:a,children:e})}function Le(){let e=(0,g.useContext)(Pe);if(!e)throw Error(`useTheme must be used inside ThemeProvider`);return e}function Re(){let{theme:e,toggleTheme:t}=Le(),{t:n}=W(),r=n(e===`light`?`theme.switchToDark`:`theme.switchToLight`);return(0,U.jsx)(`button`,{className:`theme-toggle`,type:`button`,onClick:t,"aria-label":r,title:r,children:e===`dark`?(0,U.jsx)(ve,{size:16}):(0,U.jsx)(ue,{size:16})})}function ze(){try{let e=localStorage.getItem(Ne);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches)return`dark`}catch{}return`light`}function G({href:e,navigate:t,className:n,children:r}){return(0,U.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function Be(){let{t:e}=W();return(0,U.jsxs)(`div`,{className:`boot-screen`,children:[(0,U.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,U.jsx)(`div`,{className:`loader-bar`})]})}function Ve({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=W(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,U.jsxs)(`div`,{className:`shell`,children:[(0,U.jsxs)(`aside`,{className:`sidebar`,children:[(0,U.jsxs)(G,{className:`brand`,href:`/`,navigate:n,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,U.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,U.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,U.jsx)(He,{icon:(0,U.jsx)(se,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(V,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(he,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(N,{size:16}),href:`/bots`,route:t,navigate:n,children:a(`layout.bots`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(ie,{size:16}),href:`/gifts`,route:t,navigate:n,children:a(`layout.gifts`)}),(0,U.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,U.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,U.jsx)(le,{size:16}),(0,U.jsx)(`span`,{children:a(`layout.messages`)}),(0,U.jsx)(I,{className:`nav-section-chevron`,size:15})]}),s&&(0,U.jsxs)(`div`,{className:`nav-children`,children:[(0,U.jsx)(He,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,U.jsx)(He,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,U.jsxs)(`div`,{className:`sidebar-status`,children:[(0,U.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(me,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,U.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(R,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,U.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(ge,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,U.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,U.jsxs)(`div`,{className:`workspace`,children:[(0,U.jsxs)(`header`,{className:`topbar`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:Me(t.path,a)}),(0,U.jsx)(`h1`,{children:je(t.path,a)})]}),(0,U.jsxs)(`div`,{className:`topbar-actions`,children:[(0,U.jsx)(Re,{}),(0,U.jsx)(Ee,{}),(0,U.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,U.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,U.jsx)(ce,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,U.jsx)(`main`,{className:`content`,children:i})]})]})}function He({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,U.jsxs)(G,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,U.jsx)(`span`,{children:i})]})}function Ue(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function We(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function Ge(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function Ke(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function K(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function qe(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function q(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function Je(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function Ye({title:e,eyebrow:t,children:n,actions:r}){return(0,U.jsxs)(`div`,{className:`page-frame`,children:[(0,U.jsxs)(`div`,{className:`page-title-row`,children:[(0,U.jsxs)(`div`,{children:[t&&(0,U.jsx)(`div`,{className:`eyebrow`,children:t}),(0,U.jsx)(`h2`,{children:e})]}),r&&(0,U.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function Xe({children:e}){return(0,U.jsx)(`div`,{className:`query-panel`,children:e})}function Ze({main:e,side:t}){return(0,U.jsxs)(`div`,{className:`split-layout`,children:[(0,U.jsx)(`div`,{className:`split-main`,children:e}),(0,U.jsx)(`aside`,{className:`split-side`,children:t})]})}function Qe({title:e,text:t,action:n}){return(0,U.jsxs)(`div`,{className:`section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{children:e}),t&&(0,U.jsx)(`p`,{children:t})]}),n&&(0,U.jsx)(`div`,{className:`section-action`,children:n})]})}function $e({children:e}){return(0,U.jsxs)(`div`,{className:`alert`,children:[(0,U.jsx)(O,{size:16}),` `,(0,U.jsx)(`span`,{children:e})]})}function J({children:e,tone:t=`neutral`}){return(0,U.jsx)(`span`,{className:`badge ${t}`,children:e})}function et({label:e,value:t,tone:n}){return(0,U.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{children:t})]})}function tt({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,U.jsxs)(`div`,{className:`metric ${n}`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function Y({label:e,value:t,mono:n=!1}){return(0,U.jsxs)(`div`,{className:`summary-item`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function nt({rows:e}){let{t}=W();return(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`audit.id`)}),(0,U.jsx)(`th`,{children:t(`audit.commandID`)}),(0,U.jsx)(`th`,{children:t(`audit.action`)}),(0,U.jsx)(`th`,{children:t(`audit.actor`)}),(0,U.jsx)(`th`,{children:t(`audit.status`)}),(0,U.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,U.jsx)(`th`,{children:t(`audit.reason`)}),(0,U.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[e.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.ID}),(0,U.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,U.jsx)(`td`,{children:e.Action}),(0,U.jsx)(`td`,{children:e.Actor}),(0,U.jsx)(`td`,{children:e.Status}),(0,U.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,U.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,U.jsx)(`td`,{children:K(e.CreatedAt)})]},e.ID)),e.length===0&&(0,U.jsx)(rt,{colSpan:8})]})]})})}function rt({colSpan:e}){let{t}=W();return(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function it({label:e}){return(0,U.jsx)(`section`,{className:`surface`,children:(0,U.jsx)(`div`,{className:`loading-line`,children:e})})}function at({value:e}){return(0,U.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function ot({onLogin:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,U.jsx)(`main`,{className:`login-page`,children:(0,U.jsxs)(`section`,{className:`login-panel`,children:[(0,U.jsxs)(`div`,{className:`login-head`,children:[(0,U.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,U.jsxs)(`div`,{className:`login-head-actions`,children:[(0,U.jsx)(Re,{}),(0,U.jsx)(Ee,{}),(0,U.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,U.jsxs)(`div`,{className:`login-copy`,children:[(0,U.jsx)(`h1`,{children:t(`login.heading`)}),(0,U.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,U.jsx)($e,{children:i}),(0,U.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:t(`login.secret`)}),(0,U.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,U.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var st=m();function ct({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=W(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function S(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let C=f?.dry_run&&!f.error,w=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,T=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{className:w,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,st.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,U.jsx)(`h2`,{children:e})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,U.jsx)(H,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body`,children:[(0,U.jsxs)(`div`,{className:`command-steps`,children:[(0,U.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,U.jsx)(`span`,{children:`1`}),(0,U.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`2`}),(0,U.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:C?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`3`}),(0,U.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,U.jsxs)(`label`,{className:`form-field`,children:[(0,U.jsx)(`span`,{children:s(`action.reason`)}),(0,U.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,U.jsxs)(`div`,{className:`command-preview`,children:[(0,U.jsxs)(`div`,{className:`preview-head`,children:[(0,U.jsx)(ne,{size:14}),` `,s(`action.requestPreview`)]}),(0,U.jsx)(at,{value:JSON.stringify(T,null,2)})]}),m&&(0,U.jsx)($e,{children:m}),f&&(0,U.jsxs)(`div`,{className:`result-box`,children:[(0,U.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,U.jsx)(O,{size:16}):(0,U.jsx)(k,{size:16}),(0,U.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.commandID`)}),(0,U.jsx)(`strong`,{children:f.command_id})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.status`)}),(0,U.jsx)(`strong`,{children:f.status})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.dryRun`)}),(0,U.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,U.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,U.jsx)(at,{value:JSON.stringify(f.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>S(!1),disabled:_,children:[_?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(B,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,U.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>S(!0),disabled:_||!C,children:[(0,U.jsx)(k,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function lt({rows:e,userID:t,onDone:n}){let{t:r}=W(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,U.jsxs)(`div`,{className:`authorization-block`,children:[(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:r(`auth.device`)}),(0,U.jsx)(`th`,{children:r(`auth.platform`)}),(0,U.jsx)(`th`,{children:r(`auth.ip`)}),(0,U.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,U.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,U.jsxs)(`tbody`,{children:[o.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,U.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,U.jsx)(`td`,{children:n.IP}),(0,U.jsx)(`td`,{children:K(n.ActiveAt)}),(0,U.jsx)(`td`,{className:`device-actions-cell`,children:(0,U.jsxs)(`div`,{className:`device-actions`,children:[(0,U.jsx)(ct,{label:r(`auth.revokeCurrent`),icon:(0,U.jsx)(ce,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,U.jsx)(ct,{label:r(`auth.keepCurrent`),icon:(0,U.jsx)(he,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,U.jsx)(rt,{colSpan:5})]})]})}),(0,U.jsx)(`div`,{className:`danger-zone`,children:(0,U.jsx)(ct,{label:r(`auth.revokeAll`),icon:(0,U.jsx)(P,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function ut({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`),[p,m]=(0,g.useState)(()=>dt(new Date(Date.now()+7*864e5))),[h,_]=(0,g.useState)(``);async function v(){c(!0),o(``);try{let t=await x.account(e);i(t),t.Restriction.Frozen&&(t.Restriction.Until&&m(dt(new Date(t.Restriction.Until))),_(t.Restriction.AppealURL||``))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{v()},[e]),a)return(0,U.jsx)($e,{children:a});if(!r)return(0,U.jsx)(it,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let y=r.Account;return(0,U.jsx)(Ye,{title:n(`account.detailTitle`,{id:y.ID}),eyebrow:n(`account.profile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,U.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:Ge(y)}),(0,U.jsxs)(`div`,{className:`entity-subtitle`,children:[We(y.Username)||n(`account.noUsername`),` · `,Ue(y.Phone)||n(`account.noPhone`)]})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[y.PremiumUntil>0?(0,U.jsx)(J,{tone:`good`,children:n(`account.premium`)}):(0,U.jsx)(J,{children:n(`account.notPremium`)}),r.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)}),y.Frozen?(0,U.jsx)(J,{tone:`danger`,children:n(`account.accountFrozen`)}):(0,U.jsx)(J,{children:n(`account.accountActive`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:n(`account.userID`),value:String(y.ID),mono:!0}),(0,U.jsx)(Y,{label:n(`account.lastActive`),value:qe(r.LastSeenAt)||`-`}),(0,U.jsx)(Y,{label:n(`account.premiumUntil`),value:y.PremiumUntil>0?qe(y.PremiumUntil):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,U.jsx)(Y,{label:n(`common.updatedAt`),value:K(y.UpdatedAt)||`-`}),(0,U.jsx)(Y,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,U.jsx)(Y,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,U.jsx)(Y,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.freezeSince`),value:r.Restriction.Since?K(r.Restriction.Since):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.freezeUntil`),value:r.Restriction.Until?K(r.Restriction.Until):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.freezeAppealURL`),value:r.Restriction.AppealURL||n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.createdAt`),value:K(y.CreatedAt)||`-`})]}),r.About&&(0,U.jsx)(`p`,{className:`about-text`,children:r.About}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,U.jsx)(lt,{rows:r.Authorizations,userID:y.ID,onDone:v})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(nt,{rows:r.AuditLogs})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.freezeUntil`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.freezeUntilAria`),value:p,onChange:e=>m(e.target.value),type:`datetime-local`})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.freezeAppealURL`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.freezeAppealURLAria`),value:h,onChange:e=>_(e.target.value),type:`url`,placeholder:`https://...`})]}),(0,U.jsx)(ct,{label:y.Frozen?n(`account.updateFreeze`):n(`account.freezeAccount`),icon:(0,U.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!0,freeze_until:new Date(p).toISOString(),freeze_appeal_url:h.trim()}),onDone:v}),y.Frozen&&(0,U.jsx)(ct,{label:n(`account.unfreezeAccount`),icon:(0,U.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!1}),onDone:v}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,U.jsxs)(`div`,{className:`action-stack`,children:[(0,U.jsx)(ct,{label:n(`account.setPremium`),icon:(0,U.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:q(l)}),onDone:v}),(0,U.jsx)(ct,{label:n(`account.clearPremium`),icon:(0,U.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:0}),onDone:v}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,U.jsx)(ct,{label:n(`account.grantStars`),icon:(0,U.jsx)(_e,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:y.ID,amount:q(d)}),onDone:v}),(0,U.jsx)(ct,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:y.ID,verified:!r.Verified}),onDone:v})]})]})})})}function dt(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function ft(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function pt(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function mt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=ft(o?.rows??[]);return(0,U.jsxs)(Ye,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,U.jsx)(fe,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,U.jsx)(tt,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,U.jsx)(tt,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,U.jsx)(tt,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(pe,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`account.userID`)}),(0,U.jsx)(`th`,{children:t(`account.phone`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`common.name`)}),(0,U.jsx)(`th`,{children:t(`common.device`)}),(0,U.jsx)(`th`,{children:t(`account.lastActive`)}),(0,U.jsx)(`th`,{children:t(`account.premium`)}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`account.frozen`)}),(0,U.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:Ue(n.Phone)}),(0,U.jsx)(`td`,{children:We(n.Username)}),(0,U.jsx)(`td`,{children:Ge(n)}),(0,U.jsx)(`td`,{children:n.DeviceCount}),(0,U.jsx)(`td`,{children:K(n.LastActiveAt)}),(0,U.jsx)(`td`,{children:n.PremiumUntil>0?(0,U.jsxs)(J,{tone:`good`,children:[t(`account.premium`),` `,qe(n.PremiumUntil)]}):(0,U.jsx)(J,{children:t(`common.none`)})}),(0,U.jsx)(`td`,{children:n.Verified?(0,U.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,U.jsx)(J,{children:t(`account.notVerified`)})}),(0,U.jsx)(`td`,{children:n.Frozen?(0,U.jsx)(J,{tone:`danger`,children:t(`account.frozen`)}):(0,U.jsx)(J,{children:t(`common.normal`)})}),(0,U.jsx)(`td`,{children:K(n.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,U.jsx)(rt,{colSpan:11})]})]})})]})}function ht({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,U.jsx)($e,{children:a});if(!r)return(0,U.jsx)(it,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,U.jsx)(Ye,{title:`${Ke(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,U.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,U.jsxs)(`div`,{className:`entity-subtitle`,children:[We(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[(0,U.jsx)(J,{children:Ke(c,n)}),c.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)}),c.Deleted?(0,U.jsx)(J,{tone:`danger`,children:n(`common.deleted`)}):(0,U.jsx)(J,{children:n(`common.valid`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,U.jsx)(Y,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,U.jsx)(Y,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,U.jsx)(Y,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,U.jsx)(Y,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,U.jsx)(Y,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,U.jsx)(Y,{label:n(`account.createdAt`),value:qe(c.Date)||`-`}),(0,U.jsx)(Y,{label:n(`common.updatedAt`),value:K(c.UpdatedAt)||`-`})]}),c.About&&(0,U.jsx)(`p`,{className:`about-text`,children:c.About}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(nt,{rows:r.AuditLogs})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,U.jsx)(at,{value:r.ChannelJSON})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,U.jsx)(ct,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s})]})})})}function gt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=pt(o?.rows??[]);return(0,U.jsxs)(Ye,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,U.jsx)(fe,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,U.jsx)(tt,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,U.jsx)(tt,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,U.jsx)(tt,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(pe,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`channel.channelID`)}),(0,U.jsx)(`th`,{children:t(`channel.kind`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`channel.title`)}),(0,U.jsx)(`th`,{children:t(`common.members`)}),(0,U.jsx)(`th`,{children:t(`common.admins`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:Ke(n,t)}),(0,U.jsx)(`td`,{children:We(n.Username)}),(0,U.jsx)(`td`,{children:n.Title}),(0,U.jsx)(`td`,{children:n.ParticipantsCount}),(0,U.jsx)(`td`,{children:n.AdminsCount}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.Verified?(0,U.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,U.jsx)(J,{children:t(`account.notVerified`)})}),(0,U.jsx)(`td`,{children:K(n.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,U.jsx)(rt,{colSpan:10})]})]})})]})}function _t({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1);async function l(){c(!0),o(``);try{i(await x.bot(e))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{l()},[e]),a)return(0,U.jsx)($e,{children:a});if(!r)return(0,U.jsx)(it,{label:n(s?`bots.loadingDetail`:`account.waitingData`)});let u=r.Bot;return(0,U.jsx)(Ye,{title:n(`bots.detailTitle`,{id:u.ID}),eyebrow:n(`bots.profile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/bots`),children:[(0,U.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:u.FirstName||n(`bots.unnamed`)}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:We(u.Username)||n(`account.noUsername`)})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[(0,U.jsx)(J,{tone:u.System?`warn`:`neutral`,children:u.System?n(`bots.system`):n(`bots.user`)}),u.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:n(`bots.botID`),value:String(u.ID),mono:!0}),(0,U.jsx)(Y,{label:n(`bots.owner`),value:u.OwnerUserID>0?`${u.OwnerUserID} ${We(r.OwnerUsername)}`.trim():n(`common.none`)}),(0,U.jsx)(Y,{label:n(`bots.type`),value:u.System?n(`bots.system`):n(`bots.user`)}),(0,U.jsx)(Y,{label:n(`common.updatedAt`),value:K(u.UpdatedAt)||`-`}),(0,U.jsx)(Y,{label:n(`account.createdAt`),value:K(u.CreatedAt)||`-`})]}),r.About&&(0,U.jsx)(`p`,{className:`about-text`,children:r.About}),r.Description&&r.Description.trim()!==r.About.trim()&&(0,U.jsx)(`p`,{className:`about-text`,children:r.Description}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(nt,{rows:r.AuditLogs})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`bots.actionDock`)}),(0,U.jsx)(`div`,{className:`action-stack`,children:(0,U.jsx)(ct,{label:u.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`neutral`,path:`/api/actions/set-verified`,payload:()=>({user_id:u.ID,verified:!u.Verified}),onDone:l})}),u.System?(0,U.jsx)(`p`,{className:`bot-create-note`,children:n(`bots.systemHint`)}):(0,U.jsxs)(`div`,{className:`danger-zone`,children:[(0,U.jsx)(ct,{label:n(`bots.delete`),icon:(0,U.jsx)(ye,{size:15}),tone:`danger`,path:`/api/actions/delete-bot`,payload:()=>({bot_user_id:u.ID}),onDone:()=>t(`/bots`)}),(0,U.jsx)(`p`,{className:`bot-create-note`,children:n(`bots.deleteHint`)})]})]})})})}function vt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(0),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(``),[y,S]=(0,g.useState)(``);async function C(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&t.set(`before_id`,String(c));try{let e=await x.bots(t);s(e),l(e.next_before_id)}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{C(!1)},[]);let w=o?.rows??[],T=w.filter(e=>e.Verified).length,E=w.filter(e=>e.System).length;return(0,U.jsxs)(Ye,{title:t(`bots.pageTitle`),eyebrow:o?.listing===!1?t(`bots.queryResults`):t(`bots.recent`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>C(!1),disabled:u,children:[(0,U.jsx)(fe,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`bots.currentPage`),value:String(w.length)}),(0,U.jsx)(tt,{label:t(`common.verified`),value:String(T),tone:`good`}),(0,U.jsx)(tt,{label:t(`bots.system`),value:String(E)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(`div`,{className:`section-head`,children:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{children:t(`bots.createTitle`)}),(0,U.jsx)(`p`,{children:t(`bots.createHint`)})]})}),(0,U.jsxs)(`div`,{className:`bot-create-fields`,children:[(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.ownerUserID`)}),(0,U.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),type:`number`,min:`1`,placeholder:`123456789`})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.name`)}),(0,U.jsx)(`input`,{value:_,onChange:e=>v(e.target.value),placeholder:t(`bots.namePlaceholder`),maxLength:64})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.username`)}),(0,U.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:`my_service_bot`})]})]}),(0,U.jsxs)(`div`,{className:`bot-create-actions`,children:[(0,U.jsx)(`span`,{className:`bot-create-note`,children:t(`bots.usernameHint`)}),(0,U.jsx)(ct,{label:t(`bots.create`),icon:(0,U.jsx)(de,{size:15}),tone:`neutral`,path:`/api/actions/create-bot`,payload:()=>({owner_user_id:q(m),name:_.trim(),username:y.trim().replace(/^@/,``)}),onDone:()=>C(!1)})]})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),C(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`bots.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(pe,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>C(!0),disabled:u,children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`bots.botID`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`common.name`)}),(0,U.jsx)(`th`,{children:t(`bots.owner`)}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`bots.type`)}),(0,U.jsx)(`th`,{children:t(`account.createdAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[w.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:We(n.Username)||`-`}),(0,U.jsx)(`td`,{children:n.FirstName||`-`}),(0,U.jsx)(`td`,{className:`mono`,children:n.OwnerUserID>0?n.OwnerUserID:`-`}),(0,U.jsx)(`td`,{children:n.Verified?(0,U.jsxs)(J,{tone:`good`,children:[(0,U.jsx)(D,{size:12}),` `,t(`common.verified`)]}):(0,U.jsx)(J,{children:t(`account.notVerified`)})}),(0,U.jsx)(`td`,{children:n.System?(0,U.jsx)(J,{tone:`warn`,children:t(`bots.system`)}):(0,U.jsx)(J,{children:t(`bots.user`)})}),(0,U.jsx)(`td`,{children:K(n.CreatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/bots/${n.ID}`),children:[(0,U.jsx)(N,{size:14}),` `,t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},n.ID)),w.length===0&&(0,U.jsx)(rt,{colSpan:8})]})]})})]})}function yt({navigate:e}){let{t}=W();return(0,U.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,U.jsxs)(`section`,{className:`overview-band`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,U.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,U.jsxs)(`div`,{className:`overview-metrics`,children:[(0,U.jsx)(et,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,U.jsx)(et,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,U.jsx)(et,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,U.jsxs)(`div`,{className:`command-grid`,children:[(0,U.jsx)(bt,{icon:(0,U.jsx)(V,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,U.jsx)(bt,{icon:(0,U.jsx)(he,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,U.jsx)(bt,{icon:(0,U.jsx)(le,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,U.jsxs)(`section`,{className:`work-strip`,children:[(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(k,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(oe,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(ee,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(ne,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function bt({icon:e,title:t,text:n,href:r,navigate:i}){return(0,U.jsxs)(G,{className:`launcher`,href:r,navigate:i,children:[(0,U.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,U.jsxs)(`span`,{className:`launcher-copy`,children:[(0,U.jsx)(`strong`,{children:t}),(0,U.jsx)(`span`,{children:n})]}),(0,U.jsx)(L,{size:16})]})}function xt({channelID:e,msgID:t,navigate:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,U.jsx)($e,{children:o});if(!i)return(0,U.jsx)(it,{label:r(`common.loading`)});let l=i.Message;return(0,U.jsx)(Ye,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,U.jsx)(M,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:qe(l.Date)})})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,U.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,U.jsx)(J,{children:r(`common.survived`)}),l.Pinned&&(0,U.jsx)(J,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,U.jsx)(J,{children:r(`messages.channelPost`)}),(0,U.jsxs)(J,{children:[`pts `,l.PTS]})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,U.jsx)(Y,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,U.jsx)(Y,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,U.jsx)(Y,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,U.jsx)(at,{value:i.MessageJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,U.jsx)(at,{value:i.ChannelJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.count`)}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.messageId`)}),(0,U.jsx)(`th`,{children:r(`common.sender`)}),(0,U.jsx)(`th`,{children:r(`common.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.PTSCount}),(0,U.jsx)(`td`,{children:e.Type}),(0,U.jsx)(`td`,{children:e.MessageID}),(0,U.jsx)(`td`,{children:e.SenderUserID}),(0,U.jsx)(`td`,{children:qe(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,U.jsx)(rt,{colSpan:6})]})]})})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.eventJson`)}),(0,U.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,U.jsx)(at,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,U.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function St({label:e,value:t,onChange:n}){let{t:r}=W(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,U.jsxs)(`div`,{className:`entity-picker`,children:[(0,U.jsxs)(`div`,{className:`picker-head`,children:[(0,U.jsx)(`span`,{children:e}),t?(0,U.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,U.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,U.jsxs)(`div`,{className:`selected-entity`,children:[(0,U.jsx)(F,{size:15}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:Ge(t)}),(0,U.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,U.jsx)(`span`,{children:We(t.Username)||Ue(t.Phone)||`-`})]}):null,(0,U.jsxs)(`div`,{className:`picker-search`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,U.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,U.jsx)(`div`,{className:`picker-error`,children:u}),(0,U.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,U.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,U.jsx)(`span`,{className:`mono`,children:e.ID}),(0,U.jsx)(`strong`,{children:Ge(e)}),(0,U.jsx)(`span`,{children:We(e.Username)||Ue(e.Phone)||`-`}),e.Verified?(0,U.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,U.jsx)(J,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,U.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function Ct({label:e,value:t,onChange:n}){let{t:r}=W(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,U.jsxs)(`div`,{className:`entity-picker`,children:[(0,U.jsxs)(`div`,{className:`picker-head`,children:[(0,U.jsx)(`span`,{children:e}),t?(0,U.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,U.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,U.jsxs)(`div`,{className:`selected-entity`,children:[(0,U.jsx)(F,{size:15}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:t.Title||`-`}),(0,U.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,U.jsx)(`span`,{children:We(t.Username)||Ke(t,r)})]}):null,(0,U.jsxs)(`div`,{className:`picker-search`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,U.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,U.jsx)(`div`,{className:`picker-error`,children:u}),(0,U.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,U.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,U.jsx)(`span`,{className:`mono`,children:e.ID}),(0,U.jsx)(`strong`,{children:e.Title||`-`}),(0,U.jsx)(`span`,{children:We(e.Username)||Ke(e,r)}),e.Verified?(0,U.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,U.jsx)(J,{children:Ke(e,r)})]},e.ID)),o.length===0&&!c?(0,U.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function wt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,U.jsxs)(Ye,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(Xe,{children:[(0,U.jsx)(`div`,{className:`message-selector-grid single`,children:(0,U.jsx)(Ct,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,U.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,U.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,U.jsx)(pe,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`messages.currentPage`),value:String(_.length)}),(0,U.jsx)(tt,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,U.jsx)(tt,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,U.jsx)(tt,{label:t(`messages.channelGroup`),value:n?`${n.Title||Ke(n,t)} (${n.ID})`:`-`})]}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`common.messageId`)}),(0,U.jsx)(`th`,{children:t(`common.time`)}),(0,U.jsx)(`th`,{children:t(`common.sender`)}),(0,U.jsx)(`th`,{children:`From Peer`}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.views`)}),(0,U.jsx)(`th`,{children:t(`common.status`)}),(0,U.jsx)(`th`,{children:t(`messages.body`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[_.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:qe(n.Date)}),(0,U.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,U.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.ViewsCount}),(0,U.jsx)(`td`,{children:n.Deleted?(0,U.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,U.jsx)(J,{tone:`warn`,children:t(`messages.pinned`)}):(0,U.jsx)(J,{children:t(`common.survived`)})}),(0,U.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,U.jsx)(rt,{colSpan:9})]})]})})]})}function Tt({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,U.jsx)($e,{children:o});if(!i)return(0,U.jsx)(it,{label:r(`common.loading`)});let l=i.Message;return(0,U.jsx)(Ye,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,U.jsx)(M,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:qe(l.Date)})})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,U.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,U.jsx)(J,{children:r(`common.survived`)}),(0,U.jsxs)(J,{children:[`pts `,l.PTS]}),(0,U.jsx)(J,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,U.jsx)(Y,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,U.jsx)(Y,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,U.jsx)(Y,{label:r(`common.time`),value:qe(l.Date)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,U.jsx)(at,{value:i.MessageJSON})]}),(0,U.jsxs)(`div`,{className:`raw-grid`,children:[(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,U.jsx)(at,{value:i.DialogJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,U.jsx)(at,{value:i.PrivateJSON})]})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.count`)}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.PTSCount}),(0,U.jsx)(`td`,{children:e.Type}),(0,U.jsx)(`td`,{children:qe(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,U.jsx)(rt,{colSpan:4})]})]})})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`ID`}),(0,U.jsx)(`th`,{children:r(`account.userID`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.status`)}),(0,U.jsx)(`th`,{children:r(`messages.attempts`)}),(0,U.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.ID}),(0,U.jsx)(`td`,{children:e.TargetUserID}),(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.EventType}),(0,U.jsx)(`td`,{children:e.Status}),(0,U.jsx)(`td`,{children:e.Attempts}),(0,U.jsx)(`td`,{children:K(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,U.jsx)(rt,{colSpan:7})]})]})})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,U.jsx)(ct,{label:r(`messages.deleteThis`),icon:(0,U.jsx)(ye,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function Et({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,S]=(0,g.useState)(``),[C,w]=(0,g.useState)(`1`),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(``);async function k(e=!1){if(O(``),!n||!i){O(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&T?.rows.length){let e=T.rows[T.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{E(await x.messages(r))}catch(e){O(b(e))}}function A(e){r(e),s(``),l(``),E(null)}function j(e){a(e),s(``),l(``),E(null)}return(0,U.jsxs)(Ye,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[D&&(0,U.jsx)($e,{children:D}),(0,U.jsxs)(Xe,{children:[(0,U.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,U.jsx)(St,{label:t(`messages.ownerUser`),value:n,onChange:A}),(0,U.jsx)(St,{label:t(`messages.peerUser`),value:i,onChange:j})]}),(0,U.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),k(!1)},children:[(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,U.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,U.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,U.jsx)(pe,{size:15}),` `,t(`messages.searchMessages`)]}),T?.rows.length?(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>k(!0),children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`messages.currentPage`),value:String(T?.rows.length??0)}),(0,U.jsx)(tt,{label:t(`messages.deleted`),value:String((T?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,U.jsx)(tt,{label:t(`messages.outgoing`),value:String((T?.rows??[]).filter(e=>e.Outgoing).length)}),(0,U.jsx)(tt,{label:t(`messages.ownerPeer`),value:n&&i?`${Ge(n)} / ${Ge(i)}`:`-`})]}),(0,U.jsxs)(`div`,{className:`operation-row`,children:[(0,U.jsxs)(`div`,{className:`operation-box`,children:[(0,U.jsxs)(`div`,{className:`operation-title`,children:[(0,U.jsx)(ye,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,U.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,U.jsx)(ct,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:Je(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,U.jsxs)(`div`,{className:`operation-box`,children:[(0,U.jsxs)(`div`,{className:`operation-title`,children:[(0,U.jsx)(ae,{size:15}),` `,t(`messages.clearHistory`)]}),(0,U.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,U.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,U.jsx)(ct,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:q(y),max_batches:q(C),just_clear:_,revoke:m})})]})]}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`common.messageId`)}),(0,U.jsx)(`th`,{children:t(`common.time`)}),(0,U.jsx)(`th`,{children:t(`common.sender`)}),(0,U.jsx)(`th`,{children:t(`messages.direction`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.status`)}),(0,U.jsx)(`th`,{children:t(`messages.body`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[T?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,U.jsx)(`td`,{children:qe(n.Date)}),(0,U.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,U.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.Deleted?(0,U.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):(0,U.jsx)(J,{children:t(`common.survived`)})}),(0,U.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!T||T.rows.length===0)&&(0,U.jsx)(rt,{colSpan:8})]})]})})]})}var Dt=c(o(((e,t)=>{typeof document<`u`&&typeof navigator<`u`&&(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.lottie=r())})(e,(function(){var n=``,r=!1,i=-999999,a=function(e){r=!!e},o=function(){return r},s=function(e){n=e},c=function(){return n};function l(e){return document.createElement(e)}function u(e,t){var n,r=e.length,i;for(n=0;n1?n[1]=1:n[1]<=0&&(n[1]=0),L(n[0],n[1],n[2])}function te(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),L(n[0],n[1],n[2])}function ne(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[0]+=t/360,n[0]>1?--n[0]:n[0]<0&&(n[0]+=1),L(n[0],n[1],n[2])}(function(){var e=[],t,n;for(t=0;t<256;t+=1)n=t.toString(16),e[t]=n.length===1?`0`+n:n;return function(t,n,r){return t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),`#`+e[t]+e[n]+e[r]}})();var re=function(e){g=!!e},ie=function(){return g},ae=function(e){_=e},oe=function(){return _},se=function(){return v},ce=function(e){E=e},le=function(){return E},ue=function(e){y=e};function z(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function B(e){"@babel/helpers - typeof";return B=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},B(e)}var de=function(){var e=1,t=[],n,r,i={onmessage:function(){},postMessage:function(e){n({data:e})}},a={postMessage:function(e){i.onmessage({data:e})}};function s(e){if(window.Worker&&window.Blob&&o()){var t=new Blob([`var _workerSelf = self; self.onmessage = `,e.toString()],{type:`text/javascript`}),r=URL.createObjectURL(t);return new Worker(r)}return n=e,i}function c(){r||(r=s(function(e){function t(){function e(t,n){var o,s,c=t.length,l,u,d,f;for(s=0;s=0;--t)if(e[t].ty===`sh`)if(e[t].ks.k.i)a(e[t].ks.k);else for(o=e[t].ks.k.length,r=0;rn[0]?!0:n[0]>e[0]?!1:e[1]>n[1]?!0:n[1]>e[1]?!1:e[2]>n[2]?!0:n[2]>e[2]?!1:null}var s=function(){var e=[4,4,14];function t(e){var t=e.t.d;e.t.d={k:[{s:t,t:0}]}}function n(e){var n,r=e.length;for(n=0;n=0;--n)if(e[n].ty===`sh`)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(a=e[n].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function a(t){var n=r(t,this.assetsPath,this.path),i=z(`image`);b?this.testImageLoaded(i):i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS(`http://www.w3.org/1999/xlink`,`href`,n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a}function o(t){var n=r(t,this.assetsPath,this.path),i=l(`img`);i.crossOrigin=`anonymous`,i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var a={img:i,assetData:t};return a}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return de.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function c(e,t){this.imagesLoadedCb=t;var n,r=e.length;for(n=0;nthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t=this.animationData.layers,n,r=t.length,i=e.layers,a,o=i.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(`enterFrame`),this.renderFrame(),this.trigger(`drawnFrame`)},V.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},V.prototype.play=function(e){e&&this.name!==e||this.isPaused===!0&&(this.isPaused=!1,this.trigger(`_play`),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger(`_active`)))},V.prototype.pause=function(e){e&&this.name!==e||this.isPaused===!1&&(this.isPaused=!0,this.trigger(`_pause`),this._idle=!0,this.trigger(`_idle`),this.audioController.pause())},V.prototype.togglePause=function(e){e&&this.name!==e||(this.isPaused===!0?this.play():this.pause())},V.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},V.prototype.getMarkerData=function(e){for(var t,n=0;n=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger(`loopComplete`))):this.setCurrentRawFrameValue(t):t<0?this.checkSegments(t%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger(`loopComplete`):this._completedLoop=!0):(n=!0,t=0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger(`complete`))}},V.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger(`segmentStart`)},V.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,n!==-1&&this.goToAndStop(n,!0)},V.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),be(e[0])===`object`){var n,r=e.length;for(n=0;n=0;--n)t[n].animation.destroy(e)}function T(e,t,n){var r=[].concat([].slice.call(document.getElementsByClassName(`lottie`)),[].slice.call(document.getElementsByClassName(`bodymovin`))),i,a=r.length;for(i=0;i0?n=c:t=c;while(Math.abs(s)>a&&++l=i?g(e,d,t,n):f===0?d:h(e,a,a+c,t,n)}},e}(),U=function(){function e(e){return e.concat(m(e.length))}return{double:e}}(),Se=function(){return function(e,t,n){var r=0,i=e,a=m(i),o={newElement:s,release:c};function s(){var e;return r?(--r,e=a[r]):e=t(),e}function c(e){r===i&&(a=U.double(a),i*=2),n&&n(e),a[r]=e,r+=1}return o}}(),Ce=function(){function e(){return{addedLength:0,percents:p(`float32`,le()),lengths:p(`float32`,le())}}return Se(8,e)}(),we=function(){function e(){return{lengths:[],totalLength:0}}function t(e){var t,n=e.lengths.length;for(t=0;t-.001&&o<.001}function n(n,r,i,a,o,s,c,l,u){if(i===0&&s===0&&u===0)return t(n,r,a,o,c,l);var d=e.sqrt(e.pow(a-n,2)+e.pow(o-r,2)+e.pow(s-i,2)),f=e.sqrt(e.pow(c-n,2)+e.pow(l-r,2)+e.pow(u-i,2)),p=e.sqrt(e.pow(c-a,2)+e.pow(l-o,2)+e.pow(u-s,2)),m=d>f?d>p?d-f-p:p-f-d:p>f?p-f-d:f-d-p;return m>-1e-4&&m<1e-4}var r=function(){return function(e,t,n,r){var i=le(),a,o,s,c,l,u=0,d,f=[],p=[],m=Ce.newElement();for(s=n.length,a=0;ao?-1:1,l=!0;l;)if(r[a]<=o&&r[a+1]>o?(s=(o-r[a])/(r[a+1]-r[a]),l=!1):a+=c,a<0||a>=i-1){if(a===i-1)return n[a];l=!1}return n[a]+(n[a+1]-n[a])*s}function l(t,n,r,i,a,o){var s=c(a,o),l=1-s;return[e.round((l*l*l*t[0]+(s*l*l+l*s*l+l*l*s)*r[0]+(s*s*l+l*s*s+s*l*s)*i[0]+s*s*s*n[0])*1e3)/1e3,e.round((l*l*l*t[1]+(s*l*l+l*s*l+l*l*s)*r[1]+(s*s*l+l*s*s+s*l*s)*i[1]+s*s*s*n[1])*1e3)/1e3]}var u=p(`float32`,8);function d(t,n,r,i,a,o,s){a<0?a=0:a>1&&(a=1);var l=c(a,s);o=o>1?1:o;var d=c(o,s),f,p=t.length,m=1-l,h=1-d,g=m*m*m,_=l*m*m*3,v=l*l*m*3,y=l*l*l,b=m*m*h,x=l*m*h+m*l*h+m*m*d,S=l*l*h+m*l*d+l*m*d,C=l*l*d,w=m*h*h,T=l*h*h+m*d*h+m*h*d,E=l*d*h+m*d*d+l*h*d,D=l*d*d,O=h*h*h,k=d*h*h+h*d*h+h*h*d,A=d*d*h+h*d*d+d*h*d,j=d*d*d;for(f=0;f=l.t-n){c.h&&(c=l),i=0;break}if(l.t-n>e){i=a;break}a=v||e=v?x.points.length-1:0;for(f=x.points[S].point.length,d=0;d=T&&C=v)r[0]=b[0],r[1]=b[1],r[2]=b[2];else if(e<=y)r[0]=c.s[0],r[1]=c.s[1],r[2]=c.s[2];else{var j=je(c.s),M=je(b),N=(e-y)/(v-y);Ae(r,ke(j,M,N))}else for(a=0;a=v?m=1:e1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-n)*f)/m,g=Math.sin(n*f)/m):(h=1-n,g=n),r[0]=h*i+g*c,r[1]=h*a+g*l,r[2]=h*o+g*u,r[3]=h*s+g*d,r}function Ae(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i),s=Math.asin(2*n*r+2*i*a),c=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i);e[0]=o/D,e[1]=s/D,e[2]=c/D}function je(e){var t=e[0]*D,n=e[1]*D,r=e[2]*D,i=Math.cos(t/2),a=Math.cos(n/2),o=Math.cos(r/2),s=Math.sin(t/2),c=Math.sin(n/2),l=Math.sin(r/2),u=i*a*o-s*c*l;return[s*c*o+i*a*l,s*a*o+i*c*l,i*c*o-s*a*l,u]}function Me(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==Ee&&(this._caching.lastFrame>=n&&e>=n||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function Ne(e){var t;if(this.propType===`unidimensional`)t=e*this.mult,De(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var n=0,r=this.v.length;n1e-5&&(this.v[n]=t,this._mdf=!0),n+=1}function Pe(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),n){case`v`:a=this.v;break;case`i`:a=this.i;break;case`o`:a=this.o;break;default:a=[];break}(!a[r]||a[r]&&!i)&&(a[r]=Ve.newElement()),a[r][0]=e,a[r][1]=t},He.prototype.setTripleAt=function(e,t,n,r,i,a,o,s){this.setXYAt(e,t,`v`,o,s),this.setXYAt(n,r,`o`,o,s),this.setXYAt(i,a,`i`,o,s)},He.prototype.reverse=function(){var e=new He;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var a=this._length-1,o=this._length,s;for(s=i;s=p[p.length-1].t-this.offsetTime)i=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],o=!0;else{for(var m=r,h=p.length-1,g=!0,_,v,y;g&&(_=p[m],v=p[m+1],!(v.t-this.offsetTime>e));)m=v.t-this.offsetTime)d=1;else if(e<_.t-this.offsetTime)d=0;else{var b;y.__fnct?b=y.__fnct:(b=xe.getBezierEasing(_.o.x,_.o.y,_.i.x,_.i.y).get,y.__fnct=b),d=b((e-(_.t-this.offsetTime))/(v.t-this.offsetTime-(_.t-this.offsetTime)))}a=v.s?v.s[0]:_.e[0]}i=_.s[0]}for(l=t._length,u=i.i[0].length,n.lastIndex=r,s=0;sr&&t>r)||(this._caching.lastIndex=i0||e>-1e-6&&e<0?r(e*t)/t:e}function P(){var e=this.props,t=N(e[0]),n=N(e[1]),r=N(e[4]),i=N(e[5]),a=N(e[12]),o=N(e[13]);return`matrix(`+t+`,`+n+`,`+r+`,`+i+`,`+a+`,`+o+`)`}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=c,this.skew=u,this.skewFromAxis=d,this.shear=l,this.scale=f,this.setTransform=m,this.translate=h,this.transform=g,this.multiply=_,this.applyToPoint=S,this.applyToX=C,this.applyToY=w,this.applyToZ=T,this.applyToPointArray=A,this.applyToTriplePoints=k,this.applyToPointStringified=j,this.toCSS=M,this.to2dCSS=P,this.clone=b,this.cloneFromProps=x,this.equals=y,this.inversePoints=O,this.inversePoint=D,this.getInverseMatrix=E,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=p(`float32`,16),this.reset()}}();function qe(e){"@babel/helpers - typeof";return qe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},qe(e)}var q={},Je=`__[STANDALONE]__`,Ye=`__[ANIMATIONDATA]__`,Xe=``;function Ze(e){s(e)}function Qe(){Je===!0?H.searchAnimations(Ye,Je,Xe):H.searchAnimations()}function $e(e){re(e)}function J(e){ue(e)}function et(e){return Je===!0&&(e.animationData=JSON.parse(Ye)),H.loadAnimation(e)}function tt(e){if(typeof e==`string`)switch(e){case`high`:ce(200);break;default:case`medium`:ce(50);break;case`low`:ce(10);break}else!isNaN(e)&&e>1&&ce(e)}function Y(){return typeof navigator<`u`}function nt(e,t){e===`expressions`&&ae(t)}function rt(e){switch(e){case`propertyFactory`:return G;case`shapePropertyFactory`:return Ke;case`matrix`:return K;default:return null}}q.play=H.play,q.pause=H.pause,q.setLocationHref=Ze,q.togglePause=H.togglePause,q.setSpeed=H.setSpeed,q.setDirection=H.setDirection,q.stop=H.stop,q.searchAnimations=Qe,q.registerAnimation=H.registerAnimation,q.loadAnimation=et,q.setSubframeRendering=$e,q.resize=H.resize,q.goToAndStop=H.goToAndStop,q.destroy=H.destroy,q.setQuality=tt,q.inBrowser=Y,q.installPlugin=nt,q.freeze=H.freeze,q.unfreeze=H.unfreeze,q.setVolume=H.setVolume,q.mute=H.mute,q.unmute=H.unmute,q.getRegisteredAnimations=H.getRegisteredAnimations,q.useWebWorker=a,q.setIDPrefix=J,q.__getFactory=rt,q.version=`5.13.0`;function it(){document.readyState===`complete`&&(clearInterval(lt),Qe())}function at(e){for(var t=ot.split(`&`),n=0;n=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o=[],s,c=a.length,l;for(s=0;sr+n)){var u=l.s*i<=r?0:(l.s*i-r)/n,d=l.e*i>=r+n?1:(l.e*i-r)/n;o.push([u,d])}return o.length||o.push([0,0]),o},ft.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1+r:this.s.v<0?0+r:this.s.v+r,n=this.e.v>1?1+r:this.e.v<0?0+r:this.e.v+r,t>n){var i=t;t=n,n=i}t=Math.round(t*1e4)*1e-4,n=Math.round(n*1e4)*1e-4,this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,o,s=this.shapes.length,c,l,u,d,f,p=0;if(n===t)for(o=0;o=0;--o)if(h=this.shapes[o],h.shape._mdf){for(g=h.localShapeCollection,g.releaseShapes(),this.m===2&&s>1?(b=this.calculateShapeEdges(t,n,h.totalShapeLength,y,p),y+=h.totalShapeLength):b=[[_,v]],l=b.length,c=0;c=1?m.push({s:h.totalShapeLength*(_-1),e:h.totalShapeLength*(v-1)}):(m.push({s:h.totalShapeLength*_,e:h.totalShapeLength}),m.push({s:0,e:h.totalShapeLength*(v-1)}));var x=this.addShapes(h,m[0]);if(m[0].s!==m[0].e){if(m.length>1)if(h.shape.paths.shapes[h.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,g),x=this.addShapes(h,m[1],S)}else this.addPaths(x,g),x=this.addShapes(h,m[1]);this.addPaths(x,g)}}h.shape.paths=g}}else if(this._mdf)for(o=0;ot.e){n.c=!1;break}else t.s<=l&&t.e>=l+u.addedLength?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[s],i[a].v[s],n,d,g),g=!1):(p=W.getNewSegment(i[a].v[s-1],i[a].v[s],i[a].o[s-1],i[a].i[s],(t.s-l)/u.addedLength,(t.e-l)/u.addedLength,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1),l+=u.addedLength,d+=1;if(i[a].c&&f.length){if(u=f[s-1],l<=t.e){var _=f[s-1].addedLength;t.s<=l&&t.e>=l+_?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[0],i[a].v[0],n,d,g),g=!1):(p=W.getNewSegment(i[a].v[s-1],i[a].v[0],i[a].o[s-1],i[a].i[0],(t.s-l)/_,(t.e-l)/_,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1)}else n.c=!1;l+=u.addedLength,d+=1}if(n._length&&(n.setXYAt(n.v[h][0],n.v[h][1],`i`,h),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],`o`,n._length-1)),l>t.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(r[0]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),r[1]=o.getValueAtTime((o.keyframes[0].t+.01)/n,0),i[0]=a.getValueAtTime(a.keyframes[0].t/n,0),i[1]=o.getValueAtTime(o.keyframes[0].t/n,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(r[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),r[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/n,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/n,0)):(r=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/n,o.offsetTime))}else i=e,r=i;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function r(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function i(){}function a(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0}function o(e,t,n){if(this.elem=e,this.frameId=-1,this.propType=`transform`,this.data=t,this.v=new K,this.pre=new K,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=G.getProp(e,t.p.x,0,0,this),this.py=G.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=G.getProp(e,t.p.z,0,0,this))):this.p=G.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=G.getProp(e,t.rx,0,D,this),this.ry=G.getProp(e,t.ry,0,D,this),this.rz=G.getProp(e,t.rz,0,D,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r0;)--n,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ht.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(f):Math.ceil(f),h=this.pMatrix.props,g=this.rMatrix.props,_=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v=0;if(f>0){for(;vm;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),--v;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),v-=p)}r=this.data.m===1?0:this._currentCopies-1,i=this.data.m===1?1:-1,a=this._currentCopies;for(var y,b;a;){if(t=this.elemsData[r].it,n=t[t.length-1].transform.mProps.v.props,b=n.length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),v!==0){for((r!==0&&i===1||r!==this._currentCopies-1&&i===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15]),this.matrix.transform(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]),y=0;y0&&r<1?[t]:[]:[t-r,t+r].filter(function(e){return e>0&&e<1})},wt.prototype.split=function(e){if(e<=0)return[Ct(this.points[0]),this];if(e>=1)return[this,Ct(this.points[this.points.length-1])];var t=bt(this.points[0],this.points[1],e),n=bt(this.points[1],this.points[2],e),r=bt(this.points[2],this.points[3],e),i=bt(t,n,e),a=bt(n,r,e),o=bt(i,a,e);return[new wt(this.points[0],t,i,o,!0),new wt(o,a,r,this.points[3],!0)]};function Tt(e,t){var n=e.points[0][t],r=e.points[e.points.length-1][t];if(n>r){var i=r;r=n,n=i}for(var a=xt(3*e.a[t],2*e.b[t],e.c[t]),o=0;o0&&a[o]<1){var s=e.point(a[o])[t];sr&&(r=s)}return{min:n,max:r}}wt.prototype.bounds=function(){return{x:Tt(this,0),y:Tt(this,1)}},wt.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}};function Et(e,t,n){var r=e.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:e,t:(t+n)/2,t1:t,t2:n}}function Dt(e){var t=e.bez.split(.5);return[Et(t[0],e.t1,e.t),Et(t[1],e.t,e.t2)]}function Ot(e,t){return Math.abs(e.cx-t.cx)*2=a||e.width<=r&&e.height<=r&&t.width<=r&&t.height<=r){i.push([e.t,t.t]);return}var o=Dt(e),s=Dt(t);kt(o[0],s[0],n+1,r,i,a),kt(o[0],s[1],n+1,r,i,a),kt(o[1],s[0],n+1,r,i,a),kt(o[1],s[1],n+1,r,i,a)}}wt.prototype.intersections=function(e,t,n){t===void 0&&(t=2),n===void 0&&(n=7);var r=[];return kt(Et(this,0,1),Et(e,0,1),0,t,r,n),r},wt.shapeSegment=function(e,t){var n=(t+1)%e.length();return new wt(e.v[t],e.o[t],e.i[n],e.v[n],!0)},wt.shapeSegmentInverted=function(e,t){var n=(t+1)%e.length();return new wt(e.v[n],e.i[n],e.o[t],e.v[t],!0)};function At(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function jt(e,t,n,r){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],s=[r[0],r[1],1],c=At(At(i,a),At(o,s));return vt(c[2])?null:[c[0]/c[2],c[1]/c[2]]}function X(e,t,n){return[e[0]+Math.cos(t)*n,e[1]-Math.sin(t)*n]}function Mt(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function Nt(e,t){return _t(e[0],t[0])&&_t(e[1],t[1])}function Pt(){}u([dt],Pt),Pt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=G.getProp(e,t.s,0,null,this),this.frequency=G.getProp(e,t.r,0,null,this),this.pointsType=G.getProp(e,t.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function Ft(e,t,n,r,i,a,o){var s=n-Math.PI/2,c=n+Math.PI/2,l=t[0]+Math.cos(n)*r*i,u=t[1]-Math.sin(n)*r*i;e.setTripleAt(l,u,l+Math.cos(s)*a,u-Math.sin(s)*a,l+Math.cos(c)*o,u-Math.sin(c)*o,e.length())}function It(e,t){var n=[t[0]-e[0],t[1]-e[1]],r=-Math.PI*.5;return[Math.cos(r)*n[0]-Math.sin(r)*n[1],Math.sin(r)*n[0]+Math.cos(r)*n[1]]}function Lt(e,t){var n=t===0?e.length()-1:t-1,r=(t+1)%e.length(),i=e.v[n],a=e.v[r],o=It(i,a);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function Rt(e,t,n,r,i,a,o){var s=Lt(t,n),c=t.v[n%t._length],l=t.v[n===0?t._length-1:n-1],u=t.v[(n+1)%t._length],d=a===2?Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2):0,f=a===2?Math.sqrt((c[0]-u[0])**2+(c[1]-u[1])**2):0;Ft(e,t.v[n%t._length],s,o,r,f/((i+1)*2),d/((i+1)*2),a)}function zt(e,t,n,r,i,a){for(var o=0;o1&&t.length>1&&(i=Ut(e[0],t[t.length-1]),i)?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[n,r]}function Gt(e){for(var t,n=1;n1&&(t=Wt(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function Kt(e,t){var n=e.inflectionPoints(),r,i,a,o;if(n.length===0)return[Vt(e,t)];if(n.length===1||_t(n[1],1))return a=e.split(n[0]),r=a[0],i=a[1],[Vt(r,t),Vt(i,t)];a=e.split(n[0]),r=a[0];var s=(n[1]-n[0])/(1-n[0]);return a=a[1].split(s),o=a[0],i=a[1],[Vt(r,t),Vt(o,t),Vt(i,t)]}function qt(){}u([dt],qt),qt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=G.getProp(e,t.a,0,null,this),this.miterLimit=G.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=this.amount.effectsSequence.length!==0},qt.prototype.processPath=function(e,t,n,r){var i=Ue.newElement();i.c=e.c;var a=e.length();e.c||--a;var o,s,c,l=[];for(o=0;o=0;--o)c=wt.shapeSegmentInverted(e,o),l.push(Kt(c,t));l=Gt(l);var u=null,d=null;for(o=0;o0&&(o=!1),o){var u=l(`style`);u.setAttribute(`f-forigin`,n[r].fOrigin),u.setAttribute(`f-origin`,n[r].origin),u.setAttribute(`f-family`,n[r].fFamily),u.type=`text/css`,u.innerText=`@font-face {font-family: `+n[r].fFamily+`; font-style: normal; src: url('`+n[r].fPath+`');}`,t.appendChild(u)}}else if(n[r].fOrigin===`g`||n[r].origin===1){for(s=document.querySelectorAll(`link[f-forigin="g"], link[f-origin="1"]`),c=0;c=55296&&n<=56319){var r=e.charCodeAt(1);r>=56320&&r<=57343&&(t=(n-55296)*1024+r-56320+65536)}return t}function S(e,t){var n=e.toString(16)+t.toString(16);return d.indexOf(n)!==-1}function C(e){return e===s}function w(e){return e===o}function T(e){var t=x(e);return t>=c&&t<=u}function E(e){return T(e.substr(0,2))&&T(e.substr(2,2))}function D(e){return t.indexOf(e)!==-1}function O(e,t){var o=x(e.substr(t,2));if(o!==n)return!1;var s=0;for(t+=2;s<5;){if(o=x(e.substr(t,2)),oa)return!1;s+=1,t+=2}return x(e.substr(t,2))===r}function k(){this.isLoaded=!0}var A=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return A.isModifier=S,A.isZeroWidthJoiner=C,A.isFlagEmoji=E,A.isRegionalCode=T,A.isCombinedCharacter=D,A.isRegionalFlag=O,A.isVariationSelector=w,A.BLACK_FLAG_CODE_POINT=n,A.prototype={addChars:_,addFonts:g,getCharData:v,getFontByName:b,measureText:y,checkLoadedFonts:m,setIsLoaded:k},A}();function Xt(e){this.animationData=e}Xt.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e};function Zt(e){return new Xt(e)}function Qt(){}Qt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},mn.prototype.show=function(){},mn.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},mn.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},mn.prototype.resume=function(){this._canPlay=!0},mn.prototype.setRate=function(e){this.audio.rate(e)},mn.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},mn.prototype.getBaseElement=function(){return null},mn.prototype.destroy=function(){},mn.prototype.sourceRectAtTime=function(){},mn.prototype.initExpressions=function(){};function hn(){}hn.prototype.checkLayers=function(e){var t,n=this.layers.length,r;for(this.completeLayers=!0,t=n-1;t>=0;--t)this.elements[t]||(r=this.layers[t],r.ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t)),this.completeLayers=this.elements[t]?this.completeLayers:!1;this.checkPendingElements()},hn.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},hn.prototype.createCamera=function(){throw Error(`You're using a 3d camera. Try the html renderer.`)},hn.prototype.createAudio=function(e){return new mn(e,this.globalData,this)},hn.prototype.createFootage=function(e){return new pn(e,this.globalData,this)},hn.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e0&&(this.maskElement.setAttribute(`id`,p),this.element.maskedElement.setAttribute(b,`url(`+c()+`#`+p+`)`),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}vn.prototype.getMaskProperty=function(e){return this.viewData[e].prop},vn.prototype.renderFrame=function(e){var t=this.element.finalTransform.mat,n,r=this.masksProperties.length;for(n=0;n1&&(r+=` C`+t.o[i-1][0]+`,`+t.o[i-1][1]+` `+t.i[0][0]+`,`+t.i[0][1]+` `+t.v[0][0]+`,`+t.v[0][1]),n.lastPath!==r){var o=``;n.elem&&(t.c&&(o=e.inv?this.solidPath+r:r),n.elem.setAttribute(`d`,o)),n.lastPath=r}},vn.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var yn=function(){var e={};e.createFilter=t,e.createAlphaToLuminanceFilter=n;function t(e,t){var n=z(`filter`);return n.setAttribute(`id`,e),t!==!0&&(n.setAttribute(`filterUnits`,`objectBoundingBox`),n.setAttribute(`x`,`0%`),n.setAttribute(`y`,`0%`),n.setAttribute(`width`,`100%`),n.setAttribute(`height`,`100%`)),n}function n(){var e=z(`feColorMatrix`);return e.setAttribute(`type`,`matrix`),e.setAttribute(`color-interpolation-filters`,`sRGB`),e.setAttribute(`values`,`0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1`),e}return e}(),bn=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<`u`};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),xn={},Sn=`filter_result_`;function Cn(e){var t,n=`SourceGraphic`,r=e.data.ef?e.data.ef.length:0,i=I(),a=yn.createFilter(i,!0),o=0;this.filters=[];var s;for(t=0;t=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);--e);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n.01)return!1;n+=1}return!0},Rn.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)c=r.transformers[g].mProps._mdf||c,--h,--g;if(c)for(h=f-r.styles[u].lvl,g=r.transformers.length-1;h>0;)m.multiply(r.transformers[g].mProps.v),--h,--g}else m=e;if(p=r.sh.paths,o=p._length,c){for(s=``,a=0;a=1?v=.99:v<=-1&&(v=-.99);var y=g*v,b=Math.cos(_+t.a.v)*y+a[0],x=Math.sin(_+t.a.v)*y+a[1];r.setAttribute(`fx`,b),r.setAttribute(`fy`,x),i&&!t.g._collapsable&&(t.of.setAttribute(`fx`,b),t.of.setAttribute(`fy`,x))}}}function u(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute(`stroke-dasharray`,i.dashStr),r.pElem.setAttribute(`stroke-dashoffset`,i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute(`stroke`,`rgb(`+C(t.c.v[0])+`,`+C(t.c.v[1])+`,`+C(t.c.v[2])+`)`),(t.o._mdf||n)&&r.pElem.setAttribute(`stroke-opacity`,t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute(`stroke-width`,t.w.v),r.msElem&&r.msElem.setAttribute(`stroke-width`,t.w.v))}return n}();function Gn(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}u([dn,_n,wn,kn,Tn,fn,En],Gn),Gn.prototype.initSecondaryElement=function(){},Gn.prototype.identityMatrix=new K,Gn.prototype.buildExpressionInterface=function(){},Gn.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Gn.prototype.filterUniqueShapes=function(){var e,t=this.shapes.length,n,r,i=this.stylesList.length,a,o=[],s=!1;for(r=0;r1&&s&&this.setShapesAsAnimated(o)}},Gn.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;--c){if(g=this.searchProcessedElement(e[c]),g?t[c]=n[g-1]:e[c]._render=o,e[c].ty===`fl`||e[c].ty===`st`||e[c].ty===`gf`||e[c].ty===`gs`||e[c].ty===`no`)g?t[c].style.closed=e[c].hd:t[c]=this.createStyleElement(e[c],i),e[c]._render&&t[c].style.pElem.parentNode!==r&&r.appendChild(t[c].style.pElem),f.push(t[c].style);else if(e[c].ty===`gr`){if(!g)t[c]=this.createGroupElement(e[c]);else for(d=t[c].it.length,u=0;u1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},qn.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},qn.prototype.getValue=function(e){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!e)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var r,i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(r=0;rt);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},qn.prototype.buildFinalText=function(e){for(var t=[],n=0,r=e.length,i,a,o=!1,s=!1,c=``;n=55296&&i<=56319?Yt.isRegionalFlag(e,n)?c=e.substr(n,14):(a=e.charCodeAt(n+1),a>=56320&&a<=57343&&(Yt.isModifier(i,a)?(c=e.substr(n,2),o=!0):c=Yt.isFlagEmoji(e.substr(n,4))?e.substr(n,4):e.substr(n,2))):i>56319?(a=e.charCodeAt(n+1),Yt.isVariationSelector(i)&&(o=!0)):Yt.isZeroWidthJoiner(i)&&(o=!0,s=!0),o?(t[t.length-1]+=c,o=!1):t.push(c),n+=c.length;return t},qn.prototype.completeTextData=function(e){e.__complete=!0;var t=this.elem.globalData.fontManager,n=this.data,r=[],i,a,o,s=0,c,l=n.m.g,u=0,d=0,f=0,p=[],m=0,h=0,g,_,v=t.getFontByName(e.f),y,b=0,x=Jt(v);e.fWeight=x.weight,e.fStyle=x.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),a=e.finalText.length,e.finalLineHeight=e.lh;var S=e.tr/1e3*e.finalSize,C;if(e.sz)for(var w=!0,T=e.sz[0],E=e.sz[1],D,O;w;){O=this.buildFinalText(e.t),D=0,m=0,a=O.length,S=e.tr/1e3*e.finalSize;var k=-1;for(i=0;iT&&O[i]!==` `?(k===-1?a+=1:i=k,D+=e.finalLineHeight||e.finalSize*1.2,O.splice(i,+(k===i),`\r`),k=-1,m=0):(m+=b,m+=S);D+=v.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Eh?m:h,m=-2*S,c=``,o=!0,f+=1):c=j,t.chars?(y=t.getCharData(j,v.fStyle,t.getFontByName(e.f).fFamily),b=o?0:y.w*e.finalSize/100):b=t.measureText(c,e.f,e.finalSize),j===` `?A+=b+S:(m+=b+S+A,A=0),r.push({l:b,an:b,add:u,n:o,anIndexes:[],val:c,line:f,animatorJustifyOffset:0}),l==2){if(u+=b,c===``||c===` `||i===a-1){for((c===``||c===` `)&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;s+=1,u=0}}else if(l==3){if(u+=b,c===``||i===a-1){for(c===``&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;u=0,s+=1}}else r[s].ind=s,r[s].extra=0,s+=1;if(e.l=r,h=m>h?m:h,p.push(m),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=h,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=p;var M=n.a,N,P;_=M.length;var F,I,L=[];for(g=0;g<_;g+=1){for(N=M[g],N.a.sc&&(e.strokeColorAnim=!0),N.a.sw&&(e.strokeWidthAnim=!0),(N.a.fc||N.a.fh||N.a.fs||N.a.fb)&&(e.fillColorAnim=!0),I=0,F=N.s.b,i=0;i0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var c=xe.getBezierEasing(i,a,o,s).get,l=0,u=this.finalS,d=this.finalE,f=this.data.sh;if(f===2)l=d===u?+(r>=d):e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===3)l=d===u?r>=d?0:1:1-e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===4)d===u?l=0:(l=e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l<.5?l*=2:l=1-2*(l-.5)),l=c(l);else if(f===5){if(d===u)l=0;else{var p=d-u;r=t(e(0,r+.5-u),d-u);var m=-p/2+r,h=p/2;l=Math.sqrt(1-m*m/(h*h))}l=c(l)}else f===6?(d===u?l=0:(r=t(e(0,r+.5-u),d-u),l=(1+Math.cos(Math.PI+Math.PI*2*r/(d-u)))/2),l=c(l)):(r>=n(u)&&(l=r-u<0?e(0,t(t(d,1)-(u-r),1)):e(0,t(d-r,1))),l=c(l));if(this.sm.v!==100){var g=this.sm.v*.01;g===0&&(g=1e-8);var _=.5-g*.5;l<_?l=0:(l=(l-_)/g,l>1&&(l=1))}return l*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&this.data.r===2&&(this.e.v=this._currentTextLength);var t=this.data.r===2?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var a=r;r=i,i=a}this.finalS=r,this.finalE=i}},u([Be],r);function i(e,t,n){return new r(e,t,n)}return{getTextSelectorProp:i}}();function Yn(e,t,n){var r={propType:!1},i=G.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,D,n):r,rx:a.rx?i(e,a.rx,0,D,n):r,ry:a.ry?i(e,a.ry,0,D,n):r,sk:a.sk?i(e,a.sk,0,D,n):r,sa:a.sa?i(e,a.sa,0,D,n):r,s:a.s?i(e,a.s,1,.01,n):r,a:a.a?i(e,a.a,1,0,n):r,o:a.o?i(e,a.o,0,.01,n):r,p:a.p?i(e,a.p,1,0,n):r,sw:a.sw?i(e,a.sw,0,0,n):r,sc:a.sc?i(e,a.sc,1,0,n):r,fc:a.fc?i(e,a.fc,1,0,n):r,fh:a.fh?i(e,a.fh,0,0,n):r,fs:a.fs?i(e,a.fs,0,.01,n):r,fb:a.fb?i(e,a.fb,0,.01,n):r,t:a.t?i(e,a.t,0,0,n):r},this.s=Jn.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function Xn(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=m(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}Xn.prototype.searchProperties=function(){var e,t=this._textData.a.length,n,r=G.getProp;for(e=0;e=m+U||!x?(T=(m+U-g)/h.partialLength,ie=b.point[0]+(h.point[0]-b.point[0])*T,ae=b.point[1]+(h.point[1]-b.point[1])*T,a.translate(-n[0]*f[u].an*.005,-(n[1]*A)*.01),_=!1):x&&(g+=h.partialLength,v+=1,v>=x.length&&(v=0,y+=1,S[y]?x=S[y].points:D.v.c?(v=0,y=0,x=S[y].points):(g-=h.partialLength,x=null)),x&&(b=h,h=x[v],C=h.partialLength));re=f[u].an/2-f[u].add,a.translate(-re,0,0)}else re=f[u].an/2-f[u].add,a.translate(-re,0,0),a.translate(-n[0]*f[u].an*.005,-n[1]*A*.01,0);for(P=0;Pe?this.textSpans[e].span:z(s?`g`:`text`),b<=e){if(c.setAttribute(`stroke-linecap`,`butt`),c.setAttribute(`stroke-linejoin`,`round`),c.setAttribute(`stroke-miterlimit`,`4`),this.textSpans[e].span=c,s){var S=z(`g`);c.appendChild(S),this.textSpans[e].childSpan=S}this.textSpans[e].span=c,this.layerElement.appendChild(c)}c.style.display=`inherit`}if(l.reset(),d&&(o[e].n&&(f=-g,p+=n.yOffset,p+=+!!h,h=!1),this.applyTextPropertiesToMatrix(n,l,o[e].line,f,p),f+=o[e].l||0,f+=g),s){x=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily);var C;if(x.t===1)C=new ir(x.data,this.globalData,this);else{var w=Qn;x.data&&x.data.shapes&&(w=this.buildShapeData(x.data,n.finalSize)),C=new Gn(w,this.globalData,this)}if(this.textSpans[e].glyph){var T=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(T.layerElement),T.destroy()}this.textSpans[e].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[e].childSpan.appendChild(C.layerElement),x.t===1&&this.textSpans[e].childSpan.setAttribute(`transform`,`scale(`+n.finalSize/100+`,`+n.finalSize/100+`)`)}else d&&c.setAttribute(`transform`,`translate(`+l.props[12]+`,`+l.props[13]+`)`),c.textContent=o[e].val,c.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`)}d&&c&&c.setAttribute(`d`,u)}for(;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;--n)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},rr.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=0;--n)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t=1){this.buffers=[];var e=this.globalData.canvasContext,t=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&lr.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new dr(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=$t(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new fr(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(gn.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext(`2d`);this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext(`2d`);if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById(`tp`in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=lr.getLumaCanvas(this.canvasContext.canvas);n.getContext(`2d`).drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=mr[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation=`destination-over`,this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation=`source-over`}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&=!1}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new K},pr.prototype.hide=pr.prototype.hideElement,pr.prototype.show=pr.prototype.showElement;function hr(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i=4;t.ty===`rc`?i=5:t.ty===`el`?i=6:t.ty===`sr`&&(i=7),this.sh=Ke.getShapeProp(e,t,i,e);var a,o=n.length,s;for(a=0;a=0;--a){if(d=this.searchProcessedElement(e[a]),d?t[a]=n[d-1]:e[a]._shouldRender=r,e[a].ty===`fl`||e[a].ty===`st`||e[a].ty===`gf`||e[a].ty===`gs`)d?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],m),l.push(t[a].style);else if(e[a].ty===`gr`){if(!d)t[a]=this.createGroupElement(e[a]);else for(c=t[a].it.length,s=0;s=0;--i)t[i].ty===`tr`?(o=n[i].transform,this.renderShapeTransform(e,o)):t[i].ty===`sh`||t[i].ty===`el`||t[i].ty===`rc`||t[i].ty===`sr`?this.renderPath(t[i],n[i]):t[i].ty===`fl`?this.renderFill(t[i],n[i],o):t[i].ty===`st`?this.renderStroke(t[i],n[i],o):t[i].ty===`gf`||t[i].ty===`gs`?this.renderGradientFill(t[i],n[i],o):t[i].ty===`gr`?this.renderShape(o,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},gr.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n=e.trNodes,r=t.paths,i,a,o,s=r._length;n.length=0;var c=e.transforms.finalTransform;for(o=0;o=1?u=.99:u<=-1&&(u=-.99);var d=c*u,f=Math.cos(l+t.a.v)*d+o[0],p=Math.sin(l+t.a.v)*d+o[1];i=a.createRadialGradient(f,p,0,o[0],o[1],c)}var m,h=e.g.p,g=t.g.c,_=1;for(m=0;ma&&c===`xMidYMid slice`||ii&&s===`meet`||ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:l===`xMax`&&(ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u===`YMid`&&(a>i&&s===`meet`||ai&&s===`meet`||a=0;--e)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},Z.prototype.renderFrame=function(e,t){if(!(this.renderedFrame===e&&this.renderConfig.clearCanvas===!0&&!t||this.destroyed||e===-1)){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n,r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},Z.prototype.buildItem=function(e){var t=this.elements;if(!(t[e]||this.layers[e].ty===99)){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},Z.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},Z.prototype.hide=function(){this.animationItem.container.style.display=`none`},Z.prototype.show=function(){this.animationItem.container.style.display=`block`};function br(){this.opacity=-1,this.transform=p(`float32`,16),this.fillStyle=``,this.strokeStyle=``,this.lineWidth=``,this.lineCap=``,this.lineJoin=``,this.miterLimit=``,this.id=Math.random()}function xr(){this.stack=[],this.cArrPos=0,this.cTr=new K;var e,t=15;for(e=0;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Sr.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;--e)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},Sr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)};function Cr(e,t){this.animationItem=e,this.renderConfig={clearCanvas:t&&t.clearCanvas!==void 0?t.clearCanvas:!0,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||`xMidYMid meet`,imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||`xMidYMid slice`,contentVisibility:t&&t.contentVisibility||`visible`,className:t&&t.className||``,id:t&&t.id||``,runExpressions:!t||t.runExpressions===void 0||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new xr,this.elements=[],this.pendingElements=[],this.transformMat=new K,this.completeLayers=!1,this.rendererType=`canvas`,this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}return u([Z],Cr),Cr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)},_e(`canvas`,Cr),ut.registerModifier(`tm`,ft),ut.registerModifier(`pb`,pt),ut.registerModifier(`rp`,ht),ut.registerModifier(`rd`,gt),ut.registerModifier(`zz`,Pt),ut.registerModifier(`op`,qt),q}))}))(),1),Ot=0,kt=e=>`${e}-${++Ot}`,At=[{center:`#6f5bea`,edge:`#34278f`,pattern:`#a89df5`,text:`#ffffff`},{center:`#32a86b`,edge:`#17613e`,pattern:`#8ee0b3`,text:`#ffffff`},{center:`#df8d2f`,edge:`#8c421e`,pattern:`#ffd08a`,text:`#ffffff`},{center:`#d95878`,edge:`#7b2944`,pattern:`#f5a1b6`,text:`#ffffff`}];function jt(e){if(!e.length)return e;let t=Math.floor(1e3/e.length),n=1e3%e.length;return e.map((e,r)=>({...e,rarity:String(t+ +(r({key:kt(e),name:``,rarity:`1`,sortOrder:String(t),file:null,animation:null,fileError:``});function Mt(e){let t=e.reduce((e,t)=>{let n=Number(t.backdropID);return Number.isInteger(n)?Math.max(e,n):e},0)+1,n=At[e.length%At.length];return{key:kt(`backdrop`),name:``,backdropID:String(t),rarity:`1`,sortOrder:String(e.length),...n}}var Nt=e=>jt([X(e,0),X(e,1)]),Pt=()=>{let e=Mt([]);return jt([e,Mt([e])])};function Ft({data:e,compact:t=!1}){let n=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!n.current)return;let t=Dt.default.loadAnimation({container:n.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)});return()=>t.destroy()},[e]),(0,U.jsx)(`div`,{className:`collectible-animation ${t?`compact`:``}`,ref:n})}function It({giftID:e,attribute:t}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let n=!1;return a(!1),x.giftCollectibleAnimation(e,t.kind,t.id).then(e=>{n||r(e)}).catch(()=>{n||a(!0)}),()=>{n=!0}},[e,t.id,t.kind]),i?(0,U.jsx)(`div`,{className:`collectible-animation compact failed`,children:`!`}):n?(0,U.jsx)(Ft,{data:n,compact:!0}):(0,U.jsx)(`div`,{className:`collectible-animation compact loading`,children:(0,U.jsx)(A,{className:`spin`,size:15})})}async function Lt(e){let t=new Uint8Array(await e.arrayBuffer()),n=t;if(t.length>=2&&t[0]===31&&t[1]===139){if(!(`DecompressionStream`in window))throw Error(`This browser cannot preview TGS files`);let e=new Blob([t]).stream().pipeThrough(new DecompressionStream(`gzip`));n=new Uint8Array(await new Response(e).arrayBuffer())}let r=JSON.parse(new TextDecoder().decode(n));if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`Invalid Lottie JSON`);return r}var Rt=e=>Number.parseInt(e.replace(`#`,``),16),zt=e=>e.rarity_kind===`permille`?`${e.rarity_permille}‰`:e.rarity_kind;function Bt({gift:e,onClose:t,onPublished:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!0),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(`100`),[_,v]=(0,g.useState)(`1000`),[y,S]=(0,g.useState)(`gift-${e.GiftID}`),[C,w]=(0,g.useState)(``),[T,E]=(0,g.useState)(()=>Nt(`model`)),[D,O]=(0,g.useState)(()=>Nt(`pattern`)),[M,N]=(0,g.useState)(Pt);(0,g.useEffect)(()=>{let t=!1;return x.giftCollectibles(e.GiftID).then(n=>{t||(a(n),n.found&&(h(String(n.upgrade_stars??100)),v(String(n.supply_total??1e3)),S(n.slug_prefix??`gift-${e.GiftID}`)))}).catch(e=>d(b(e))).finally(()=>{t||s(!1)}),()=>{t=!0}},[e.GiftID]);let P=(0,g.useMemo)(()=>({models:T.reduce((e,t)=>e+Number(t.rarity||0),0),patterns:D.reduce((e,t)=>e+Number(t.rarity||0),0),backdrops:M.reduce((e,t)=>e+Number(t.rarity||0),0)}),[T,D,M]),F=()=>p(null),I=(e,t,n)=>{(e===`models`?E:O)(e=>e.map(e=>e.key===t?{...e,...n}:e)),F()};async function L(e,t,n){if(I(e,t.key,{file:n,animation:null,fileError:``}),n)try{let r=await Lt(n);I(e,t.key,{animation:r,fileError:``})}catch(n){I(e,t.key,{animation:null,fileError:b(n)})}}function ee(e,t=``){if(!C.trim())throw Error(r(`action.reasonRequired`));if(T.length<2||D.length<2||M.length<2)throw Error(r(`collectibles.minimumAttributes`));let n=M.map(e=>Number(e.backdropID));if(new Set(n).size!==n.length)throw Error(r(`collectibles.duplicateBackdropID`));for(let e of[...T,...D])if(!e.file)throw Error(r(`collectibles.fileRequired`));let i=new FormData,a=e=>e.map(e=>({name:e.name.trim(),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),file_key:e.key}));i.set(`metadata`,JSON.stringify({command_id:t,reason:C.trim(),confirm:e,upgrade_stars:m,supply_total:Number(_),slug_prefix:y.trim().toLowerCase(),models:a(T),patterns:a(D),backdrops:M.map(e=>({name:e.name.trim(),backdrop_id:Number(e.backdropID),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),center_color:Rt(e.center),edge_color:Rt(e.edge),pattern_color:Rt(e.pattern),text_color:Rt(e.text)}))}));for(let e of[...T,...D])i.set(e.key,e.file,e.file.name);return i}async function R(){l(!0),d(``),p(null);try{p(await x.publishGiftCollectibles(e.GiftID,ee(!1)))}catch(e){d(b(e))}finally{l(!1)}}async function ne(){if(f){l(!0),d(``);try{await x.publishGiftCollectibles(e.GiftID,ee(!0,f.command_id)),n(),t()}catch(e){d(b(e))}finally{l(!1)}}}let ie=(e,t,n)=>(0,U.jsxs)(`section`,{className:`collectible-section`,children:[(0,U.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.${e}`)}),(0,U.jsx)(`span`,{children:r(`collectibles.rarityHint`)})]}),(0,U.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,U.jsxs)(J,{tone:P[e]>0?`good`:`neutral`,children:[P[e],`‰`]}),(0,U.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{n(jt([...t,X(e===`models`?`model`:`pattern`,t.length)])),F()},children:[(0,U.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,U.jsx)(`div`,{className:`collectible-rows`,children:t.map((i,a)=>(0,U.jsxs)(`div`,{className:`collectible-row animated`,children:[(0,U.jsx)(`div`,{className:`collectible-row-index`,children:a+1}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`common.name`)}),(0,U.jsx)(`input`,{value:i.name,maxLength:128,onChange:t=>I(e,i.key,{name:t.target.value})})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:i.rarity,onChange:t=>I(e,i.key,{rarity:t.target.value})})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:i.sortOrder,onChange:t=>I(e,i.key,{sortOrder:t.target.value})})]}),(0,U.jsxs)(`label`,{className:`collectible-file`,children:[(0,U.jsx)(`span`,{children:r(`gifts.animation`)}),(0,U.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:t=>void L(e,i,t.target.files?.[0]??null)}),(0,U.jsxs)(`em`,{children:[(0,U.jsx)(te,{size:13}),i.file?.name??r(`gifts.chooseFile`)]})]}),(0,U.jsx)(`div`,{className:`collectible-inline-preview`,children:i.animation?(0,U.jsx)(Ft,{data:i.animation,compact:!0}):(0,U.jsx)(j,{size:16})}),(0,U.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:t.length<=2,onClick:()=>{n(jt(t.filter(e=>e.key!==i.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,U.jsx)(ye,{size:14})}),i.fileError&&(0,U.jsx)(`span`,{className:`collectible-file-error`,children:i.fileError})]},i.key))})]});return(0,st.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal collectible-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`collectibles.title`,{id:e.GiftID}),children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:r(`collectibles.eyebrow`)}),(0,U.jsx)(`h2`,{children:r(`collectibles.title`,{id:e.GiftID})}),(0,U.jsx)(`p`,{children:e.Title||`Gift #${e.GiftID}`})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:t,disabled:c,"aria-label":r(`action.close`),children:(0,U.jsx)(H,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body collectible-modal-body`,children:[o?(0,U.jsxs)(`div`,{className:`collectible-loading`,children:[(0,U.jsx)(A,{className:`spin`}),r(`common.loading`)]}):i?.found?(0,U.jsxs)(`section`,{className:`collectible-active`,children:[(0,U.jsxs)(`div`,{className:`collectible-active-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(re,{size:18}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.activeRevision`,{revision:i.revision??0})}),(0,U.jsxs)(`span`,{children:[i.slug_prefix,` · ⭐ `,i.upgrade_stars,` · `,i.issued,` / `,i.supply_total]})]})]}),(0,U.jsx)(J,{tone:`good`,children:r(`collectibles.published`)})]}),(0,U.jsxs)(`div`,{className:`collectible-active-grid`,children:[[...i.models??[],...i.patterns??[]].map(t=>(0,U.jsxs)(`article`,{children:[(0,U.jsx)(It,{giftID:e.GiftID,attribute:t}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`strong`,{children:[t.name,t.crafted&&(0,U.jsx)(J,{children:`crafted`})]}),(0,U.jsxs)(`span`,{children:[r(`collectibles.${t.kind}`),` · `,zt(t)]})]})]},`${t.kind}-${t.id}`)),(i.backdrops??[]).map(e=>(0,U.jsxs)(`article`,{children:[(0,U.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, #${(e.center_color??0).toString(16).padStart(6,`0`)}, #${(e.edge_color??0).toString(16).padStart(6,`0`)})`,color:`#${(e.text_color??16777215).toString(16).padStart(6,`0`)}`},children:`Aa`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e.name}),(0,U.jsxs)(`span`,{children:[r(`collectibles.backdrop`),` · `,zt(e)]})]})]},`backdrop-${e.id}`))]})]}):(0,U.jsxs)(`div`,{className:`collectible-empty`,children:[(0,U.jsx)(re,{size:22}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.noPool`)}),(0,U.jsx)(`span`,{children:r(`collectibles.noPoolHint`)})]})]}),(0,U.jsxs)(`section`,{className:`collectible-definition`,children:[(0,U.jsxs)(`div`,{className:`collectible-definition-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.publishNew`)}),(0,U.jsx)(`span`,{children:r(`collectibles.immutableHint`)})]}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,U.jsx)(`span`,{children:`TGS`}),(0,U.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,U.jsxs)(`div`,{className:`gift-fields-grid collectible-main-fields`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.upgradeStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:m,onChange:e=>{h(e.target.value),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.supply`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:_,onChange:e=>{v(e.target.value),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.slug`)}),(0,U.jsx)(`input`,{value:y,maxLength:48,onChange:e=>{S(e.target.value.toLowerCase()),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.reason`)}),(0,U.jsx)(`input`,{value:C,maxLength:1e3,placeholder:r(`gifts.reasonPlaceholder`),onChange:e=>w(e.target.value)})]})]}),ie(`models`,T,E),ie(`patterns`,D,O),(0,U.jsxs)(`section`,{className:`collectible-section`,children:[(0,U.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.backdrops`)}),(0,U.jsx)(`span`,{children:r(`collectibles.colorHint`)})]}),(0,U.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,U.jsxs)(J,{tone:P.backdrops>0?`good`:`neutral`,children:[P.backdrops,`‰`]}),(0,U.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{N(jt([...M,Mt(M)])),F()},children:[(0,U.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,U.jsx)(`div`,{className:`collectible-rows`,children:M.map((e,t)=>(0,U.jsxs)(`div`,{className:`collectible-row backdrop`,children:[(0,U.jsx)(`div`,{className:`collectible-row-index`,children:t+1}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`common.name`)}),(0,U.jsx)(`input`,{value:e.name,maxLength:128,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,name:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.backdropID`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,value:e.backdropID,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,backdropID:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:e.rarity,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,rarity:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:e.sortOrder,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,sortOrder:t.target.value}:n)),F()}})]}),[`center`,`edge`,`pattern`,`text`].map(t=>(0,U.jsxs)(`label`,{className:`collectible-color`,children:[(0,U.jsx)(`span`,{children:r(`collectibles.color.${t}`)}),(0,U.jsx)(`input`,{type:`color`,value:e[t],onChange:n=>{N(M.map(r=>r.key===e.key?{...r,[t]:n.target.value}:r)),F()}})]},t)),(0,U.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, ${e.center}, ${e.edge})`,color:e.text},children:`Aa`}),(0,U.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:M.length<=2,onClick:()=>{N(jt(M.filter(t=>t.key!==e.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,U.jsx)(ye,{size:14})})]},e.key))})]})]}),u&&(0,U.jsx)($e,{children:u}),f&&(0,U.jsxs)(`div`,{className:`gift-validation`,children:[(0,U.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,U.jsx)(k,{size:17}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.validationReady`)}),(0,U.jsx)(`span`,{children:r(`collectibles.validationHint`)})]})]}),(0,U.jsx)(`pre`,{children:JSON.stringify(f.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:t,disabled:c,children:r(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:R,disabled:c,children:[c?(0,U.jsx)(A,{className:`spin`,size:15}):(0,U.jsx)(he,{size:15}),r(`gifts.validate`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:ne,disabled:c||!f,children:[(0,U.jsx)(be,{size:15}),r(`collectibles.publish`)]})]})]})}),document.body)}function Vt(e){return e.model_count+e.pattern_count+e.backdrop_count}function Ht(e){let t=Number(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Ut({giftID:e,revision:t,compact:n=!1}){let r=(0,g.useRef)(null),i=(0,g.useRef)(null),[a,o]=(0,g.useState)(!0),[s,c]=(0,g.useState)(``);(0,g.useEffect)(()=>{let t=!1;return x.giftAnimation(e).then(e=>{t||!r.current||(i.current?.destroy(),i.current=Dt.default.loadAnimation({container:r.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(e=>c(b(e))),()=>{t=!0,i.current?.destroy(),i.current=null}},[e,t]);function l(){i.current&&(a?i.current.pause():i.current.play(),o(!a))}return(0,U.jsxs)(`div`,{className:`gift-animation-shell ${n?`compact`:``}`,children:[(0,U.jsx)(`div`,{className:`gift-animation`,ref:r,children:s&&(0,U.jsx)(`span`,{children:s})}),(0,U.jsx)(`button`,{className:`gift-play`,type:`button`,onClick:l,"aria-label":a?`Pause`:`Play`,children:a?(0,U.jsx)(z,{size:14}):(0,U.jsx)(B,{size:14})})]})}function Wt({sourceGiftID:e}){let t=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let n=!1,r=null;return x.officialGiftAnimation(e).then(e=>{n||!t.current||(r=Dt.default.loadAnimation({container:t.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(()=>void 0),()=>{n=!0,r?.destroy()}},[e]),(0,U.jsx)(`div`,{className:`gift-animation-shell`,children:(0,U.jsx)(`div`,{className:`gift-animation`,ref:t})})}function Gt(){let{t:e}=W(),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`official`),[p,m]=(0,g.useState)([]),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!0),[E,D]=(0,g.useState)(`0`),[O,j]=(0,g.useState)(`0`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(`0`),[I,L]=(0,g.useState)(``),[ee,R]=(0,g.useState)(`50`),[ne,ie]=(0,g.useState)(`50`),[ae,oe]=(0,g.useState)(`0`),[se,ce]=(0,g.useState)(!0),[le,ue]=(0,g.useState)(``),[z,B]=(0,g.useState)(null),[me,ge]=(0,g.useState)(!1),[_e,ve]=(0,g.useState)(``),[ye,V]=(0,g.useState)(``);async function xe(){ve(``);try{n((await x.gifts()).Gifts??[])}catch(e){ve(b(e))}}(0,g.useEffect)(()=>{xe()},[]),(0,g.useEffect)(()=>{!a||d!==`official`||p.length>0||x.officialGifts().then(e=>m(e.gifts??[])).catch(e=>V(b(e)))},[a,d,p.length]);let Se=(0,g.useMemo)(()=>p.find(e=>e.source_gift_id===S)??null,[p,S]),Ce=(0,g.useMemo)(()=>({all:p.length,upgrade:p.filter(e=>e.can_upgrade).length,craft:p.filter(e=>e.can_craft).length,basic:p.filter(e=>!e.can_upgrade).length}),[p]),we=(0,g.useMemo)(()=>{let e=h.trim().toLowerCase();return p.filter(t=>(v===`all`||v===`upgrade`&&t.can_upgrade||v===`craft`&&t.can_craft||v===`basic`&&!t.can_upgrade)&&(!e||t.source_gift_id.includes(e)||t.title.toLowerCase().includes(e)))},[p,h,v]),Te=(0,g.useMemo)(()=>{let e=r.trim().toLowerCase();return e?t.filter(t=>String(t.GiftID).includes(e)||t.Title.toLowerCase().includes(e)||t.SourceFormat.toLowerCase().includes(e)):t},[t,r]);function Ee(t,n=``){if(!l)throw Error(e(`gifts.fileRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));let r=new FormData;return r.set(`metadata`,JSON.stringify({command_id:n,reason:le.trim(),confirm:t,gift_id:P,title:I.trim(),stars:ee,convert_stars:ne,enabled:se,sort_order:Number(ae)})),r.set(`file`,l,l.name),r}function De(t,n=``){if(!S)throw Error(e(`gifts.officialRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));return{command_id:n,reason:le.trim(),confirm:t,source_gift_id:S,gift_id:P,title:I.trim(),stars:ee,convert_stars:ne,enabled:se,sort_order:Number(ae),include_collectible:w,upgrade_stars:E,supply_total:Number(O),slug_prefix:M.trim().toLowerCase()}}function Oe(t){C(t.source_gift_id),L(t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})),R(String(t.stars)),ie(String(t.convert_stars)),T(t.can_upgrade),D(t.upgrade_stars),j(String(t.availability_total||1)),N(`official-${t.source_gift_id}`),B(null)}async function ke(){ge(!0),V(``),B(null);try{B(d===`official`?await x.importOfficialGift(De(!1)):await x.importGift(Ee(!1)))}catch(e){V(b(e))}finally{ge(!1)}}async function Ae(){if(z){ge(!0),V(``);try{d===`official`?await x.importOfficialGift(De(!0,z.command_id)):await x.importGift(Ee(!0,z.command_id)),B(null),u(null),F(`0`),L(``),C(``),await xe(),o(!1)}catch(e){V(b(e))}finally{ge(!1)}}}function je(){F(`0`),L(``),R(`50`),ie(`50`),oe(`0`),ce(!0),ue(``),u(null),B(null),V(``),f(`official`),C(``),_(``),y(`all`),o(!0)}function Me(e){F(e.GiftID),L(e.Title),R(String(e.Stars)),ie(String(e.ConvertStars)),oe(String(e.SortOrder)),ce(e.Enabled),ue(``),u(null),B(null),V(``),f(`official`),C(``),_(``),y(`all`),o(!0)}return(0,U.jsxs)(Ye,{title:e(`gifts.pageTitle`),eyebrow:e(`gifts.eyebrow`),actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>xe(),disabled:me,children:[(0,U.jsx)(fe,{size:15}),` `,e(`common.refresh`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:je,children:[(0,U.jsx)(de,{size:15}),` `,e(`gifts.add`)]})]}),children:[_e&&(0,U.jsx)($e,{children:_e}),(0,U.jsxs)(`div`,{className:`metric-row gift-metrics`,children:[(0,U.jsx)(tt,{label:e(`gifts.total`),value:String(t.length)}),(0,U.jsx)(tt,{label:e(`gifts.enabled`),value:String(t.filter(e=>e.Enabled).length),tone:`good`}),(0,U.jsx)(tt,{label:e(`gifts.received`),value:t.reduce((e,t)=>e+BigInt(t.ReceivedCount),0n).toString()}),(0,U.jsx)(tt,{label:e(`gifts.formats`),value:`TGS / Lottie`})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`div`,{className:`toolbar`,children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:e(`gifts.searchPlaceholder`)})]}),(0,U.jsx)(`span`,{className:`gift-list-summary`,children:e(`gifts.listSummary`,{shown:Te.length,total:t.length})})]})}),(0,U.jsx)(`div`,{className:`table-wrap gift-table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table gift-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:e(`gifts.animation`)}),(0,U.jsx)(`th`,{children:e(`gifts.idRevision`)}),(0,U.jsx)(`th`,{children:e(`gifts.title`)}),(0,U.jsx)(`th`,{children:e(`gifts.price`)}),(0,U.jsx)(`th`,{children:e(`gifts.source`)}),(0,U.jsx)(`th`,{children:e(`gifts.received`)}),(0,U.jsx)(`th`,{children:e(`common.status`)}),(0,U.jsx)(`th`,{children:e(`common.updatedAt`)}),(0,U.jsx)(`th`,{children:e(`common.actions`)})]})}),(0,U.jsxs)(`tbody`,{children:[Te.map(t=>(0,U.jsxs)(`tr`,{className:t.Enabled?``:`gift-row-disabled`,children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(Ut,{giftID:t.GiftID,revision:t.Revision,compact:!0})}),(0,U.jsxs)(`td`,{className:`mono`,children:[t.GiftID,` / `,t.Revision]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{className:`gift-table-title`,children:t.Title||`Gift #${t.GiftID}`}),(0,U.jsxs)(`span`,{className:`gift-sort-order`,children:[e(`gifts.sortOrder`),`: `,t.SortOrder]})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsxs)(`strong`,{className:`gift-table-price`,children:[`⭐ `,t.Stars]}),(0,U.jsxs)(`span`,{className:`gift-convert-price`,children:[`→ `,t.ConvertStars]})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(J,{children:t.SourceFormat}),(0,U.jsx)(`span`,{className:`gift-source-size`,children:Ht(t.AnimationSize)})]}),(0,U.jsx)(`td`,{children:t.ReceivedCount}),(0,U.jsx)(`td`,{children:(0,U.jsx)(J,{tone:t.Enabled?`good`:`neutral`,children:t.Enabled?e(`common.enabled`):e(`common.disabled`)})}),(0,U.jsx)(`td`,{children:K(t.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`div`,{className:`gift-table-actions`,children:[(0,U.jsxs)(`button`,{className:`btn compact-btn collectible-button`,type:`button`,onClick:()=>c(t),children:[(0,U.jsx)(re,{size:13}),e(`collectibles.manage`)]}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>Me(t),children:e(`gifts.replace`)}),(0,U.jsx)(ct,{compact:!0,tone:`neutral`,label:t.Enabled?e(`gifts.disable`):e(`gifts.enable`),path:`/api/actions/set-gift-enabled`,payload:()=>({gift_id:t.GiftID,enabled:!t.Enabled}),onDone:()=>void xe()})]})})]},t.GiftID)),Te.length===0&&(0,U.jsx)(rt,{colSpan:9})]})]})}),a&&(0,st.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal gift-import-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P}),children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:e(`gifts.importEyebrow`)}),(0,U.jsx)(`h2`,{children:P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P})})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>o(!1),disabled:me,"aria-label":e(`action.close`),children:(0,U.jsx)(H,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body gift-import-modal-body`,children:[(0,U.jsxs)(`div`,{className:`command-steps`,children:[(0,U.jsxs)(`div`,{className:`command-step ${(d===`official`?S:l)?`done`:`active`}`,children:[(0,U.jsx)(`span`,{children:`1`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepDetails`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${z?`done`:(d===`official`?S:l)?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`2`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepValidate`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${z?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`3`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepImport`)})]})]}),(0,U.jsxs)(`div`,{className:`gift-source-tabs`,children:[(0,U.jsx)(`button`,{className:`btn ${d===`official`?`primary`:``}`,type:`button`,onClick:()=>{f(`official`),B(null)},children:e(`gifts.officialSource`)}),(0,U.jsx)(`button`,{className:`btn ${d===`file`?`primary`:``}`,type:`button`,onClick:()=>{f(`file`),B(null)},children:e(`gifts.fileSource`)})]}),d===`official`?(0,U.jsxs)(`section`,{className:`official-gift-picker`,children:[(0,U.jsxs)(`div`,{className:`gift-import-note`,children:[(0,U.jsx)(`span`,{children:e(`gifts.officialHint`)}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,U.jsx)(`span`,{children:p.length}),(0,U.jsx)(`span`,{children:`SHA-256`})]})]}),(0,U.jsxs)(`div`,{className:`official-gift-tools`,children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),placeholder:e(`gifts.officialSearch`)})]}),(0,U.jsx)(`span`,{children:e(`gifts.officialResults`,{shown:we.length,total:p.length})})]}),(0,U.jsx)(`div`,{className:`official-gift-categories`,role:`group`,"aria-label":e(`gifts.officialCategoryLabel`),children:[`all`,`upgrade`,`craft`,`basic`].map(t=>(0,U.jsxs)(`button`,{className:v===t?`active`:``,type:`button`,"aria-pressed":v===t,onClick:()=>y(t),children:[e(`gifts.officialCategory.${t}`),(0,U.jsx)(`span`,{children:Ce[t]})]},t))}),(0,U.jsxs)(`div`,{className:`official-gift-list`,role:`listbox`,"aria-label":e(`gifts.officialSelect`),children:[we.map(t=>{let n=t.source_gift_id===S;return(0,U.jsxs)(`button`,{className:`official-gift-option ${n?`selected`:``}`,type:`button`,role:`option`,"aria-selected":n,onClick:()=>Oe(t),children:[(0,U.jsxs)(`span`,{className:`official-gift-option-head`,children:[(0,U.jsx)(`strong`,{children:t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})}),(0,U.jsxs)(`span`,{className:`mono`,children:[`#`,t.source_gift_id]})]}),(0,U.jsxs)(`span`,{className:`official-gift-option-meta`,children:[(0,U.jsxs)(`span`,{children:[`⭐ `,t.stars]}),(0,U.jsx)(`span`,{children:e(`gifts.officialAttributes`,{count:Vt(t)})})]}),(0,U.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,U.jsx)(`span`,{className:t.can_upgrade?`yes`:`no`,children:t.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,U.jsx)(`span`,{className:t.can_craft?`craft`:`no`,children:t.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]},t.source_gift_id)}),we.length===0&&(0,U.jsx)(`div`,{className:`official-gift-empty`,children:e(`gifts.officialEmpty`)})]}),Se&&(0,U.jsxs)(`div`,{className:`official-gift-selected`,children:[(0,U.jsx)(Wt,{sourceGiftID:Se.source_gift_id}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:Se.title||e(`gifts.officialUnnamed`,{id:Se.source_gift_id})}),(0,U.jsx)(`span`,{className:`mono`,children:Se.source_gift_id}),(0,U.jsxs)(`small`,{children:[Se.model_count,` `,e(`collectibles.models`),` · `,Se.pattern_count,` `,e(`collectibles.patterns`),` · `,Se.backdrop_count,` `,e(`collectibles.backdrops`)]}),(0,U.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,U.jsx)(`span`,{className:Se.can_upgrade?`yes`:`no`,children:Se.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,U.jsx)(`span`,{className:Se.can_craft?`craft`:`no`,children:Se.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]})]}),Se?.can_upgrade&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>{T(e.target.checked),B(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:e(`gifts.includeCollectible`)})]}),w&&(0,U.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.upgradeStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:E,onChange:e=>{D(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.supply`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:O,onChange:e=>{j(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.slug`)}),(0,U.jsx)(`input`,{value:M,maxLength:48,onChange:e=>{N(e.target.value.toLowerCase()),B(null)}})]})]})]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`gift-import-note`,children:[(0,U.jsx)(`span`,{children:e(`gifts.importHint`)}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,"aria-label":e(`gifts.formats`),children:[(0,U.jsx)(`span`,{children:`TGS`}),(0,U.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,U.jsxs)(`label`,{className:`gift-file-picker ${l?`has-file`:``}`,children:[(0,U.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:e=>{u(e.target.files?.[0]??null),B(null)}}),(0,U.jsx)(`span`,{className:`gift-file-icon`,children:(0,U.jsx)(te,{size:22})}),(0,U.jsxs)(`span`,{className:`gift-file-copy`,children:[(0,U.jsx)(`span`,{className:`gift-field-label`,children:e(`gifts.animation`)}),(0,U.jsx)(`strong`,{children:l?l.name:e(`gifts.filePrompt`)}),(0,U.jsx)(`small`,{children:l?Ht(l.size):e(`gifts.fileHint`)})]}),(0,U.jsx)(`span`,{className:`gift-file-action`,children:e(l?`gifts.changeFile`:`gifts.chooseFile`)})]})]}),(0,U.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.title`)}),(0,U.jsx)(`input`,{value:I,maxLength:128,placeholder:e(`gifts.titlePlaceholder`),onChange:e=>{L(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.stars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:ee,onChange:e=>{R(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.convertStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,value:ne,onChange:e=>{ie(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:ae,onChange:e=>{oe(e.target.value),B(null)}})]})]}),(0,U.jsxs)(`label`,{className:`gift-reason-field`,children:[(0,U.jsx)(`span`,{children:e(`gifts.reason`)}),(0,U.jsx)(`input`,{value:le,placeholder:e(`gifts.reasonPlaceholder`),onChange:e=>ue(e.target.value)})]}),(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:se,onChange:e=>{ce(e.target.checked),B(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:e(`gifts.enableAfterImport`)})]}),ye&&(0,U.jsx)($e,{children:ye}),z&&(0,U.jsxs)(`div`,{className:`gift-validation`,children:[(0,U.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,U.jsx)(k,{size:17}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e(`gifts.validationReady`)}),(0,U.jsx)(`span`,{children:e(`gifts.validationHint`)})]})]}),(0,U.jsx)(`pre`,{children:JSON.stringify(z.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>o(!1),disabled:me,children:e(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:ke,disabled:me,children:[me?(0,U.jsx)(A,{className:`spin`,size:15}):(0,U.jsx)(he,{size:15}),e(`gifts.validate`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:Ae,disabled:me||!z,children:[(0,U.jsx)(be,{size:15}),e(`gifts.confirmImport`)]})]})]})}),document.body),s&&(0,U.jsx)(Bt,{gift:s,onClose:()=>c(null),onPublished:()=>void xe()})]})}function Kt({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1],i=e.path.match(/^\/bots\/(\d+)$/)?.[1];return n?(0,U.jsx)(ut,{id:Number(n),navigate:t}):r?(0,U.jsx)(ht,{id:Number(r),navigate:t}):i?(0,U.jsx)(_t,{id:Number(i),navigate:t}):e.path===`/accounts`?(0,U.jsx)(mt,{navigate:t}):e.path===`/channels`?(0,U.jsx)(gt,{navigate:t}):e.path===`/bots`?(0,U.jsx)(vt,{navigate:t}):e.path===`/gifts`?(0,U.jsx)(Gt,{}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,U.jsx)(Tt,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,U.jsx)(xt,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,U.jsx)(wt,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,U.jsx)(Et,{navigate:t}):(0,U.jsx)(yt,{navigate:t})}function qt(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>Ae());(0,g.useEffect)(()=>{let e=()=>r(Ae());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(Ae())};return e===void 0?(0,U.jsx)(Be,{}):e===null?(0,U.jsx)(ot,{onLogin:t}):(0,U.jsx)(Ve,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,U.jsx)(Kt,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,U.jsx)(g.StrictMode,{children:(0,U.jsx)(Ie,{children:(0,U.jsx)(Te,{children:(0,U.jsx)(qt,{})})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css b/cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css new file mode 100644 index 00000000..a538e8da --- /dev/null +++ b/cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css @@ -0,0 +1 @@ +:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#eef1f5;--bg-accent:#e7ecf1;--panel:#fff;--panel-subtle:#f5f8fb;--panel-strong:#eef2f6;--surface-soft:#f2f7f6;--overlay:#18222f6b;--topbar-bg:#ffffffdb;--line:#e5eaf0;--line-strong:#d3dce4;--heading:#253040;--text:#333f4d;--text-soft:#45525f;--muted:#6d7885;--muted-2:#9aa4b1;--brand:#1f7d6f;--brand-strong:#196155;--brand-2:#3a6cae;--brand-tint:#e8f4f0;--brand-tint-border:#c8e2db;--brand-tint-text:#235d53;--good:#1f8a57;--good-tint:#eaf6ef;--good-border:#c1e1cf;--warn:#a86a12;--warn-tint:#fcf4e4;--warn-border:#e7d09e;--danger:#c0392b;--danger-tint:#fcefec;--danger-border:#eecac3;--danger-text:#8f2f27;--purple:#6a4fa3;--purple-tint:#f4effb;--purple-border:#dcd0f0;--purple-text:#5a4590;--input-bg:#fff;--btn-bg:#fff;--btn-text:#29323d;--btn-hover:#f4f7fa;--switch-track:#c8d0d6;--code-bg:#1b2733;--code-text:#d6e3ef;--code-border:#2b3a49;--sidebar:#1c2530;--sidebar-soft:#26313d;--sidebar-line:#313c4a;--sidebar-row:#232d38;--sidebar-text:#dbe3ec;--sidebar-muted:#8b98a8;--sidebar-faint:#7c8a9a;--sidebar-heading:#fff;--focus:#1f7d6f29;--shadow:0 12px 34px #1827381a;--shadow-sm:0 2px 10px #1827380d;--shadow-brand:0 8px 22px #1f7d6f38;--radius-xs:8px;--radius-sm:9px;--radius:11px;--radius-lg:14px}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0f141a;--bg-accent:#131a22;--panel:#171f28;--panel-subtle:#1c2530;--panel-strong:#212c38;--surface-soft:#1a232d;--overlay:#05080c9e;--topbar-bg:#151c24db;--line:#29333f;--line-strong:#38434f;--heading:#eef3f8;--text:#d5dde6;--text-soft:#c2ccd6;--muted:#98a4b1;--muted-2:#6d7885;--brand:#37a596;--brand-strong:#45b6a6;--brand-2:#6fa8e6;--brand-tint:#14322d;--brand-tint-border:#245349;--brand-tint-text:#7fd3c4;--good:#47c281;--good-tint:#12301f;--good-border:#245639;--warn:#e0aa4d;--warn-tint:#322810;--warn-border:#574413;--danger:#e6695c;--danger-tint:#35201d;--danger-border:#5c332d;--danger-text:#f0a49b;--purple:#ac90e2;--purple-tint:#221b31;--purple-border:#3d3357;--purple-text:#c9b6ef;--input-bg:#131a22;--btn-bg:#1e2731;--btn-text:#dbe2ea;--btn-hover:#26313d;--switch-track:#3a454f;--code-bg:#0c1218;--code-text:#cdd9e5;--code-border:#232f3b;--sidebar:#10151b;--sidebar-soft:#1c242f;--sidebar-line:#262f3a;--sidebar-row:#161d25;--sidebar-text:#cbd4de;--sidebar-muted:#7c8794;--sidebar-faint:#6f7b88;--sidebar-heading:#f0f4f8;--focus:#37a5963d;--shadow:0 16px 40px #00000075;--shadow-sm:0 2px 12px #00000061;--shadow-brand:0 8px 22px #37a59642}*{box-sizing:border-box}html,body,#root{min-height:100%}body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;margin:0;font:13px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;transition:background-color .2s,color .2s}button,input,textarea{font:inherit}a{color:inherit;text-decoration:none}.shell{grid-template-columns:232px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{height:100vh;color:var(--sidebar-text);background:var(--sidebar);border-right:1px solid var(--sidebar-line);flex-direction:column;gap:16px;padding:18px 12px;display:flex;position:sticky;top:0;overflow-y:auto}.brand{align-items:center;gap:10px;min-height:42px;padding:0 4px;display:flex}.brand.compact{justify-content:center}.brand-elevated .brand-mark{box-shadow:var(--shadow-brand)}.brand-mark{color:#fff;background:var(--brand);border-radius:var(--radius-sm);border:1px solid #fff3;place-items:center;width:34px;height:34px;font-weight:800;display:grid}.brand strong{font-size:14px;line-height:1.1;display:block}.brand small{color:var(--sidebar-muted);margin-top:3px;font-size:11px;display:block}.sidebar-label{color:var(--sidebar-faint);text-transform:uppercase;letter-spacing:.04em;padding:0 8px;font-size:11px;font-weight:700}.nav-list,.nav-section{gap:4px;display:grid}.nav-section-toggle{width:100%;min-height:38px;color:var(--sidebar-muted);border-radius:var(--radius-sm);cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;grid-template-columns:18px minmax(0,1fr) 16px;align-items:center;gap:9px;padding:0 10px;font-size:12px;font-weight:800;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-section-toggle:hover,.nav-section.active .nav-section-toggle{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-section-chevron{color:var(--sidebar-muted);justify-self:end;transition:transform .14s}.nav-section.open .nav-section-chevron{transform:rotate(180deg)}.nav-children{gap:4px;padding:2px 0 2px 18px;display:grid}.nav-item{min-height:38px;color:var(--sidebar-text);border-radius:var(--radius-sm);border:1px solid #0000;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;padding:0 10px;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-dot{background:var(--sidebar-faint);border-radius:999px;justify-self:center;width:6px;height:6px}.nav-item:hover,.nav-item.active{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-item.active .nav-dot{background:var(--brand)}.sidebar-status{gap:7px;margin-top:auto;display:grid}.runtime-row{min-height:32px;color:var(--sidebar-text);background:var(--sidebar-row);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;padding:0 8px;display:grid}.runtime-row strong{color:var(--sidebar-heading);font-size:11px}.workspace{min-width:0}.topbar{z-index:20;background:var(--topbar-bg);border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);justify-content:space-between;align-items:center;gap:18px;min-height:66px;padding:12px 24px;display:flex;position:sticky;top:0}.topbar h1{color:var(--heading);margin:2px 0 0;font-size:20px;line-height:1.2}.topbar-actions,.page-actions,.section-action,.entity-badges,.row-actions,.modal-actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.language-switch{background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;min-height:30px;padding:2px;display:inline-flex}.language-switch button{min-width:42px;min-height:24px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:999px;padding:0 9px;font-weight:800;transition:color .14s,background-color .14s}.language-switch button.active{color:#fff;background:var(--brand)}.language-switch button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.theme-toggle{width:34px;height:34px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);cursor:pointer;border-radius:999px;place-items:center;transition:color .16s,background-color .16s,border-color .16s;display:inline-grid}.theme-toggle:hover{color:var(--brand);border-color:var(--brand-tint-border);background:var(--brand-tint)}.theme-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.actor-pill{min-height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;padding:0 10px;display:inline-flex}.content{gap:16px;padding:18px 24px 30px;display:grid}.eyebrow{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:800}.dashboard-layout,.stacked-sections{gap:14px;display:grid}.overview-band,.page-frame{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm)}.overview-band{grid-template-columns:minmax(220px,1fr) minmax(420px,.9fr);align-items:center;gap:16px;padding:16px;display:grid}.overview-band h2,.page-title-row h2,.section-head h2,.modal h2{color:var(--heading);margin:0;font-size:18px;line-height:1.25}.overview-metrics,.metric-row{grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;display:grid}.overview-metrics{grid-template-columns:repeat(3,minmax(120px,1fr))}.status-item,.metric,.summary-item{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:0;padding:10px}.status-item span,.metric span,.summary-item span{color:var(--muted);margin-bottom:6px;font-size:11px;display:block}.status-item strong,.metric strong,.summary-item strong{overflow-wrap:anywhere;color:var(--text);font-weight:800;display:block}.status-item.good,.metric.good{border-color:var(--good-border)}.status-item.warn,.metric.warn{border-color:var(--warn-border)}.metric.danger{border-color:var(--danger-border)}.command-grid{grid-template-columns:repeat(3,minmax(220px,1fr));gap:12px;display:grid}.launcher{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-height:94px;box-shadow:var(--shadow-sm);grid-template-columns:38px minmax(0,1fr) 18px;align-items:center;gap:12px;padding:14px;transition:border-color .16s,box-shadow .16s,transform .16s;display:grid}.launcher:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.launcher-icon{width:38px;height:38px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);place-items:center;display:grid}.launcher-copy{gap:4px;display:grid}.launcher-copy strong{color:var(--heading);font-size:15px}.launcher-copy span{color:var(--muted)}.work-strip{grid-template-columns:repeat(4,minmax(160px,1fr));gap:8px;display:grid}.strip-item{min-height:38px;color:var(--text-soft);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.page-frame{gap:14px;padding:14px;display:grid}.page-title-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:14px;padding-bottom:12px;display:flex}.query-panel{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.message-query input{width:150px}.message-selector-grid{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;margin-bottom:10px;display:grid}.message-selector-grid.single{grid-template-columns:minmax(320px,620px)}.entity-picker{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);gap:8px;min-width:0;padding:10px;display:grid}.picker-head{min-height:24px;color:var(--text-soft);justify-content:space-between;align-items:center;gap:8px;font-weight:800;display:flex}.selected-entity{min-height:40px;color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 9px;display:grid}.selected-entity strong,.selected-entity span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.selected-entity div{gap:2px;min-width:0;display:grid}.selected-entity div span{color:var(--brand-tint-text);opacity:.85;font-size:11px}.picker-search{background:var(--panel-subtle);border:1px solid var(--line-strong);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;height:34px;padding:0 6px 0 9px;display:grid}.picker-search input{width:100%;height:30px;box-shadow:none;background:0 0;border:0;padding:0}.picker-results{border:1px solid var(--line);border-radius:var(--radius-sm);max-height:236px;display:grid;overflow:auto}.picker-row{min-height:36px;color:var(--text);background:var(--panel);border:0;border-bottom:1px solid var(--line);cursor:pointer;text-align:left;grid-template-columns:96px minmax(120px,1fr) minmax(120px,1fr) auto;align-items:center;gap:8px;padding:6px 8px;display:grid}.picker-row:last-child{border-bottom:0}.picker-row:hover,.picker-row.selected{background:var(--surface-soft)}.picker-row strong,.picker-row span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.picker-empty,.picker-error{color:var(--muted);text-align:center;padding:9px}.picker-error{color:var(--danger);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius-sm)}input,textarea{color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);outline:none;transition:border-color .14s,box-shadow .14s}input::placeholder,textarea::placeholder{color:var(--muted-2)}input{width:190px;height:34px;padding:0 10px}textarea{resize:vertical;width:100%;padding:9px 10px}input:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus)}.small-input{width:88px}.field-inline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.field-inline span{font-size:11px;font-weight:700}.searchbox{width:min(380px,100%);height:34px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:inline-flex}.searchbox input{width:100%;height:30px;box-shadow:none;border:0;padding:0}.btn{min-height:34px;color:var(--btn-text);background:var(--btn-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;justify-content:center;align-items:center;gap:6px;padding:0 12px;transition:background-color .14s,border-color .14s,color .14s,box-shadow .14s;display:inline-flex}.btn:hover:not(:disabled){background:var(--btn-hover)}.btn:disabled{color:var(--muted-2);cursor:not-allowed}.btn.primary{color:#fff;background:var(--brand);border-color:var(--brand)}.btn.primary:hover:not(:disabled){background:var(--brand-strong);border-color:var(--brand-strong)}.btn.ghost{background:var(--panel-subtle)}.btn.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.btn.danger:hover:not(:disabled){background:var(--danger-tint);border-color:var(--danger)}.btn.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.btn.warn:hover:not(:disabled){background:var(--warn-tint);border-color:var(--warn)}.btn:disabled,.btn.primary:disabled,.btn.warn:disabled,.btn.danger:disabled{color:var(--muted-2);background:var(--panel-strong);border-color:var(--line);cursor:not-allowed}.btn.full{width:100%}.icon-text{gap:7px}.compact-btn{min-height:28px;padding:0 8px;font-size:12px}.row-link,.link-button{color:var(--brand-2);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:0;display:inline-flex}.table-wrap{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);width:100%;overflow-x:auto}.data-table{border-collapse:collapse;width:100%;font-size:12.5px}.data-table th,.data-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;white-space:nowrap;height:38px;padding:7px 9px}.data-table th{z-index:0;color:var(--muted);background:var(--panel-strong);font-weight:800;position:sticky;top:0}.data-table tbody tr:hover{background:var(--panel-subtle)}.data-table tr:last-child td{border-bottom:0}.mono{font-family:SFMono-Regular,Consolas,Liberation Mono,monospace}.truncate{text-overflow:ellipsis;max-width:380px;overflow:hidden}.badge{min-height:22px;color:var(--muted);background:var(--panel-strong);border:1px solid var(--line-strong);white-space:nowrap;border-radius:999px;align-items:center;padding:1px 8px;display:inline-flex}.badge.good{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.badge.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.badge.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.empty-cell{color:var(--muted);text-align:center}.bot-create-fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.bot-create-fields .duration-field input{width:100%}.bot-create-actions{border-top:1px solid var(--line);justify-content:space-between;align-items:center;gap:14px;margin-top:14px;padding-top:14px;display:flex}.bot-create-note{color:var(--muted);font-size:12px;line-height:1.4}@media (width<=760px){.bot-create-fields{grid-template-columns:1fr}.bot-create-actions{flex-direction:column;align-items:stretch}}.split-layout{grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:14px;display:grid}.split-main,.split-side{min-width:0}.entity-head{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);justify-content:space-between;align-items:flex-start;gap:14px;padding:14px;display:flex}.entity-title{color:var(--heading);font-size:20px;font-weight:800;line-height:1.25}.entity-subtitle{color:var(--muted);margin-top:4px}.summary-grid{grid-template-columns:repeat(4,minmax(150px,1fr));gap:8px;display:grid}.about-text{color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);margin:0;padding:10px}.section-block,.action-dock,.surface{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm);padding:12px}.section-head{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.section-head p{color:var(--muted);margin:5px 0 0}.action-dock{gap:10px;display:grid;position:sticky;top:82px}.dock-title{color:var(--text-soft);border-bottom:1px solid var(--line);padding-bottom:4px;font-weight:800}.action-dock>.btn,.action-dock .action-stack .btn{justify-content:center;width:100%}.duration-field{gap:4px;display:grid}.duration-field span{color:var(--muted);font-size:11px;font-weight:800}.duration-field input{width:100%}.action-stack{gap:10px;display:grid}.action-stack .btn,.action-dock>.btn{min-height:42px}.danger-zone{border-top:1px solid var(--line);flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;display:flex}.authorization-block{gap:10px;display:grid}.authorization-table{table-layout:fixed;min-width:720px}.authorization-table th,.authorization-table td{height:46px}.device-text{text-overflow:ellipsis;max-width:260px;overflow:hidden}.device-actions-head{width:190px}.device-actions-cell{width:190px;min-width:190px}.device-actions{white-space:normal;grid-template-columns:repeat(2,minmax(82px,1fr));gap:6px;min-width:178px;display:grid}.device-actions .btn{justify-content:center;width:100%}.operation-row{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;display:grid}.operation-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}.operation-title{width:100%;color:var(--heading);align-items:center;gap:6px;font-weight:800;display:flex}.checkline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.checkline input{width:auto;height:auto}.alert{color:var(--danger-text);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius);align-items:flex-start;gap:8px;padding:9px 10px;display:flex}.json-block{max-height:520px;color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius);margin:0;padding:12px;font-size:12px;overflow:auto}.raw-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.loading-line{min-height:80px;color:var(--muted);place-items:center;display:grid}.empty-panel{min-height:92px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);place-items:center;display:grid}.gift-metrics .metric{background:var(--panel-subtle);min-height:68px;padding:12px}.gift-metrics .metric strong{font-size:17px}.gift-file-icon{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);flex:none;place-items:center;display:grid}.gift-format-chips{flex-wrap:wrap;flex:none;justify-content:flex-end;gap:6px;display:flex}.gift-format-chips span{color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);letter-spacing:.02em;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.gift-list-summary{color:var(--muted);margin-left:auto;font-size:11px;font-weight:700}.gift-import-modal{width:min(860px,100%)}.gift-import-modal-body{gap:14px}.gift-source-tabs{gap:8px;display:flex}.official-gift-picker{gap:12px;min-width:0;display:grid}.official-gift-tools{align-items:center;gap:12px;display:flex}.official-gift-tools .searchbox{width:100%}.official-gift-tools>span{color:var(--muted);flex:none;font-size:11px;font-weight:750}.official-gift-categories{flex-wrap:wrap;gap:7px;display:flex}.official-gift-categories button{min-height:32px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line-strong);font:inherit;cursor:pointer;border-radius:999px;align-items:center;gap:7px;padding:5px 10px;font-size:11px;font-weight:800;transition:color .15s,background .15s,border-color .15s,box-shadow .15s;display:inline-flex}.official-gift-categories button:hover{color:var(--brand);border-color:var(--brand-tint-border)}.official-gift-categories button.active{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:var(--shadow-brand)}.official-gift-categories button span{min-width:20px;height:20px;color:inherit;background:#7d8c9b38;border-radius:999px;place-items:center;padding:0 5px;font-size:10px;display:grid}.official-gift-categories button.active span{color:var(--brand);background:#ffffffd9}.official-gift-list{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel-subtle);scrollbar-gutter:stable;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-height:126px;max-height:314px;padding:8px;display:grid;overflow:auto}.official-gift-option{text-align:left;min-width:0;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);cursor:pointer;box-shadow:var(--shadow-sm);gap:8px;padding:11px 12px;transition:border-color .15s,box-shadow .15s,transform .15s;display:grid}.official-gift-option:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.official-gift-option.selected{border-color:var(--brand);box-shadow:0 0 0 2px var(--focus), var(--shadow)}.official-gift-option-head{grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:8px;display:grid}.official-gift-option-head strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.official-gift-option-head .mono{color:var(--muted);font-size:9px}.official-gift-option-meta{color:var(--muted);flex-wrap:wrap;gap:10px;font-size:10px;font-weight:700;display:flex}.official-gift-capabilities{flex-wrap:wrap;gap:5px;display:flex}.official-gift-capabilities>span{letter-spacing:.01em;border:1px solid #0000;border-radius:999px;padding:3px 7px;font-size:9px;font-weight:850}.official-gift-capabilities>span.yes{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.official-gift-capabilities>span.craft{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.official-gift-capabilities>span.no{color:var(--muted);background:var(--panel-strong);border-color:var(--line-strong)}.official-gift-empty{min-height:108px;color:var(--muted);text-align:center;grid-column:1/-1;place-items:center;padding:20px;font-size:12px;display:grid}.official-gift-selected{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface-soft);grid-template-columns:108px minmax(0,1fr);align-items:center;gap:14px;padding:12px;display:grid}.official-gift-selected .gift-animation-shell{width:96px;height:96px}.official-gift-selected>div:last-child{gap:5px;min-width:0;display:grid}.official-gift-selected small{color:var(--muted)}.gift-import-note{color:var(--muted);justify-content:space-between;align-items:center;gap:12px;line-height:1.45;display:flex}.gift-file-picker{min-height:78px;color:var(--text);background:var(--panel);border:1px dashed var(--line-strong);border-radius:var(--radius);cursor:pointer;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;transition:border-color .16s,background .16s,box-shadow .16s;display:grid;position:relative}.gift-file-picker:hover,.gift-file-picker.has-file{background:var(--brand-tint);border-color:var(--brand);box-shadow:0 0 0 2px var(--focus)}.gift-file-picker input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.gift-file-icon{border-radius:var(--radius-sm);width:40px;height:40px}.gift-file-copy{gap:2px;min-width:0;display:grid}.gift-field-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10px;font-weight:800}.gift-file-copy strong{color:var(--heading);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.gift-file-copy small{color:var(--muted);font-size:11px;font-weight:500}.gift-file-action{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);padding:7px 10px;font-size:11px;font-weight:800}.gift-fields-grid{grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(120px,1fr));gap:10px;display:grid}.gift-fields-grid label,.gift-reason-field{color:var(--muted);gap:6px;font-size:11px;font-weight:700;display:grid}.gift-fields-grid input,.gift-reason-field input{width:100%;min-width:0;height:38px;color:var(--text);background:var(--input-bg);border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 10px}.gift-fields-grid input:focus,.gift-reason-field input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus);outline:none}.gift-switch{color:var(--text-soft);cursor:pointer;align-items:center;gap:9px;font-size:12px;font-weight:700;display:inline-flex}.gift-switch input{opacity:0;width:1px;height:1px;position:absolute}.gift-switch-track{background:var(--switch-track);border-radius:999px;align-items:center;width:34px;height:19px;padding:2px;transition:background .16s;display:flex}.gift-switch-track span{background:#fff;border-radius:50%;width:15px;height:15px;transition:transform .16s;box-shadow:0 1px 3px #10182838}.gift-switch input:checked+.gift-switch-track{background:var(--brand)}.gift-switch input:checked+.gift-switch-track span{transform:translate(15px)}.gift-switch input:focus-visible+.gift-switch-track{outline:3px solid var(--focus);outline-offset:2px}.gift-validation{color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius-sm);overflow:hidden}.gift-validation-head{color:var(--code-text);background:#ffffff09;border-bottom:1px solid #ffffff17;align-items:center;gap:9px;padding:10px 12px;display:flex}.gift-validation-head div{gap:2px;display:grid}.gift-validation-head span{color:var(--brand);font-size:10px}.gift-validation pre{max-height:180px;color:var(--code-text);margin:0;padding:11px 12px;font-size:11px;overflow:auto}.gift-animation-shell{background:var(--surface-soft);place-items:center;min-height:210px;display:grid;position:relative}.gift-animation{width:200px;height:200px}.gift-animation canvas{width:100%!important;height:100%!important}.gift-play{width:30px;height:30px;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:50%;place-items:center;display:grid;position:absolute;bottom:8px;right:8px}.gift-table-wrap{background:var(--panel)}.gift-table{min-width:1080px}.gift-table th:first-child{width:74px}.gift-table td{vertical-align:middle}.gift-animation-shell.compact{border:1px solid var(--line);border-radius:var(--radius-sm);width:56px;min-height:56px;overflow:hidden}.gift-animation-shell.compact .gift-animation{width:54px;height:54px}.gift-animation-shell.compact .gift-play{width:20px;height:20px;bottom:3px;right:3px}.gift-row-disabled{opacity:.68}.gift-table-title,.gift-sort-order,.gift-source-size,.gift-convert-price{display:block}.gift-table-title{text-overflow:ellipsis;white-space:nowrap;max-width:220px;overflow:hidden}.gift-sort-order,.gift-source-size,.gift-convert-price{color:var(--muted);margin-top:3px;font-size:10px}.gift-table-price{color:var(--warn)}.gift-table-actions{align-items:center;gap:6px;display:flex}.collectible-button{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.collectible-button:hover{background:var(--purple-tint);border-color:var(--purple)}.collectible-modal{width:min(1180px,100%);max-height:min(92vh,980px)}.collectible-modal .modal-head p{color:var(--muted);margin:4px 0 0;font-size:11px}.collectible-modal-body{background:var(--bg);gap:16px;padding:16px 18px 22px;overflow:auto}.collectible-loading{min-height:90px;color:var(--muted);justify-content:center;align-items:center;gap:8px;display:flex}.collectible-empty{color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius);align-items:center;gap:12px;padding:16px;display:flex}.collectible-empty div,.collectible-definition-head>div:first-child,.collectible-section-head>div:first-child{gap:3px;display:grid}.collectible-empty span,.collectible-definition-head span,.collectible-section-head span{color:var(--muted);font-size:10px;font-weight:500}.collectible-active{background:var(--panel);border:1px solid var(--purple-border);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-active-head{background:var(--purple-tint);border-bottom:1px solid var(--purple-border);justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.collectible-active-head>div{color:var(--purple-text);align-items:center;gap:9px;display:flex}.collectible-active-head>div>div{gap:2px;display:grid}.collectible-active-head span{color:var(--muted);font-size:10px}.collectible-active-grid{background:var(--line);grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:1px;display:grid}.collectible-active-grid article{background:var(--panel);align-items:center;gap:9px;min-width:0;padding:9px 11px;display:flex}.collectible-active-grid article>div:last-child{gap:2px;min-width:0;display:grid}.collectible-active-grid article strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.collectible-active-grid article span{color:var(--muted);font-size:9px}.collectible-definition{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-definition-head{background:var(--panel-subtle);border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.collectible-main-fields{background:var(--panel-subtle);border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section{border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section:last-child{border-bottom:0}.collectible-section-head{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.collectible-section-tools{align-items:center;gap:7px;display:flex}.collectible-rows{gap:7px;display:grid}.collectible-row{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:end;gap:7px;padding:9px 9px 9px 36px;display:grid;position:relative}.collectible-row:hover{background:var(--panel);border-color:var(--line-strong);box-shadow:var(--shadow-sm)}.collectible-row.animated{grid-template-columns:minmax(120px,1.2fr) 90px 78px minmax(160px,1.4fr) 48px 30px}.collectible-row.backdrop{grid-template-columns:minmax(110px,1.2fr) 70px 80px 70px repeat(4,52px) 48px 30px}.collectible-row-index{width:27px;color:var(--purple-text);background:var(--purple-tint);border-right:1px solid var(--purple-border);border-radius:var(--radius-xs) 0 0 var(--radius-xs);place-items:center;font-size:10px;font-weight:800;display:grid;position:absolute;top:0;bottom:0;left:0}.collectible-row label{gap:4px;min-width:0;display:grid}.collectible-row label>span{color:var(--muted);text-transform:uppercase;letter-spacing:.025em;font-size:9px;font-weight:800}.collectible-row input:not([type=file]){width:100%;min-width:0;height:32px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;padding:0 8px;font-size:11px}.collectible-row input:focus{border-color:var(--purple);box-shadow:0 0 0 3px var(--purple-tint);outline:none}.collectible-file input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.collectible-file em{min-width:0;height:32px;color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius-sm);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;align-items:center;gap:5px;padding:0 8px;font-size:10px;font-style:normal;font-weight:700;display:flex;overflow:hidden}.collectible-inline-preview{width:42px;height:42px;color:var(--purple);background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);place-items:center;display:grid;overflow:hidden}.collectible-animation{width:100%;height:100%;overflow:hidden}.collectible-animation.compact{background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);flex:0 0 42px;place-items:center;width:42px;height:42px;display:grid}.collectible-animation canvas{width:100%!important;height:100%!important}.collectible-animation.failed{color:var(--danger);background:var(--danger-tint)}.collectible-animation.loading{color:var(--purple-text)}.collectible-file-error{color:var(--danger);grid-column:1/-1;font-size:10px}.collectible-color input{cursor:pointer;height:32px!important;padding:3px!important}.collectible-backdrop-preview{border-radius:var(--radius-sm);border:1px solid #2a1f472e;flex:0 0 42px;place-items:center;width:42px;height:42px;font-size:11px;font-weight:900;display:grid;box-shadow:inset 0 0 0 1px #fff3}.collectible-row .icon-btn{align-self:center}.collectible-row .icon-btn:disabled{opacity:.28}@media (width<=900px){.gift-fields-grid,.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:repeat(2,minmax(0,1fr))}.collectible-inline-preview,.collectible-backdrop-preview,.collectible-row .icon-btn{place-self:center start}}@media (width<=620px){.gift-import-note{flex-direction:column;align-items:flex-start}.gift-format-chips{justify-content:flex-start}.gift-file-picker{grid-template-columns:40px minmax(0,1fr)}.gift-file-action{display:none}.gift-fields-grid{grid-template-columns:1fr}.gift-list-summary{width:100%;margin-left:0}.official-gift-tools{flex-direction:column;align-items:stretch}.official-gift-list{grid-template-columns:1fr;max-height:340px}.official-gift-selected{grid-template-columns:82px minmax(0,1fr)}.official-gift-selected .gift-animation-shell{width:72px;height:72px}.collectible-modal-body{padding:10px}.collectible-definition-head,.collectible-section-head{flex-direction:column;align-items:flex-start}.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:1fr}.collectible-active-grid{grid-template-columns:1fr 1fr}}.modal-backdrop{z-index:10000;background:var(--overlay);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);place-items:center;padding:24px;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(760px,100%);max-height:min(820px,100vh - 48px);box-shadow:var(--shadow);padding:0;overflow:hidden}.command-modal{flex-direction:column;display:flex}.command-modal>.modal-head,.command-modal>.modal-actions{flex:none}.modal-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 18px 12px;display:flex}.icon-btn{width:30px;height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;place-items:center;transition:background-color .14s,border-color .14s,color .14s;display:grid}.icon-btn:hover{background:var(--btn-hover);border-color:var(--line-strong)}.command-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.command-body{grid-auto-rows:max-content;gap:12px;min-height:0;padding:14px 18px;display:grid;overflow:auto}.command-step{min-height:38px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.command-step span{background:var(--panel);border:1px solid var(--line);border-radius:999px;place-items:center;width:20px;height:20px;font-size:11px;font-weight:800;display:grid}.command-step.active{color:var(--brand);border-color:var(--brand-tint-border)}.command-step.done{color:var(--good);border-color:var(--good-border)}.form-field{gap:6px;display:grid}.form-field span,.form-stack span{color:var(--text-soft);font-weight:800}.command-preview{gap:8px;display:grid}.command-preview .json-block{max-height:150px}.preview-head,.result-title{color:var(--text-soft);align-items:center;gap:7px;font-weight:800;display:flex}.result-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);gap:8px;padding:10px;display:grid}.result-line{grid-template-columns:92px minmax(0,1fr);gap:8px;display:grid}.result-line span{color:var(--muted)}.result-line strong{overflow-wrap:anywhere}.result-message{color:var(--text-soft)}.modal-actions{background:var(--panel);border-top:1px solid var(--line);justify-content:flex-end;padding:12px 18px}.login-page{background:var(--bg);place-items:center;min-height:100vh;padding:24px;display:grid}.login-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(420px,100%);box-shadow:var(--shadow);gap:18px;padding:22px;display:grid}.login-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.login-head-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.login-chip{min-height:24px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:999px;align-items:center;padding:0 8px;font-size:12px;display:inline-flex}.login-copy h1{color:var(--heading);margin:0;font-size:22px}.login-copy p{color:var(--muted);margin:8px 0 0}.form-stack{gap:12px;display:grid}.form-stack label{gap:6px;display:grid}.form-stack input{width:100%}.boot-screen{background:var(--bg);align-content:center;place-items:center;gap:18px;min-height:100vh;display:grid}.loader-bar{background:var(--line-strong);border-radius:999px;width:180px;height:4px;overflow:hidden}.loader-bar:before{content:"";background:var(--brand);width:42%;height:100%;animation:1s ease-in-out infinite load;display:block}.spin{animation:.8s linear infinite spin}@keyframes load{0%{transform:translate(-120%)}to{transform:translate(260%)}}@keyframes spin{to{transform:rotate(360deg)}}@media (width<=1120px){.shell{grid-template-columns:1fr}.sidebar{height:auto;position:static}.nav-list{grid-template-columns:repeat(4,minmax(0,1fr))}.sidebar-status{display:none}.overview-band,.split-layout,.operation-row,.raw-grid,.message-selector-grid,.message-selector-grid.single{grid-template-columns:1fr}.action-dock{position:static}}@media (width<=760px){.content,.topbar{padding-left:14px;padding-right:14px}.command-grid,.work-strip,.overview-metrics,.metric-row,.summary-grid,.command-steps{grid-template-columns:1fr}.sidebar{gap:12px;padding:14px}.nav-list{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar,.page-title-row,.entity-head{flex-direction:column;align-items:flex-start}input,.searchbox{width:100%}.toolbar{align-items:stretch}.picker-row,.selected-entity{grid-template-columns:1fr}} diff --git a/cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js b/cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js deleted file mode 100644 index 4d0101b7..00000000 --- a/cmd/telesrv-admin/web/dist/assets/index-CqgHld2y.js +++ /dev/null @@ -1,9 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-Ee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` -`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{re=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ne(e):``}function ae(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return``}}function oe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function se(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return oe(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ce(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function le(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ue(e){var t=le(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function z(e){e._valueTracker||=ue(e)}function de(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=le(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function B(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function V(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ce(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function pe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function me(e,t){pe(e,t);var n=ce(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ge(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ge(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function he(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ge(e,t,n){(t!==`number`||B(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var _e=Array.isArray;function ve(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Se.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function we(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Te={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Te).forEach(function(e){Ee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Te[t]=Te[e]})});function De(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Te.hasOwnProperty(e)&&Te[e]?(``+t).trim():t+`px`}function Oe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=De(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var ke=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ae(e,t){if(t){if(ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function je(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Me=null;function Ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pe=null,Fe=null,Ie=null;function Le(e){if(e=ji(e)){if(typeof Pe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ni(t),Pe(e.stateNode,e.type,t))}}function Re(e){Fe?Ie?Ie.push(e):Ie=[e]:Fe=e}function ze(){if(Fe){var e=Fe,t=Ie;if(Ie=Fe=null,Le(e),t)for(e=0;e>>=0,e===0?32:31-(_t(e)/vt|0)|0}var bt=64,xt=4194304;function St(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ct(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=St(a))):r=St(s)}else o=n&~i,o===0?a!==0&&(r=St(a)):r=St(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function kt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function At(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=mn(),pn=fn=dn=null,Qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(){for(var e=window,t=B();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=B(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Er(e){var t=wr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cr(n.ownerDocument.documentElement,n)){if(r!==null&&Tr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Sr(n,a);var o=Sr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==B(r)||(r=Or,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&br(Ar,r)||(Ar=r,r=ii(kr,`onSelect`),0Fi||(e.current=Pi[Fi],Pi[Fi]=null,Fi--)}function Ri(e,t){Fi++,Pi[Fi]=e.current,e.current=t}var zi={},Bi=Ii(zi),Vi=Ii(!1),Hi=zi;function Ui(e,t){var n=e.type.contextTypes;if(!n)return zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Wi(e){return e=e.childContextTypes,e!=null}function Gi(){Li(Vi),Li(Bi)}function Ki(e,t,n){if(Bi.current!==zi)throw Error(r(168));Ri(Bi,t),Ri(Vi,n)}function qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,se(e)||`Unknown`,a));return R({},n,i)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zi,Hi=Bi.current,Ri(Bi,e),Ri(Vi,Vi.current),!0}function Yi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=qi(e,t,Hi),i.__reactInternalMemoizedMergedChildContext=e,Li(Vi),Li(Bi),Ri(Bi,e)):Li(Vi),Ri(Vi,n)}var Xi=null,Zi=!1,Qi=!1;function $i(e){Xi===null?Xi=[e]:Xi.push(e)}function ea(e){Zi=!0,$i(e)}function ta(){if(!Qi&&Xi!==null){Qi=!0;var e=0,t=X;try{var n=Xi;for(X=1;e>=o,i-=o,la=1<<32-gt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),_a&&da(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),_a&&da(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return _a&&da(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),_a&&da(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&ja(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=ka(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=ka(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(_e(i))return h(e,r,i,o);if(ee(i))return g(e,r,i,o);Aa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Na=Ma(!0),Pa=Ma(!1),Fa=Ii(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Li(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e)if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(r(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e;return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{X=n,vo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Z(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}var ds={readContext:Ua,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ua,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=bo,a=jo();if(_a){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Vc===null)throw Error(r(349));yo&30||Ro(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,i,o,e),[e]),i.flags|=2048,Wo(9,zo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(_a){var n=ua,r=la;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[wi]=t,e[Ti]=i,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=je(n,i),n){case`dialog`:Zr(`cancel`,e),Zr(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:Zr(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;oel&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304)}else{if(!i)if(e=mo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!_a)return oc(t),null}else 2*ot()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ot(),t.sibling=null,n=po.current,Ri(po,i?n&1|2:n&1),t);case 22:case 23:return wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function cc(e,t){switch(ma(t),t.tag){case 1:return Wi(t.type)&&Gi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),Li(Vi),Li(Bi),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fo(t),null;case 13:if(Li(po),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Li(po),null;case 4:return lo(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(fi=rn,e=wr(),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(pi={focusedElem:e,selectionRange:n},rn=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wi],delete t[Ti],delete t[Di],delete t[Oi],delete t[ki])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=di));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount==`function`)try{mt.onCommitFiberUnmount(pt,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?bi(e.parentNode,n):e.nodeType===1&&bi(e,n),tn(e)):bi(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=ot()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Lc(i/1960))-i,10e?16:e,ol===null)var i=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(r(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lot()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=xt,xt<<=1,!(xt&130023424)&&(xt=4194304)):t=1);var n=fl();e=qa(e,t),e!==null&&(kt(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}else Ms=!1,_a&&t.flags&1048576&&fa(t,aa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;$s(e,t),e=t.pendingProps;var a=Ui(t,Bi.current);Ha(t,n),a=ko(null,t,i,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Wi(i)?(o=!0,Ji(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,i,e,n),t=Vs(null,t,i,!0,o,n)):(t.tag=0,_a&&o&&pa(t),Ns(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=hs(i,e),a){case 0:t=zs(null,t,i,e,n);break a;case 1:t=Bs(null,t,i,e,n);break a;case 11:t=Ps(null,t,i,e,n);break a;case 14:t=Fs(null,t,i,hs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),zs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Bs(e,t,i,a,n);case 3:a:{if(Hs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(r(423)),t),t=Us(e,t,i,n,a);break a}else if(i!==a){a=Ss(Error(r(424)),t),t=Us(e,t,i,n,a);break a}else for(ga=xi(t.stateNode.containerInfo.firstChild),ha=t,_a=!0,va=null,n=Pa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ea(),i===a){t=ec(e,t,n);break a}Ns(e,t,i,n)}t=t.child}return t;case 5:return uo(t),e===null&&Sa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,mi(i,a)?s=null:o!==null&&mi(i,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Sa(t),null;case 13:return Ks(e,t,n);case 4:return co(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Na(t,null,i,n):Ns(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Ps(e,t,i,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ri(Fa,i._currentValue),i._currentValue=s,o!==null)if(Z(o.value,s)){if(o.children===a.children&&!Vi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ha(t,n),a=Ua(a),i=i(a),t.flags|=1,Ns(e,t,i,n),t.child;case 14:return i=t.type,a=hs(i,t.pendingProps),a=hs(i.type,a),Fs(e,t,i,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),$s(e,t),t.tag=1,Wi(i)?(e=!0,Ji(t)):e=!1,Ha(t,n),ys(t,i,a),xs(t,i,a,n),Vs(null,t,i,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return nt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Kl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ot(0),this.expirationTimes=Ot(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ot(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=typeof FormData<`u`&&t.body instanceof FormData,r=await fetch(e,{credentials:`same-origin`,headers:n?t.headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok){let e=a?.error||a?.Error||a?.message||r.statusText;throw new v(r.status,e)}return a}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),gifts:()=>y(`/api/gifts`),officialGifts:()=>y(`/api/official-gifts`),officialGiftAnimation:e=>y(`/api/official-gifts/${encodeURIComponent(e)}/animation`),giftAnimation:e=>y(`/api/gifts/${encodeURIComponent(e)}/animation`),giftCollectibles:e=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles`),giftCollectibleAnimation:(e,t,n)=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles/${t}/${encodeURIComponent(n)}/animation`),importGift:e=>y(`/api/actions/import-gift`,{method:`POST`,body:e}),importOfficialGift:e=>y(`/api/actions/import-official-gift`,{method:`POST`,body:JSON.stringify(e)}),publishGiftCollectibles:(e,t)=>y(`/api/actions/publish-gift-collectibles?gift_id=${encodeURIComponent(e)}`,{method:`POST`,body:t}),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},S=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),C=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...w,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),E=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(T,{ref:i,iconNode:t,className:C(`lucide-${S(e)}`,n),...r}));return n.displayName=`${e}`,n},D=E(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=E(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),k=E(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),A=E(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),j=E(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),M=E(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),N=E(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),P=E(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),F=E(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),I=E(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),L=E(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),ee=E(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),R=E(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),te=E(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),ne=E(`Gem`,[[`path`,{d:`M6 3h12l4 6-10 13L2 9Z`,key:`1pcd5k`}],[`path`,{d:`M11 3 8 9l4 13 4-13-3-6`,key:`1fcu3u`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),re=E(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),ie=E(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ae=E(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),oe=E(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),se=E(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),ce=E(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),le=E(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),ue=E(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),z=E(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),de=E(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),B=E(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),V=E(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),fe=E(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),pe=E(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),me=E(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),he=E(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ge=E(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),_e=E(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),ve=E(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),ye=E(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),H=E(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),U=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),W=o(((e,t)=>{t.exports=U()}))(),be=`telesrv.admin.lang`,xe={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"route.gifts":`Star Gifts`,"route.giftsSubtitle":`Console / Star Gifts`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.gifts":`Star Gifts`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Switch to dark theme`,"theme.switchToLight":`Switch to light theme`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.accountFrozen":`Account frozen`,"account.accountActive":`Account active`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeAccount":`Freeze account`,"account.updateFreeze":`Update freeze`,"account.unfreezeAccount":`Unfreeze account`,"account.freezeSince":`Frozen since`,"account.freezeUntil":`Appeal deadline`,"account.freezeUntilAria":`Freeze appeal deadline`,"account.freezeAppealURL":`Appeal URL`,"account.freezeAppealURLAria":`Freeze appeal URL`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"gifts.pageTitle":`Star Gift Catalog`,"gifts.eyebrow":`Catalog, immutable revisions and animation assets`,"gifts.total":`Catalog entries`,"gifts.enabled":`Enabled`,"gifts.received":`Received gifts`,"gifts.formats":`Accepted formats`,"gifts.add":`Add gift`,"gifts.searchPlaceholder":`Search gift ID, title or format`,"gifts.listSummary":`Showing {shown} of {total}`,"gifts.idRevision":`ID / Revision`,"gifts.price":`Price / Conversion`,"gifts.importTitle":`Import a Star Gift`,"gifts.importEyebrow":`Gift catalog operation`,"gifts.newRevision":`Create revision for gift #{id}`,"gifts.importHint":`Upload TGS or plain Lottie JSON. Lottie is normalized and compressed to TGS.`,"gifts.officialSource":`Official snapshot`,"gifts.fileSource":`Upload file`,"gifts.officialHint":`Choose a verified gift from data/official-gifts. Complete collectible pools are imported atomically.`,"gifts.officialSearch":`Search official gift ID or title`,"gifts.officialSelect":`Choose an official gift`,"gifts.officialRequired":`Choose an official gift first`,"gifts.officialResults":`Showing {shown} of {total}`,"gifts.officialCategoryLabel":`Official gift capability category`,"gifts.officialCategory.all":`All`,"gifts.officialCategory.upgrade":`Upgradable`,"gifts.officialCategory.craft":`Craftable`,"gifts.officialCategory.basic":`Not upgradable`,"gifts.officialUnnamed":`Unnamed official gift #{id}`,"gifts.officialAttributes":`{count} attributes`,"gifts.canUpgrade":`Can upgrade`,"gifts.cannotUpgrade":`Cannot upgrade`,"gifts.canCraft":`Can Craft`,"gifts.cannotCraft":`Cannot Craft`,"gifts.officialEmpty":`No official gifts match this category and search.`,"gifts.includeCollectible":`Import the complete collectible pool, including crafted models`,"gifts.animation":`Animation file`,"gifts.filePrompt":`Drop or choose a TGS / Lottie file`,"gifts.fileHint":`TGS, JSON or Lottie · validated before import`,"gifts.chooseFile":`Choose file`,"gifts.changeFile":`Change file`,"gifts.title":`Display title`,"gifts.titlePlaceholder":`e.g. Celebration Star`,"gifts.stars":`Price in Stars`,"gifts.convertStars":`Conversion Stars`,"gifts.sortOrder":`Sort order`,"gifts.reason":`Audit reason`,"gifts.reasonPlaceholder":`Briefly describe why this gift is being imported`,"gifts.enableAfterImport":`Enable after import`,"gifts.validate":`Dry-run validation`,"gifts.confirmImport":`Confirm import`,"gifts.stepDetails":`File and details`,"gifts.stepValidate":`Dry-run validation`,"gifts.stepImport":`Confirm import`,"gifts.fileRequired":`Choose a TGS or Lottie file first`,"gifts.source":`Source`,"gifts.replace":`New revision`,"gifts.disable":`Disable`,"gifts.enable":`Enable`,"gifts.empty":`No Star Gifts have been imported.`,"gifts.emptyHint":`Import the first animation above to build the gift catalog.`,"gifts.validationReady":`Validation passed`,"gifts.validationHint":`Review the normalized metadata, then confirm the import.`,"gifts.confirmState":`Apply the validated state change to gift #{id}?`,"collectibles.manage":`Attribute pool`,"collectibles.title":`Collectible pool · Gift #{id}`,"collectibles.eyebrow":`Unique gift attributes`,"collectibles.activeRevision":`Published revision {revision}`,"collectibles.published":`Published`,"collectibles.noPool":`No collectible pool published`,"collectibles.noPoolHint":`Publish models, patterns and backdrops to enable upgrades.`,"collectibles.publishNew":`Publish a new immutable revision`,"collectibles.immutableHint":`Dry-run checks every file and the attribute-pool structure before the revision becomes active.`,"collectibles.upgradeStars":`Upgrade price in Stars`,"collectibles.supply":`Unique supply`,"collectibles.slug":`Public slug prefix`,"collectibles.models":`Models`,"collectibles.patterns":`Patterns`,"collectibles.backdrops":`Backdrops`,"collectibles.model":`Model`,"collectibles.pattern":`Pattern`,"collectibles.backdrop":`Backdrop`,"collectibles.rarity":`Rarity ‰`,"collectibles.rarityHint":`Keep at least two attributes. Permille values are relative regular-upgrade weights; add/remove redistributes them to 1000.`,"collectibles.minimumAttributes":`Models, patterns, and backdrops must each contain at least two attributes.`,"collectibles.duplicateBackdropID":`Backdrop IDs must be unique within the pool.`,"collectibles.colorHint":`Colors are stored as 24-bit RGB values.`,"collectibles.addAttribute":`Add`,"collectibles.remove":`Remove attribute`,"collectibles.fileRequired":`Every model and pattern needs a TGS or Lottie file.`,"collectibles.backdropID":`Backdrop ID`,"collectibles.color.center":`Center`,"collectibles.color.edge":`Edge`,"collectibles.color.pattern":`Pattern`,"collectibles.color.text":`Text`,"collectibles.validationReady":`Attribute pool is valid`,"collectibles.validationHint":`Review the normalized assets, then publish this immutable revision.`,"collectibles.publish":`Publish revision`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"route.gifts":`星星礼物`,"route.giftsSubtitle":`控制台 / 星星礼物`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.gifts":`礼物目录`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`切换到深色主题`,"theme.switchToLight":`切换到浅色主题`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.accountFrozen":`账号已冻结`,"account.accountActive":`账号正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeAccount":`冻结账号`,"account.updateFreeze":`更新冻结信息`,"account.unfreezeAccount":`解冻账号`,"account.freezeSince":`冻结开始时间`,"account.freezeUntil":`申诉截止时间`,"account.freezeUntilAria":`账号冻结申诉截止时间`,"account.freezeAppealURL":`申诉链接`,"account.freezeAppealURLAria":`账号冻结申诉链接`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"gifts.pageTitle":`星星礼物目录`,"gifts.eyebrow":`目录、不可变版本与动画资源`,"gifts.total":`目录条目`,"gifts.enabled":`已启用`,"gifts.received":`已领取礼物`,"gifts.formats":`支持格式`,"gifts.add":`添加礼物`,"gifts.searchPlaceholder":`搜索礼物 ID、标题或格式`,"gifts.listSummary":`显示 {shown} / {total} 项`,"gifts.idRevision":`ID / 版本`,"gifts.price":`售价 / 兑换`,"gifts.importTitle":`导入星星礼物`,"gifts.importEyebrow":`礼物目录操作`,"gifts.newRevision":`为礼物 #{id} 创建新版本`,"gifts.importHint":`支持 TGS 或纯 Lottie JSON;Lottie 会规范化并压缩成 TGS。`,"gifts.officialSource":`官方资源库`,"gifts.fileSource":`上传文件`,"gifts.officialHint":`从 data/official-gifts 的已校验快照中选择;完整 collectible 属性池会与礼物原子导入。`,"gifts.officialSearch":`搜索官方礼物 ID 或标题`,"gifts.officialSelect":`请选择官方礼物`,"gifts.officialRequired":`请先选择一个官方礼物`,"gifts.officialResults":`显示 {shown} / {total} 项`,"gifts.officialCategoryLabel":`官方礼物能力分类`,"gifts.officialCategory.all":`全部`,"gifts.officialCategory.upgrade":`可升级`,"gifts.officialCategory.craft":`可 Craft`,"gifts.officialCategory.basic":`不可升级`,"gifts.officialUnnamed":`未命名官方礼物 #{id}`,"gifts.officialAttributes":`{count} 个属性`,"gifts.canUpgrade":`可升级`,"gifts.cannotUpgrade":`不可升级`,"gifts.canCraft":`可 Craft`,"gifts.cannotCraft":`不可 Craft`,"gifts.officialEmpty":`当前分类和搜索条件下没有官方礼物。`,"gifts.includeCollectible":`完整导入 collectible 属性池(包含 crafted 模型)`,"gifts.animation":`动画文件`,"gifts.filePrompt":`拖放或选择 TGS / Lottie 文件`,"gifts.fileHint":`支持 TGS、JSON、Lottie,导入前会先进行校验`,"gifts.chooseFile":`选择文件`,"gifts.changeFile":`更换文件`,"gifts.title":`显示标题`,"gifts.titlePlaceholder":`例如:庆典星星`,"gifts.stars":`售价 Stars`,"gifts.convertStars":`可兑换 Stars`,"gifts.sortOrder":`排序值`,"gifts.reason":`审计原因`,"gifts.reasonPlaceholder":`简要说明本次导入礼物的原因`,"gifts.enableAfterImport":`导入后启用`,"gifts.validate":`Dry-run 校验`,"gifts.confirmImport":`确认导入`,"gifts.stepDetails":`文件与信息`,"gifts.stepValidate":`Dry-run 校验`,"gifts.stepImport":`确认导入`,"gifts.fileRequired":`请先选择 TGS 或 Lottie 文件`,"gifts.source":`来源`,"gifts.replace":`创建新版本`,"gifts.disable":`停用`,"gifts.enable":`启用`,"gifts.empty":`尚未导入星星礼物。`,"gifts.emptyHint":`从上方导入第一个动画,开始搭建礼物目录。`,"gifts.validationReady":`校验已通过`,"gifts.validationHint":`确认规范化后的元数据无误,再执行正式导入。`,"gifts.confirmState":`确认执行礼物 #{id} 的状态变更吗?`,"collectibles.manage":`属性池`,"collectibles.title":`Collectibles 属性池 · 礼物 #{id}`,"collectibles.eyebrow":`唯一礼物属性管理`,"collectibles.activeRevision":`已发布版本 {revision}`,"collectibles.published":`已发布`,"collectibles.noPool":`尚未发布 Collectibles 属性池`,"collectibles.noPoolHint":`发布模型、图案与背景后,客户端即可升级为唯一礼物。`,"collectibles.publishNew":`发布新的不可变版本`,"collectibles.immutableHint":`Dry-run 会校验全部文件和属性池结构,通过后才切换为当前版本。`,"collectibles.upgradeStars":`升级价格 Stars`,"collectibles.supply":`唯一礼物总量`,"collectibles.slug":`公开 Slug 前缀`,"collectibles.models":`模型`,"collectibles.patterns":`图案`,"collectibles.backdrops":`背景`,"collectibles.model":`模型`,"collectibles.pattern":`图案`,"collectibles.backdrop":`背景`,"collectibles.rarity":`稀有度 ‰`,"collectibles.rarityHint":`每类至少保留两项。Permille 是普通升级的相对权重,增删时会自动重新分配为 1000。`,"collectibles.minimumAttributes":`模型、图案和背景每类都必须至少包含两个属性。`,"collectibles.duplicateBackdropID":`同一属性池中的背景 ID 必须唯一。`,"collectibles.colorHint":`颜色会按 24 位 RGB 数值保存。`,"collectibles.addAttribute":`添加`,"collectibles.remove":`删除属性`,"collectibles.fileRequired":`每个模型和图案都必须选择 TGS 或 Lottie 文件。`,"collectibles.backdropID":`背景 ID`,"collectibles.color.center":`中心色`,"collectibles.color.edge":`边缘色`,"collectibles.color.pattern":`图案色`,"collectibles.color.text":`文字色`,"collectibles.validationReady":`属性池校验通过`,"collectibles.validationHint":`确认规范化资源无误后,即可发布这个不可变版本。`,"collectibles.publish":`发布版本`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`},ru:{"app.adminConsole":`Панель администратора`,"app.localAccess":`Локальный доступ`,"app.title":`telesrv admin`,"common.actions":`Действия`,"common.admins":`Администраторы`,"common.backToList":`Назад к списку`,"common.channel":`Канал`,"common.channelOrGroup":`Канал / Группа`,"common.clear":`Очистить`,"common.close":`Закрыть`,"common.count":`Количество`,"common.deleted":`Удалено`,"common.detail":`Детали`,"common.device":`Устройство`,"common.disabled":`Отключено`,"common.enabled":`Включено`,"common.fromPeer":`От пира`,"common.group":`Группа`,"common.id":`ID`,"common.limit":`Лимит`,"common.loading":`Загрузка…`,"common.member":`Участник`,"common.members":`Участники`,"common.messageId":`ID сообщения`,"common.name":`Имя`,"common.no":`Нет`,"common.noResults":`Нет результатов`,"common.none":`Нет`,"common.normal":`Обычный`,"common.operations":`Операции`,"common.owner":`Владелец`,"common.platform":`Платформа`,"common.refresh":`Обновить`,"common.search":`Поиск`,"common.sender":`Отправитель`,"common.status":`Статус`,"common.survived":`Уцелело`,"common.time":`Время`,"common.type":`Тип`,"common.updatedAt":`Обновлено`,"common.username":`Имя пользователя`,"common.valid":`Действителен`,"common.verified":`Подтверждён`,"common.views":`Просмотры`,"common.yes":`Да`,"route.accounts":`Аккаунты`,"route.accountsSubtitle":`Консоль / Аккаунты`,"route.channels":`Супергруппы и каналы`,"route.channelsSubtitle":`Консоль / Каналы`,"route.dashboard":`Панель управления`,"route.dashboardSubtitle":`Консоль / Обзор`,"route.messages":`Аудит сообщений`,"route.messagesSubtitle":`Консоль / Сообщения`,"route.gifts":`Звёздные подарки`,"route.giftsSubtitle":`Консоль / Звёздные подарки`,"layout.navigation":`Навигация`,"layout.primaryNav":`Основное меню`,"layout.dashboard":`Обзор`,"layout.accounts":`Аккаунты`,"layout.channels":`Супергруппы / Каналы`,"layout.messages":`Сообщения`,"layout.gifts":`Звёздные подарки`,"layout.privateMessages":`Личные`,"layout.groupMessages":`Группы`,"layout.runtime":`Среда выполнения`,"layout.adminBackend":`Админ-бэкенд`,"layout.ready":`Готов`,"layout.pgRead":`Чтение из PG`,"layout.readOnly":`Только чтение`,"layout.writeOps":`Операции записи`,"layout.dryRun":`Тестовый запуск`,"layout.actor":`Вы вошли как: {actor}`,"layout.logout":`Выйти`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Тёмная тема`,"theme.switchToLight":`Светлая тема`,"login.heading":`Панель администратора`,"login.body":`Введите учётные данные для входа в консоль.`,"login.secret":`Пароль или токен администратора`,"login.submit":`Войти`,"login.submitting":`Вход…`,"dashboard.eyebrow":`Состояние системы`,"dashboard.title":`Обзор консоли`,"dashboard.readPath":`Путь чтения`,"dashboard.readPathValue":`PG только для чтения`,"dashboard.writePath":`Путь записи`,"dashboard.executionPolicy":`Политика выполнения`,"dashboard.dryRunFirst":`Сначала тестовый запуск`,"dashboard.accountsText":`Статус аккаунтов, Premium, подтверждение, сессии.`,"dashboard.channelsText":`Публичные каналы и группы, число участников, статус подтверждения.`,"dashboard.messagesText":`Ящики сообщений, обновления, состояние исходящих.`,"dashboard.strip.dryRun":`Все опасные действия начинаются с тестового запуска`,"dashboard.strip.token":`Браузер никогда не сохраняет внутренние токены`,"dashboard.strip.pagination":`Списки используют курсорную пагинацию`,"dashboard.strip.snapshot":`Детальные страницы сохраняют моментальные снимки исходного состояния`,"account.pageTitle":`Аккаунты`,"account.queryResults":`Результаты поиска`,"account.recentActive":`Недавно активные аккаунты`,"account.currentPage":`Аккаунты на странице`,"account.onlineDevices":`Активные сессии устройств`,"account.premium":`Premium`,"account.frozen":`Заморожен`,"account.searchPlaceholder":`ID пользователя / телефон / имя пользователя`,"account.userID":`ID пользователя`,"account.phone":`Телефон`,"account.lastActive":`Последняя активность`,"account.notVerified":`Не подтверждён`,"account.notPremium":`Без Premium`,"account.premiumUntil":`Premium истекает`,"account.starsBalance":`Баланс Звёзд`,"account.startingGrantApplied":`стартовый бонус начислен`,"account.startingGrantPending":`ожидает стартового бонуса`,"account.activeSessions":`Авторизованные устройства`,"account.accountFlags":`Флаги аккаунта`,"account.restriction":`Ограничение`,"account.restricted":`Ограничен`,"account.createdAt":`Создан`,"account.detailTitle":`Аккаунт #{id}`,"account.profile":`Профиль аккаунта`,"account.loadingDetail":`Загрузка данных аккаунта`,"account.waitingData":`Ожидание данных`,"account.noUsername":`Нет имени пользователя`,"account.noPhone":`Нет телефона`,"account.accountFrozen":`Аккаунт заморожен`,"account.accountActive":`Аккаунт активен`,"account.authorizationsTitle":`Авторизованные устройства`,"account.authorizationsCount":`Авторизаций: {count}`,"account.recentAdminOps":`Последние действия администратора`,"account.recent30Audit":`Последние 30 записей аудита`,"account.actionDock":`Действия с аккаунтом`,"account.freezeAccount":`Заморозить аккаунт`,"account.updateFreeze":`Обновить параметры заморозки`,"account.unfreezeAccount":`Разморозить аккаунт`,"account.freezeSince":`Заморожен с`,"account.freezeUntil":`Срок подачи апелляции`,"account.freezeUntilAria":`Срок подачи апелляции на заморозку`,"account.freezeAppealURL":`URL для апелляции`,"account.freezeAppealURLAria":`URL для апелляции на заморозку`,"account.premiumMonths":`Срок действия Premium (в месяцах)`,"account.premiumMonthsAria":`Указать срок действия Premium в месяцах`,"account.setPremium":`Выдать Premium`,"account.clearPremium":`Снять Premium`,"account.starsAmount":`Количество Звёзд`,"account.starsAmountAria":`Указать количество начисляемых Звёзд`,"account.grantStars":`Начислить Звёзды`,"account.setVerified":`Подтвердить аккаунт`,"account.clearVerified":`Снять подтверждение`,"channel.pageTitle":`Супергруппы и каналы`,"channel.recentUpdated":`Недавно обновлённые`,"channel.currentPage":`Объекты на странице`,"channel.megagroups":`Супергруппы`,"channel.broadcasts":`Каналы`,"channel.verifiedCount":`Подтверждённые`,"channel.searchPlaceholder":`ID канала / имя пользователя / название`,"channel.channelID":`ID канала`,"channel.kind":`Тип`,"channel.title":`Название`,"channel.pts":`PTS`,"channel.detailProfile":`Профиль канала`,"channel.loadingDetail":`Загрузка данных канала`,"channel.creator":`Создатель: {id}`,"channel.governance":`Модерация`,"channel.governanceValue":`Заблокировано {banned} / Исключено {kicked}`,"channel.flags":`Флаги канала`,"channel.rawRow":`Исходная строка БД`,"channel.rawRowText":`Снимок базы данных только для чтения`,"channel.actionDock":`Действия с каналом`,"channel.setVerified":`Подтвердить канал`,"channel.clearVerified":`Снять подтверждение`,"channel.kind.broadcast":`Канал`,"channel.kind.forum":`Супергруппа / Форум`,"channel.kind.megagroup":`Супергруппа`,"channel.kind.generic":`Канал / Группа`,"messages.privateTitle":`Личные сообщения`,"messages.privateEyebrow":`Личные ящики сообщений`,"messages.groupTitle":`Групповые сообщения`,"messages.groupEyebrow":`Сообщения супергрупп и каналов`,"messages.selectPrivatePeers":`Сначала найдите и выберите владельца и собеседника`,"messages.selectChannel":`Сначала найдите и выберите супергруппу или канал`,"messages.ownerUser":`Пользователь-владелец`,"messages.peerUser":`Собеседник`,"messages.beforeDatePlaceholder":`курсор before_date`,"messages.beforeIDPlaceholder":`курсор before_msg_id`,"messages.limitPlaceholder":`лимит <= 100`,"messages.searchMessages":`Поиск сообщений`,"messages.nextPage":`Следующая страница`,"messages.currentPage":`Сообщения на странице`,"messages.deleted":`Удалено`,"messages.outgoing":`Исходящее`,"messages.incoming":`Входящее`,"messages.ownerPeer":`Владелец / Собеседник`,"messages.deleteSelected":`Удалить выбранные сообщения`,"messages.idsPlaceholder":`ID сообщений через запятую`,"messages.revoke":`Удалить для обеих сторон`,"messages.previewDelete":`Тестовое удаление`,"messages.clearHistory":`Очистить историю личной переписки`,"messages.maxIDPlaceholder":`граница max_id`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Очистить только у себя`,"messages.previewClearHistory":`Тестовая очистка истории`,"messages.direction":`Направление`,"messages.body":`Текст сообщения`,"messages.privateDetailTitle":`Сообщение #{id}`,"messages.detailEyebrow":`Детали сообщения`,"messages.backPrivate":`Назад к личным сообщениям`,"messages.backGroup":`Назад к групповым сообщениям`,"messages.ownerPeerTitle":`Владелец {owner} · Собеседник {peer}`,"messages.senderSubtitle":`Отправитель {sender} · {date}`,"messages.boxID":`ID ящика сообщений`,"messages.privateMessageID":`ID личного сообщения`,"messages.messageSender":`Отправитель сообщения`,"messages.messageBox":`Ящик сообщений`,"messages.dialogRow":`Строка диалога`,"messages.privateRow":`Строка личного сообщения`,"messages.channelMessageRow":`Строка сообщения канала`,"messages.channelRow":`Строка канала`,"messages.userUpdateEvents":`События обновления пользователей`,"messages.channelUpdateEvents":`События обновления каналов`,"messages.eventJson":`JSON события`,"messages.dispatchOutbox":`Очередь отправки (Outbox)`,"messages.messageBoxesSnapshot":`Снимок message_boxes только для чтения`,"messages.dialogSnapshot":`Снимок dialogs только для чтения`,"messages.privateSnapshot":`Снимок private_messages только для чтения`,"messages.channelMessagesSnapshot":`Снимок channel_messages только для чтения`,"messages.channelSnapshot":`Снимок channels только для чтения`,"messages.userEventsSource":`постоянные user_update_events`,"messages.channelEventsSource":`постоянные channel_update_events`,"messages.outboxSource":`онлайн/офлайн dispatch_outbox`,"messages.attempts":`Попытки`,"messages.deleteThis":`Удалить это сообщение`,"messages.groupDetailTitle":`Групповое сообщение #{id}`,"messages.channelGroupTitle":`Канал / Группа {id}`,"messages.mediaCount":`С медиафайлами`,"messages.channelPosts":`Посты канала`,"messages.channelGroup":`Канал / Группа`,"messages.pinned":`Закреплено`,"messages.channelPost":`Пост в канале`,"gifts.pageTitle":`Каталог звёздных подарков`,"gifts.eyebrow":`Каталог, неизменяемые версии и файлы анимаций`,"gifts.total":`Подарков в каталоге`,"gifts.enabled":`Включено`,"gifts.received":`Полученные подарки`,"gifts.formats":`Поддерживаемые форматы`,"gifts.add":`Добавить подарок`,"gifts.searchPlaceholder":`Поиск по ID подарка, названию или формату`,"gifts.listSummary":`Показано {shown} из {total}`,"gifts.idRevision":`ID / Версия`,"gifts.price":`Цена / Конвертация`,"gifts.importTitle":`Импорт звёздного подарка`,"gifts.importEyebrow":`Управление каталогом подарков`,"gifts.newRevision":`Создать версию для подарка #{id}`,"gifts.importHint":`Загрузите файл TGS или обычный Lottie JSON. Lottie нормализуется и сжимается в формат TGS.`,"gifts.officialSource":`Официальный снимок`,"gifts.fileSource":`Загрузить файл`,"gifts.officialHint":`Выберите проверенный подарок из data/official-gifts. Полные пулы коллекционных предметов импортируются атомарно.`,"gifts.officialSearch":`Поиск по ID или названию официального подарка`,"gifts.officialSelect":`Выберите официальный подарок`,"gifts.officialRequired":`Сначала выберите официальный подарок`,"gifts.officialResults":`Показано {shown} из {total}`,"gifts.officialCategoryLabel":`Категория возможностей официального подарка`,"gifts.officialCategory.all":`Все`,"gifts.officialCategory.upgrade":`Можно улучшить`,"gifts.officialCategory.craft":`Можно создать`,"gifts.officialCategory.basic":`Нельзя улучшить`,"gifts.officialUnnamed":`Официальный подарок без названия #{id}`,"gifts.officialAttributes":`Атрибутов: {count}`,"gifts.canUpgrade":`Можно улучшить`,"gifts.cannotUpgrade":`Нельзя улучшить`,"gifts.canCraft":`Можно создать`,"gifts.cannotCraft":`Нельзя создать`,"gifts.officialEmpty":`Нет подарков, соответствующих категории и поиску.`,"gifts.includeCollectible":`Импортировать полный пул коллекционных предметов, включая созданные модели`,"gifts.animation":`Файл анимации`,"gifts.filePrompt":`Перетащите или выберите файл TGS / Lottie`,"gifts.fileHint":`TGS, JSON или Lottie · файл проверяется перед импортом`,"gifts.chooseFile":`Выбрать файл`,"gifts.changeFile":`Изменить файл`,"gifts.title":`Отображаемое название`,"gifts.titlePlaceholder":`например, Праздничная звезда`,"gifts.stars":`Цена в Звёздах`,"gifts.convertStars":`Звёзд при конвертации`,"gifts.sortOrder":`Порядок сортировки`,"gifts.reason":`Причина для аудита`,"gifts.reasonPlaceholder":`Кратко опишите причину импорта этого подарка`,"gifts.enableAfterImport":`Включить после импорта`,"gifts.validate":`Тестовая проверка`,"gifts.confirmImport":`Подтвердить импорт`,"gifts.stepDetails":`Файл и описание`,"gifts.stepValidate":`Тестовая проверка`,"gifts.stepImport":`Подтверждение импорта`,"gifts.fileRequired":`Сначала выберите файл TGS или Lottie`,"gifts.source":`Источник`,"gifts.replace":`Новая версия`,"gifts.disable":`Отключить`,"gifts.enable":`Включить`,"gifts.empty":`Звёздные подарки ещё не импортированы.`,"gifts.emptyHint":`Импортируйте первую анимацию, чтобы начать наполнение каталога.`,"gifts.validationReady":`Проверка пройдена`,"gifts.validationHint":`Проверьте нормализованные метаданные и подтвердите импорт.`,"gifts.confirmState":`Применить проверенные изменения состояния к подарку #{id}?`,"collectibles.manage":`Пул атрибутов`,"collectibles.title":`Пул коллекционных предметов · Подарок #{id}`,"collectibles.eyebrow":`Уникальные атрибуты подарка`,"collectibles.activeRevision":`Опубликованная версия {revision}`,"collectibles.published":`Опубликовано`,"collectibles.noPool":`Нет опубликованного пула коллекционных предметов`,"collectibles.noPoolHint":`Опубликуйте модели, узоры и фоны для активации улучшений.`,"collectibles.publishNew":`Опубликовать новую неизменяемую версию`,"collectibles.immutableHint":`Тестовый запуск проверяет каждый файл и структуру набора атрибутов перед активацией версии.`,"collectibles.upgradeStars":`Цена улучшения в Звёздах`,"collectibles.supply":`Уникальный тираж`,"collectibles.slug":`Публичный префикс ссылки (slug)`,"collectibles.models":`Модели`,"collectibles.patterns":`Узоры`,"collectibles.backdrops":`Фоны`,"collectibles.model":`Модель`,"collectibles.pattern":`Узор`,"collectibles.backdrop":`Фон`,"collectibles.rarity":`Редкость ‰`,"collectibles.rarityHint":`В каждой категории должно быть не менее двух атрибутов. Значения в промилле задают относительные веса обычного улучшения; при добавлении или удалении они перераспределяются до суммы 1000.`,"collectibles.minimumAttributes":`Модели, узоры и фоны должны содержать не менее двух атрибутов в каждой категории.`,"collectibles.duplicateBackdropID":`ID фонов в одном наборе должны быть уникальными.`,"collectibles.colorHint":`Цвета сохраняются как 24-битные RGB-значения.`,"collectibles.addAttribute":`Добавить`,"collectibles.remove":`Удалить атрибут`,"collectibles.fileRequired":`Для каждой модели и узора требуется файл TGS или Lottie.`,"collectibles.backdropID":`ID фона`,"collectibles.color.center":`Центр`,"collectibles.color.edge":`Край`,"collectibles.color.pattern":`Узор`,"collectibles.color.text":`Текст`,"collectibles.validationReady":`Пул атрибутов корректен`,"collectibles.validationHint":`Проверьте нормализованные ресурсы и опубликуйте эту неизменяемую версию.`,"collectibles.publish":`Опубликовать версию`,"messages.msgIDsInvalid":`Некорректные ID сообщений`,"auth.device":`Устройство`,"auth.platform":`Платформа`,"auth.ip":`IP-адрес`,"auth.lastActive":`Последняя активность`,"auth.revokeCurrent":`Отозвать текущую`,"auth.keepCurrent":`Оставить текущую`,"auth.revokeAll":`Отозвать все устройства`,"picker.userPlaceholder":`Поиск по user_id / телефону / имени пользователя`,"picker.channelPlaceholder":`Поиск по channel_id / имени пользователя / названию`,"picker.verified":`Подтверждённые`,"picker.regular":`Обычные`,"action.reasonRequired":`Пожалуйста, укажите причину операции`,"action.flow":`Процесс выполнения`,"action.close":`Закрыть`,"action.stepReason":`Укажите причину`,"action.stepDryRun":`Тестовый запуск`,"action.stepConfirm":`Подтверждение выполнения`,"action.reason":`Причина операции`,"action.reasonPlaceholder":`Опишите, почему выполняется эта операция`,"action.requestPreview":`Запросить предпросмотр`,"action.result":`Результат действия`,"action.commandID":`ID команды`,"action.status":`Статус`,"action.dryRun":`Тестовый запуск`,"action.runAgain":`Повторить тестовый запуск`,"action.runDry":`Сначала выполните тестовый запуск`,"action.confirm":`Подтвердить выполнение`,"audit.id":`ID`,"audit.commandID":`ID команды`,"audit.action":`Действие`,"audit.actor":`Исполнитель`,"audit.status":`Статус`,"audit.dryRun":`Тестовый запуск`,"audit.reason":`Причина`,"audit.time":`Время`}},Se=(0,g.createContext)(null);function Ce({children:e}){let[t,n]=(0,g.useState)(()=>De());(0,g.useEffect)(()=>{try{localStorage.setItem(be,t)}catch{}let e=t===`zh`?`zh-CN`:t===`ru`?`ru`:`en`;document.documentElement.lang=e,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=Ee(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>Ee(t,e,n)}),[t]);return(0,W.jsx)(Se.Provider,{value:r,children:e})}function we(){let e=(0,g.useContext)(Se);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function Te(){let{lang:e,setLang:t,t:n}=we();return(0,W.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`,`ru`].map(r=>(0,W.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function Ee(e,t,n){let r=xe[e][t]??xe.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function De(){try{let e=Oe(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=Oe(localStorage.getItem(be));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=Oe(t);if(e)return e}return`en`}function Oe(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:t===`ru`||t.startsWith(`ru-`)?`ru`:null}function ke(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function Ae(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/messages`)?t(`route.messages`):e.startsWith(`/gifts`)?t(`route.gifts`):t(`route.dashboard`)}function je(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):e.startsWith(`/gifts`)?t(`route.giftsSubtitle`):t(`route.dashboardSubtitle`)}var Me=`telesrv.admin.theme`,Ne=(0,g.createContext)(null);function Pe(e){document.documentElement.setAttribute(`data-theme`,e),document.documentElement.style.colorScheme=e}function Fe({children:e}){let[t,n]=(0,g.useState)(()=>Re());(0,g.useEffect)(()=>{Pe(t);try{localStorage.setItem(Me,t)}catch{}},[t]),(0,g.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>{let t=null;try{t=localStorage.getItem(Me)}catch{t=null}t!==`light`&&t!==`dark`&&n(e.matches?`dark`:`light`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let r=(0,g.useCallback)(e=>n(e),[]),i=(0,g.useCallback)(()=>n(e=>e===`dark`?`light`:`dark`),[]),a=(0,g.useMemo)(()=>({theme:t,setTheme:r,toggleTheme:i}),[t,r,i]);return(0,W.jsx)(Ne.Provider,{value:a,children:e})}function Ie(){let e=(0,g.useContext)(Ne);if(!e)throw Error(`useTheme must be used inside ThemeProvider`);return e}function Le(){let{theme:e,toggleTheme:t}=Ie(),{t:n}=we(),r=n(e===`light`?`theme.switchToDark`:`theme.switchToLight`);return(0,W.jsx)(`button`,{className:`theme-toggle`,type:`button`,onClick:t,"aria-label":r,title:r,children:e===`dark`?(0,W.jsx)(ge,{size:16}):(0,W.jsx)(le,{size:16})})}function Re(){try{let e=localStorage.getItem(Me);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches)return`dark`}catch{}return`light`}function ze({href:e,navigate:t,className:n,children:r}){return(0,W.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function G(){let{t:e}=we();return(0,W.jsxs)(`div`,{className:`boot-screen`,children:[(0,W.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,W.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`strong`,{children:`telesrv`}),(0,W.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,W.jsx)(`div`,{className:`loader-bar`})]})}function Be({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=we(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,W.jsxs)(`div`,{className:`shell`,children:[(0,W.jsxs)(`aside`,{className:`sidebar`,children:[(0,W.jsxs)(ze,{className:`brand`,href:`/`,navigate:n,children:[(0,W.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`strong`,{children:`telesrv`}),(0,W.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,W.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,W.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,W.jsx)(Ve,{icon:(0,W.jsx)(oe,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,W.jsx)(Ve,{icon:(0,W.jsx)(ye,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,W.jsx)(Ve,{icon:(0,W.jsx)(pe,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,W.jsx)(Ve,{icon:(0,W.jsx)(re,{size:16}),href:`/gifts`,route:t,navigate:n,children:a(`layout.gifts`)}),(0,W.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,W.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,W.jsx)(ce,{size:16}),(0,W.jsx)(`span`,{children:a(`layout.messages`)}),(0,W.jsx)(F,{className:`nav-section-chevron`,size:15})]}),s&&(0,W.jsxs)(`div`,{className:`nav-children`,children:[(0,W.jsx)(Ve,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,W.jsx)(Ve,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,W.jsxs)(`div`,{className:`sidebar-status`,children:[(0,W.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,W.jsxs)(`div`,{className:`runtime-row`,children:[(0,W.jsx)(fe,{size:14}),(0,W.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,W.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,W.jsxs)(`div`,{className:`runtime-row`,children:[(0,W.jsx)(ee,{size:14}),(0,W.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,W.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,W.jsxs)(`div`,{className:`runtime-row`,children:[(0,W.jsx)(me,{size:14}),(0,W.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,W.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,W.jsxs)(`div`,{className:`workspace`,children:[(0,W.jsxs)(`header`,{className:`topbar`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:je(t.path,a)}),(0,W.jsx)(`h1`,{children:Ae(t.path,a)})]}),(0,W.jsxs)(`div`,{className:`topbar-actions`,children:[(0,W.jsx)(Le,{}),(0,W.jsx)(Te,{}),(0,W.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,W.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,W.jsx)(se,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,W.jsx)(`main`,{className:`content`,children:i})]})]})}function Ve({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,W.jsxs)(ze,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,W.jsx)(`span`,{children:i})]})}function He(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function Ue(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function We(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function Ge(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function Ke(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function K(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function qe(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function q(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function Je({title:e,eyebrow:t,children:n,actions:r}){return(0,W.jsxs)(`div`,{className:`page-frame`,children:[(0,W.jsxs)(`div`,{className:`page-title-row`,children:[(0,W.jsxs)(`div`,{children:[t&&(0,W.jsx)(`div`,{className:`eyebrow`,children:t}),(0,W.jsx)(`h2`,{children:e})]}),r&&(0,W.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function Ye({children:e}){return(0,W.jsx)(`div`,{className:`query-panel`,children:e})}function Xe({main:e,side:t}){return(0,W.jsxs)(`div`,{className:`split-layout`,children:[(0,W.jsx)(`div`,{className:`split-main`,children:e}),(0,W.jsx)(`aside`,{className:`split-side`,children:t})]})}function Ze({title:e,text:t,action:n}){return(0,W.jsxs)(`div`,{className:`section-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h2`,{children:e}),t&&(0,W.jsx)(`p`,{children:t})]}),n&&(0,W.jsx)(`div`,{className:`section-action`,children:n})]})}function Qe({children:e}){return(0,W.jsxs)(`div`,{className:`alert`,children:[(0,W.jsx)(O,{size:16}),` `,(0,W.jsx)(`span`,{children:e})]})}function J({children:e,tone:t=`neutral`}){return(0,W.jsx)(`span`,{className:`badge ${t}`,children:e})}function $e({label:e,value:t,tone:n}){return(0,W.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`strong`,{children:t})]})}function et({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,W.jsxs)(`div`,{className:`metric ${n}`,children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function Y({label:e,value:t,mono:n=!1}){return(0,W.jsxs)(`div`,{className:`summary-item`,children:[(0,W.jsx)(`span`,{children:e}),(0,W.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function tt({rows:e}){let{t}=we();return(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`audit.id`)}),(0,W.jsx)(`th`,{children:t(`audit.commandID`)}),(0,W.jsx)(`th`,{children:t(`audit.action`)}),(0,W.jsx)(`th`,{children:t(`audit.actor`)}),(0,W.jsx)(`th`,{children:t(`audit.status`)}),(0,W.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,W.jsx)(`th`,{children:t(`audit.reason`)}),(0,W.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,W.jsxs)(`tbody`,{children:[e.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.ID}),(0,W.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,W.jsx)(`td`,{children:e.Action}),(0,W.jsx)(`td`,{children:e.Actor}),(0,W.jsx)(`td`,{children:e.Status}),(0,W.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,W.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,W.jsx)(`td`,{children:Ke(e.CreatedAt)})]},e.ID)),e.length===0&&(0,W.jsx)(nt,{colSpan:8})]})]})})}function nt({colSpan:e}){let{t}=we();return(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function rt({label:e}){return(0,W.jsx)(`section`,{className:`surface`,children:(0,W.jsx)(`div`,{className:`loading-line`,children:e})})}function it({value:e}){return(0,W.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function at({onLogin:e}){let{t}=we(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,W.jsx)(`main`,{className:`login-page`,children:(0,W.jsxs)(`section`,{className:`login-panel`,children:[(0,W.jsxs)(`div`,{className:`login-head`,children:[(0,W.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,W.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`strong`,{children:`telesrv`}),(0,W.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,W.jsxs)(`div`,{className:`login-head-actions`,children:[(0,W.jsx)(Le,{}),(0,W.jsx)(Te,{}),(0,W.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,W.jsxs)(`div`,{className:`login-copy`,children:[(0,W.jsx)(`h1`,{children:t(`login.heading`)}),(0,W.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,W.jsx)(Qe,{children:i}),(0,W.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:t(`login.secret`)}),(0,W.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,W.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var ot=m();function st({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=we(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function S(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let C=f?.dry_run&&!f.error,w=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,T=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{className:w,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,ot.createPortal)((0,W.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,W.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,W.jsxs)(`div`,{className:`modal-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,W.jsx)(`h2`,{children:e})]}),(0,W.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,W.jsx)(H,{size:15})})]}),(0,W.jsxs)(`div`,{className:`command-body`,children:[(0,W.jsxs)(`div`,{className:`command-steps`,children:[(0,W.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,W.jsx)(`span`,{children:`1`}),(0,W.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`2`}),(0,W.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:C?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`3`}),(0,W.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,W.jsxs)(`label`,{className:`form-field`,children:[(0,W.jsx)(`span`,{children:s(`action.reason`)}),(0,W.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,W.jsxs)(`div`,{className:`command-preview`,children:[(0,W.jsxs)(`div`,{className:`preview-head`,children:[(0,W.jsx)(te,{size:14}),` `,s(`action.requestPreview`)]}),(0,W.jsx)(it,{value:JSON.stringify(T,null,2)})]}),m&&(0,W.jsx)(Qe,{children:m}),f&&(0,W.jsxs)(`div`,{className:`result-box`,children:[(0,W.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,W.jsx)(O,{size:16}):(0,W.jsx)(k,{size:16}),(0,W.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,W.jsxs)(`div`,{className:`result-line`,children:[(0,W.jsx)(`span`,{children:s(`action.commandID`)}),(0,W.jsx)(`strong`,{children:f.command_id})]}),(0,W.jsxs)(`div`,{className:`result-line`,children:[(0,W.jsx)(`span`,{children:s(`action.status`)}),(0,W.jsx)(`strong`,{children:f.status})]}),(0,W.jsxs)(`div`,{className:`result-line`,children:[(0,W.jsx)(`span`,{children:s(`action.dryRun`)}),(0,W.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,W.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,W.jsx)(it,{value:JSON.stringify(f.details,null,2)})]})]}),(0,W.jsxs)(`div`,{className:`modal-actions`,children:[(0,W.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>S(!1),disabled:_,children:[_?(0,W.jsx)(A,{size:15,className:`spin`}):(0,W.jsx)(z,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,W.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>S(!0),disabled:_||!C,children:[(0,W.jsx)(k,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function ct({rows:e,userID:t,onDone:n}){let{t:r}=we(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,W.jsxs)(`div`,{className:`authorization-block`,children:[(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:r(`auth.device`)}),(0,W.jsx)(`th`,{children:r(`auth.platform`)}),(0,W.jsx)(`th`,{children:r(`auth.ip`)}),(0,W.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,W.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,W.jsxs)(`tbody`,{children:[o.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,W.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,W.jsx)(`td`,{children:n.IP}),(0,W.jsx)(`td`,{children:Ke(n.ActiveAt)}),(0,W.jsx)(`td`,{className:`device-actions-cell`,children:(0,W.jsxs)(`div`,{className:`device-actions`,children:[(0,W.jsx)(st,{label:r(`auth.revokeCurrent`),icon:(0,W.jsx)(se,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,W.jsx)(st,{label:r(`auth.keepCurrent`),icon:(0,W.jsx)(pe,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,W.jsx)(nt,{colSpan:5})]})]})}),(0,W.jsx)(`div`,{className:`danger-zone`,children:(0,W.jsx)(st,{label:r(`auth.revokeAll`),icon:(0,W.jsx)(N,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function lt({id:e,navigate:t}){let{t:n}=we(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`),[p,m]=(0,g.useState)(()=>ut(new Date(Date.now()+7*864e5))),[h,_]=(0,g.useState)(``);async function v(){c(!0),o(``);try{let t=await x.account(e);i(t),t.Restriction.Frozen&&(t.Restriction.Until&&m(ut(new Date(t.Restriction.Until))),_(t.Restriction.AppealURL||``))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{v()},[e]),a)return(0,W.jsx)(Qe,{children:a});if(!r)return(0,W.jsx)(rt,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let y=r.Account;return(0,W.jsx)(Je,{title:n(`account.detailTitle`,{id:y.ID}),eyebrow:n(`account.profile`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,W.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,W.jsx)(Xe,{main:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:We(y)}),(0,W.jsxs)(`div`,{className:`entity-subtitle`,children:[Ue(y.Username)||n(`account.noUsername`),` · `,He(y.Phone)||n(`account.noPhone`)]})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[y.PremiumUntil>0?(0,W.jsx)(J,{tone:`good`,children:n(`account.premium`)}):(0,W.jsx)(J,{children:n(`account.notPremium`)}),r.Verified?(0,W.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,W.jsx)(J,{children:n(`account.notVerified`)}),y.Frozen?(0,W.jsx)(J,{tone:`danger`,children:n(`account.accountFrozen`)}):(0,W.jsx)(J,{children:n(`account.accountActive`)})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:n(`account.userID`),value:String(y.ID),mono:!0}),(0,W.jsx)(Y,{label:n(`account.lastActive`),value:K(r.LastSeenAt)||`-`}),(0,W.jsx)(Y,{label:n(`account.premiumUntil`),value:y.PremiumUntil>0?K(y.PremiumUntil):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,W.jsx)(Y,{label:n(`common.updatedAt`),value:Ke(y.UpdatedAt)||`-`}),(0,W.jsx)(Y,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,W.jsx)(Y,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,W.jsx)(Y,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.freezeSince`),value:r.Restriction.Since?Ke(r.Restriction.Since):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.freezeUntil`),value:r.Restriction.Until?Ke(r.Restriction.Until):n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.freezeAppealURL`),value:r.Restriction.AppealURL||n(`common.none`)}),(0,W.jsx)(Y,{label:n(`account.createdAt`),value:Ke(y.CreatedAt)||`-`})]}),r.About&&(0,W.jsx)(`p`,{className:`about-text`,children:r.About}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,W.jsx)(ct,{rows:r.Authorizations,userID:y.ID,onDone:v})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,W.jsx)(tt,{rows:r.AuditLogs})]})]}),side:(0,W.jsxs)(`section`,{className:`action-dock`,children:[(0,W.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.freezeUntil`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.freezeUntilAria`),value:p,onChange:e=>m(e.target.value),type:`datetime-local`})]}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.freezeAppealURL`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.freezeAppealURLAria`),value:h,onChange:e=>_(e.target.value),type:`url`,placeholder:`https://...`})]}),(0,W.jsx)(st,{label:y.Frozen?n(`account.updateFreeze`):n(`account.freezeAccount`),icon:(0,W.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!0,freeze_until:new Date(p).toISOString(),freeze_appeal_url:h.trim()}),onDone:v}),y.Frozen&&(0,W.jsx)(st,{label:n(`account.unfreezeAccount`),icon:(0,W.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!1}),onDone:v}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,W.jsxs)(`div`,{className:`action-stack`,children:[(0,W.jsx)(st,{label:n(`account.setPremium`),icon:(0,W.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:qe(l)}),onDone:v}),(0,W.jsx)(st,{label:n(`account.clearPremium`),icon:(0,W.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:0}),onDone:v}),(0,W.jsxs)(`label`,{className:`duration-field`,children:[(0,W.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,W.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,W.jsx)(st,{label:n(`account.grantStars`),icon:(0,W.jsx)(he,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:y.ID,amount:qe(d)}),onDone:v}),(0,W.jsx)(st,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,W.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:y.ID,verified:!r.Verified}),onDone:v})]})]})})})}function ut(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function dt(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function ft(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function pt({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=dt(o?.rows??[]);return(0,W.jsxs)(Je,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,W.jsx)(B,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,W.jsx)(Qe,{children:f}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,W.jsx)(et,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,W.jsx)(et,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,W.jsx)(et,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,W.jsx)(Ye,{children:(0,W.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,W.jsxs)(`label`,{className:`field-inline`,children:[(0,W.jsx)(`span`,{children:t(`common.limit`)}),(0,W.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,W.jsx)(A,{size:15,className:`spin`}):(0,W.jsx)(V,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`account.userID`)}),(0,W.jsx)(`th`,{children:t(`account.phone`)}),(0,W.jsx)(`th`,{children:t(`common.username`)}),(0,W.jsx)(`th`,{children:t(`common.name`)}),(0,W.jsx)(`th`,{children:t(`common.device`)}),(0,W.jsx)(`th`,{children:t(`account.lastActive`)}),(0,W.jsx)(`th`,{children:t(`account.premium`)}),(0,W.jsx)(`th`,{children:t(`common.verified`)}),(0,W.jsx)(`th`,{children:t(`account.frozen`)}),(0,W.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.ID}),(0,W.jsx)(`td`,{children:He(n.Phone)}),(0,W.jsx)(`td`,{children:Ue(n.Username)}),(0,W.jsx)(`td`,{children:We(n)}),(0,W.jsx)(`td`,{children:n.DeviceCount}),(0,W.jsx)(`td`,{children:Ke(n.LastActiveAt)}),(0,W.jsx)(`td`,{children:n.PremiumUntil>0?(0,W.jsxs)(J,{tone:`good`,children:[t(`account.premium`),` `,K(n.PremiumUntil)]}):(0,W.jsx)(J,{children:t(`common.none`)})}),(0,W.jsx)(`td`,{children:n.Verified?(0,W.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,W.jsx)(J,{children:t(`account.notVerified`)})}),(0,W.jsx)(`td`,{children:n.Frozen?(0,W.jsx)(J,{tone:`danger`,children:t(`account.frozen`)}):(0,W.jsx)(J,{children:t(`common.normal`)})}),(0,W.jsx)(`td`,{children:Ke(n.UpdatedAt)}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,W.jsx)(nt,{colSpan:11})]})]})})]})}function mt({id:e,navigate:t}){let{t:n}=we(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,W.jsx)(Qe,{children:a});if(!r)return(0,W.jsx)(rt,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,W.jsx)(Je,{title:`${Ge(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,W.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,W.jsx)(Xe,{main:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,W.jsxs)(`div`,{className:`entity-subtitle`,children:[Ue(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[(0,W.jsx)(J,{children:Ge(c,n)}),c.Verified?(0,W.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,W.jsx)(J,{children:n(`account.notVerified`)}),c.Deleted?(0,W.jsx)(J,{tone:`danger`,children:n(`common.deleted`)}):(0,W.jsx)(J,{children:n(`common.valid`)})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,W.jsx)(Y,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,W.jsx)(Y,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,W.jsx)(Y,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,W.jsx)(Y,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,W.jsx)(Y,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,W.jsx)(Y,{label:n(`account.createdAt`),value:K(c.Date)||`-`}),(0,W.jsx)(Y,{label:n(`common.updatedAt`),value:Ke(c.UpdatedAt)||`-`})]}),c.About&&(0,W.jsx)(`p`,{className:`about-text`,children:c.About}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,W.jsx)(tt,{rows:r.AuditLogs})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,W.jsx)(it,{value:r.ChannelJSON})]})]}),side:(0,W.jsxs)(`section`,{className:`action-dock`,children:[(0,W.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,W.jsx)(st,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,W.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s})]})})})}function ht({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=ft(o?.rows??[]);return(0,W.jsxs)(Je,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,W.jsx)(B,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,W.jsx)(Qe,{children:f}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,W.jsx)(et,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,W.jsx)(et,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,W.jsx)(et,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,W.jsx)(Ye,{children:(0,W.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,W.jsxs)(`label`,{className:`field-inline`,children:[(0,W.jsx)(`span`,{children:t(`common.limit`)}),(0,W.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,W.jsx)(A,{size:15,className:`spin`}):(0,W.jsx)(V,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`channel.channelID`)}),(0,W.jsx)(`th`,{children:t(`channel.kind`)}),(0,W.jsx)(`th`,{children:t(`common.username`)}),(0,W.jsx)(`th`,{children:t(`channel.title`)}),(0,W.jsx)(`th`,{children:t(`common.members`)}),(0,W.jsx)(`th`,{children:t(`common.admins`)}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:t(`common.verified`)}),(0,W.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.ID}),(0,W.jsx)(`td`,{children:Ge(n,t)}),(0,W.jsx)(`td`,{children:Ue(n.Username)}),(0,W.jsx)(`td`,{children:n.Title}),(0,W.jsx)(`td`,{children:n.ParticipantsCount}),(0,W.jsx)(`td`,{children:n.AdminsCount}),(0,W.jsx)(`td`,{children:n.PTS}),(0,W.jsx)(`td`,{children:n.Verified?(0,W.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,W.jsx)(J,{children:t(`account.notVerified`)})}),(0,W.jsx)(`td`,{children:Ke(n.UpdatedAt)}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,W.jsx)(nt,{colSpan:10})]})]})})]})}function gt({navigate:e}){let{t}=we();return(0,W.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,W.jsxs)(`section`,{className:`overview-band`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,W.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,W.jsxs)(`div`,{className:`overview-metrics`,children:[(0,W.jsx)($e,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,W.jsx)($e,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,W.jsx)($e,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,W.jsxs)(`div`,{className:`command-grid`,children:[(0,W.jsx)(_t,{icon:(0,W.jsx)(ye,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,W.jsx)(_t,{icon:(0,W.jsx)(pe,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,W.jsx)(_t,{icon:(0,W.jsx)(ce,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,W.jsxs)(`section`,{className:`work-strip`,children:[(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(k,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(ae,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(L,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,W.jsxs)(`div`,{className:`strip-item`,children:[(0,W.jsx)(te,{size:16}),(0,W.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function _t({icon:e,title:t,text:n,href:r,navigate:i}){return(0,W.jsxs)(ze,{className:`launcher`,href:r,navigate:i,children:[(0,W.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,W.jsxs)(`span`,{className:`launcher-copy`,children:[(0,W.jsx)(`strong`,{children:t}),(0,W.jsx)(`span`,{children:n})]}),(0,W.jsx)(I,{size:16})]})}function vt({channelID:e,msgID:t,navigate:n}){let{t:r}=we(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,W.jsx)(Qe,{children:o});if(!i)return(0,W.jsx)(rt,{label:r(`common.loading`)});let l=i.Message;return(0,W.jsx)(Je,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,W.jsx)(M,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,W.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:K(l.Date)})})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,W.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,W.jsx)(J,{children:r(`common.survived`)}),l.Pinned&&(0,W.jsx)(J,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,W.jsx)(J,{children:r(`messages.channelPost`)}),(0,W.jsxs)(J,{children:[`pts `,l.PTS]})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,W.jsx)(Y,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,W.jsx)(Y,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,W.jsx)(Y,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,W.jsx)(it,{value:i.MessageJSON})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,W.jsx)(it,{value:i.ChannelJSON})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:r(`common.count`)}),(0,W.jsx)(`th`,{children:r(`common.type`)}),(0,W.jsx)(`th`,{children:r(`common.messageId`)}),(0,W.jsx)(`th`,{children:r(`common.sender`)}),(0,W.jsx)(`th`,{children:r(`common.time`)})]})}),(0,W.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.PTS}),(0,W.jsx)(`td`,{children:e.PTSCount}),(0,W.jsx)(`td`,{children:e.Type}),(0,W.jsx)(`td`,{children:e.MessageID}),(0,W.jsx)(`td`,{children:e.SenderUserID}),(0,W.jsx)(`td`,{children:K(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,W.jsx)(nt,{colSpan:6})]})]})})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.eventJson`)}),(0,W.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,W.jsx)(it,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,W.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function yt({label:e,value:t,onChange:n}){let{t:r}=we(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,W.jsxs)(`div`,{className:`entity-picker`,children:[(0,W.jsxs)(`div`,{className:`picker-head`,children:[(0,W.jsx)(`span`,{children:e}),t?(0,W.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,W.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,W.jsxs)(`div`,{className:`selected-entity`,children:[(0,W.jsx)(P,{size:15}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:We(t)}),(0,W.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,W.jsx)(`span`,{children:Ue(t.Username)||He(t.Phone)||`-`})]}):null,(0,W.jsxs)(`div`,{className:`picker-search`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,W.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,W.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,W.jsx)(`div`,{className:`picker-error`,children:u}),(0,W.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,W.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,W.jsx)(`span`,{className:`mono`,children:e.ID}),(0,W.jsx)(`strong`,{children:We(e)}),(0,W.jsx)(`span`,{children:Ue(e.Username)||He(e.Phone)||`-`}),e.Verified?(0,W.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,W.jsx)(J,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,W.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function bt({label:e,value:t,onChange:n}){let{t:r}=we(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,W.jsxs)(`div`,{className:`entity-picker`,children:[(0,W.jsxs)(`div`,{className:`picker-head`,children:[(0,W.jsx)(`span`,{children:e}),t?(0,W.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,W.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,W.jsxs)(`div`,{className:`selected-entity`,children:[(0,W.jsx)(P,{size:15}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:t.Title||`-`}),(0,W.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,W.jsx)(`span`,{children:Ue(t.Username)||Ge(t,r)})]}):null,(0,W.jsxs)(`div`,{className:`picker-search`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,W.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,W.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,W.jsx)(`div`,{className:`picker-error`,children:u}),(0,W.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,W.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,W.jsx)(`span`,{className:`mono`,children:e.ID}),(0,W.jsx)(`strong`,{children:e.Title||`-`}),(0,W.jsx)(`span`,{children:Ue(e.Username)||Ge(e,r)}),e.Verified?(0,W.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,W.jsx)(J,{children:Ge(e,r)})]},e.ID)),o.length===0&&!c?(0,W.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function xt({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,W.jsxs)(Je,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,W.jsx)(Qe,{children:f}),(0,W.jsxs)(Ye,{children:[(0,W.jsx)(`div`,{className:`message-selector-grid single`,children:(0,W.jsx)(bt,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,W.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,W.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,W.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,W.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,W.jsx)(V,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`messages.currentPage`),value:String(_.length)}),(0,W.jsx)(et,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,W.jsx)(et,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,W.jsx)(et,{label:t(`messages.channelGroup`),value:n?`${n.Title||Ge(n,t)} (${n.ID})`:`-`})]}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`common.messageId`)}),(0,W.jsx)(`th`,{children:t(`common.time`)}),(0,W.jsx)(`th`,{children:t(`common.sender`)}),(0,W.jsx)(`th`,{children:`From Peer`}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:t(`common.views`)}),(0,W.jsx)(`th`,{children:t(`common.status`)}),(0,W.jsx)(`th`,{children:t(`messages.body`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[_.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.ID}),(0,W.jsx)(`td`,{children:K(n.Date)}),(0,W.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,W.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,W.jsx)(`td`,{children:n.PTS}),(0,W.jsx)(`td`,{children:n.ViewsCount}),(0,W.jsx)(`td`,{children:n.Deleted?(0,W.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,W.jsx)(J,{tone:`warn`,children:t(`messages.pinned`)}):(0,W.jsx)(J,{children:t(`common.survived`)})}),(0,W.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,W.jsx)(nt,{colSpan:9})]})]})})]})}function St({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=we(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,W.jsx)(Qe,{children:o});if(!i)return(0,W.jsx)(rt,{label:r(`common.loading`)});let l=i.Message;return(0,W.jsx)(Je,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,W.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,W.jsx)(M,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,W.jsx)(Xe,{main:(0,W.jsxs)(`div`,{className:`stacked-sections`,children:[(0,W.jsxs)(`section`,{className:`entity-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,W.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:K(l.Date)})})]}),(0,W.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,W.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,W.jsx)(J,{children:r(`common.survived`)}),(0,W.jsxs)(J,{children:[`pts `,l.PTS]}),(0,W.jsx)(J,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,W.jsxs)(`div`,{className:`summary-grid`,children:[(0,W.jsx)(Y,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,W.jsx)(Y,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,W.jsx)(Y,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,W.jsx)(Y,{label:r(`common.time`),value:K(l.Date)})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,W.jsx)(it,{value:i.MessageJSON})]}),(0,W.jsxs)(`div`,{className:`raw-grid`,children:[(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,W.jsx)(it,{value:i.DialogJSON})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,W.jsx)(it,{value:i.PrivateJSON})]})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:r(`common.count`)}),(0,W.jsx)(`th`,{children:r(`common.type`)}),(0,W.jsx)(`th`,{children:r(`common.time`)})]})}),(0,W.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.PTS}),(0,W.jsx)(`td`,{children:e.PTSCount}),(0,W.jsx)(`td`,{children:e.Type}),(0,W.jsx)(`td`,{children:K(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,W.jsx)(nt,{colSpan:4})]})]})})]}),(0,W.jsxs)(`section`,{className:`section-block`,children:[(0,W.jsx)(Ze,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:`ID`}),(0,W.jsx)(`th`,{children:r(`account.userID`)}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:r(`common.type`)}),(0,W.jsx)(`th`,{children:r(`common.status`)}),(0,W.jsx)(`th`,{children:r(`messages.attempts`)}),(0,W.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,W.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{children:e.ID}),(0,W.jsx)(`td`,{children:e.TargetUserID}),(0,W.jsx)(`td`,{children:e.PTS}),(0,W.jsx)(`td`,{children:e.EventType}),(0,W.jsx)(`td`,{children:e.Status}),(0,W.jsx)(`td`,{children:e.Attempts}),(0,W.jsx)(`td`,{children:Ke(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,W.jsx)(nt,{colSpan:7})]})]})})]})]}),side:(0,W.jsxs)(`section`,{className:`action-dock`,children:[(0,W.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,W.jsx)(st,{label:r(`messages.deleteThis`),icon:(0,W.jsx)(_e,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function Ct({navigate:e}){let{t}=we(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,S]=(0,g.useState)(``),[C,w]=(0,g.useState)(`1`),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(``);async function k(e=!1){if(O(``),!n||!i){O(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&T?.rows.length){let e=T.rows[T.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{E(await x.messages(r))}catch(e){O(b(e))}}function A(e){r(e),s(``),l(``),E(null)}function j(e){a(e),s(``),l(``),E(null)}return(0,W.jsxs)(Je,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[D&&(0,W.jsx)(Qe,{children:D}),(0,W.jsxs)(Ye,{children:[(0,W.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,W.jsx)(yt,{label:t(`messages.ownerUser`),value:n,onChange:A}),(0,W.jsx)(yt,{label:t(`messages.peerUser`),value:i,onChange:j})]}),(0,W.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),k(!1)},children:[(0,W.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,W.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,W.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,W.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,W.jsx)(V,{size:15}),` `,t(`messages.searchMessages`)]}),T?.rows.length?(0,W.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>k(!0),children:[(0,W.jsx)(I,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,W.jsxs)(`div`,{className:`metric-row`,children:[(0,W.jsx)(et,{label:t(`messages.currentPage`),value:String(T?.rows.length??0)}),(0,W.jsx)(et,{label:t(`messages.deleted`),value:String((T?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,W.jsx)(et,{label:t(`messages.outgoing`),value:String((T?.rows??[]).filter(e=>e.Outgoing).length)}),(0,W.jsx)(et,{label:t(`messages.ownerPeer`),value:n&&i?`${We(n)} / ${We(i)}`:`-`})]}),(0,W.jsxs)(`div`,{className:`operation-row`,children:[(0,W.jsxs)(`div`,{className:`operation-box`,children:[(0,W.jsxs)(`div`,{className:`operation-title`,children:[(0,W.jsx)(_e,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,W.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,W.jsxs)(`label`,{className:`checkline`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,W.jsx)(st,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:q(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,W.jsxs)(`div`,{className:`operation-box`,children:[(0,W.jsxs)(`div`,{className:`operation-title`,children:[(0,W.jsx)(ie,{size:15}),` `,t(`messages.clearHistory`)]}),(0,W.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,W.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,W.jsxs)(`label`,{className:`checkline`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,W.jsxs)(`label`,{className:`checkline`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,W.jsx)(st,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:qe(y),max_batches:qe(C),just_clear:_,revoke:m})})]})]}),(0,W.jsx)(`div`,{className:`table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:t(`common.messageId`)}),(0,W.jsx)(`th`,{children:t(`common.time`)}),(0,W.jsx)(`th`,{children:t(`common.sender`)}),(0,W.jsx)(`th`,{children:t(`messages.direction`)}),(0,W.jsx)(`th`,{children:`PTS`}),(0,W.jsx)(`th`,{children:t(`common.status`)}),(0,W.jsx)(`th`,{children:t(`messages.body`)}),(0,W.jsx)(`th`,{})]})}),(0,W.jsxs)(`tbody`,{children:[T?.rows.map(n=>(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,W.jsx)(`td`,{children:K(n.Date)}),(0,W.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,W.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,W.jsx)(`td`,{children:n.PTS}),(0,W.jsx)(`td`,{children:n.Deleted?(0,W.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):(0,W.jsx)(J,{children:t(`common.survived`)})}),(0,W.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,W.jsx)(I,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!T||T.rows.length===0)&&(0,W.jsx)(nt,{colSpan:8})]})]})})]})}var wt=c(o(((e,t)=>{typeof document<`u`&&typeof navigator<`u`&&(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.lottie=r())})(e,(function(){var n=``,r=!1,i=-999999,a=function(e){r=!!e},o=function(){return r},s=function(e){n=e},c=function(){return n};function l(e){return document.createElement(e)}function u(e,t){var n,r=e.length,i;for(n=0;n1?n[1]=1:n[1]<=0&&(n[1]=0),L(n[0],n[1],n[2])}function te(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),L(n[0],n[1],n[2])}function ne(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[0]+=t/360,n[0]>1?--n[0]:n[0]<0&&(n[0]+=1),L(n[0],n[1],n[2])}(function(){var e=[],t,n;for(t=0;t<256;t+=1)n=t.toString(16),e[t]=n.length===1?`0`+n:n;return function(t,n,r){return t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),`#`+e[t]+e[n]+e[r]}})();var re=function(e){g=!!e},ie=function(){return g},ae=function(e){_=e},oe=function(){return _},se=function(){return v},ce=function(e){E=e},le=function(){return E},ue=function(e){y=e};function z(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function de(e){"@babel/helpers - typeof";return de=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},de(e)}var B=function(){var e=1,t=[],n,r,i={onmessage:function(){},postMessage:function(e){n({data:e})}},a={postMessage:function(e){i.onmessage({data:e})}};function s(e){if(window.Worker&&window.Blob&&o()){var t=new Blob([`var _workerSelf = self; self.onmessage = `,e.toString()],{type:`text/javascript`}),r=URL.createObjectURL(t);return new Worker(r)}return n=e,i}function c(){r||(r=s(function(e){function t(){function e(t,n){var o,s,c=t.length,l,u,d,f;for(s=0;s=0;--t)if(e[t].ty===`sh`)if(e[t].ks.k.i)a(e[t].ks.k);else for(o=e[t].ks.k.length,r=0;rn[0]?!0:n[0]>e[0]?!1:e[1]>n[1]?!0:n[1]>e[1]?!1:e[2]>n[2]?!0:n[2]>e[2]?!1:null}var s=function(){var e=[4,4,14];function t(e){var t=e.t.d;e.t.d={k:[{s:t,t:0}]}}function n(e){var n,r=e.length;for(n=0;n=0;--n)if(e[n].ty===`sh`)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(a=e[n].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function a(t){var n=r(t,this.assetsPath,this.path),i=z(`image`);b?this.testImageLoaded(i):i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS(`http://www.w3.org/1999/xlink`,`href`,n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a}function o(t){var n=r(t,this.assetsPath,this.path),i=l(`img`);i.crossOrigin=`anonymous`,i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var a={img:i,assetData:t};return a}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return B.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function c(e,t){this.imagesLoadedCb=t;var n,r=e.length;for(n=0;nthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t=this.animationData.layers,n,r=t.length,i=e.layers,a,o=i.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(`enterFrame`),this.renderFrame(),this.trigger(`drawnFrame`)},H.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},H.prototype.play=function(e){e&&this.name!==e||this.isPaused===!0&&(this.isPaused=!1,this.trigger(`_play`),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger(`_active`)))},H.prototype.pause=function(e){e&&this.name!==e||this.isPaused===!1&&(this.isPaused=!0,this.trigger(`_pause`),this._idle=!0,this.trigger(`_idle`),this.audioController.pause())},H.prototype.togglePause=function(e){e&&this.name!==e||(this.isPaused===!0?this.play():this.pause())},H.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},H.prototype.getMarkerData=function(e){for(var t,n=0;n=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger(`loopComplete`))):this.setCurrentRawFrameValue(t):t<0?this.checkSegments(t%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger(`loopComplete`):this._completedLoop=!0):(n=!0,t=0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger(`complete`))}},H.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger(`segmentStart`)},H.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,n!==-1&&this.goToAndStop(n,!0)},H.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),ye(e[0])===`object`){var n,r=e.length;for(n=0;n=0;--n)t[n].animation.destroy(e)}function T(e,t,n){var r=[].concat([].slice.call(document.getElementsByClassName(`lottie`)),[].slice.call(document.getElementsByClassName(`bodymovin`))),i,a=r.length;for(i=0;i0?n=c:t=c;while(Math.abs(s)>a&&++l=i?g(e,d,t,n):f===0?d:h(e,a,a+c,t,n)}},e}(),be=function(){function e(e){return e.concat(m(e.length))}return{double:e}}(),xe=function(){return function(e,t,n){var r=0,i=e,a=m(i),o={newElement:s,release:c};function s(){var e;return r?(--r,e=a[r]):e=t(),e}function c(e){r===i&&(a=be.double(a),i*=2),n&&n(e),a[r]=e,r+=1}return o}}(),Se=function(){function e(){return{addedLength:0,percents:p(`float32`,le()),lengths:p(`float32`,le())}}return xe(8,e)}(),Ce=function(){function e(){return{lengths:[],totalLength:0}}function t(e){var t,n=e.lengths.length;for(t=0;t-.001&&o<.001}function n(n,r,i,a,o,s,c,l,u){if(i===0&&s===0&&u===0)return t(n,r,a,o,c,l);var d=e.sqrt(e.pow(a-n,2)+e.pow(o-r,2)+e.pow(s-i,2)),f=e.sqrt(e.pow(c-n,2)+e.pow(l-r,2)+e.pow(u-i,2)),p=e.sqrt(e.pow(c-a,2)+e.pow(l-o,2)+e.pow(u-s,2)),m=d>f?d>p?d-f-p:p-f-d:p>f?p-f-d:f-d-p;return m>-1e-4&&m<1e-4}var r=function(){return function(e,t,n,r){var i=le(),a,o,s,c,l,u=0,d,f=[],p=[],m=Se.newElement();for(s=n.length,a=0;ao?-1:1,l=!0;l;)if(r[a]<=o&&r[a+1]>o?(s=(o-r[a])/(r[a+1]-r[a]),l=!1):a+=c,a<0||a>=i-1){if(a===i-1)return n[a];l=!1}return n[a]+(n[a+1]-n[a])*s}function l(t,n,r,i,a,o){var s=c(a,o),l=1-s;return[e.round((l*l*l*t[0]+(s*l*l+l*s*l+l*l*s)*r[0]+(s*s*l+l*s*s+s*l*s)*i[0]+s*s*s*n[0])*1e3)/1e3,e.round((l*l*l*t[1]+(s*l*l+l*s*l+l*l*s)*r[1]+(s*s*l+l*s*s+s*l*s)*i[1]+s*s*s*n[1])*1e3)/1e3]}var u=p(`float32`,8);function d(t,n,r,i,a,o,s){a<0?a=0:a>1&&(a=1);var l=c(a,s);o=o>1?1:o;var d=c(o,s),f,p=t.length,m=1-l,h=1-d,g=m*m*m,_=l*m*m*3,v=l*l*m*3,y=l*l*l,b=m*m*h,x=l*m*h+m*l*h+m*m*d,S=l*l*h+m*l*d+l*m*d,C=l*l*d,w=m*h*h,T=l*h*h+m*d*h+m*h*d,E=l*d*h+m*d*d+l*h*d,D=l*d*d,O=h*h*h,k=d*h*h+h*d*h+h*h*d,A=d*d*h+h*d*d+d*h*d,j=d*d*d;for(f=0;f=l.t-n){c.h&&(c=l),i=0;break}if(l.t-n>e){i=a;break}a=v||e=v?x.points.length-1:0;for(f=x.points[S].point.length,d=0;d=T&&C=v)r[0]=b[0],r[1]=b[1],r[2]=b[2];else if(e<=y)r[0]=c.s[0],r[1]=c.s[1],r[2]=c.s[2];else{var j=je(c.s),M=je(b),N=(e-y)/(v-y);Ae(r,ke(j,M,N))}else for(a=0;a=v?m=1:e1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-n)*f)/m,g=Math.sin(n*f)/m):(h=1-n,g=n),r[0]=h*i+g*c,r[1]=h*a+g*l,r[2]=h*o+g*u,r[3]=h*s+g*d,r}function Ae(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i),s=Math.asin(2*n*r+2*i*a),c=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i);e[0]=o/D,e[1]=s/D,e[2]=c/D}function je(e){var t=e[0]*D,n=e[1]*D,r=e[2]*D,i=Math.cos(t/2),a=Math.cos(n/2),o=Math.cos(r/2),s=Math.sin(t/2),c=Math.sin(n/2),l=Math.sin(r/2),u=i*a*o-s*c*l;return[s*c*o+i*a*l,s*a*o+i*c*l,i*c*o-s*a*l,u]}function Me(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==Ee&&(this._caching.lastFrame>=n&&e>=n||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function Ne(e){var t;if(this.propType===`unidimensional`)t=e*this.mult,De(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var n=0,r=this.v.length;n1e-5&&(this.v[n]=t,this._mdf=!0),n+=1}function Pe(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),n){case`v`:a=this.v;break;case`i`:a=this.i;break;case`o`:a=this.o;break;default:a=[];break}(!a[r]||a[r]&&!i)&&(a[r]=Ve.newElement()),a[r][0]=e,a[r][1]=t},He.prototype.setTripleAt=function(e,t,n,r,i,a,o,s){this.setXYAt(e,t,`v`,o,s),this.setXYAt(n,r,`o`,o,s),this.setXYAt(i,a,`i`,o,s)},He.prototype.reverse=function(){var e=new He;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var a=this._length-1,o=this._length,s;for(s=i;s=p[p.length-1].t-this.offsetTime)i=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],o=!0;else{for(var m=r,h=p.length-1,g=!0,_,v,y;g&&(_=p[m],v=p[m+1],!(v.t-this.offsetTime>e));)m=v.t-this.offsetTime)d=1;else if(e<_.t-this.offsetTime)d=0;else{var b;y.__fnct?b=y.__fnct:(b=W.getBezierEasing(_.o.x,_.o.y,_.i.x,_.i.y).get,y.__fnct=b),d=b((e-(_.t-this.offsetTime))/(v.t-this.offsetTime-(_.t-this.offsetTime)))}a=v.s?v.s[0]:_.e[0]}i=_.s[0]}for(l=t._length,u=i.i[0].length,n.lastIndex=r,s=0;sr&&t>r)||(this._caching.lastIndex=i0||e>-1e-6&&e<0?r(e*t)/t:e}function P(){var e=this.props,t=N(e[0]),n=N(e[1]),r=N(e[4]),i=N(e[5]),a=N(e[12]),o=N(e[13]);return`matrix(`+t+`,`+n+`,`+r+`,`+i+`,`+a+`,`+o+`)`}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=c,this.skew=u,this.skewFromAxis=d,this.shear=l,this.scale=f,this.setTransform=m,this.translate=h,this.transform=g,this.multiply=_,this.applyToPoint=S,this.applyToX=C,this.applyToY=w,this.applyToZ=T,this.applyToPointArray=A,this.applyToTriplePoints=k,this.applyToPointStringified=j,this.toCSS=M,this.to2dCSS=P,this.clone=b,this.cloneFromProps=x,this.equals=y,this.inversePoints=O,this.inversePoint=D,this.getInverseMatrix=E,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=p(`float32`,16),this.reset()}}();function qe(e){"@babel/helpers - typeof";return qe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},qe(e)}var q={},Je=`__[STANDALONE]__`,Ye=`__[ANIMATIONDATA]__`,Xe=``;function Ze(e){s(e)}function Qe(){Je===!0?U.searchAnimations(Ye,Je,Xe):U.searchAnimations()}function J(e){re(e)}function $e(e){ue(e)}function et(e){return Je===!0&&(e.animationData=JSON.parse(Ye)),U.loadAnimation(e)}function Y(e){if(typeof e==`string`)switch(e){case`high`:ce(200);break;default:case`medium`:ce(50);break;case`low`:ce(10);break}else!isNaN(e)&&e>1&&ce(e)}function tt(){return typeof navigator<`u`}function nt(e,t){e===`expressions`&&ae(t)}function rt(e){switch(e){case`propertyFactory`:return G;case`shapePropertyFactory`:return Ke;case`matrix`:return K;default:return null}}q.play=U.play,q.pause=U.pause,q.setLocationHref=Ze,q.togglePause=U.togglePause,q.setSpeed=U.setSpeed,q.setDirection=U.setDirection,q.stop=U.stop,q.searchAnimations=Qe,q.registerAnimation=U.registerAnimation,q.loadAnimation=et,q.setSubframeRendering=J,q.resize=U.resize,q.goToAndStop=U.goToAndStop,q.destroy=U.destroy,q.setQuality=Y,q.inBrowser=tt,q.installPlugin=nt,q.freeze=U.freeze,q.unfreeze=U.unfreeze,q.setVolume=U.setVolume,q.mute=U.mute,q.unmute=U.unmute,q.getRegisteredAnimations=U.getRegisteredAnimations,q.useWebWorker=a,q.setIDPrefix=$e,q.__getFactory=rt,q.version=`5.13.0`;function it(){document.readyState===`complete`&&(clearInterval(lt),Qe())}function at(e){for(var t=ot.split(`&`),n=0;n=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o=[],s,c=a.length,l;for(s=0;sr+n)){var u=l.s*i<=r?0:(l.s*i-r)/n,d=l.e*i>=r+n?1:(l.e*i-r)/n;o.push([u,d])}return o.length||o.push([0,0]),o},ft.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1+r:this.s.v<0?0+r:this.s.v+r,n=this.e.v>1?1+r:this.e.v<0?0+r:this.e.v+r,t>n){var i=t;t=n,n=i}t=Math.round(t*1e4)*1e-4,n=Math.round(n*1e4)*1e-4,this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,o,s=this.shapes.length,c,l,u,d,f,p=0;if(n===t)for(o=0;o=0;--o)if(h=this.shapes[o],h.shape._mdf){for(g=h.localShapeCollection,g.releaseShapes(),this.m===2&&s>1?(b=this.calculateShapeEdges(t,n,h.totalShapeLength,y,p),y+=h.totalShapeLength):b=[[_,v]],l=b.length,c=0;c=1?m.push({s:h.totalShapeLength*(_-1),e:h.totalShapeLength*(v-1)}):(m.push({s:h.totalShapeLength*_,e:h.totalShapeLength}),m.push({s:0,e:h.totalShapeLength*(v-1)}));var x=this.addShapes(h,m[0]);if(m[0].s!==m[0].e){if(m.length>1)if(h.shape.paths.shapes[h.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,g),x=this.addShapes(h,m[1],S)}else this.addPaths(x,g),x=this.addShapes(h,m[1]);this.addPaths(x,g)}}h.shape.paths=g}}else if(this._mdf)for(o=0;ot.e){n.c=!1;break}else t.s<=l&&t.e>=l+u.addedLength?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[s],i[a].v[s],n,d,g),g=!1):(p=Te.getNewSegment(i[a].v[s-1],i[a].v[s],i[a].o[s-1],i[a].i[s],(t.s-l)/u.addedLength,(t.e-l)/u.addedLength,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1),l+=u.addedLength,d+=1;if(i[a].c&&f.length){if(u=f[s-1],l<=t.e){var _=f[s-1].addedLength;t.s<=l&&t.e>=l+_?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[0],i[a].v[0],n,d,g),g=!1):(p=Te.getNewSegment(i[a].v[s-1],i[a].v[0],i[a].o[s-1],i[a].i[0],(t.s-l)/_,(t.e-l)/_,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1)}else n.c=!1;l+=u.addedLength,d+=1}if(n._length&&(n.setXYAt(n.v[h][0],n.v[h][1],`i`,h),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],`o`,n._length-1)),l>t.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(r[0]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),r[1]=o.getValueAtTime((o.keyframes[0].t+.01)/n,0),i[0]=a.getValueAtTime(a.keyframes[0].t/n,0),i[1]=o.getValueAtTime(o.keyframes[0].t/n,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(r[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),r[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/n,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/n,0)):(r=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/n,o.offsetTime))}else i=e,r=i;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function r(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function i(){}function a(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0}function o(e,t,n){if(this.elem=e,this.frameId=-1,this.propType=`transform`,this.data=t,this.v=new K,this.pre=new K,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=G.getProp(e,t.p.x,0,0,this),this.py=G.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=G.getProp(e,t.p.z,0,0,this))):this.p=G.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=G.getProp(e,t.rx,0,D,this),this.ry=G.getProp(e,t.ry,0,D,this),this.rz=G.getProp(e,t.rz,0,D,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r0;)--n,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ht.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(f):Math.ceil(f),h=this.pMatrix.props,g=this.rMatrix.props,_=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v=0;if(f>0){for(;vm;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),--v;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),v-=p)}r=this.data.m===1?0:this._currentCopies-1,i=this.data.m===1?1:-1,a=this._currentCopies;for(var y,b;a;){if(t=this.elemsData[r].it,n=t[t.length-1].transform.mProps.v.props,b=n.length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),v!==0){for((r!==0&&i===1||r!==this._currentCopies-1&&i===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15]),this.matrix.transform(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]),y=0;y0&&r<1?[t]:[]:[t-r,t+r].filter(function(e){return e>0&&e<1})},wt.prototype.split=function(e){if(e<=0)return[Ct(this.points[0]),this];if(e>=1)return[this,Ct(this.points[this.points.length-1])];var t=bt(this.points[0],this.points[1],e),n=bt(this.points[1],this.points[2],e),r=bt(this.points[2],this.points[3],e),i=bt(t,n,e),a=bt(n,r,e),o=bt(i,a,e);return[new wt(this.points[0],t,i,o,!0),new wt(o,a,r,this.points[3],!0)]};function Tt(e,t){var n=e.points[0][t],r=e.points[e.points.length-1][t];if(n>r){var i=r;r=n,n=i}for(var a=xt(3*e.a[t],2*e.b[t],e.c[t]),o=0;o0&&a[o]<1){var s=e.point(a[o])[t];sr&&(r=s)}return{min:n,max:r}}wt.prototype.bounds=function(){return{x:Tt(this,0),y:Tt(this,1)}},wt.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}};function Et(e,t,n){var r=e.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:e,t:(t+n)/2,t1:t,t2:n}}function Dt(e){var t=e.bez.split(.5);return[Et(t[0],e.t1,e.t),Et(t[1],e.t,e.t2)]}function Ot(e,t){return Math.abs(e.cx-t.cx)*2=a||e.width<=r&&e.height<=r&&t.width<=r&&t.height<=r){i.push([e.t,t.t]);return}var o=Dt(e),s=Dt(t);kt(o[0],s[0],n+1,r,i,a),kt(o[0],s[1],n+1,r,i,a),kt(o[1],s[0],n+1,r,i,a),kt(o[1],s[1],n+1,r,i,a)}}wt.prototype.intersections=function(e,t,n){t===void 0&&(t=2),n===void 0&&(n=7);var r=[];return kt(Et(this,0,1),Et(e,0,1),0,t,r,n),r},wt.shapeSegment=function(e,t){var n=(t+1)%e.length();return new wt(e.v[t],e.o[t],e.i[n],e.v[n],!0)},wt.shapeSegmentInverted=function(e,t){var n=(t+1)%e.length();return new wt(e.v[n],e.i[n],e.o[t],e.v[t],!0)};function At(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function jt(e,t,n,r){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],s=[r[0],r[1],1],c=At(At(i,a),At(o,s));return vt(c[2])?null:[c[0]/c[2],c[1]/c[2]]}function X(e,t,n){return[e[0]+Math.cos(t)*n,e[1]-Math.sin(t)*n]}function Mt(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function Nt(e,t){return _t(e[0],t[0])&&_t(e[1],t[1])}function Pt(){}u([dt],Pt),Pt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=G.getProp(e,t.s,0,null,this),this.frequency=G.getProp(e,t.r,0,null,this),this.pointsType=G.getProp(e,t.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function Ft(e,t,n,r,i,a,o){var s=n-Math.PI/2,c=n+Math.PI/2,l=t[0]+Math.cos(n)*r*i,u=t[1]-Math.sin(n)*r*i;e.setTripleAt(l,u,l+Math.cos(s)*a,u-Math.sin(s)*a,l+Math.cos(c)*o,u-Math.sin(c)*o,e.length())}function It(e,t){var n=[t[0]-e[0],t[1]-e[1]],r=-Math.PI*.5;return[Math.cos(r)*n[0]-Math.sin(r)*n[1],Math.sin(r)*n[0]+Math.cos(r)*n[1]]}function Lt(e,t){var n=t===0?e.length()-1:t-1,r=(t+1)%e.length(),i=e.v[n],a=e.v[r],o=It(i,a);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function Rt(e,t,n,r,i,a,o){var s=Lt(t,n),c=t.v[n%t._length],l=t.v[n===0?t._length-1:n-1],u=t.v[(n+1)%t._length],d=a===2?Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2):0,f=a===2?Math.sqrt((c[0]-u[0])**2+(c[1]-u[1])**2):0;Ft(e,t.v[n%t._length],s,o,r,f/((i+1)*2),d/((i+1)*2),a)}function zt(e,t,n,r,i,a){for(var o=0;o1&&t.length>1&&(i=Ut(e[0],t[t.length-1]),i)?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[n,r]}function Gt(e){for(var t,n=1;n1&&(t=Wt(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function Kt(e,t){var n=e.inflectionPoints(),r,i,a,o;if(n.length===0)return[Vt(e,t)];if(n.length===1||_t(n[1],1))return a=e.split(n[0]),r=a[0],i=a[1],[Vt(r,t),Vt(i,t)];a=e.split(n[0]),r=a[0];var s=(n[1]-n[0])/(1-n[0]);return a=a[1].split(s),o=a[0],i=a[1],[Vt(r,t),Vt(o,t),Vt(i,t)]}function qt(){}u([dt],qt),qt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=G.getProp(e,t.a,0,null,this),this.miterLimit=G.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=this.amount.effectsSequence.length!==0},qt.prototype.processPath=function(e,t,n,r){var i=Ue.newElement();i.c=e.c;var a=e.length();e.c||--a;var o,s,c,l=[];for(o=0;o=0;--o)c=wt.shapeSegmentInverted(e,o),l.push(Kt(c,t));l=Gt(l);var u=null,d=null;for(o=0;o0&&(o=!1),o){var u=l(`style`);u.setAttribute(`f-forigin`,n[r].fOrigin),u.setAttribute(`f-origin`,n[r].origin),u.setAttribute(`f-family`,n[r].fFamily),u.type=`text/css`,u.innerText=`@font-face {font-family: `+n[r].fFamily+`; font-style: normal; src: url('`+n[r].fPath+`');}`,t.appendChild(u)}}else if(n[r].fOrigin===`g`||n[r].origin===1){for(s=document.querySelectorAll(`link[f-forigin="g"], link[f-origin="1"]`),c=0;c=55296&&n<=56319){var r=e.charCodeAt(1);r>=56320&&r<=57343&&(t=(n-55296)*1024+r-56320+65536)}return t}function S(e,t){var n=e.toString(16)+t.toString(16);return d.indexOf(n)!==-1}function C(e){return e===s}function w(e){return e===o}function T(e){var t=x(e);return t>=c&&t<=u}function E(e){return T(e.substr(0,2))&&T(e.substr(2,2))}function D(e){return t.indexOf(e)!==-1}function O(e,t){var o=x(e.substr(t,2));if(o!==n)return!1;var s=0;for(t+=2;s<5;){if(o=x(e.substr(t,2)),oa)return!1;s+=1,t+=2}return x(e.substr(t,2))===r}function k(){this.isLoaded=!0}var A=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return A.isModifier=S,A.isZeroWidthJoiner=C,A.isFlagEmoji=E,A.isRegionalCode=T,A.isCombinedCharacter=D,A.isRegionalFlag=O,A.isVariationSelector=w,A.BLACK_FLAG_CODE_POINT=n,A.prototype={addChars:_,addFonts:g,getCharData:v,getFontByName:b,measureText:y,checkLoadedFonts:m,setIsLoaded:k},A}();function Xt(e){this.animationData=e}Xt.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e};function Zt(e){return new Xt(e)}function Qt(){}Qt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},mn.prototype.show=function(){},mn.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},mn.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},mn.prototype.resume=function(){this._canPlay=!0},mn.prototype.setRate=function(e){this.audio.rate(e)},mn.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},mn.prototype.getBaseElement=function(){return null},mn.prototype.destroy=function(){},mn.prototype.sourceRectAtTime=function(){},mn.prototype.initExpressions=function(){};function hn(){}hn.prototype.checkLayers=function(e){var t,n=this.layers.length,r;for(this.completeLayers=!0,t=n-1;t>=0;--t)this.elements[t]||(r=this.layers[t],r.ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t)),this.completeLayers=this.elements[t]?this.completeLayers:!1;this.checkPendingElements()},hn.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},hn.prototype.createCamera=function(){throw Error(`You're using a 3d camera. Try the html renderer.`)},hn.prototype.createAudio=function(e){return new mn(e,this.globalData,this)},hn.prototype.createFootage=function(e){return new pn(e,this.globalData,this)},hn.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e0&&(this.maskElement.setAttribute(`id`,p),this.element.maskedElement.setAttribute(b,`url(`+c()+`#`+p+`)`),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}vn.prototype.getMaskProperty=function(e){return this.viewData[e].prop},vn.prototype.renderFrame=function(e){var t=this.element.finalTransform.mat,n,r=this.masksProperties.length;for(n=0;n1&&(r+=` C`+t.o[i-1][0]+`,`+t.o[i-1][1]+` `+t.i[0][0]+`,`+t.i[0][1]+` `+t.v[0][0]+`,`+t.v[0][1]),n.lastPath!==r){var o=``;n.elem&&(t.c&&(o=e.inv?this.solidPath+r:r),n.elem.setAttribute(`d`,o)),n.lastPath=r}},vn.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var yn=function(){var e={};e.createFilter=t,e.createAlphaToLuminanceFilter=n;function t(e,t){var n=z(`filter`);return n.setAttribute(`id`,e),t!==!0&&(n.setAttribute(`filterUnits`,`objectBoundingBox`),n.setAttribute(`x`,`0%`),n.setAttribute(`y`,`0%`),n.setAttribute(`width`,`100%`),n.setAttribute(`height`,`100%`)),n}function n(){var e=z(`feColorMatrix`);return e.setAttribute(`type`,`matrix`),e.setAttribute(`color-interpolation-filters`,`sRGB`),e.setAttribute(`values`,`0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1`),e}return e}(),bn=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<`u`};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),xn={},Sn=`filter_result_`;function Cn(e){var t,n=`SourceGraphic`,r=e.data.ef?e.data.ef.length:0,i=I(),a=yn.createFilter(i,!0),o=0;this.filters=[];var s;for(t=0;t=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);--e);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n.01)return!1;n+=1}return!0},Rn.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)c=r.transformers[g].mProps._mdf||c,--h,--g;if(c)for(h=f-r.styles[u].lvl,g=r.transformers.length-1;h>0;)m.multiply(r.transformers[g].mProps.v),--h,--g}else m=e;if(p=r.sh.paths,o=p._length,c){for(s=``,a=0;a=1?v=.99:v<=-1&&(v=-.99);var y=g*v,b=Math.cos(_+t.a.v)*y+a[0],x=Math.sin(_+t.a.v)*y+a[1];r.setAttribute(`fx`,b),r.setAttribute(`fy`,x),i&&!t.g._collapsable&&(t.of.setAttribute(`fx`,b),t.of.setAttribute(`fy`,x))}}}function u(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute(`stroke-dasharray`,i.dashStr),r.pElem.setAttribute(`stroke-dashoffset`,i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute(`stroke`,`rgb(`+C(t.c.v[0])+`,`+C(t.c.v[1])+`,`+C(t.c.v[2])+`)`),(t.o._mdf||n)&&r.pElem.setAttribute(`stroke-opacity`,t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute(`stroke-width`,t.w.v),r.msElem&&r.msElem.setAttribute(`stroke-width`,t.w.v))}return n}();function Gn(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}u([dn,_n,wn,kn,Tn,fn,En],Gn),Gn.prototype.initSecondaryElement=function(){},Gn.prototype.identityMatrix=new K,Gn.prototype.buildExpressionInterface=function(){},Gn.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Gn.prototype.filterUniqueShapes=function(){var e,t=this.shapes.length,n,r,i=this.stylesList.length,a,o=[],s=!1;for(r=0;r1&&s&&this.setShapesAsAnimated(o)}},Gn.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;--c){if(g=this.searchProcessedElement(e[c]),g?t[c]=n[g-1]:e[c]._render=o,e[c].ty===`fl`||e[c].ty===`st`||e[c].ty===`gf`||e[c].ty===`gs`||e[c].ty===`no`)g?t[c].style.closed=e[c].hd:t[c]=this.createStyleElement(e[c],i),e[c]._render&&t[c].style.pElem.parentNode!==r&&r.appendChild(t[c].style.pElem),f.push(t[c].style);else if(e[c].ty===`gr`){if(!g)t[c]=this.createGroupElement(e[c]);else for(d=t[c].it.length,u=0;u1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},qn.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},qn.prototype.getValue=function(e){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!e)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var r,i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(r=0;rt);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},qn.prototype.buildFinalText=function(e){for(var t=[],n=0,r=e.length,i,a,o=!1,s=!1,c=``;n=55296&&i<=56319?Yt.isRegionalFlag(e,n)?c=e.substr(n,14):(a=e.charCodeAt(n+1),a>=56320&&a<=57343&&(Yt.isModifier(i,a)?(c=e.substr(n,2),o=!0):c=Yt.isFlagEmoji(e.substr(n,4))?e.substr(n,4):e.substr(n,2))):i>56319?(a=e.charCodeAt(n+1),Yt.isVariationSelector(i)&&(o=!0)):Yt.isZeroWidthJoiner(i)&&(o=!0,s=!0),o?(t[t.length-1]+=c,o=!1):t.push(c),n+=c.length;return t},qn.prototype.completeTextData=function(e){e.__complete=!0;var t=this.elem.globalData.fontManager,n=this.data,r=[],i,a,o,s=0,c,l=n.m.g,u=0,d=0,f=0,p=[],m=0,h=0,g,_,v=t.getFontByName(e.f),y,b=0,x=Jt(v);e.fWeight=x.weight,e.fStyle=x.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),a=e.finalText.length,e.finalLineHeight=e.lh;var S=e.tr/1e3*e.finalSize,C;if(e.sz)for(var w=!0,T=e.sz[0],E=e.sz[1],D,O;w;){O=this.buildFinalText(e.t),D=0,m=0,a=O.length,S=e.tr/1e3*e.finalSize;var k=-1;for(i=0;iT&&O[i]!==` `?(k===-1?a+=1:i=k,D+=e.finalLineHeight||e.finalSize*1.2,O.splice(i,+(k===i),`\r`),k=-1,m=0):(m+=b,m+=S);D+=v.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Eh?m:h,m=-2*S,c=``,o=!0,f+=1):c=j,t.chars?(y=t.getCharData(j,v.fStyle,t.getFontByName(e.f).fFamily),b=o?0:y.w*e.finalSize/100):b=t.measureText(c,e.f,e.finalSize),j===` `?A+=b+S:(m+=b+S+A,A=0),r.push({l:b,an:b,add:u,n:o,anIndexes:[],val:c,line:f,animatorJustifyOffset:0}),l==2){if(u+=b,c===``||c===` `||i===a-1){for((c===``||c===` `)&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;s+=1,u=0}}else if(l==3){if(u+=b,c===``||i===a-1){for(c===``&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;u=0,s+=1}}else r[s].ind=s,r[s].extra=0,s+=1;if(e.l=r,h=m>h?m:h,p.push(m),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=h,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=p;var M=n.a,N,P;_=M.length;var F,I,L=[];for(g=0;g<_;g+=1){for(N=M[g],N.a.sc&&(e.strokeColorAnim=!0),N.a.sw&&(e.strokeWidthAnim=!0),(N.a.fc||N.a.fh||N.a.fs||N.a.fb)&&(e.fillColorAnim=!0),I=0,F=N.s.b,i=0;i0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var c=W.getBezierEasing(i,a,o,s).get,l=0,u=this.finalS,d=this.finalE,f=this.data.sh;if(f===2)l=d===u?+(r>=d):e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===3)l=d===u?r>=d?0:1:1-e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===4)d===u?l=0:(l=e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l<.5?l*=2:l=1-2*(l-.5)),l=c(l);else if(f===5){if(d===u)l=0;else{var p=d-u;r=t(e(0,r+.5-u),d-u);var m=-p/2+r,h=p/2;l=Math.sqrt(1-m*m/(h*h))}l=c(l)}else f===6?(d===u?l=0:(r=t(e(0,r+.5-u),d-u),l=(1+Math.cos(Math.PI+Math.PI*2*r/(d-u)))/2),l=c(l)):(r>=n(u)&&(l=r-u<0?e(0,t(t(d,1)-(u-r),1)):e(0,t(d-r,1))),l=c(l));if(this.sm.v!==100){var g=this.sm.v*.01;g===0&&(g=1e-8);var _=.5-g*.5;l<_?l=0:(l=(l-_)/g,l>1&&(l=1))}return l*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&this.data.r===2&&(this.e.v=this._currentTextLength);var t=this.data.r===2?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var a=r;r=i,i=a}this.finalS=r,this.finalE=i}},u([Be],r);function i(e,t,n){return new r(e,t,n)}return{getTextSelectorProp:i}}();function Yn(e,t,n){var r={propType:!1},i=G.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,D,n):r,rx:a.rx?i(e,a.rx,0,D,n):r,ry:a.ry?i(e,a.ry,0,D,n):r,sk:a.sk?i(e,a.sk,0,D,n):r,sa:a.sa?i(e,a.sa,0,D,n):r,s:a.s?i(e,a.s,1,.01,n):r,a:a.a?i(e,a.a,1,0,n):r,o:a.o?i(e,a.o,0,.01,n):r,p:a.p?i(e,a.p,1,0,n):r,sw:a.sw?i(e,a.sw,0,0,n):r,sc:a.sc?i(e,a.sc,1,0,n):r,fc:a.fc?i(e,a.fc,1,0,n):r,fh:a.fh?i(e,a.fh,0,0,n):r,fs:a.fs?i(e,a.fs,0,.01,n):r,fb:a.fb?i(e,a.fb,0,.01,n):r,t:a.t?i(e,a.t,0,0,n):r},this.s=Jn.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function Xn(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=m(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}Xn.prototype.searchProperties=function(){var e,t=this._textData.a.length,n,r=G.getProp;for(e=0;e=m+be||!x?(T=(m+be-g)/h.partialLength,ie=b.point[0]+(h.point[0]-b.point[0])*T,ae=b.point[1]+(h.point[1]-b.point[1])*T,a.translate(-n[0]*f[u].an*.005,-(n[1]*A)*.01),_=!1):x&&(g+=h.partialLength,v+=1,v>=x.length&&(v=0,y+=1,S[y]?x=S[y].points:D.v.c?(v=0,y=0,x=S[y].points):(g-=h.partialLength,x=null)),x&&(b=h,h=x[v],C=h.partialLength));re=f[u].an/2-f[u].add,a.translate(-re,0,0)}else re=f[u].an/2-f[u].add,a.translate(-re,0,0),a.translate(-n[0]*f[u].an*.005,-n[1]*A*.01,0);for(P=0;Pe?this.textSpans[e].span:z(s?`g`:`text`),b<=e){if(c.setAttribute(`stroke-linecap`,`butt`),c.setAttribute(`stroke-linejoin`,`round`),c.setAttribute(`stroke-miterlimit`,`4`),this.textSpans[e].span=c,s){var S=z(`g`);c.appendChild(S),this.textSpans[e].childSpan=S}this.textSpans[e].span=c,this.layerElement.appendChild(c)}c.style.display=`inherit`}if(l.reset(),d&&(o[e].n&&(f=-g,p+=n.yOffset,p+=+!!h,h=!1),this.applyTextPropertiesToMatrix(n,l,o[e].line,f,p),f+=o[e].l||0,f+=g),s){x=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily);var C;if(x.t===1)C=new ir(x.data,this.globalData,this);else{var w=Qn;x.data&&x.data.shapes&&(w=this.buildShapeData(x.data,n.finalSize)),C=new Gn(w,this.globalData,this)}if(this.textSpans[e].glyph){var T=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(T.layerElement),T.destroy()}this.textSpans[e].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[e].childSpan.appendChild(C.layerElement),x.t===1&&this.textSpans[e].childSpan.setAttribute(`transform`,`scale(`+n.finalSize/100+`,`+n.finalSize/100+`)`)}else d&&c.setAttribute(`transform`,`translate(`+l.props[12]+`,`+l.props[13]+`)`),c.textContent=o[e].val,c.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`)}d&&c&&c.setAttribute(`d`,u)}for(;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;--n)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},rr.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=0;--n)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t=1){this.buffers=[];var e=this.globalData.canvasContext,t=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&lr.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new dr(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=$t(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new fr(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(gn.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext(`2d`);this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext(`2d`);if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById(`tp`in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=lr.getLumaCanvas(this.canvasContext.canvas);n.getContext(`2d`).drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=mr[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation=`destination-over`,this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation=`source-over`}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&=!1}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new K},pr.prototype.hide=pr.prototype.hideElement,pr.prototype.show=pr.prototype.showElement;function hr(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i=4;t.ty===`rc`?i=5:t.ty===`el`?i=6:t.ty===`sr`&&(i=7),this.sh=Ke.getShapeProp(e,t,i,e);var a,o=n.length,s;for(a=0;a=0;--a){if(d=this.searchProcessedElement(e[a]),d?t[a]=n[d-1]:e[a]._shouldRender=r,e[a].ty===`fl`||e[a].ty===`st`||e[a].ty===`gf`||e[a].ty===`gs`)d?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],m),l.push(t[a].style);else if(e[a].ty===`gr`){if(!d)t[a]=this.createGroupElement(e[a]);else for(c=t[a].it.length,s=0;s=0;--i)t[i].ty===`tr`?(o=n[i].transform,this.renderShapeTransform(e,o)):t[i].ty===`sh`||t[i].ty===`el`||t[i].ty===`rc`||t[i].ty===`sr`?this.renderPath(t[i],n[i]):t[i].ty===`fl`?this.renderFill(t[i],n[i],o):t[i].ty===`st`?this.renderStroke(t[i],n[i],o):t[i].ty===`gf`||t[i].ty===`gs`?this.renderGradientFill(t[i],n[i],o):t[i].ty===`gr`?this.renderShape(o,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},gr.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n=e.trNodes,r=t.paths,i,a,o,s=r._length;n.length=0;var c=e.transforms.finalTransform;for(o=0;o=1?u=.99:u<=-1&&(u=-.99);var d=c*u,f=Math.cos(l+t.a.v)*d+o[0],p=Math.sin(l+t.a.v)*d+o[1];i=a.createRadialGradient(f,p,0,o[0],o[1],c)}var m,h=e.g.p,g=t.g.c,_=1;for(m=0;ma&&c===`xMidYMid slice`||ii&&s===`meet`||ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:l===`xMax`&&(ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u===`YMid`&&(a>i&&s===`meet`||ai&&s===`meet`||a=0;--e)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},Z.prototype.renderFrame=function(e,t){if(!(this.renderedFrame===e&&this.renderConfig.clearCanvas===!0&&!t||this.destroyed||e===-1)){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n,r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},Z.prototype.buildItem=function(e){var t=this.elements;if(!(t[e]||this.layers[e].ty===99)){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},Z.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},Z.prototype.hide=function(){this.animationItem.container.style.display=`none`},Z.prototype.show=function(){this.animationItem.container.style.display=`block`};function br(){this.opacity=-1,this.transform=p(`float32`,16),this.fillStyle=``,this.strokeStyle=``,this.lineWidth=``,this.lineCap=``,this.lineJoin=``,this.miterLimit=``,this.id=Math.random()}function xr(){this.stack=[],this.cArrPos=0,this.cTr=new K;var e,t=15;for(e=0;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Sr.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;--e)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},Sr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)};function Cr(e,t){this.animationItem=e,this.renderConfig={clearCanvas:t&&t.clearCanvas!==void 0?t.clearCanvas:!0,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||`xMidYMid meet`,imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||`xMidYMid slice`,contentVisibility:t&&t.contentVisibility||`visible`,className:t&&t.className||``,id:t&&t.id||``,runExpressions:!t||t.runExpressions===void 0||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new xr,this.elements=[],this.pendingElements=[],this.transformMat=new K,this.completeLayers=!1,this.rendererType=`canvas`,this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}return u([Z],Cr),Cr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)},ge(`canvas`,Cr),ut.registerModifier(`tm`,ft),ut.registerModifier(`pb`,pt),ut.registerModifier(`rp`,ht),ut.registerModifier(`rd`,gt),ut.registerModifier(`zz`,Pt),ut.registerModifier(`op`,qt),q}))}))(),1),Tt=0,Et=e=>`${e}-${++Tt}`,Dt=[{center:`#6f5bea`,edge:`#34278f`,pattern:`#a89df5`,text:`#ffffff`},{center:`#32a86b`,edge:`#17613e`,pattern:`#8ee0b3`,text:`#ffffff`},{center:`#df8d2f`,edge:`#8c421e`,pattern:`#ffd08a`,text:`#ffffff`},{center:`#d95878`,edge:`#7b2944`,pattern:`#f5a1b6`,text:`#ffffff`}];function Ot(e){if(!e.length)return e;let t=Math.floor(1e3/e.length),n=1e3%e.length;return e.map((e,r)=>({...e,rarity:String(t+ +(r({key:Et(e),name:``,rarity:`1`,sortOrder:String(t),file:null,animation:null,fileError:``});function At(e){let t=e.reduce((e,t)=>{let n=Number(t.backdropID);return Number.isInteger(n)?Math.max(e,n):e},0)+1,n=Dt[e.length%Dt.length];return{key:Et(`backdrop`),name:``,backdropID:String(t),rarity:`1`,sortOrder:String(e.length),...n}}var jt=e=>Ot([kt(e,0),kt(e,1)]),X=()=>{let e=At([]);return Ot([e,At([e])])};function Mt({data:e,compact:t=!1}){let n=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!n.current)return;let t=wt.default.loadAnimation({container:n.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)});return()=>t.destroy()},[e]),(0,W.jsx)(`div`,{className:`collectible-animation ${t?`compact`:``}`,ref:n})}function Nt({giftID:e,attribute:t}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let n=!1;return a(!1),x.giftCollectibleAnimation(e,t.kind,t.id).then(e=>{n||r(e)}).catch(()=>{n||a(!0)}),()=>{n=!0}},[e,t.id,t.kind]),i?(0,W.jsx)(`div`,{className:`collectible-animation compact failed`,children:`!`}):n?(0,W.jsx)(Mt,{data:n,compact:!0}):(0,W.jsx)(`div`,{className:`collectible-animation compact loading`,children:(0,W.jsx)(A,{className:`spin`,size:15})})}async function Pt(e){let t=new Uint8Array(await e.arrayBuffer()),n=t;if(t.length>=2&&t[0]===31&&t[1]===139){if(!(`DecompressionStream`in window))throw Error(`This browser cannot preview TGS files`);let e=new Blob([t]).stream().pipeThrough(new DecompressionStream(`gzip`));n=new Uint8Array(await new Response(e).arrayBuffer())}let r=JSON.parse(new TextDecoder().decode(n));if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`Invalid Lottie JSON`);return r}var Ft=e=>Number.parseInt(e.replace(`#`,``),16),It=e=>e.rarity_kind===`permille`?`${e.rarity_permille}‰`:e.rarity_kind;function Lt({gift:e,onClose:t,onPublished:n}){let{t:r}=we(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!0),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(`100`),[_,v]=(0,g.useState)(`1000`),[y,S]=(0,g.useState)(`gift-${e.GiftID}`),[C,w]=(0,g.useState)(``),[T,E]=(0,g.useState)(()=>jt(`model`)),[D,O]=(0,g.useState)(()=>jt(`pattern`)),[M,N]=(0,g.useState)(X);(0,g.useEffect)(()=>{let t=!1;return x.giftCollectibles(e.GiftID).then(n=>{t||(a(n),n.found&&(h(String(n.upgrade_stars??100)),v(String(n.supply_total??1e3)),S(n.slug_prefix??`gift-${e.GiftID}`)))}).catch(e=>d(b(e))).finally(()=>{t||s(!1)}),()=>{t=!0}},[e.GiftID]);let P=(0,g.useMemo)(()=>({models:T.reduce((e,t)=>e+Number(t.rarity||0),0),patterns:D.reduce((e,t)=>e+Number(t.rarity||0),0),backdrops:M.reduce((e,t)=>e+Number(t.rarity||0),0)}),[T,D,M]),F=()=>p(null),I=(e,t,n)=>{(e===`models`?E:O)(e=>e.map(e=>e.key===t?{...e,...n}:e)),F()};async function L(e,t,n){if(I(e,t.key,{file:n,animation:null,fileError:``}),n)try{let r=await Pt(n);I(e,t.key,{animation:r,fileError:``})}catch(n){I(e,t.key,{animation:null,fileError:b(n)})}}function ee(e,t=``){if(!C.trim())throw Error(r(`action.reasonRequired`));if(T.length<2||D.length<2||M.length<2)throw Error(r(`collectibles.minimumAttributes`));let n=M.map(e=>Number(e.backdropID));if(new Set(n).size!==n.length)throw Error(r(`collectibles.duplicateBackdropID`));for(let e of[...T,...D])if(!e.file)throw Error(r(`collectibles.fileRequired`));let i=new FormData,a=e=>e.map(e=>({name:e.name.trim(),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),file_key:e.key}));i.set(`metadata`,JSON.stringify({command_id:t,reason:C.trim(),confirm:e,upgrade_stars:m,supply_total:Number(_),slug_prefix:y.trim().toLowerCase(),models:a(T),patterns:a(D),backdrops:M.map(e=>({name:e.name.trim(),backdrop_id:Number(e.backdropID),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),center_color:Ft(e.center),edge_color:Ft(e.edge),pattern_color:Ft(e.pattern),text_color:Ft(e.text)}))}));for(let e of[...T,...D])i.set(e.key,e.file,e.file.name);return i}async function te(){l(!0),d(``),p(null);try{p(await x.publishGiftCollectibles(e.GiftID,ee(!1)))}catch(e){d(b(e))}finally{l(!1)}}async function re(){if(f){l(!0),d(``);try{await x.publishGiftCollectibles(e.GiftID,ee(!0,f.command_id)),n(),t()}catch(e){d(b(e))}finally{l(!1)}}}let ie=(e,t,n)=>(0,W.jsxs)(`section`,{className:`collectible-section`,children:[(0,W.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.${e}`)}),(0,W.jsx)(`span`,{children:r(`collectibles.rarityHint`)})]}),(0,W.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,W.jsxs)(J,{tone:P[e]>0?`good`:`neutral`,children:[P[e],`‰`]}),(0,W.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{n(Ot([...t,kt(e===`models`?`model`:`pattern`,t.length)])),F()},children:[(0,W.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,W.jsx)(`div`,{className:`collectible-rows`,children:t.map((i,a)=>(0,W.jsxs)(`div`,{className:`collectible-row animated`,children:[(0,W.jsx)(`div`,{className:`collectible-row-index`,children:a+1}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`common.name`)}),(0,W.jsx)(`input`,{value:i.name,maxLength:128,onChange:t=>I(e,i.key,{name:t.target.value})})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:i.rarity,onChange:t=>I(e,i.key,{rarity:t.target.value})})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,W.jsx)(`input`,{type:`number`,value:i.sortOrder,onChange:t=>I(e,i.key,{sortOrder:t.target.value})})]}),(0,W.jsxs)(`label`,{className:`collectible-file`,children:[(0,W.jsx)(`span`,{children:r(`gifts.animation`)}),(0,W.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:t=>void L(e,i,t.target.files?.[0]??null)}),(0,W.jsxs)(`em`,{children:[(0,W.jsx)(R,{size:13}),i.file?.name??r(`gifts.chooseFile`)]})]}),(0,W.jsx)(`div`,{className:`collectible-inline-preview`,children:i.animation?(0,W.jsx)(Mt,{data:i.animation,compact:!0}):(0,W.jsx)(j,{size:16})}),(0,W.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:t.length<=2,onClick:()=>{n(Ot(t.filter(e=>e.key!==i.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,W.jsx)(_e,{size:14})}),i.fileError&&(0,W.jsx)(`span`,{className:`collectible-file-error`,children:i.fileError})]},i.key))})]});return(0,ot.createPortal)((0,W.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,W.jsxs)(`section`,{className:`modal command-modal collectible-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`collectibles.title`,{id:e.GiftID}),children:[(0,W.jsxs)(`div`,{className:`modal-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:r(`collectibles.eyebrow`)}),(0,W.jsx)(`h2`,{children:r(`collectibles.title`,{id:e.GiftID})}),(0,W.jsx)(`p`,{children:e.Title||`Gift #${e.GiftID}`})]}),(0,W.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:t,disabled:c,"aria-label":r(`action.close`),children:(0,W.jsx)(H,{size:15})})]}),(0,W.jsxs)(`div`,{className:`command-body collectible-modal-body`,children:[o?(0,W.jsxs)(`div`,{className:`collectible-loading`,children:[(0,W.jsx)(A,{className:`spin`}),r(`common.loading`)]}):i?.found?(0,W.jsxs)(`section`,{className:`collectible-active`,children:[(0,W.jsxs)(`div`,{className:`collectible-active-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(ne,{size:18}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.activeRevision`,{revision:i.revision??0})}),(0,W.jsxs)(`span`,{children:[i.slug_prefix,` · ⭐ `,i.upgrade_stars,` · `,i.issued,` / `,i.supply_total]})]})]}),(0,W.jsx)(J,{tone:`good`,children:r(`collectibles.published`)})]}),(0,W.jsxs)(`div`,{className:`collectible-active-grid`,children:[[...i.models??[],...i.patterns??[]].map(t=>(0,W.jsxs)(`article`,{children:[(0,W.jsx)(Nt,{giftID:e.GiftID,attribute:t}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`strong`,{children:[t.name,t.crafted&&(0,W.jsx)(J,{children:`crafted`})]}),(0,W.jsxs)(`span`,{children:[r(`collectibles.${t.kind}`),` · `,It(t)]})]})]},`${t.kind}-${t.id}`)),(i.backdrops??[]).map(e=>(0,W.jsxs)(`article`,{children:[(0,W.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, #${(e.center_color??0).toString(16).padStart(6,`0`)}, #${(e.edge_color??0).toString(16).padStart(6,`0`)})`,color:`#${(e.text_color??16777215).toString(16).padStart(6,`0`)}`},children:`Aa`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:e.name}),(0,W.jsxs)(`span`,{children:[r(`collectibles.backdrop`),` · `,It(e)]})]})]},`backdrop-${e.id}`))]})]}):(0,W.jsxs)(`div`,{className:`collectible-empty`,children:[(0,W.jsx)(ne,{size:22}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.noPool`)}),(0,W.jsx)(`span`,{children:r(`collectibles.noPoolHint`)})]})]}),(0,W.jsxs)(`section`,{className:`collectible-definition`,children:[(0,W.jsxs)(`div`,{className:`collectible-definition-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.publishNew`)}),(0,W.jsx)(`span`,{children:r(`collectibles.immutableHint`)})]}),(0,W.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,W.jsx)(`span`,{children:`TGS`}),(0,W.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,W.jsxs)(`div`,{className:`gift-fields-grid collectible-main-fields`,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.upgradeStars`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:m,onChange:e=>{h(e.target.value),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.supply`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:_,onChange:e=>{v(e.target.value),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.slug`)}),(0,W.jsx)(`input`,{value:y,maxLength:48,onChange:e=>{S(e.target.value.toLowerCase()),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`gifts.reason`)}),(0,W.jsx)(`input`,{value:C,maxLength:1e3,placeholder:r(`gifts.reasonPlaceholder`),onChange:e=>w(e.target.value)})]})]}),ie(`models`,T,E),ie(`patterns`,D,O),(0,W.jsxs)(`section`,{className:`collectible-section`,children:[(0,W.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.backdrops`)}),(0,W.jsx)(`span`,{children:r(`collectibles.colorHint`)})]}),(0,W.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,W.jsxs)(J,{tone:P.backdrops>0?`good`:`neutral`,children:[P.backdrops,`‰`]}),(0,W.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{N(Ot([...M,At(M)])),F()},children:[(0,W.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,W.jsx)(`div`,{className:`collectible-rows`,children:M.map((e,t)=>(0,W.jsxs)(`div`,{className:`collectible-row backdrop`,children:[(0,W.jsx)(`div`,{className:`collectible-row-index`,children:t+1}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`common.name`)}),(0,W.jsx)(`input`,{value:e.name,maxLength:128,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,name:t.target.value}:n)),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.backdropID`)}),(0,W.jsx)(`input`,{type:`number`,min:`0`,value:e.backdropID,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,backdropID:t.target.value}:n)),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:e.rarity,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,rarity:t.target.value}:n)),F()}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,W.jsx)(`input`,{type:`number`,value:e.sortOrder,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,sortOrder:t.target.value}:n)),F()}})]}),[`center`,`edge`,`pattern`,`text`].map(t=>(0,W.jsxs)(`label`,{className:`collectible-color`,children:[(0,W.jsx)(`span`,{children:r(`collectibles.color.${t}`)}),(0,W.jsx)(`input`,{type:`color`,value:e[t],onChange:n=>{N(M.map(r=>r.key===e.key?{...r,[t]:n.target.value}:r)),F()}})]},t)),(0,W.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, ${e.center}, ${e.edge})`,color:e.text},children:`Aa`}),(0,W.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:M.length<=2,onClick:()=>{N(Ot(M.filter(t=>t.key!==e.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,W.jsx)(_e,{size:14})})]},e.key))})]})]}),u&&(0,W.jsx)(Qe,{children:u}),f&&(0,W.jsxs)(`div`,{className:`gift-validation`,children:[(0,W.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,W.jsx)(k,{size:17}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:r(`collectibles.validationReady`)}),(0,W.jsx)(`span`,{children:r(`collectibles.validationHint`)})]})]}),(0,W.jsx)(`pre`,{children:JSON.stringify(f.details,null,2)})]})]}),(0,W.jsxs)(`div`,{className:`modal-actions`,children:[(0,W.jsx)(`button`,{className:`btn`,type:`button`,onClick:t,disabled:c,children:r(`common.close`)}),(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:te,disabled:c,children:[c?(0,W.jsx)(A,{className:`spin`,size:15}):(0,W.jsx)(pe,{size:15}),r(`gifts.validate`)]}),(0,W.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:re,disabled:c||!f,children:[(0,W.jsx)(ve,{size:15}),r(`collectibles.publish`)]})]})]})}),document.body)}function Rt(e){return e.model_count+e.pattern_count+e.backdrop_count}function zt(e){let t=Number(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Bt({giftID:e,revision:t,compact:n=!1}){let r=(0,g.useRef)(null),i=(0,g.useRef)(null),[a,o]=(0,g.useState)(!0),[s,c]=(0,g.useState)(``);(0,g.useEffect)(()=>{let t=!1;return x.giftAnimation(e).then(e=>{t||!r.current||(i.current?.destroy(),i.current=wt.default.loadAnimation({container:r.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(e=>c(b(e))),()=>{t=!0,i.current?.destroy(),i.current=null}},[e,t]);function l(){i.current&&(a?i.current.pause():i.current.play(),o(!a))}return(0,W.jsxs)(`div`,{className:`gift-animation-shell ${n?`compact`:``}`,children:[(0,W.jsx)(`div`,{className:`gift-animation`,ref:r,children:s&&(0,W.jsx)(`span`,{children:s})}),(0,W.jsx)(`button`,{className:`gift-play`,type:`button`,onClick:l,"aria-label":a?`Pause`:`Play`,children:a?(0,W.jsx)(ue,{size:14}):(0,W.jsx)(z,{size:14})})]})}function Vt({sourceGiftID:e}){let t=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let n=!1,r=null;return x.officialGiftAnimation(e).then(e=>{n||!t.current||(r=wt.default.loadAnimation({container:t.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(()=>void 0),()=>{n=!0,r?.destroy()}},[e]),(0,W.jsx)(`div`,{className:`gift-animation-shell`,children:(0,W.jsx)(`div`,{className:`gift-animation`,ref:t})})}function Ht(){let{t:e}=we(),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`official`),[p,m]=(0,g.useState)([]),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!0),[E,D]=(0,g.useState)(`0`),[O,j]=(0,g.useState)(`0`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(`0`),[I,L]=(0,g.useState)(``),[ee,te]=(0,g.useState)(`50`),[re,ie]=(0,g.useState)(`50`),[ae,oe]=(0,g.useState)(`0`),[se,ce]=(0,g.useState)(!0),[le,ue]=(0,g.useState)(``),[z,fe]=(0,g.useState)(null),[me,he]=(0,g.useState)(!1),[ge,_e]=(0,g.useState)(``),[ye,U]=(0,g.useState)(``);async function be(){_e(``);try{n((await x.gifts()).Gifts??[])}catch(e){_e(b(e))}}(0,g.useEffect)(()=>{be()},[]),(0,g.useEffect)(()=>{!a||d!==`official`||p.length>0||x.officialGifts().then(e=>m(e.gifts??[])).catch(e=>U(b(e)))},[a,d,p.length]);let xe=(0,g.useMemo)(()=>p.find(e=>e.source_gift_id===S)??null,[p,S]),Se=(0,g.useMemo)(()=>({all:p.length,upgrade:p.filter(e=>e.can_upgrade).length,craft:p.filter(e=>e.can_craft).length,basic:p.filter(e=>!e.can_upgrade).length}),[p]),Ce=(0,g.useMemo)(()=>{let e=h.trim().toLowerCase();return p.filter(t=>(v===`all`||v===`upgrade`&&t.can_upgrade||v===`craft`&&t.can_craft||v===`basic`&&!t.can_upgrade)&&(!e||t.source_gift_id.includes(e)||t.title.toLowerCase().includes(e)))},[p,h,v]),Te=(0,g.useMemo)(()=>{let e=r.trim().toLowerCase();return e?t.filter(t=>String(t.GiftID).includes(e)||t.Title.toLowerCase().includes(e)||t.SourceFormat.toLowerCase().includes(e)):t},[t,r]);function Ee(t,n=``){if(!l)throw Error(e(`gifts.fileRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));let r=new FormData;return r.set(`metadata`,JSON.stringify({command_id:n,reason:le.trim(),confirm:t,gift_id:P,title:I.trim(),stars:ee,convert_stars:re,enabled:se,sort_order:Number(ae)})),r.set(`file`,l,l.name),r}function De(t,n=``){if(!S)throw Error(e(`gifts.officialRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));return{command_id:n,reason:le.trim(),confirm:t,source_gift_id:S,gift_id:P,title:I.trim(),stars:ee,convert_stars:re,enabled:se,sort_order:Number(ae),include_collectible:w,upgrade_stars:E,supply_total:Number(O),slug_prefix:M.trim().toLowerCase()}}function Oe(t){C(t.source_gift_id),L(t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})),te(String(t.stars)),ie(String(t.convert_stars)),T(t.can_upgrade),D(t.upgrade_stars),j(String(t.availability_total||1)),N(`official-${t.source_gift_id}`),fe(null)}async function ke(){he(!0),U(``),fe(null);try{fe(d===`official`?await x.importOfficialGift(De(!1)):await x.importGift(Ee(!1)))}catch(e){U(b(e))}finally{he(!1)}}async function Ae(){if(z){he(!0),U(``);try{d===`official`?await x.importOfficialGift(De(!0,z.command_id)):await x.importGift(Ee(!0,z.command_id)),fe(null),u(null),F(`0`),L(``),C(``),await be(),o(!1)}catch(e){U(b(e))}finally{he(!1)}}}function je(){F(`0`),L(``),te(`50`),ie(`50`),oe(`0`),ce(!0),ue(``),u(null),fe(null),U(``),f(`official`),C(``),_(``),y(`all`),o(!0)}function Me(e){F(e.GiftID),L(e.Title),te(String(e.Stars)),ie(String(e.ConvertStars)),oe(String(e.SortOrder)),ce(e.Enabled),ue(``),u(null),fe(null),U(``),f(`official`),C(``),_(``),y(`all`),o(!0)}return(0,W.jsxs)(Je,{title:e(`gifts.pageTitle`),eyebrow:e(`gifts.eyebrow`),actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>be(),disabled:me,children:[(0,W.jsx)(B,{size:15}),` `,e(`common.refresh`)]}),(0,W.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:je,children:[(0,W.jsx)(de,{size:15}),` `,e(`gifts.add`)]})]}),children:[ge&&(0,W.jsx)(Qe,{children:ge}),(0,W.jsxs)(`div`,{className:`metric-row gift-metrics`,children:[(0,W.jsx)(et,{label:e(`gifts.total`),value:String(t.length)}),(0,W.jsx)(et,{label:e(`gifts.enabled`),value:String(t.filter(e=>e.Enabled).length),tone:`good`}),(0,W.jsx)(et,{label:e(`gifts.received`),value:t.reduce((e,t)=>e+BigInt(t.ReceivedCount),0n).toString()}),(0,W.jsx)(et,{label:e(`gifts.formats`),value:`TGS / Lottie`})]}),(0,W.jsx)(Ye,{children:(0,W.jsxs)(`div`,{className:`toolbar`,children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:e(`gifts.searchPlaceholder`)})]}),(0,W.jsx)(`span`,{className:`gift-list-summary`,children:e(`gifts.listSummary`,{shown:Te.length,total:t.length})})]})}),(0,W.jsx)(`div`,{className:`table-wrap gift-table-wrap`,children:(0,W.jsxs)(`table`,{className:`data-table gift-table`,children:[(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{children:e(`gifts.animation`)}),(0,W.jsx)(`th`,{children:e(`gifts.idRevision`)}),(0,W.jsx)(`th`,{children:e(`gifts.title`)}),(0,W.jsx)(`th`,{children:e(`gifts.price`)}),(0,W.jsx)(`th`,{children:e(`gifts.source`)}),(0,W.jsx)(`th`,{children:e(`gifts.received`)}),(0,W.jsx)(`th`,{children:e(`common.status`)}),(0,W.jsx)(`th`,{children:e(`common.updatedAt`)}),(0,W.jsx)(`th`,{children:e(`common.actions`)})]})}),(0,W.jsxs)(`tbody`,{children:[Te.map(t=>(0,W.jsxs)(`tr`,{className:t.Enabled?``:`gift-row-disabled`,children:[(0,W.jsx)(`td`,{children:(0,W.jsx)(Bt,{giftID:t.GiftID,revision:t.Revision,compact:!0})}),(0,W.jsxs)(`td`,{className:`mono`,children:[t.GiftID,` / `,t.Revision]}),(0,W.jsxs)(`td`,{children:[(0,W.jsx)(`strong`,{className:`gift-table-title`,children:t.Title||`Gift #${t.GiftID}`}),(0,W.jsxs)(`span`,{className:`gift-sort-order`,children:[e(`gifts.sortOrder`),`: `,t.SortOrder]})]}),(0,W.jsxs)(`td`,{children:[(0,W.jsxs)(`strong`,{className:`gift-table-price`,children:[`⭐ `,t.Stars]}),(0,W.jsxs)(`span`,{className:`gift-convert-price`,children:[`→ `,t.ConvertStars]})]}),(0,W.jsxs)(`td`,{children:[(0,W.jsx)(J,{children:t.SourceFormat}),(0,W.jsx)(`span`,{className:`gift-source-size`,children:zt(t.AnimationSize)})]}),(0,W.jsx)(`td`,{children:t.ReceivedCount}),(0,W.jsx)(`td`,{children:(0,W.jsx)(J,{tone:t.Enabled?`good`:`neutral`,children:t.Enabled?e(`common.enabled`):e(`common.disabled`)})}),(0,W.jsx)(`td`,{children:Ke(t.UpdatedAt)}),(0,W.jsx)(`td`,{children:(0,W.jsxs)(`div`,{className:`gift-table-actions`,children:[(0,W.jsxs)(`button`,{className:`btn compact-btn collectible-button`,type:`button`,onClick:()=>c(t),children:[(0,W.jsx)(ne,{size:13}),e(`collectibles.manage`)]}),(0,W.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>Me(t),children:e(`gifts.replace`)}),(0,W.jsx)(st,{compact:!0,tone:`neutral`,label:t.Enabled?e(`gifts.disable`):e(`gifts.enable`),path:`/api/actions/set-gift-enabled`,payload:()=>({gift_id:t.GiftID,enabled:!t.Enabled}),onDone:()=>void be()})]})})]},t.GiftID)),Te.length===0&&(0,W.jsx)(nt,{colSpan:9})]})]})}),a&&(0,ot.createPortal)((0,W.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,W.jsxs)(`section`,{className:`modal command-modal gift-import-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P}),children:[(0,W.jsxs)(`div`,{className:`modal-head`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`eyebrow`,children:e(`gifts.importEyebrow`)}),(0,W.jsx)(`h2`,{children:P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P})})]}),(0,W.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>o(!1),disabled:me,"aria-label":e(`action.close`),children:(0,W.jsx)(H,{size:15})})]}),(0,W.jsxs)(`div`,{className:`command-body gift-import-modal-body`,children:[(0,W.jsxs)(`div`,{className:`command-steps`,children:[(0,W.jsxs)(`div`,{className:`command-step ${(d===`official`?S:l)?`done`:`active`}`,children:[(0,W.jsx)(`span`,{children:`1`}),(0,W.jsx)(`strong`,{children:e(`gifts.stepDetails`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${z?`done`:(d===`official`?S:l)?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`2`}),(0,W.jsx)(`strong`,{children:e(`gifts.stepValidate`)})]}),(0,W.jsxs)(`div`,{className:`command-step ${z?`active`:``}`,children:[(0,W.jsx)(`span`,{children:`3`}),(0,W.jsx)(`strong`,{children:e(`gifts.stepImport`)})]})]}),(0,W.jsxs)(`div`,{className:`gift-source-tabs`,children:[(0,W.jsx)(`button`,{className:`btn ${d===`official`?`primary`:``}`,type:`button`,onClick:()=>{f(`official`),fe(null)},children:e(`gifts.officialSource`)}),(0,W.jsx)(`button`,{className:`btn ${d===`file`?`primary`:``}`,type:`button`,onClick:()=>{f(`file`),fe(null)},children:e(`gifts.fileSource`)})]}),d===`official`?(0,W.jsxs)(`section`,{className:`official-gift-picker`,children:[(0,W.jsxs)(`div`,{className:`gift-import-note`,children:[(0,W.jsx)(`span`,{children:e(`gifts.officialHint`)}),(0,W.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,W.jsx)(`span`,{children:p.length}),(0,W.jsx)(`span`,{children:`SHA-256`})]})]}),(0,W.jsxs)(`div`,{className:`official-gift-tools`,children:[(0,W.jsxs)(`label`,{className:`searchbox`,children:[(0,W.jsx)(V,{size:15}),(0,W.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),placeholder:e(`gifts.officialSearch`)})]}),(0,W.jsx)(`span`,{children:e(`gifts.officialResults`,{shown:Ce.length,total:p.length})})]}),(0,W.jsx)(`div`,{className:`official-gift-categories`,role:`group`,"aria-label":e(`gifts.officialCategoryLabel`),children:[`all`,`upgrade`,`craft`,`basic`].map(t=>(0,W.jsxs)(`button`,{className:v===t?`active`:``,type:`button`,"aria-pressed":v===t,onClick:()=>y(t),children:[e(`gifts.officialCategory.${t}`),(0,W.jsx)(`span`,{children:Se[t]})]},t))}),(0,W.jsxs)(`div`,{className:`official-gift-list`,role:`listbox`,"aria-label":e(`gifts.officialSelect`),children:[Ce.map(t=>{let n=t.source_gift_id===S;return(0,W.jsxs)(`button`,{className:`official-gift-option ${n?`selected`:``}`,type:`button`,role:`option`,"aria-selected":n,onClick:()=>Oe(t),children:[(0,W.jsxs)(`span`,{className:`official-gift-option-head`,children:[(0,W.jsx)(`strong`,{children:t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})}),(0,W.jsxs)(`span`,{className:`mono`,children:[`#`,t.source_gift_id]})]}),(0,W.jsxs)(`span`,{className:`official-gift-option-meta`,children:[(0,W.jsxs)(`span`,{children:[`⭐ `,t.stars]}),(0,W.jsx)(`span`,{children:e(`gifts.officialAttributes`,{count:Rt(t)})})]}),(0,W.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,W.jsx)(`span`,{className:t.can_upgrade?`yes`:`no`,children:t.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,W.jsx)(`span`,{className:t.can_craft?`craft`:`no`,children:t.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]},t.source_gift_id)}),Ce.length===0&&(0,W.jsx)(`div`,{className:`official-gift-empty`,children:e(`gifts.officialEmpty`)})]}),xe&&(0,W.jsxs)(`div`,{className:`official-gift-selected`,children:[(0,W.jsx)(Vt,{sourceGiftID:xe.source_gift_id}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:xe.title||e(`gifts.officialUnnamed`,{id:xe.source_gift_id})}),(0,W.jsx)(`span`,{className:`mono`,children:xe.source_gift_id}),(0,W.jsxs)(`small`,{children:[xe.model_count,` `,e(`collectibles.models`),` · `,xe.pattern_count,` `,e(`collectibles.patterns`),` · `,xe.backdrop_count,` `,e(`collectibles.backdrops`)]}),(0,W.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,W.jsx)(`span`,{className:xe.can_upgrade?`yes`:`no`,children:xe.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,W.jsx)(`span`,{className:xe.can_craft?`craft`:`no`,children:xe.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]})]}),xe?.can_upgrade&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`label`,{className:`gift-switch`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>{T(e.target.checked),fe(null)}}),(0,W.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{})}),(0,W.jsx)(`span`,{children:e(`gifts.includeCollectible`)})]}),w&&(0,W.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`collectibles.upgradeStars`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:E,onChange:e=>{D(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`collectibles.supply`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:O,onChange:e=>{j(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`collectibles.slug`)}),(0,W.jsx)(`input`,{value:M,maxLength:48,onChange:e=>{N(e.target.value.toLowerCase()),fe(null)}})]})]})]})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`gift-import-note`,children:[(0,W.jsx)(`span`,{children:e(`gifts.importHint`)}),(0,W.jsxs)(`div`,{className:`gift-format-chips`,"aria-label":e(`gifts.formats`),children:[(0,W.jsx)(`span`,{children:`TGS`}),(0,W.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,W.jsxs)(`label`,{className:`gift-file-picker ${l?`has-file`:``}`,children:[(0,W.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:e=>{u(e.target.files?.[0]??null),fe(null)}}),(0,W.jsx)(`span`,{className:`gift-file-icon`,children:(0,W.jsx)(R,{size:22})}),(0,W.jsxs)(`span`,{className:`gift-file-copy`,children:[(0,W.jsx)(`span`,{className:`gift-field-label`,children:e(`gifts.animation`)}),(0,W.jsx)(`strong`,{children:l?l.name:e(`gifts.filePrompt`)}),(0,W.jsx)(`small`,{children:l?zt(l.size):e(`gifts.fileHint`)})]}),(0,W.jsx)(`span`,{className:`gift-file-action`,children:e(l?`gifts.changeFile`:`gifts.chooseFile`)})]})]}),(0,W.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.title`)}),(0,W.jsx)(`input`,{value:I,maxLength:128,placeholder:e(`gifts.titlePlaceholder`),onChange:e=>{L(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.stars`)}),(0,W.jsx)(`input`,{type:`number`,min:`1`,value:ee,onChange:e=>{te(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.convertStars`)}),(0,W.jsx)(`input`,{type:`number`,min:`0`,value:re,onChange:e=>{ie(e.target.value),fe(null)}})]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`span`,{children:e(`gifts.sortOrder`)}),(0,W.jsx)(`input`,{type:`number`,value:ae,onChange:e=>{oe(e.target.value),fe(null)}})]})]}),(0,W.jsxs)(`label`,{className:`gift-reason-field`,children:[(0,W.jsx)(`span`,{children:e(`gifts.reason`)}),(0,W.jsx)(`input`,{value:le,placeholder:e(`gifts.reasonPlaceholder`),onChange:e=>ue(e.target.value)})]}),(0,W.jsxs)(`label`,{className:`gift-switch`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:se,onChange:e=>{ce(e.target.checked),fe(null)}}),(0,W.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{})}),(0,W.jsx)(`span`,{children:e(`gifts.enableAfterImport`)})]}),ye&&(0,W.jsx)(Qe,{children:ye}),z&&(0,W.jsxs)(`div`,{className:`gift-validation`,children:[(0,W.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,W.jsx)(k,{size:17}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`strong`,{children:e(`gifts.validationReady`)}),(0,W.jsx)(`span`,{children:e(`gifts.validationHint`)})]})]}),(0,W.jsx)(`pre`,{children:JSON.stringify(z.details,null,2)})]})]}),(0,W.jsxs)(`div`,{className:`modal-actions`,children:[(0,W.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>o(!1),disabled:me,children:e(`common.close`)}),(0,W.jsxs)(`button`,{className:`btn`,type:`button`,onClick:ke,disabled:me,children:[me?(0,W.jsx)(A,{className:`spin`,size:15}):(0,W.jsx)(pe,{size:15}),e(`gifts.validate`)]}),(0,W.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:Ae,disabled:me||!z,children:[(0,W.jsx)(ve,{size:15}),e(`gifts.confirmImport`)]})]})]})}),document.body),s&&(0,W.jsx)(Lt,{gift:s,onClose:()=>c(null),onPublished:()=>void be()})]})}function Ut({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1];return n?(0,W.jsx)(lt,{id:Number(n),navigate:t}):r?(0,W.jsx)(mt,{id:Number(r),navigate:t}):e.path===`/accounts`?(0,W.jsx)(pt,{navigate:t}):e.path===`/channels`?(0,W.jsx)(ht,{navigate:t}):e.path===`/gifts`?(0,W.jsx)(Ht,{}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,W.jsx)(St,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,W.jsx)(vt,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,W.jsx)(xt,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,W.jsx)(Ct,{navigate:t}):(0,W.jsx)(gt,{navigate:t})}function Wt(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>ke());(0,g.useEffect)(()=>{let e=()=>r(ke());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(ke())};return e===void 0?(0,W.jsx)(G,{}):e===null?(0,W.jsx)(at,{onLogin:t}):(0,W.jsx)(Be,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,W.jsx)(Ut,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,W.jsx)(g.StrictMode,{children:(0,W.jsx)(Fe,{children:(0,W.jsx)(Ce,{children:(0,W.jsx)(Wt,{})})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css b/cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css deleted file mode 100644 index f80a193d..00000000 --- a/cmd/telesrv-admin/web/dist/assets/index-DuOdm70q.css +++ /dev/null @@ -1 +0,0 @@ -:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#eef1f5;--bg-accent:#e7ecf1;--panel:#fff;--panel-subtle:#f5f8fb;--panel-strong:#eef2f6;--surface-soft:#f2f7f6;--overlay:#18222f6b;--topbar-bg:#ffffffdb;--line:#e5eaf0;--line-strong:#d3dce4;--heading:#253040;--text:#333f4d;--text-soft:#45525f;--muted:#6d7885;--muted-2:#9aa4b1;--brand:#1f7d6f;--brand-strong:#196155;--brand-2:#3a6cae;--brand-tint:#e8f4f0;--brand-tint-border:#c8e2db;--brand-tint-text:#235d53;--good:#1f8a57;--good-tint:#eaf6ef;--good-border:#c1e1cf;--warn:#a86a12;--warn-tint:#fcf4e4;--warn-border:#e7d09e;--danger:#c0392b;--danger-tint:#fcefec;--danger-border:#eecac3;--danger-text:#8f2f27;--purple:#6a4fa3;--purple-tint:#f4effb;--purple-border:#dcd0f0;--purple-text:#5a4590;--input-bg:#fff;--btn-bg:#fff;--btn-text:#29323d;--btn-hover:#f4f7fa;--switch-track:#c8d0d6;--code-bg:#1b2733;--code-text:#d6e3ef;--code-border:#2b3a49;--sidebar:#1c2530;--sidebar-soft:#26313d;--sidebar-line:#313c4a;--sidebar-row:#232d38;--sidebar-text:#dbe3ec;--sidebar-muted:#8b98a8;--sidebar-faint:#7c8a9a;--sidebar-heading:#fff;--focus:#1f7d6f29;--shadow:0 12px 34px #1827381a;--shadow-sm:0 2px 10px #1827380d;--shadow-brand:0 8px 22px #1f7d6f38;--radius-xs:8px;--radius-sm:9px;--radius:11px;--radius-lg:14px}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0f141a;--bg-accent:#131a22;--panel:#171f28;--panel-subtle:#1c2530;--panel-strong:#212c38;--surface-soft:#1a232d;--overlay:#05080c9e;--topbar-bg:#151c24db;--line:#29333f;--line-strong:#38434f;--heading:#eef3f8;--text:#d5dde6;--text-soft:#c2ccd6;--muted:#98a4b1;--muted-2:#6d7885;--brand:#37a596;--brand-strong:#45b6a6;--brand-2:#6fa8e6;--brand-tint:#14322d;--brand-tint-border:#245349;--brand-tint-text:#7fd3c4;--good:#47c281;--good-tint:#12301f;--good-border:#245639;--warn:#e0aa4d;--warn-tint:#322810;--warn-border:#574413;--danger:#e6695c;--danger-tint:#35201d;--danger-border:#5c332d;--danger-text:#f0a49b;--purple:#ac90e2;--purple-tint:#221b31;--purple-border:#3d3357;--purple-text:#c9b6ef;--input-bg:#131a22;--btn-bg:#1e2731;--btn-text:#dbe2ea;--btn-hover:#26313d;--switch-track:#3a454f;--code-bg:#0c1218;--code-text:#cdd9e5;--code-border:#232f3b;--sidebar:#10151b;--sidebar-soft:#1c242f;--sidebar-line:#262f3a;--sidebar-row:#161d25;--sidebar-text:#cbd4de;--sidebar-muted:#7c8794;--sidebar-faint:#6f7b88;--sidebar-heading:#f0f4f8;--focus:#37a5963d;--shadow:0 16px 40px #00000075;--shadow-sm:0 2px 12px #00000061;--shadow-brand:0 8px 22px #37a59642}*{box-sizing:border-box}html,body,#root{min-height:100%}body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;margin:0;font:13px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;transition:background-color .2s,color .2s}button,input,textarea{font:inherit}a{color:inherit;text-decoration:none}.shell{grid-template-columns:232px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{height:100vh;color:var(--sidebar-text);background:var(--sidebar);border-right:1px solid var(--sidebar-line);flex-direction:column;gap:16px;padding:18px 12px;display:flex;position:sticky;top:0;overflow-y:auto}.brand{align-items:center;gap:10px;min-height:42px;padding:0 4px;display:flex}.brand.compact{justify-content:center}.brand-elevated .brand-mark{box-shadow:var(--shadow-brand)}.brand-mark{color:#fff;background:var(--brand);border-radius:var(--radius-sm);border:1px solid #fff3;place-items:center;width:34px;height:34px;font-weight:800;display:grid}.brand strong{font-size:14px;line-height:1.1;display:block}.brand small{color:var(--sidebar-muted);margin-top:3px;font-size:11px;display:block}.sidebar-label{color:var(--sidebar-faint);text-transform:uppercase;letter-spacing:.04em;padding:0 8px;font-size:11px;font-weight:700}.nav-list,.nav-section{gap:4px;display:grid}.nav-section-toggle{width:100%;min-height:38px;color:var(--sidebar-muted);border-radius:var(--radius-sm);cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;grid-template-columns:18px minmax(0,1fr) 16px;align-items:center;gap:9px;padding:0 10px;font-size:12px;font-weight:800;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-section-toggle:hover,.nav-section.active .nav-section-toggle{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-section-chevron{color:var(--sidebar-muted);justify-self:end;transition:transform .14s}.nav-section.open .nav-section-chevron{transform:rotate(180deg)}.nav-children{gap:4px;padding:2px 0 2px 18px;display:grid}.nav-item{min-height:38px;color:var(--sidebar-text);border-radius:var(--radius-sm);border:1px solid #0000;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;padding:0 10px;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-dot{background:var(--sidebar-faint);border-radius:999px;justify-self:center;width:6px;height:6px}.nav-item:hover,.nav-item.active{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-item.active .nav-dot{background:var(--brand)}.sidebar-status{gap:7px;margin-top:auto;display:grid}.runtime-row{min-height:32px;color:var(--sidebar-text);background:var(--sidebar-row);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;padding:0 8px;display:grid}.runtime-row strong{color:var(--sidebar-heading);font-size:11px}.workspace{min-width:0}.topbar{z-index:20;background:var(--topbar-bg);border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);justify-content:space-between;align-items:center;gap:18px;min-height:66px;padding:12px 24px;display:flex;position:sticky;top:0}.topbar h1{color:var(--heading);margin:2px 0 0;font-size:20px;line-height:1.2}.topbar-actions,.page-actions,.section-action,.entity-badges,.row-actions,.modal-actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.language-switch{background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;min-height:30px;padding:2px;display:inline-flex}.language-switch button{min-width:42px;min-height:24px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:999px;padding:0 9px;font-weight:800;transition:color .14s,background-color .14s}.language-switch button.active{color:#fff;background:var(--brand)}.language-switch button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.theme-toggle{width:34px;height:34px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);cursor:pointer;border-radius:999px;place-items:center;transition:color .16s,background-color .16s,border-color .16s;display:inline-grid}.theme-toggle:hover{color:var(--brand);border-color:var(--brand-tint-border);background:var(--brand-tint)}.theme-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.actor-pill{min-height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;padding:0 10px;display:inline-flex}.content{gap:16px;padding:18px 24px 30px;display:grid}.eyebrow{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:800}.dashboard-layout,.stacked-sections{gap:14px;display:grid}.overview-band,.page-frame{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm)}.overview-band{grid-template-columns:minmax(220px,1fr) minmax(420px,.9fr);align-items:center;gap:16px;padding:16px;display:grid}.overview-band h2,.page-title-row h2,.section-head h2,.modal h2{color:var(--heading);margin:0;font-size:18px;line-height:1.25}.overview-metrics,.metric-row{grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;display:grid}.overview-metrics{grid-template-columns:repeat(3,minmax(120px,1fr))}.status-item,.metric,.summary-item{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:0;padding:10px}.status-item span,.metric span,.summary-item span{color:var(--muted);margin-bottom:6px;font-size:11px;display:block}.status-item strong,.metric strong,.summary-item strong{overflow-wrap:anywhere;color:var(--text);font-weight:800;display:block}.status-item.good,.metric.good{border-color:var(--good-border)}.status-item.warn,.metric.warn{border-color:var(--warn-border)}.metric.danger{border-color:var(--danger-border)}.command-grid{grid-template-columns:repeat(3,minmax(220px,1fr));gap:12px;display:grid}.launcher{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-height:94px;box-shadow:var(--shadow-sm);grid-template-columns:38px minmax(0,1fr) 18px;align-items:center;gap:12px;padding:14px;transition:border-color .16s,box-shadow .16s,transform .16s;display:grid}.launcher:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.launcher-icon{width:38px;height:38px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);place-items:center;display:grid}.launcher-copy{gap:4px;display:grid}.launcher-copy strong{color:var(--heading);font-size:15px}.launcher-copy span{color:var(--muted)}.work-strip{grid-template-columns:repeat(4,minmax(160px,1fr));gap:8px;display:grid}.strip-item{min-height:38px;color:var(--text-soft);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.page-frame{gap:14px;padding:14px;display:grid}.page-title-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:14px;padding-bottom:12px;display:flex}.query-panel{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.message-query input{width:150px}.message-selector-grid{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;margin-bottom:10px;display:grid}.message-selector-grid.single{grid-template-columns:minmax(320px,620px)}.entity-picker{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);gap:8px;min-width:0;padding:10px;display:grid}.picker-head{min-height:24px;color:var(--text-soft);justify-content:space-between;align-items:center;gap:8px;font-weight:800;display:flex}.selected-entity{min-height:40px;color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 9px;display:grid}.selected-entity strong,.selected-entity span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.selected-entity div{gap:2px;min-width:0;display:grid}.selected-entity div span{color:var(--brand-tint-text);opacity:.85;font-size:11px}.picker-search{background:var(--panel-subtle);border:1px solid var(--line-strong);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;height:34px;padding:0 6px 0 9px;display:grid}.picker-search input{width:100%;height:30px;box-shadow:none;background:0 0;border:0;padding:0}.picker-results{border:1px solid var(--line);border-radius:var(--radius-sm);max-height:236px;display:grid;overflow:auto}.picker-row{min-height:36px;color:var(--text);background:var(--panel);border:0;border-bottom:1px solid var(--line);cursor:pointer;text-align:left;grid-template-columns:96px minmax(120px,1fr) minmax(120px,1fr) auto;align-items:center;gap:8px;padding:6px 8px;display:grid}.picker-row:last-child{border-bottom:0}.picker-row:hover,.picker-row.selected{background:var(--surface-soft)}.picker-row strong,.picker-row span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.picker-empty,.picker-error{color:var(--muted);text-align:center;padding:9px}.picker-error{color:var(--danger);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius-sm)}input,textarea{color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);outline:none;transition:border-color .14s,box-shadow .14s}input::placeholder,textarea::placeholder{color:var(--muted-2)}input{width:190px;height:34px;padding:0 10px}textarea{resize:vertical;width:100%;padding:9px 10px}input:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus)}.small-input{width:88px}.field-inline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.field-inline span{font-size:11px;font-weight:700}.searchbox{width:min(380px,100%);height:34px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:inline-flex}.searchbox input{width:100%;height:30px;box-shadow:none;border:0;padding:0}.btn{min-height:34px;color:var(--btn-text);background:var(--btn-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;justify-content:center;align-items:center;gap:6px;padding:0 12px;transition:background-color .14s,border-color .14s,color .14s,box-shadow .14s;display:inline-flex}.btn:hover:not(:disabled){background:var(--btn-hover)}.btn:disabled{color:var(--muted-2);cursor:not-allowed}.btn.primary{color:#fff;background:var(--brand);border-color:var(--brand)}.btn.primary:hover:not(:disabled){background:var(--brand-strong);border-color:var(--brand-strong)}.btn.ghost{background:var(--panel-subtle)}.btn.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.btn.danger:hover:not(:disabled){background:var(--danger-tint);border-color:var(--danger)}.btn.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.btn.warn:hover:not(:disabled){background:var(--warn-tint);border-color:var(--warn)}.btn:disabled,.btn.primary:disabled,.btn.warn:disabled,.btn.danger:disabled{color:var(--muted-2);background:var(--panel-strong);border-color:var(--line);cursor:not-allowed}.btn.full{width:100%}.icon-text{gap:7px}.compact-btn{min-height:28px;padding:0 8px;font-size:12px}.row-link,.link-button{color:var(--brand-2);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:0;display:inline-flex}.table-wrap{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);width:100%;overflow-x:auto}.data-table{border-collapse:collapse;width:100%;font-size:12.5px}.data-table th,.data-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;white-space:nowrap;height:38px;padding:7px 9px}.data-table th{z-index:0;color:var(--muted);background:var(--panel-strong);font-weight:800;position:sticky;top:0}.data-table tbody tr:hover{background:var(--panel-subtle)}.data-table tr:last-child td{border-bottom:0}.mono{font-family:SFMono-Regular,Consolas,Liberation Mono,monospace}.truncate{text-overflow:ellipsis;max-width:380px;overflow:hidden}.badge{min-height:22px;color:var(--muted);background:var(--panel-strong);border:1px solid var(--line-strong);white-space:nowrap;border-radius:999px;align-items:center;padding:1px 8px;display:inline-flex}.badge.good{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.badge.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.badge.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.empty-cell{color:var(--muted);text-align:center}.split-layout{grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:14px;display:grid}.split-main,.split-side{min-width:0}.entity-head{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);justify-content:space-between;align-items:flex-start;gap:14px;padding:14px;display:flex}.entity-title{color:var(--heading);font-size:20px;font-weight:800;line-height:1.25}.entity-subtitle{color:var(--muted);margin-top:4px}.summary-grid{grid-template-columns:repeat(4,minmax(150px,1fr));gap:8px;display:grid}.about-text{color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);margin:0;padding:10px}.section-block,.action-dock,.surface{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm);padding:12px}.section-head{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.section-head p{color:var(--muted);margin:5px 0 0}.action-dock{gap:10px;display:grid;position:sticky;top:82px}.dock-title{color:var(--text-soft);border-bottom:1px solid var(--line);padding-bottom:4px;font-weight:800}.action-dock>.btn,.action-dock .action-stack .btn{justify-content:center;width:100%}.duration-field{gap:4px;display:grid}.duration-field span{color:var(--muted);font-size:11px;font-weight:800}.duration-field input{width:100%}.action-stack{gap:10px;display:grid}.action-stack .btn,.action-dock>.btn{min-height:42px}.danger-zone{border-top:1px solid var(--line);flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;display:flex}.authorization-block{gap:10px;display:grid}.authorization-table{table-layout:fixed;min-width:720px}.authorization-table th,.authorization-table td{height:46px}.device-text{text-overflow:ellipsis;max-width:260px;overflow:hidden}.device-actions-head{width:190px}.device-actions-cell{width:190px;min-width:190px}.device-actions{white-space:normal;grid-template-columns:repeat(2,minmax(82px,1fr));gap:6px;min-width:178px;display:grid}.device-actions .btn{justify-content:center;width:100%}.operation-row{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;display:grid}.operation-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}.operation-title{width:100%;color:var(--heading);align-items:center;gap:6px;font-weight:800;display:flex}.checkline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.checkline input{width:auto;height:auto}.alert{color:var(--danger-text);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius);align-items:flex-start;gap:8px;padding:9px 10px;display:flex}.json-block{max-height:520px;color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius);margin:0;padding:12px;font-size:12px;overflow:auto}.raw-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.loading-line{min-height:80px;color:var(--muted);place-items:center;display:grid}.empty-panel{min-height:92px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);place-items:center;display:grid}.gift-metrics .metric{background:var(--panel-subtle);min-height:68px;padding:12px}.gift-metrics .metric strong{font-size:17px}.gift-file-icon{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);flex:none;place-items:center;display:grid}.gift-format-chips{flex-wrap:wrap;flex:none;justify-content:flex-end;gap:6px;display:flex}.gift-format-chips span{color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);letter-spacing:.02em;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.gift-list-summary{color:var(--muted);margin-left:auto;font-size:11px;font-weight:700}.gift-import-modal{width:min(860px,100%)}.gift-import-modal-body{gap:14px}.gift-source-tabs{gap:8px;display:flex}.official-gift-picker{gap:12px;min-width:0;display:grid}.official-gift-tools{align-items:center;gap:12px;display:flex}.official-gift-tools .searchbox{width:100%}.official-gift-tools>span{color:var(--muted);flex:none;font-size:11px;font-weight:750}.official-gift-categories{flex-wrap:wrap;gap:7px;display:flex}.official-gift-categories button{min-height:32px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line-strong);font:inherit;cursor:pointer;border-radius:999px;align-items:center;gap:7px;padding:5px 10px;font-size:11px;font-weight:800;transition:color .15s,background .15s,border-color .15s,box-shadow .15s;display:inline-flex}.official-gift-categories button:hover{color:var(--brand);border-color:var(--brand-tint-border)}.official-gift-categories button.active{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:var(--shadow-brand)}.official-gift-categories button span{min-width:20px;height:20px;color:inherit;background:#7d8c9b38;border-radius:999px;place-items:center;padding:0 5px;font-size:10px;display:grid}.official-gift-categories button.active span{color:var(--brand);background:#ffffffd9}.official-gift-list{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel-subtle);scrollbar-gutter:stable;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-height:126px;max-height:314px;padding:8px;display:grid;overflow:auto}.official-gift-option{text-align:left;min-width:0;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);cursor:pointer;box-shadow:var(--shadow-sm);gap:8px;padding:11px 12px;transition:border-color .15s,box-shadow .15s,transform .15s;display:grid}.official-gift-option:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.official-gift-option.selected{border-color:var(--brand);box-shadow:0 0 0 2px var(--focus), var(--shadow)}.official-gift-option-head{grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:8px;display:grid}.official-gift-option-head strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.official-gift-option-head .mono{color:var(--muted);font-size:9px}.official-gift-option-meta{color:var(--muted);flex-wrap:wrap;gap:10px;font-size:10px;font-weight:700;display:flex}.official-gift-capabilities{flex-wrap:wrap;gap:5px;display:flex}.official-gift-capabilities>span{letter-spacing:.01em;border:1px solid #0000;border-radius:999px;padding:3px 7px;font-size:9px;font-weight:850}.official-gift-capabilities>span.yes{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.official-gift-capabilities>span.craft{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.official-gift-capabilities>span.no{color:var(--muted);background:var(--panel-strong);border-color:var(--line-strong)}.official-gift-empty{min-height:108px;color:var(--muted);text-align:center;grid-column:1/-1;place-items:center;padding:20px;font-size:12px;display:grid}.official-gift-selected{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface-soft);grid-template-columns:108px minmax(0,1fr);align-items:center;gap:14px;padding:12px;display:grid}.official-gift-selected .gift-animation-shell{width:96px;height:96px}.official-gift-selected>div:last-child{gap:5px;min-width:0;display:grid}.official-gift-selected small{color:var(--muted)}.gift-import-note{color:var(--muted);justify-content:space-between;align-items:center;gap:12px;line-height:1.45;display:flex}.gift-file-picker{min-height:78px;color:var(--text);background:var(--panel);border:1px dashed var(--line-strong);border-radius:var(--radius);cursor:pointer;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;transition:border-color .16s,background .16s,box-shadow .16s;display:grid;position:relative}.gift-file-picker:hover,.gift-file-picker.has-file{background:var(--brand-tint);border-color:var(--brand);box-shadow:0 0 0 2px var(--focus)}.gift-file-picker input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.gift-file-icon{border-radius:var(--radius-sm);width:40px;height:40px}.gift-file-copy{gap:2px;min-width:0;display:grid}.gift-field-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10px;font-weight:800}.gift-file-copy strong{color:var(--heading);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.gift-file-copy small{color:var(--muted);font-size:11px;font-weight:500}.gift-file-action{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);padding:7px 10px;font-size:11px;font-weight:800}.gift-fields-grid{grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(120px,1fr));gap:10px;display:grid}.gift-fields-grid label,.gift-reason-field{color:var(--muted);gap:6px;font-size:11px;font-weight:700;display:grid}.gift-fields-grid input,.gift-reason-field input{width:100%;min-width:0;height:38px;color:var(--text);background:var(--input-bg);border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 10px}.gift-fields-grid input:focus,.gift-reason-field input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus);outline:none}.gift-switch{color:var(--text-soft);cursor:pointer;align-items:center;gap:9px;font-size:12px;font-weight:700;display:inline-flex}.gift-switch input{opacity:0;width:1px;height:1px;position:absolute}.gift-switch-track{background:var(--switch-track);border-radius:999px;align-items:center;width:34px;height:19px;padding:2px;transition:background .16s;display:flex}.gift-switch-track span{background:#fff;border-radius:50%;width:15px;height:15px;transition:transform .16s;box-shadow:0 1px 3px #10182838}.gift-switch input:checked+.gift-switch-track{background:var(--brand)}.gift-switch input:checked+.gift-switch-track span{transform:translate(15px)}.gift-switch input:focus-visible+.gift-switch-track{outline:3px solid var(--focus);outline-offset:2px}.gift-validation{color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius-sm);overflow:hidden}.gift-validation-head{color:var(--code-text);background:#ffffff09;border-bottom:1px solid #ffffff17;align-items:center;gap:9px;padding:10px 12px;display:flex}.gift-validation-head div{gap:2px;display:grid}.gift-validation-head span{color:var(--brand);font-size:10px}.gift-validation pre{max-height:180px;color:var(--code-text);margin:0;padding:11px 12px;font-size:11px;overflow:auto}.gift-animation-shell{background:var(--surface-soft);place-items:center;min-height:210px;display:grid;position:relative}.gift-animation{width:200px;height:200px}.gift-animation canvas{width:100%!important;height:100%!important}.gift-play{width:30px;height:30px;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:50%;place-items:center;display:grid;position:absolute;bottom:8px;right:8px}.gift-table-wrap{background:var(--panel)}.gift-table{min-width:1080px}.gift-table th:first-child{width:74px}.gift-table td{vertical-align:middle}.gift-animation-shell.compact{border:1px solid var(--line);border-radius:var(--radius-sm);width:56px;min-height:56px;overflow:hidden}.gift-animation-shell.compact .gift-animation{width:54px;height:54px}.gift-animation-shell.compact .gift-play{width:20px;height:20px;bottom:3px;right:3px}.gift-row-disabled{opacity:.68}.gift-table-title,.gift-sort-order,.gift-source-size,.gift-convert-price{display:block}.gift-table-title{text-overflow:ellipsis;white-space:nowrap;max-width:220px;overflow:hidden}.gift-sort-order,.gift-source-size,.gift-convert-price{color:var(--muted);margin-top:3px;font-size:10px}.gift-table-price{color:var(--warn)}.gift-table-actions{align-items:center;gap:6px;display:flex}.collectible-button{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.collectible-button:hover{background:var(--purple-tint);border-color:var(--purple)}.collectible-modal{width:min(1180px,100%);max-height:min(92vh,980px)}.collectible-modal .modal-head p{color:var(--muted);margin:4px 0 0;font-size:11px}.collectible-modal-body{background:var(--bg);gap:16px;padding:16px 18px 22px;overflow:auto}.collectible-loading{min-height:90px;color:var(--muted);justify-content:center;align-items:center;gap:8px;display:flex}.collectible-empty{color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius);align-items:center;gap:12px;padding:16px;display:flex}.collectible-empty div,.collectible-definition-head>div:first-child,.collectible-section-head>div:first-child{gap:3px;display:grid}.collectible-empty span,.collectible-definition-head span,.collectible-section-head span{color:var(--muted);font-size:10px;font-weight:500}.collectible-active{background:var(--panel);border:1px solid var(--purple-border);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-active-head{background:var(--purple-tint);border-bottom:1px solid var(--purple-border);justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.collectible-active-head>div{color:var(--purple-text);align-items:center;gap:9px;display:flex}.collectible-active-head>div>div{gap:2px;display:grid}.collectible-active-head span{color:var(--muted);font-size:10px}.collectible-active-grid{background:var(--line);grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:1px;display:grid}.collectible-active-grid article{background:var(--panel);align-items:center;gap:9px;min-width:0;padding:9px 11px;display:flex}.collectible-active-grid article>div:last-child{gap:2px;min-width:0;display:grid}.collectible-active-grid article strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.collectible-active-grid article span{color:var(--muted);font-size:9px}.collectible-definition{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-definition-head{background:var(--panel-subtle);border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.collectible-main-fields{background:var(--panel-subtle);border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section{border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section:last-child{border-bottom:0}.collectible-section-head{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.collectible-section-tools{align-items:center;gap:7px;display:flex}.collectible-rows{gap:7px;display:grid}.collectible-row{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:end;gap:7px;padding:9px 9px 9px 36px;display:grid;position:relative}.collectible-row:hover{background:var(--panel);border-color:var(--line-strong);box-shadow:var(--shadow-sm)}.collectible-row.animated{grid-template-columns:minmax(120px,1.2fr) 90px 78px minmax(160px,1.4fr) 48px 30px}.collectible-row.backdrop{grid-template-columns:minmax(110px,1.2fr) 70px 80px 70px repeat(4,52px) 48px 30px}.collectible-row-index{width:27px;color:var(--purple-text);background:var(--purple-tint);border-right:1px solid var(--purple-border);border-radius:var(--radius-xs) 0 0 var(--radius-xs);place-items:center;font-size:10px;font-weight:800;display:grid;position:absolute;top:0;bottom:0;left:0}.collectible-row label{gap:4px;min-width:0;display:grid}.collectible-row label>span{color:var(--muted);text-transform:uppercase;letter-spacing:.025em;font-size:9px;font-weight:800}.collectible-row input:not([type=file]){width:100%;min-width:0;height:32px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;padding:0 8px;font-size:11px}.collectible-row input:focus{border-color:var(--purple);box-shadow:0 0 0 3px var(--purple-tint);outline:none}.collectible-file input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.collectible-file em{min-width:0;height:32px;color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius-sm);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;align-items:center;gap:5px;padding:0 8px;font-size:10px;font-style:normal;font-weight:700;display:flex;overflow:hidden}.collectible-inline-preview{width:42px;height:42px;color:var(--purple);background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);place-items:center;display:grid;overflow:hidden}.collectible-animation{width:100%;height:100%;overflow:hidden}.collectible-animation.compact{background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);flex:0 0 42px;place-items:center;width:42px;height:42px;display:grid}.collectible-animation canvas{width:100%!important;height:100%!important}.collectible-animation.failed{color:var(--danger);background:var(--danger-tint)}.collectible-animation.loading{color:var(--purple-text)}.collectible-file-error{color:var(--danger);grid-column:1/-1;font-size:10px}.collectible-color input{cursor:pointer;height:32px!important;padding:3px!important}.collectible-backdrop-preview{border-radius:var(--radius-sm);border:1px solid #2a1f472e;flex:0 0 42px;place-items:center;width:42px;height:42px;font-size:11px;font-weight:900;display:grid;box-shadow:inset 0 0 0 1px #fff3}.collectible-row .icon-btn{align-self:center}.collectible-row .icon-btn:disabled{opacity:.28}@media (width<=900px){.gift-fields-grid,.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:repeat(2,minmax(0,1fr))}.collectible-inline-preview,.collectible-backdrop-preview,.collectible-row .icon-btn{place-self:center start}}@media (width<=620px){.gift-import-note{flex-direction:column;align-items:flex-start}.gift-format-chips{justify-content:flex-start}.gift-file-picker{grid-template-columns:40px minmax(0,1fr)}.gift-file-action{display:none}.gift-fields-grid{grid-template-columns:1fr}.gift-list-summary{width:100%;margin-left:0}.official-gift-tools{flex-direction:column;align-items:stretch}.official-gift-list{grid-template-columns:1fr;max-height:340px}.official-gift-selected{grid-template-columns:82px minmax(0,1fr)}.official-gift-selected .gift-animation-shell{width:72px;height:72px}.collectible-modal-body{padding:10px}.collectible-definition-head,.collectible-section-head{flex-direction:column;align-items:flex-start}.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:1fr}.collectible-active-grid{grid-template-columns:1fr 1fr}}.modal-backdrop{z-index:10000;background:var(--overlay);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);place-items:center;padding:24px;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(760px,100%);max-height:min(820px,100vh - 48px);box-shadow:var(--shadow);padding:0;overflow:hidden}.command-modal{flex-direction:column;display:flex}.command-modal>.modal-head,.command-modal>.modal-actions{flex:none}.modal-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 18px 12px;display:flex}.icon-btn{width:30px;height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;place-items:center;transition:background-color .14s,border-color .14s,color .14s;display:grid}.icon-btn:hover{background:var(--btn-hover);border-color:var(--line-strong)}.command-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.command-body{grid-auto-rows:max-content;gap:12px;min-height:0;padding:14px 18px;display:grid;overflow:auto}.command-step{min-height:38px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.command-step span{background:var(--panel);border:1px solid var(--line);border-radius:999px;place-items:center;width:20px;height:20px;font-size:11px;font-weight:800;display:grid}.command-step.active{color:var(--brand);border-color:var(--brand-tint-border)}.command-step.done{color:var(--good);border-color:var(--good-border)}.form-field{gap:6px;display:grid}.form-field span,.form-stack span{color:var(--text-soft);font-weight:800}.command-preview{gap:8px;display:grid}.command-preview .json-block{max-height:150px}.preview-head,.result-title{color:var(--text-soft);align-items:center;gap:7px;font-weight:800;display:flex}.result-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);gap:8px;padding:10px;display:grid}.result-line{grid-template-columns:92px minmax(0,1fr);gap:8px;display:grid}.result-line span{color:var(--muted)}.result-line strong{overflow-wrap:anywhere}.result-message{color:var(--text-soft)}.modal-actions{background:var(--panel);border-top:1px solid var(--line);justify-content:flex-end;padding:12px 18px}.login-page{background:var(--bg);place-items:center;min-height:100vh;padding:24px;display:grid}.login-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(420px,100%);box-shadow:var(--shadow);gap:18px;padding:22px;display:grid}.login-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.login-head-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.login-chip{min-height:24px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:999px;align-items:center;padding:0 8px;font-size:12px;display:inline-flex}.login-copy h1{color:var(--heading);margin:0;font-size:22px}.login-copy p{color:var(--muted);margin:8px 0 0}.form-stack{gap:12px;display:grid}.form-stack label{gap:6px;display:grid}.form-stack input{width:100%}.boot-screen{background:var(--bg);align-content:center;place-items:center;gap:18px;min-height:100vh;display:grid}.loader-bar{background:var(--line-strong);border-radius:999px;width:180px;height:4px;overflow:hidden}.loader-bar:before{content:"";background:var(--brand);width:42%;height:100%;animation:1s ease-in-out infinite load;display:block}.spin{animation:.8s linear infinite spin}@keyframes load{0%{transform:translate(-120%)}to{transform:translate(260%)}}@keyframes spin{to{transform:rotate(360deg)}}@media (width<=1120px){.shell{grid-template-columns:1fr}.sidebar{height:auto;position:static}.nav-list{grid-template-columns:repeat(4,minmax(0,1fr))}.sidebar-status{display:none}.overview-band,.split-layout,.operation-row,.raw-grid,.message-selector-grid,.message-selector-grid.single{grid-template-columns:1fr}.action-dock{position:static}}@media (width<=760px){.content,.topbar{padding-left:14px;padding-right:14px}.command-grid,.work-strip,.overview-metrics,.metric-row,.summary-grid,.command-steps{grid-template-columns:1fr}.sidebar{gap:12px;padding:14px}.nav-list{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar,.page-title-row,.entity-head{flex-direction:column;align-items:flex-start}input,.searchbox{width:100%}.toolbar{align-items:stretch}.picker-row,.selected-entity{grid-template-columns:1fr}} diff --git a/cmd/telesrv-admin/web/dist/index.html b/cmd/telesrv-admin/web/dist/index.html index 8da7a220..1c5443a7 100644 --- a/cmd/telesrv-admin/web/dist/index.html +++ b/cmd/telesrv-admin/web/dist/index.html @@ -21,8 +21,8 @@ } })(); - - + +
diff --git a/cmd/telesrv-admin/web/src/api.ts b/cmd/telesrv-admin/web/src/api.ts index 75bc7d79..a568db36 100644 --- a/cmd/telesrv-admin/web/src/api.ts +++ b/cmd/telesrv-admin/web/src/api.ts @@ -1,6 +1,8 @@ import type { AccountDetail, AccountListResponse, + BotDetail, + BotListResponse, ChannelDetail, ChannelListResponse, CommandResult, @@ -56,6 +58,8 @@ export const api = { account: (id: number) => request(`/api/accounts/${id}`), channels: (params: URLSearchParams) => request(`/api/channels?${params.toString()}`), channel: (id: number) => request(`/api/channels/${id}`), + bots: (params: URLSearchParams) => request(`/api/bots?${params.toString()}`), + bot: (id: number) => request(`/api/bots/${id}`), messages: (params: URLSearchParams) => request(`/api/messages?${params.toString()}`), message: (ownerUserID: number, msgID: number) => { const params = new URLSearchParams({ owner_user_id: String(ownerUserID), msg_id: String(msgID) }); diff --git a/cmd/telesrv-admin/web/src/components/Layout.tsx b/cmd/telesrv-admin/web/src/components/Layout.tsx index d9600970..411fc0ab 100644 --- a/cmd/telesrv-admin/web/src/components/Layout.tsx +++ b/cmd/telesrv-admin/web/src/components/Layout.tsx @@ -1,4 +1,5 @@ import { + Bot, ChevronDown, Database, LayoutDashboard, @@ -76,6 +77,7 @@ export function Shell({ } href="/" route={route} navigate={navigate}>{t("layout.dashboard")} } href="/accounts" route={route} navigate={navigate}>{t("layout.accounts")} } href="/channels" route={route} navigate={navigate}>{t("layout.channels")} + } href="/bots" route={route} navigate={navigate}>{t("layout.bots")} } href="/gifts" route={route} navigate={navigate}>{t("layout.gifts")}
} + > + +
+
+
{bot.FirstName || t("bots.unnamed")}
+
{displayUsername(bot.Username) || t("account.noUsername")}
+
+
+ {bot.System ? t("bots.system") : t("bots.user")} + {bot.Verified ? {t("common.verified")} : {t("account.notVerified")}} +
+
+
+ + 0 ? `${bot.OwnerUserID} ${displayUsername(detail.OwnerUsername)}`.trim() : t("common.none")} /> + + + +
+ {detail.About &&

{detail.About}

} + {detail.Description && detail.Description.trim() !== detail.About.trim() &&

{detail.Description}

} +
+ + +
+
+ } + side={ +
+
{t("bots.actionDock")}
+
+ } + tone="neutral" + path="/api/actions/set-verified" + payload={() => ({ user_id: bot.ID, verified: !bot.Verified })} + onDone={load} + /> +
+ {bot.System ? ( +

{t("bots.systemHint")}

+ ) : ( +
+ } + tone="danger" + path="/api/actions/delete-bot" + payload={() => ({ bot_user_id: bot.ID })} + onDone={() => navigate("/bots")} + /> +

{t("bots.deleteHint")}

+
+ )} +
+ } + /> + + ); +} diff --git a/cmd/telesrv-admin/web/src/pages/BotsPage.tsx b/cmd/telesrv-admin/web/src/pages/BotsPage.tsx new file mode 100644 index 00000000..a4cde501 --- /dev/null +++ b/cmd/telesrv-admin/web/src/pages/BotsPage.tsx @@ -0,0 +1,167 @@ +import { BadgeCheck, Bot, ChevronRight, Loader2, Plus, RefreshCw, Search } from "lucide-react"; +import { useEffect, useState } from "react"; +import { api, errorMessage } from "../api"; +import { ActionButton } from "../components/ActionButton"; +import { Alert, Badge, EmptyRow, Metric, PageFrame, QueryPanel } from "../components/ui"; +import { useI18n } from "../i18n"; +import { displayUsername, formatDate, toInt } from "../lib/format"; +import type { Navigate } from "../routing"; +import type { BotListResponse } from "../types"; + +export function BotsPage({ navigate }: { navigate: Navigate }) { + const { t } = useI18n(); + const [q, setQ] = useState(""); + const [limit, setLimit] = useState("50"); + const [data, setData] = useState(null); + const [cursor, setCursor] = useState(0); + const [busy, setBusy] = useState(false); + const [error, setError] = useState(""); + + const [ownerID, setOwnerID] = useState(""); + const [botName, setBotName] = useState(""); + const [botUsername, setBotUsername] = useState(""); + + async function load(next = false) { + setBusy(true); + setError(""); + const params = new URLSearchParams({ limit }); + if (q.trim()) { + params.set("q", q.trim()); + } else if (next) { + params.set("before_id", String(cursor)); + } + try { + const result = await api.bots(params); + setData(result); + setCursor(result.next_before_id); + } catch (err) { + setError(errorMessage(err)); + } finally { + setBusy(false); + } + } + + useEffect(() => { + void load(false); + }, []); + + const rows = data?.rows ?? []; + const verified = rows.filter((row) => row.Verified).length; + const systemCount = rows.filter((row) => row.System).length; + + return ( + load(false)} disabled={busy}> + {t("common.refresh")} + + } + > + {error && {error}} +
+ + + +
+ +
+
+
+

{t("bots.createTitle")}

+

{t("bots.createHint")}

+
+
+
+ + + +
+
+ {t("bots.usernameHint")} + } + tone="neutral" + path="/api/actions/create-bot" + payload={() => ({ + owner_user_id: toInt(ownerID), + name: botName.trim(), + username: botUsername.trim().replace(/^@/, "") + })} + onDone={() => load(false)} + /> +
+
+ + +
{ event.preventDefault(); void load(false); }}> + + + + {data?.listing && data.has_more && ( + + )} +
+
+ +
+ + + + + + + + + + + + + + + {rows.map((row) => ( + + + + + + + + + + + ))} + {rows.length === 0 && } + +
{t("bots.botID")}{t("common.username")}{t("common.name")}{t("bots.owner")}{t("common.verified")}{t("bots.type")}{t("account.createdAt")}
{row.ID}{displayUsername(row.Username) || "-"}{row.FirstName || "-"}{row.OwnerUserID > 0 ? row.OwnerUserID : "-"}{row.Verified ? {t("common.verified")} : {t("account.notVerified")}}{row.System ? {t("bots.system")} : {t("bots.user")}}{formatDate(row.CreatedAt)}
+
+
+ ); +} diff --git a/cmd/telesrv-admin/web/src/pages/Routes.tsx b/cmd/telesrv-admin/web/src/pages/Routes.tsx index 441a9e1d..a76dd433 100644 --- a/cmd/telesrv-admin/web/src/pages/Routes.tsx +++ b/cmd/telesrv-admin/web/src/pages/Routes.tsx @@ -3,6 +3,8 @@ import { AccountDetailPage } from "./AccountDetailPage"; import { AccountsPage } from "./AccountsPage"; import { ChannelDetailPage } from "./ChannelDetailPage"; import { ChannelsPage } from "./ChannelsPage"; +import { BotDetailPage } from "./BotDetailPage"; +import { BotsPage } from "./BotsPage"; import { Dashboard } from "./Dashboard"; import { GroupMessageDetailPage } from "./GroupMessageDetailPage"; import { GroupMessagesPage } from "./GroupMessagesPage"; @@ -13,17 +15,24 @@ import { GiftsPage } from "./GiftsPage"; export function Routes({ route, navigate }: { route: RouteState; navigate: Navigate }) { const accountID = route.path.match(/^\/accounts\/(\d+)$/)?.[1]; const channelID = route.path.match(/^\/channels\/(\d+)$/)?.[1]; + const botID = route.path.match(/^\/bots\/(\d+)$/)?.[1]; if (accountID) { return ; } if (channelID) { return ; } + if (botID) { + return ; + } if (route.path === "/accounts") { return ; } if (route.path === "/channels") { return ; + } + if (route.path === "/bots") { + return ; } if (route.path === "/gifts") { return ; diff --git a/cmd/telesrv-admin/web/src/routing.ts b/cmd/telesrv-admin/web/src/routing.ts index 43273165..a3a042e6 100644 --- a/cmd/telesrv-admin/web/src/routing.ts +++ b/cmd/telesrv-admin/web/src/routing.ts @@ -19,6 +19,7 @@ export function currentRoute(): RouteState { export function routeTitle(pathname: string, t: TFunction): string { if (pathname.startsWith("/accounts")) return t("route.accounts"); if (pathname.startsWith("/channels")) return t("route.channels"); + if (pathname.startsWith("/bots")) return t("route.bots"); if (pathname.startsWith("/messages")) return t("route.messages"); if (pathname.startsWith("/gifts")) return t("route.gifts"); return t("route.dashboard"); @@ -27,6 +28,7 @@ export function routeTitle(pathname: string, t: TFunction): string { export function routeSubtitle(pathname: string, t: TFunction): string { if (pathname.startsWith("/accounts")) return t("route.accountsSubtitle"); if (pathname.startsWith("/channels")) return t("route.channelsSubtitle"); + if (pathname.startsWith("/bots")) return t("route.botsSubtitle"); if (pathname.startsWith("/messages")) return t("route.messagesSubtitle"); if (pathname.startsWith("/gifts")) return t("route.giftsSubtitle"); return t("route.dashboardSubtitle"); diff --git a/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css b/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css index 2c3e0be3..51923628 100644 --- a/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css +++ b/cmd/telesrv-admin/web/src/styles/02-pages-and-forms.css @@ -577,3 +577,40 @@ textarea:focus { color: var(--muted); text-align: center; } + +.bot-create-fields { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 12px; +} + +.bot-create-fields .duration-field input { + width: 100%; +} + +.bot-create-actions { + display: flex; + align-items: center; + justify-content: space-between; + gap: 14px; + margin-top: 14px; + padding-top: 14px; + border-top: 1px solid var(--line); +} + +.bot-create-note { + color: var(--muted); + font-size: 12px; + line-height: 1.4; +} + +@media (max-width: 760px) { + .bot-create-fields { + grid-template-columns: 1fr; + } + + .bot-create-actions { + flex-direction: column; + align-items: stretch; + } +} diff --git a/cmd/telesrv-admin/web/src/types.ts b/cmd/telesrv-admin/web/src/types.ts index be00b027..d4963a65 100644 --- a/cmd/telesrv-admin/web/src/types.ts +++ b/cmd/telesrv-admin/web/src/types.ts @@ -99,6 +99,25 @@ export type ChannelDetail = { AuditLogs: AuditLogRow[]; }; +export type BotRow = { + ID: number; + Username: string; + FirstName: string; + Verified: boolean; + System: boolean; + OwnerUserID: number; + CreatedAt: string; + UpdatedAt: string; +}; + +export type BotDetail = { + Bot: BotRow; + About: string; + Description: string; + OwnerUsername: string; + AuditLogs: AuditLogRow[]; +}; + export type MessageRow = { OwnerUserID: number; BoxID: number; @@ -285,6 +304,15 @@ export type ChannelListResponse = { listing: boolean; }; +export type BotListResponse = { + query: string; + limit: number; + rows: BotRow[]; + has_more: boolean; + next_before_id: number; + listing: boolean; +}; + export type MessageListResponse = { owner_user_id: number; peer_id: number; diff --git a/cmd/telesrv/main.go b/cmd/telesrv/main.go index 2dd4e458..5aecfbc8 100644 --- a/cmd/telesrv/main.go +++ b/cmd/telesrv/main.go @@ -921,6 +921,7 @@ func run(logger *zap.Logger) error { ChannelNotifier: router, Messages: messagesService, Gifts: giftsService, + Bots: botsService, }) // bot session 撤销、在线通知与 @ChatBot 流式草稿推送经 router 实现(需 tg.* 边界), // router 创建后注入。 diff --git a/internal/admin/service.go b/internal/admin/service.go index 356c02b2..ce0e5edc 100644 --- a/internal/admin/service.go +++ b/internal/admin/service.go @@ -32,6 +32,8 @@ const ( ActionPublishGiftCollectibles = "gifts.collectibles.publish" ActionSetStarGiftEnabled = "gifts.set_enabled" ActionSetStarGiftSortOrder = "gifts.set_sort_order" + ActionCreateBot = "bot.create" + ActionDeleteBot = "bot.delete" maxCommandIDLength = 128 maxActorLength = 128 @@ -127,6 +129,14 @@ type OfficialGiftsSource interface { Bundle(ctx context.Context, giftID int64, includeCollectible bool) (officialgifts.Bundle, error) } +// BotService creates bot accounts on behalf of the admin. It mirrors the +// owner-scoped /newbot flow: a bot is a users row (is_bot=true) plus a bots row +// owned by ownerUserID, and the returned token is shown once to the operator. +type BotService interface { + CreateBot(ctx context.Context, ownerUserID int64, name, username string) (domain.User, string, error) + DeleteBot(ctx context.Context, botUserID int64) (domain.User, error) +} + type Dependencies struct { Commands CommandRepository Restrictions RestrictionStore @@ -142,6 +152,7 @@ type Dependencies struct { Messages MessagesService Gifts GiftsService OfficialGifts OfficialGiftsSource + Bots BotService Now func() time.Time } @@ -160,6 +171,7 @@ type Service struct { messages MessagesService gifts GiftsService officialGifts OfficialGiftsSource + bots BotService now func() time.Time } @@ -211,6 +223,9 @@ func (s *Service) Configure(deps Dependencies) *Service { if deps.OfficialGifts != nil { s.officialGifts = deps.OfficialGifts } + if deps.Bots != nil { + s.bots = deps.Bots + } if deps.Now != nil { s.now = deps.Now } @@ -346,6 +361,18 @@ type SetChannelVerifiedRequest struct { Verified bool `json:"verified"` } +type CreateBotRequest struct { + CommandMeta + OwnerUserID int64 `json:"owner_user_id"` + Name string `json:"name"` + Username string `json:"username"` +} + +type DeleteBotRequest struct { + CommandMeta + BotUserID int64 `json:"bot_user_id"` +} + type RevokeSessionsRequest struct { CommandMeta UserID int64 `json:"user_id"` @@ -691,6 +718,93 @@ func (s *Service) SetVerified(ctx context.Context, req SetVerifiedRequest) (Comm }) } +// CreateBot provisions a new bot account owned by ownerUserID. The dry-run stage +// only validates the display name and username; the confirm stage creates the +// users+bots rows and returns the freshly minted token in the result details so +// the operator can copy it once. +func (s *Service) CreateBot(ctx context.Context, req CreateBotRequest) (CommandResult, error) { + if s == nil || s.bots == nil { + return CommandResult{}, fmt.Errorf("admin bot dependency is not configured") + } + if req.OwnerUserID <= 0 { + return CommandResult{}, fmt.Errorf("owner_user_id is required") + } + name := strings.TrimSpace(req.Name) + if name == "" || len([]rune(name)) > domain.MaxBotNameLength { + return CommandResult{}, domain.ErrBotNameInvalid + } + username := strings.TrimSpace(strings.TrimPrefix(req.Username, "@")) + if !domain.ValidBotUsername(username) { + return CommandResult{}, domain.ErrBotUsernameInvalid + } + req.Name = name + req.Username = username + return s.runCommand(ctx, req.CommandMeta, ActionCreateBot, req.OwnerUserID, domain.Peer{}, req, func() (CommandResult, error) { + details := map[string]any{ + "owner_user_id": req.OwnerUserID, + "name": name, + "username": username, + } + if req.DryRun { + return CommandResult{Message: "bot creation validated", Details: details}, nil + } + bot, token, err := s.bots.CreateBot(ctx, req.OwnerUserID, name, username) + if err != nil { + return CommandResult{Details: details}, err + } + details["bot_user_id"] = bot.ID + // The token is a credential. It is surfaced once so the operator can copy + // it; it is also persisted in the audit result, so treat admin audit logs + // as sensitive. + details["token"] = token + if err := s.notifyUserChanged(ctx, bot); err != nil { + details["notify_error"] = err.Error() + } + return CommandResult{Message: "bot created", Details: details}, nil + }) +} + +// DeleteBot permanently removes a user-created bot. The dry-run stage verifies +// the target is a non-system bot; the confirm stage tombstones the account and +// invalidates its token. System bots are rejected outright. +func (s *Service) DeleteBot(ctx context.Context, req DeleteBotRequest) (CommandResult, error) { + if s == nil || s.bots == nil { + return CommandResult{}, fmt.Errorf("admin bot dependency is not configured") + } + if req.BotUserID <= 0 { + return CommandResult{}, fmt.Errorf("bot_user_id is required") + } + if domain.IsSystemUserID(req.BotUserID) { + return CommandResult{}, fmt.Errorf("system bots cannot be deleted") + } + return s.runCommand(ctx, req.CommandMeta, ActionDeleteBot, req.BotUserID, domain.Peer{}, req, func() (CommandResult, error) { + details := map[string]any{"bot_user_id": req.BotUserID} + if s.users != nil { + u, found, err := s.users.AdminUser(ctx, req.BotUserID) + if err != nil { + return CommandResult{}, err + } + if !found || !u.Bot { + return CommandResult{}, domain.ErrBotNotFound + } + details["username"] = u.Username + details["name"] = u.FirstName + } + if req.DryRun { + return CommandResult{Message: "bot deletion validated", Details: details}, nil + } + deleted, err := s.bots.DeleteBot(ctx, req.BotUserID) + if err != nil { + return CommandResult{Details: details}, err + } + details["deleted"] = true + if err := s.notifyUserChanged(ctx, deleted); err != nil { + details["notify_error"] = err.Error() + } + return CommandResult{Message: "bot deleted", Details: details}, nil + }) +} + func (s *Service) SetChannelVerified(ctx context.Context, req SetChannelVerifiedRequest) (CommandResult, error) { if req.ChannelID <= 0 { return CommandResult{}, fmt.Errorf("channel_id is required") diff --git a/internal/adminapi/server.go b/internal/adminapi/server.go index e7f07f14..a8428af4 100644 --- a/internal/adminapi/server.go +++ b/internal/adminapi/server.go @@ -30,6 +30,8 @@ type Service interface { GrantStars(ctx context.Context, req admin.GrantStarsRequest) (admin.CommandResult, error) SetVerified(ctx context.Context, req admin.SetVerifiedRequest) (admin.CommandResult, error) SetChannelVerified(ctx context.Context, req admin.SetChannelVerifiedRequest) (admin.CommandResult, error) + CreateBot(ctx context.Context, req admin.CreateBotRequest) (admin.CommandResult, error) + DeleteBot(ctx context.Context, req admin.DeleteBotRequest) (admin.CommandResult, error) RevokeSessions(ctx context.Context, req admin.RevokeSessionsRequest) (admin.CommandResult, error) DeletePrivateMessages(ctx context.Context, req admin.DeletePrivateMessagesRequest) (admin.CommandResult, error) DeletePrivateHistory(ctx context.Context, req admin.DeletePrivateHistoryRequest) (admin.CommandResult, error) @@ -97,6 +99,8 @@ func (s *Server) routes() http.Handler { mux.HandleFunc("POST /v1/accounts/set-verified", s.authenticated(s.handleSetVerified)) mux.HandleFunc("POST /v1/accounts/revoke-sessions", s.authenticated(s.handleRevokeSessions)) mux.HandleFunc("POST /v1/channels/set-verified", s.authenticated(s.handleSetChannelVerified)) + mux.HandleFunc("POST /v1/bots/create", s.authenticated(s.handleCreateBot)) + mux.HandleFunc("POST /v1/bots/delete", s.authenticated(s.handleDeleteBot)) mux.HandleFunc("POST /v1/messages/delete", s.authenticated(s.handleDeleteMessages)) mux.HandleFunc("POST /v1/messages/delete-history", s.authenticated(s.handleDeleteHistory)) mux.HandleFunc("POST /v1/gifts/import", s.authenticated(s.handleImportStarGift)) @@ -168,6 +172,24 @@ func (s *Server) handleSetChannelVerified(w http.ResponseWriter, r *http.Request writeCommandResult(w, result, err) } +func (s *Server) handleCreateBot(w http.ResponseWriter, r *http.Request) { + var req admin.CreateBotRequest + if !decodeJSON(w, r, &req) { + return + } + result, err := s.svc.CreateBot(r.Context(), req) + writeCommandResult(w, result, err) +} + +func (s *Server) handleDeleteBot(w http.ResponseWriter, r *http.Request) { + var req admin.DeleteBotRequest + if !decodeJSON(w, r, &req) { + return + } + result, err := s.svc.DeleteBot(r.Context(), req) + writeCommandResult(w, result, err) +} + func (s *Server) handleRevokeSessions(w http.ResponseWriter, r *http.Request) { var req admin.RevokeSessionsRequest if !decodeJSON(w, r, &req) { diff --git a/internal/adminapi/server_test.go b/internal/adminapi/server_test.go index b4591396..a2cdd49e 100644 --- a/internal/adminapi/server_test.go +++ b/internal/adminapi/server_test.go @@ -250,6 +250,14 @@ func (fakeService) SetChannelVerified(_ context.Context, req admin.SetChannelVer return admin.CommandResult{CommandID: req.CommandID, Status: "completed", DryRun: req.DryRun}, nil } +func (fakeService) CreateBot(_ context.Context, req admin.CreateBotRequest) (admin.CommandResult, error) { + return admin.CommandResult{CommandID: req.CommandID, Status: "completed", DryRun: req.DryRun}, nil +} + +func (fakeService) DeleteBot(_ context.Context, req admin.DeleteBotRequest) (admin.CommandResult, error) { + return admin.CommandResult{CommandID: req.CommandID, Status: "completed", DryRun: req.DryRun}, nil +} + func (fakeService) RevokeSessions(context.Context, admin.RevokeSessionsRequest) (admin.CommandResult, error) { return admin.CommandResult{}, nil } diff --git a/internal/app/bots/service.go b/internal/app/bots/service.go index a610b8cd..717c3528 100644 --- a/internal/app/bots/service.go +++ b/internal/app/bots/service.go @@ -448,6 +448,42 @@ func (s *Service) ListOwnedBots(ctx context.Context, ownerUserID int64) ([]domai return out, nil } +// botAccountDeleter is the optional store capability used to permanently delete +// a user-created bot. Only the Postgres store implements it, so the memory store +// and other BotStore mocks are unaffected. +type botAccountDeleter interface { + DeleteBotAccount(ctx context.Context, botUserID int64) (domain.User, error) +} + +// DeleteBot permanently removes a user-created bot. System service bots are +// rejected. Live sessions are dropped and the bot's caches are invalidated so +// the deletion is visible immediately. Returns the tombstoned user. +func (s *Service) DeleteBot(ctx context.Context, botUserID int64) (domain.User, error) { + if s == nil || s.bots == nil || botUserID == 0 { + return domain.User{}, domain.ErrBotNotFound + } + if domain.IsSystemUserID(botUserID) { + return domain.User{}, domain.ErrBotNotFound + } + deleter, ok := s.bots.(botAccountDeleter) + if !ok { + return domain.User{}, fmt.Errorf("bot deletion is not supported by the configured store") + } + // Drop live sessions up front so the token stops working even if a caller + // races the tombstone; DeleteBotAccount also revokes the authorization rows. + if s.hooks != nil { + if err := s.hooks.RevokeBotSessions(ctx, botUserID); err != nil { + s.log.Warn("revoke bot sessions before delete", zap.Int64("bot_user_id", botUserID), zap.Error(err)) + } + } + u, err := deleter.DeleteBotAccount(ctx, botUserID) + if err != nil { + return domain.User{}, err + } + s.invalidateBotReadCaches(ctx, botUserID) + return u, nil +} + // ExportBotToken 返回 bot token;revoke=true 时先轮换 secret 并撤销已登录 session。 func (s *Service) ExportBotToken(ctx context.Context, ownerUserID, botUserID int64, revoke bool) (string, error) { if revoke { diff --git a/internal/store/postgres/bot.go b/internal/store/postgres/bot.go index 2810ad0e..0be2b4aa 100644 --- a/internal/store/postgres/bot.go +++ b/internal/store/postgres/bot.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "strings" + "time" "github.com/jackc/pgerrcode" "github.com/jackc/pgx/v5" @@ -87,6 +88,91 @@ func (s *BotStore) CreateBotAccount(ctx context.Context, user domain.User, profi return userFromModel(row), profile, nil } +// DeleteBotAccount permanently removes a user-created bot in one transaction: +// it revokes the bot's sessions, purges its private state, releases its +// username, drops the bots row (which invalidates the token) and tombstones the +// users row. System service bots and non-bot users are rejected. The reused +// helpers are the same vetted primitives that back account deletion, so the +// tombstone satisfies users_deletion_state_check. Returns the tombstoned user +// for change notifications. +func (s *BotStore) DeleteBotAccount(ctx context.Context, botUserID int64) (domain.User, error) { + if botUserID == 0 || domain.IsSystemUserID(botUserID) { + return domain.User{}, domain.ErrBotNotFound + } + beginner, ok := s.db.(txBeginner) + if !ok { + return domain.User{}, fmt.Errorf("delete bot account: db does not support transactions") + } + tx, err := beginner.Begin(ctx) + if err != nil { + return domain.User{}, fmt.Errorf("delete bot account: begin: %w", err) + } + defer func() { _ = tx.Rollback(ctx) }() + + if err := lockUsersForUpdate(ctx, tx, botUserID); err != nil { + return domain.User{}, fmt.Errorf("delete bot account: lock: %w", err) + } + u, found, err := NewUserStore(tx).ByID(ctx, botUserID) + if err != nil { + return domain.User{}, err + } + if !found || !u.Bot || u.Deleted { + return domain.User{}, domain.ErrBotNotFound + } + // Only bots backed by a bots row (created via /newbot or the admin) are + // deletable here; system service bots are already excluded above. + var hasBotRow bool + if err := tx.QueryRow(ctx, `SELECT EXISTS(SELECT 1 FROM bots WHERE bot_user_id = $1)`, botUserID).Scan(&hasBotRow); err != nil { + return domain.User{}, fmt.Errorf("delete bot account: probe bots row: %w", err) + } + if !hasBotRow { + return domain.User{}, domain.ErrBotNotFound + } + + now := time.Now().UTC() + if err := enqueueAccountDeletionNotifications(ctx, tx, botUserID); err != nil { + return domain.User{}, err + } + if _, err := revokeByUserExceptTx(ctx, tx, botUserID, 0); err != nil { + return domain.User{}, fmt.Errorf("delete bot account: revoke sessions: %w", err) + } + if err := purgeDeletedAccountPrivateState(ctx, tx, botUserID, now); err != nil { + return domain.User{}, err + } + if err := replacePeerUsernameTx(ctx, tx, peerUsernameTypeUser, botUserID, ""); err != nil { + return domain.User{}, fmt.Errorf("delete bot account: release username: %w", err) + } + // Drop the bots row so the token can no longer authenticate a login. + if _, err := tx.Exec(ctx, `DELETE FROM bots WHERE bot_user_id = $1`, botUserID); err != nil { + return domain.User{}, fmt.Errorf("delete bot account: delete bots row: %w", err) + } + if _, err := tx.Exec(ctx, ` +UPDATE users SET + phone = '', first_name = '', last_name = '', username = '', country_code = '', about = '', + verified = false, support = false, last_seen_at = 0, + premium_expires_at = NULL, emoji_status_document_id = 0, emoji_status_until = 0, + emoji_status_collectible_id = NULL, emoji_status_collectible = '{}'::jsonb, + color_set = false, color = 0, color_background_emoji_id = 0, + profile_color_set = false, profile_color = 0, profile_color_background_emoji_id = 0, + birthday_day = 0, birthday_month = 0, birthday_year = 0, personal_channel_id = 0, + deleted_at = $2, deletion_source = 'manual', deletion_reason = 'admin bot deletion', + account_delete_at = NULL, updated_at = $2 +WHERE id = $1 AND deleted_at IS NULL`, botUserID, now); err != nil { + return domain.User{}, fmt.Errorf("delete bot account: tombstone: %w", err) + } + u, found, err = NewUserStore(tx).ByID(ctx, botUserID) + if err != nil || !found { + if err == nil { + err = domain.ErrUserNotFound + } + return domain.User{}, err + } + if err := tx.Commit(ctx); err != nil { + return domain.User{}, fmt.Errorf("delete bot account: commit: %w", err) + } + return u, nil +} + func (s *BotStore) GetBot(ctx context.Context, botUserID int64) (domain.BotProfile, bool, error) { if botUserID == 0 { return domain.BotProfile{}, false, nil From 313624eab20132e3bd8740006db5ad1a49e94fdd Mon Sep 17 00:00:00 2001 From: epilepticseizureee Date: Thu, 23 Jul 2026 04:00:29 +0300 Subject: [PATCH 3/5] admin: gift granting, collectible attribute/number control, and Layer 228 moderation tools Admin console additions (Layer 228): - Give Gifts: dedicated tab with sorted Lottie/TGS gift picker + inline form; grant any catalog gift to a user/channel from 777000 (no charge) - Upgraded/collectible delivery: mint a unique gift with admin-selected model/pattern/backdrop and custom number, or random/auto (DB FK + UNIQUE(gift_id,num) enforce invariants) - SCAM/FAKE flags for users/channels (migration 0136) with configurable profile warning (TELESRV_SCAM_WARNING/TELESRV_FAKE_WARNING) - Support toggle, force channel settings incl. gigagroup (migration 0137), username management, cosmetic color/emoji-status - Emoji admin tab (custom emoji list + document IDs + Lottie/TGS preview) - Bot management; soft UI / dark theme Wired through Router -> admin.Service -> adminapi -> BFF -> React panel (en/zh/ru). --- .env.example | 8 + cmd/telesrv-admin/readstore.go | 146 ++++- cmd/telesrv-admin/server.go | 368 +++++++++++ .../web/dist/assets/index-BB8hN3NX.js | 9 - .../web/dist/assets/index-BlWlOvtx.css | 1 - .../web/dist/assets/index-Bx7A77x9.js | 9 + .../web/dist/assets/index-XV_IEG5m.css | 1 + cmd/telesrv-admin/web/dist/index.html | 4 +- cmd/telesrv-admin/web/src/api.ts | 3 + .../web/src/components/Layout.tsx | 6 +- .../web/src/components/attributes.tsx | 168 +++++ .../web/src/components/flags.tsx | 59 ++ cmd/telesrv-admin/web/src/i18n.tsx | 219 +++++++ .../web/src/pages/AccountDetailPage.tsx | 9 + .../web/src/pages/AccountsPage.tsx | 3 +- .../web/src/pages/BotDetailPage.tsx | 8 + cmd/telesrv-admin/web/src/pages/BotsPage.tsx | 3 +- .../web/src/pages/ChannelDetailPage.tsx | 10 + .../web/src/pages/ChannelsPage.tsx | 3 +- cmd/telesrv-admin/web/src/pages/EmojiPage.tsx | 158 +++++ cmd/telesrv-admin/web/src/pages/GiftsPage.tsx | 2 +- .../web/src/pages/GiveGiftForm.tsx | 229 +++++++ .../web/src/pages/GiveGiftsPage.tsx | 83 +++ cmd/telesrv-admin/web/src/pages/Routes.tsx | 8 + cmd/telesrv-admin/web/src/routing.ts | 4 + .../src/styles/03-entities-and-actions.css | 167 +++++ cmd/telesrv-admin/web/src/types.ts | 32 + cmd/telesrv/main.go | 3 + .../migrations/0136_scam_fake_flags.down.sql | 7 + deploy/migrations/0136_scam_fake_flags.up.sql | 9 + .../0137_channel_gigagroup.down.sql | 2 + .../migrations/0137_channel_gigagroup.up.sql | 3 + docs/configuration.en.md | 2 + internal/admin/service.go | 613 ++++++++++++++++++ internal/admin/service_test.go | 120 ++++ internal/adminapi/server.go | 144 ++++ internal/adminapi/server_test.go | 48 ++ internal/app/channels/service.go | 40 ++ internal/app/files/emoji_animation.go | 79 +++ internal/app/users/service.go | 47 ++ internal/config/config.go | 8 + internal/domain/channel.go | 22 + internal/domain/star_gift.go | 28 + internal/domain/user.go | 2 + internal/rpc/convert_channels_core.go | 15 +- internal/rpc/convert_flags.go | 81 +++ internal/rpc/convert_users.go | 2 + internal/rpc/payments_star_gifts.go | 22 +- internal/rpc/payments_star_gifts_admin.go | 99 +++ internal/rpc/users.go | 5 + internal/store/channel.go | 5 + internal/store/memory/channel_settings.go | 104 +++ internal/store/memory/users.go | 27 + internal/store/postgres/channel_core.go | 2 +- internal/store/postgres/channel_settings.go | 171 +++++ internal/store/postgres/channel_store.go | 2 +- internal/store/postgres/queries/user.sql | 15 + internal/store/postgres/sqlcgen/bot.sql.go | 4 +- internal/store/postgres/sqlcgen/models.go | 2 + internal/store/postgres/sqlcgen/user.sql.go | 188 +++++- internal/store/postgres/star_gift_upgrade.go | 43 +- internal/store/postgres/user.go | 33 + internal/store/user.go | 4 + 63 files changed, 3650 insertions(+), 71 deletions(-) delete mode 100644 cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js delete mode 100644 cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css create mode 100644 cmd/telesrv-admin/web/dist/assets/index-Bx7A77x9.js create mode 100644 cmd/telesrv-admin/web/dist/assets/index-XV_IEG5m.css create mode 100644 cmd/telesrv-admin/web/src/components/attributes.tsx create mode 100644 cmd/telesrv-admin/web/src/components/flags.tsx create mode 100644 cmd/telesrv-admin/web/src/pages/EmojiPage.tsx create mode 100644 cmd/telesrv-admin/web/src/pages/GiveGiftForm.tsx create mode 100644 cmd/telesrv-admin/web/src/pages/GiveGiftsPage.tsx create mode 100644 deploy/migrations/0136_scam_fake_flags.down.sql create mode 100644 deploy/migrations/0136_scam_fake_flags.up.sql create mode 100644 deploy/migrations/0137_channel_gigagroup.down.sql create mode 100644 deploy/migrations/0137_channel_gigagroup.up.sql create mode 100644 internal/app/files/emoji_animation.go create mode 100644 internal/rpc/convert_flags.go create mode 100644 internal/rpc/payments_star_gifts_admin.go diff --git a/.env.example b/.env.example index d4211299..6aeed89e 100644 --- a/.env.example +++ b/.env.example @@ -91,6 +91,14 @@ TELESRV_PUBLIC_APP_LINK_BASE= TELESRV_PUBLIC_WEB_BASE_URL=https://web.telesrv.net TELESRV_PUBLIC_APP_NAME=telesrv +# Profile warning text injected into getFullUser/getFullChannel About for peers +# flagged SCAM/FAKE from the admin panel. Empty keeps built-in English defaults. +# Clients cannot localize server text, so set your audience language here. The +# stored bio/description is never overwritten; the warning is re-applied from the +# flag on every read and survives the owner editing their description. +TELESRV_SCAM_WARNING= +TELESRV_FAKE_WARNING= + # Admin API / Admin UI 配置 # # TELESRV_ADMIN_API_TOKEN 是主服务 (cmd/telesrv) 暴露 Admin REST API 的鉴权 token, diff --git a/cmd/telesrv-admin/readstore.go b/cmd/telesrv-admin/readstore.go index c16387bf..0d169fa9 100644 --- a/cmd/telesrv-admin/readstore.go +++ b/cmd/telesrv-admin/readstore.go @@ -43,6 +43,8 @@ type AccountRow struct { Frozen bool Reason string Verified bool + Scam bool + Fake bool PremiumUntil int64 LastActiveAt time.Time DeviceCount int @@ -53,6 +55,8 @@ type AccountDetail struct { About string LastSeenAt int64 Verified bool + Scam bool + Fake bool Support bool Bot bool StarsBalance int64 @@ -112,10 +116,19 @@ type ChannelRow struct { Broadcast bool Megagroup bool Forum bool - Monoforum bool - Verified bool - Deleted bool - ParticipantsCount int + Monoforum bool + Verified bool + Scam bool + Fake bool + Gigagroup bool + Deleted bool + AntiSpam bool + ParticipantsHidden bool + NoForwards bool + JoinToSend bool + JoinRequest bool + SlowmodeSeconds int + ParticipantsCount int AdminsCount int KickedCount int BannedCount int @@ -206,7 +219,7 @@ WITH auth AS ( GROUP BY user_id ) SELECT u.id, u.phone, u.username, u.first_name, u.last_name, u.created_at, u.updated_at, - COALESCE(r.frozen, false), COALESCE(r.reason, ''), u.verified, + COALESCE(r.frozen, false), COALESCE(r.reason, ''), u.verified, u.scam, u.fake, COALESCE(EXTRACT(EPOCH FROM u.premium_expires_at), 0)::bigint, COALESCE(a.last_active_at, '0001-01-01 00:00:00+00'::timestamptz), COALESCE(a.device_count, 0)::int, COALESCE(NULLIF(u.username, ''), p.username_lower, '') AS display_username @@ -224,7 +237,7 @@ LIMIT $5`, id, phone, phoneRaw, username, accountSearchLimit) out := make([]AccountRow, 0) for rows.Next() { var item AccountRow - if err := rows.Scan(&item.ID, &item.Phone, &item.Username, &item.FirstName, &item.LastName, &item.CreatedAt, &item.UpdatedAt, &item.Frozen, &item.Reason, &item.Verified, &item.PremiumUntil, &item.LastActiveAt, &item.DeviceCount, &item.Username); err != nil { + if err := rows.Scan(&item.ID, &item.Phone, &item.Username, &item.FirstName, &item.LastName, &item.CreatedAt, &item.UpdatedAt, &item.Frozen, &item.Reason, &item.Verified, &item.Scam, &item.Fake, &item.PremiumUntil, &item.LastActiveAt, &item.DeviceCount, &item.Username); err != nil { return nil, err } out = append(out, item) @@ -237,6 +250,8 @@ type BotRow struct { Username string FirstName string Verified bool + Scam bool + Fake bool System bool OwnerUserID int64 CreatedAt time.Time @@ -262,7 +277,7 @@ func (s *readStore) ListBots(ctx context.Context, beforeID int64, limit int) ([] limit = accountListMaxLimit } rows, err := s.pool.Query(ctx, ` -SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.verified, +SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.verified, u.scam, u.fake, COALESCE(b.owner_user_id, 0), u.created_at, u.updated_at FROM users u LEFT JOIN bots b ON b.bot_user_id = u.id @@ -277,7 +292,7 @@ LIMIT $2`, beforeID, limit+1) out := make([]BotRow, 0, limit+1) for rows.Next() { var item BotRow - if err := rows.Scan(&item.ID, &item.Username, &item.FirstName, &item.Verified, &item.OwnerUserID, &item.CreatedAt, &item.UpdatedAt); err != nil { + if err := rows.Scan(&item.ID, &item.Username, &item.FirstName, &item.Verified, &item.Scam, &item.Fake, &item.OwnerUserID, &item.CreatedAt, &item.UpdatedAt); err != nil { return nil, false, err } item.System = domain.IsSystemUserID(item.ID) @@ -304,7 +319,7 @@ func (s *readStore) SearchBots(ctx context.Context, q string) ([]BotRow, error) } username := strings.ToLower(strings.TrimPrefix(q, "@")) rows, err := s.pool.Query(ctx, ` -SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.verified, +SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.verified, u.scam, u.fake, COALESCE(b.owner_user_id, 0), u.created_at, u.updated_at FROM users u LEFT JOIN bots b ON b.bot_user_id = u.id @@ -319,7 +334,7 @@ LIMIT $3`, id, username, accountSearchLimit) out := make([]BotRow, 0) for rows.Next() { var item BotRow - if err := rows.Scan(&item.ID, &item.Username, &item.FirstName, &item.Verified, &item.OwnerUserID, &item.CreatedAt, &item.UpdatedAt); err != nil { + if err := rows.Scan(&item.ID, &item.Username, &item.FirstName, &item.Verified, &item.Scam, &item.Fake, &item.OwnerUserID, &item.CreatedAt, &item.UpdatedAt); err != nil { return nil, err } item.System = domain.IsSystemUserID(item.ID) @@ -331,14 +346,14 @@ LIMIT $3`, id, username, accountSearchLimit) func (s *readStore) BotDetail(ctx context.Context, botUserID int64) (BotDetail, error) { var out BotDetail err := s.pool.QueryRow(ctx, ` -SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.about, u.verified, +SELECT u.id, COALESCE(NULLIF(u.username, ''), p.username_lower, ''), u.first_name, u.about, u.verified, u.scam, u.fake, COALESCE(b.owner_user_id, 0), COALESCE(b.description, ''), u.created_at, u.updated_at FROM users u LEFT JOIN bots b ON b.bot_user_id = u.id LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id WHERE u.id = $1 AND u.is_bot AND u.deleted_at IS NULL`, botUserID).Scan( - &out.Bot.ID, &out.Bot.Username, &out.Bot.FirstName, &out.About, &out.Bot.Verified, + &out.Bot.ID, &out.Bot.Username, &out.Bot.FirstName, &out.About, &out.Bot.Verified, &out.Bot.Scam, &out.Bot.Fake, &out.Bot.OwnerUserID, &out.Description, &out.Bot.CreatedAt, &out.Bot.UpdatedAt, ) if err != nil { @@ -377,7 +392,8 @@ func (s *readStore) SearchChannels(ctx context.Context, q string) ([]ChannelRow, rows, err := s.pool.Query(ctx, ` SELECT c.id, c.access_hash, c.creator_user_id, c.title, c.about, COALESCE(NULLIF(c.username, ''), p.username_lower, '') AS display_username, - c.broadcast, c.megagroup, c.forum, c.monoforum, c.verified, c.deleted, + c.broadcast, c.megagroup, c.forum, c.monoforum, c.verified, c.scam, c.fake, c.gigagroup, c.deleted, + c.antispam, c.participants_hidden, c.noforwards, c.join_to_send, c.join_request, c.slowmode_seconds, c.participants_count, c.admins_count, c.kicked_count, c.banned_count, c.top_message_id, c.pinned_message_id, c.pts, c.date, c.created_at, c.updated_at FROM channels c @@ -410,7 +426,8 @@ func (s *readStore) ListChannels(ctx context.Context, beforeUpdatedUS, beforeID rows, err := s.pool.Query(ctx, ` SELECT c.id, c.access_hash, c.creator_user_id, c.title, c.about, COALESCE(NULLIF(c.username, ''), p.username_lower, '') AS display_username, - c.broadcast, c.megagroup, c.forum, c.monoforum, c.verified, c.deleted, + c.broadcast, c.megagroup, c.forum, c.monoforum, c.verified, c.scam, c.fake, c.gigagroup, c.deleted, + c.antispam, c.participants_hidden, c.noforwards, c.join_to_send, c.join_request, c.slowmode_seconds, c.participants_count, c.admins_count, c.kicked_count, c.banned_count, c.top_message_id, c.pinned_message_id, c.pts, c.date, c.created_at, c.updated_at FROM channels c @@ -442,7 +459,8 @@ func (s *readStore) ChannelDetail(ctx context.Context, channelID int64) (Channel err := s.pool.QueryRow(ctx, ` SELECT c.id, c.access_hash, c.creator_user_id, c.title, c.about, COALESCE(NULLIF(c.username, ''), p.username_lower, '') AS display_username, - c.broadcast, c.megagroup, c.forum, c.monoforum, c.verified, c.deleted, + c.broadcast, c.megagroup, c.forum, c.monoforum, c.verified, c.scam, c.fake, c.gigagroup, c.deleted, + c.antispam, c.participants_hidden, c.noforwards, c.join_to_send, c.join_request, c.slowmode_seconds, c.participants_count, c.admins_count, c.kicked_count, c.banned_count, c.top_message_id, c.pinned_message_id, c.pts, c.date, c.created_at, c.updated_at, row_to_json(c)::jsonb @@ -486,7 +504,8 @@ func scanChannelRow(row channelScanner, item *ChannelRow) error { func channelScanDest(item *ChannelRow) []any { return []any{ &item.ID, &item.AccessHash, &item.CreatorUserID, &item.Title, &item.About, &item.Username, - &item.Broadcast, &item.Megagroup, &item.Forum, &item.Monoforum, &item.Verified, &item.Deleted, + &item.Broadcast, &item.Megagroup, &item.Forum, &item.Monoforum, &item.Verified, &item.Scam, &item.Fake, &item.Gigagroup, &item.Deleted, + &item.AntiSpam, &item.ParticipantsHidden, &item.NoForwards, &item.JoinToSend, &item.JoinRequest, &item.SlowmodeSeconds, &item.ParticipantsCount, &item.AdminsCount, &item.KickedCount, &item.BannedCount, &item.TopMessageID, &item.PinnedMessageID, &item.PTS, &item.Date, &item.CreatedAt, &item.UpdatedAt, } @@ -511,7 +530,7 @@ WITH auth AS ( GROUP BY user_id ) SELECT u.id, u.phone, u.username, u.first_name, u.last_name, u.created_at, u.updated_at, - COALESCE(r.frozen, false), COALESCE(r.reason, ''), u.verified, + COALESCE(r.frozen, false), COALESCE(r.reason, ''), u.verified, u.scam, u.fake, COALESCE(EXTRACT(EPOCH FROM u.premium_expires_at), 0)::bigint, auth.last_active_at, auth.device_count, COALESCE(NULLIF(u.username, ''), p.username_lower, '') AS display_username @@ -530,7 +549,7 @@ LIMIT $3`, beforeActiveUS, beforeID, limit+1) out := make([]AccountRow, 0, limit+1) for rows.Next() { var item AccountRow - if err := rows.Scan(&item.ID, &item.Phone, &item.Username, &item.FirstName, &item.LastName, &item.CreatedAt, &item.UpdatedAt, &item.Frozen, &item.Reason, &item.Verified, &item.PremiumUntil, &item.LastActiveAt, &item.DeviceCount, &item.Username); err != nil { + if err := rows.Scan(&item.ID, &item.Phone, &item.Username, &item.FirstName, &item.LastName, &item.CreatedAt, &item.UpdatedAt, &item.Frozen, &item.Reason, &item.Verified, &item.Scam, &item.Fake, &item.PremiumUntil, &item.LastActiveAt, &item.DeviceCount, &item.Username); err != nil { return nil, false, err } out = append(out, item) @@ -549,7 +568,7 @@ func (s *readStore) AccountDetail(ctx context.Context, userID int64) (AccountDet var out AccountDetail err := s.pool.QueryRow(ctx, ` SELECT u.id, u.phone, u.username, u.first_name, u.last_name, u.created_at, u.updated_at, - u.about, u.last_seen_at, u.verified, u.support, u.is_bot, + u.about, u.last_seen_at, u.verified, u.scam, u.fake, u.support, u.is_bot, COALESCE(r.frozen, false), COALESCE(r.reason, ''), COALESCE(EXTRACT(EPOCH FROM u.premium_expires_at), 0)::bigint, COALESCE(sb.balance, 0)::bigint, COALESCE(sb.granted, false), @@ -560,7 +579,7 @@ LEFT JOIN stars_balances sb ON sb.user_id = u.id LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id WHERE u.id = $1`, userID).Scan( &out.Account.ID, &out.Account.Phone, &out.Account.Username, &out.Account.FirstName, &out.Account.LastName, - &out.Account.CreatedAt, &out.Account.UpdatedAt, &out.About, &out.LastSeenAt, &out.Verified, &out.Support, &out.Bot, + &out.Account.CreatedAt, &out.Account.UpdatedAt, &out.About, &out.LastSeenAt, &out.Verified, &out.Scam, &out.Fake, &out.Support, &out.Bot, &out.Account.Frozen, &out.Account.Reason, &out.Account.PremiumUntil, &out.StarsBalance, &out.StarsGranted, &out.Account.Username, ) if err != nil { @@ -962,3 +981,90 @@ func prettyJSON(raw []byte) string { } return string(out) } + +// EmojiRow is a custom-emoji document projection for the admin emoji browser. +type EmojiRow struct { + DocumentID int64 `json:"DocumentID,string"` + Alt string + MimeType string + Size int64 + SetTitle string + CreatedAt time.Time +} + +const emojiListDefaultLimit = 60 +const emojiListMaxLimit = 200 + +func scanEmojiRows(rows pgx.Rows) ([]EmojiRow, error) { + out := make([]EmojiRow, 0) + for rows.Next() { + var item EmojiRow + if err := rows.Scan(&item.DocumentID, &item.Alt, &item.MimeType, &item.Size, &item.CreatedAt, &item.SetTitle); err != nil { + return nil, err + } + out = append(out, item) + } + return out, rows.Err() +} + +const emojiSelectColumns = `d.id, + COALESCE((SELECT a->>'alt' FROM jsonb_array_elements(d.attributes) a WHERE a->>'kind' = 'custom_emoji' LIMIT 1), ''), + d.mime_type, d.size, d.created_at, + COALESCE((SELECT s.title FROM sticker_sets s WHERE s.emojis AND NOT s.deleted AND s.document_ids @> to_jsonb(d.id) LIMIT 1), '')` + +// ListEmoji pages over custom-emoji documents by descending id. +func (s *readStore) ListEmoji(ctx context.Context, beforeID int64, limit int) ([]EmojiRow, bool, error) { + if limit <= 0 { + limit = emojiListDefaultLimit + } + if limit > emojiListMaxLimit { + limit = emojiListMaxLimit + } + rows, err := s.pool.Query(ctx, ` +SELECT `+emojiSelectColumns+` +FROM documents d +WHERE d.attributes @> '[{"kind":"custom_emoji"}]'::jsonb + AND ($1::bigint = 0 OR d.id < $1) +ORDER BY d.id DESC +LIMIT $2`, beforeID, limit+1) + if err != nil { + return nil, false, fmt.Errorf("list emoji: %w", err) + } + defer rows.Close() + out, err := scanEmojiRows(rows) + if err != nil { + return nil, false, err + } + hasMore := len(out) > limit + if hasMore { + out = out[:limit] + } + return out, hasMore, nil +} + +// SearchEmoji finds custom-emoji documents by document id or emoticon substring. +func (s *readStore) SearchEmoji(ctx context.Context, q string) ([]EmojiRow, error) { + q = strings.TrimSpace(q) + if q == "" { + return nil, nil + } + id := int64(-1) + if n, err := strconv.ParseInt(q, 10, 64); err == nil { + id = n + } + rows, err := s.pool.Query(ctx, ` +SELECT `+emojiSelectColumns+` +FROM documents d +WHERE d.attributes @> '[{"kind":"custom_emoji"}]'::jsonb + AND (d.id = $1 OR EXISTS ( + SELECT 1 FROM jsonb_array_elements(d.attributes) a + WHERE a->>'kind' = 'custom_emoji' AND a->>'alt' ILIKE '%' || $2 || '%' + )) +ORDER BY d.id DESC +LIMIT $3`, id, q, emojiListMaxLimit) + if err != nil { + return nil, fmt.Errorf("search emoji: %w", err) + } + defer rows.Close() + return scanEmojiRows(rows) +} diff --git a/cmd/telesrv-admin/server.go b/cmd/telesrv-admin/server.go index e1ee773f..08a8bcc0 100644 --- a/cmd/telesrv-admin/server.go +++ b/cmd/telesrv-admin/server.go @@ -55,6 +55,8 @@ func (s *server) routes() http.Handler { mux.Handle("GET /api/channels/{id}", s.requireAuthAPI(http.HandlerFunc(s.handleChannelDetailAPI))) mux.Handle("GET /api/bots", s.requireAuthAPI(http.HandlerFunc(s.handleBotsAPI))) mux.Handle("GET /api/bots/{id}", s.requireAuthAPI(http.HandlerFunc(s.handleBotDetailAPI))) + mux.Handle("GET /api/emoji", s.requireAuthAPI(http.HandlerFunc(s.handleEmojiAPI))) + mux.Handle("GET /api/emoji/{id}/animation", s.requireAuthAPI(http.HandlerFunc(s.handleEmojiAnimationAPI))) mux.Handle("GET /api/messages", s.requireAuthAPI(http.HandlerFunc(s.handleMessagesAPI))) mux.Handle("GET /api/messages/detail", s.requireAuthAPI(http.HandlerFunc(s.handleMessageDetailAPI))) mux.Handle("GET /api/messages/groups", s.requireAuthAPI(http.HandlerFunc(s.handleGroupMessagesAPI))) @@ -69,6 +71,16 @@ func (s *server) routes() http.Handler { mux.Handle("POST /api/actions/grant-premium", s.requireAuthAPI(http.HandlerFunc(s.handleGrantPremiumAPI))) mux.Handle("POST /api/actions/grant-stars", s.requireAuthAPI(http.HandlerFunc(s.handleGrantStarsAPI))) mux.Handle("POST /api/actions/set-verified", s.requireAuthAPI(http.HandlerFunc(s.handleSetVerifiedAPI))) + mux.Handle("POST /api/actions/set-account-flags", s.requireAuthAPI(http.HandlerFunc(s.handleSetUserFlagsAPI))) + mux.Handle("POST /api/actions/set-channel-flags", s.requireAuthAPI(http.HandlerFunc(s.handleSetChannelFlagsAPI))) + mux.Handle("POST /api/actions/set-support", s.requireAuthAPI(http.HandlerFunc(s.handleSetSupportAPI))) + mux.Handle("POST /api/actions/set-account-username", s.requireAuthAPI(http.HandlerFunc(s.handleSetUsernameAPI))) + mux.Handle("POST /api/actions/set-account-color", s.requireAuthAPI(http.HandlerFunc(s.handleSetUserColorAPI))) + mux.Handle("POST /api/actions/set-account-emoji-status", s.requireAuthAPI(http.HandlerFunc(s.handleSetUserEmojiStatusAPI))) + mux.Handle("POST /api/actions/set-channel-settings", s.requireAuthAPI(http.HandlerFunc(s.handleSetChannelSettingsAPI))) + mux.Handle("POST /api/actions/set-channel-username", s.requireAuthAPI(http.HandlerFunc(s.handleSetChannelUsernameAPI))) + mux.Handle("POST /api/actions/set-channel-color", s.requireAuthAPI(http.HandlerFunc(s.handleSetChannelColorAPI))) + mux.Handle("POST /api/actions/set-channel-emoji-status", s.requireAuthAPI(http.HandlerFunc(s.handleSetChannelEmojiStatusAPI))) mux.Handle("POST /api/actions/create-bot", s.requireAuthAPI(http.HandlerFunc(s.handleCreateBotAPI))) mux.Handle("POST /api/actions/delete-bot", s.requireAuthAPI(http.HandlerFunc(s.handleDeleteBotAPI))) mux.Handle("POST /api/actions/set-channel-verified", s.requireAuthAPI(http.HandlerFunc(s.handleSetChannelVerifiedAPI))) @@ -80,6 +92,7 @@ func (s *server) routes() http.Handler { mux.Handle("POST /api/actions/publish-gift-collectibles", s.requireAuthAPI(http.HandlerFunc(s.handlePublishStarGiftCollectiblesAPI))) mux.Handle("POST /api/actions/set-gift-enabled", s.requireAuthAPI(http.HandlerFunc(s.handleSetStarGiftEnabledAPI))) mux.Handle("POST /api/actions/set-gift-sort-order", s.requireAuthAPI(http.HandlerFunc(s.handleSetStarGiftSortOrderAPI))) + mux.Handle("POST /api/actions/give-gift", s.requireAuthAPI(http.HandlerFunc(s.handleGiveGiftAPI))) mux.HandleFunc("/api/", func(w http.ResponseWriter, _ *http.Request) { writeAPIError(w, http.StatusNotFound, "api route not found") }) @@ -192,6 +205,73 @@ func (s *server) handleStarGiftsAPI(w http.ResponseWriter, r *http.Request) { writeJSON(w, http.StatusOK, map[string]any{"Gifts": rows}) } +func (s *server) handleEmojiAPI(w http.ResponseWriter, r *http.Request) { + if s.read == nil { + writeAPIError(w, http.StatusServiceUnavailable, "read store is not configured") + return + } + q := r.URL.Query().Get("q") + beforeID, _ := parseInt64(r.URL.Query().Get("before_id")) + limit, _ := parseInt(r.URL.Query().Get("limit")) + rows := []EmojiRow{} + hasMore := false + var err error + if strings.TrimSpace(q) != "" { + rows, err = s.read.SearchEmoji(r.Context(), q) + } else { + rows, hasMore, err = s.read.ListEmoji(r.Context(), beforeID, limit) + } + if err != nil { + writeAPIError(w, http.StatusInternalServerError, err.Error()) + return + } + nextBeforeID := int64(0) + if hasMore && len(rows) > 0 { + nextBeforeID = rows[len(rows)-1].DocumentID + } + writeJSON(w, http.StatusOK, map[string]any{ + "query": q, + "rows": rows, + "has_more": hasMore, + "next_before_id": nextBeforeID, + "listing": strings.TrimSpace(q) == "", + }) +} + +func (s *server) handleEmojiAnimationAPI(w http.ResponseWriter, r *http.Request) { + documentID, err := strconv.ParseInt(r.PathValue("id"), 10, 64) + if err != nil || documentID <= 0 { + writeAPIError(w, http.StatusBadRequest, "invalid document id") + return + } + req, err := http.NewRequestWithContext(r.Context(), http.MethodGet, + fmt.Sprintf("%s/v1/emoji/%d/animation", s.cfg.AdminAPIURL, documentID), nil) + if err != nil { + writeAPIError(w, http.StatusInternalServerError, err.Error()) + return + } + req.Header.Set("Authorization", "Bearer "+s.cfg.AdminAPIToken) + resp, err := http.DefaultClient.Do(req) + if err != nil { + writeAPIError(w, http.StatusBadGateway, err.Error()) + return + } + defer resp.Body.Close() + raw, err := io.ReadAll(io.LimitReader(resp.Body, (4<<20)+1)) + if err != nil || len(raw) > 4<<20 { + writeAPIError(w, http.StatusBadGateway, "invalid animation response") + return + } + if resp.StatusCode != http.StatusOK { + writeAPIError(w, resp.StatusCode, string(raw)) + return + } + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.Header().Set("Cache-Control", "private, max-age=60") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(raw) +} + func (s *server) handleStarGiftAnimationAPI(w http.ResponseWriter, r *http.Request) { giftID, err := strconv.ParseInt(r.PathValue("id"), 10, 64) if err != nil || giftID <= 0 { @@ -706,6 +786,254 @@ func (s *server) handleSetVerifiedAPI(w http.ResponseWriter, r *http.Request) { writeCommandResultAPI(w, result, err) } +type setUserFlagsAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + UserID int64 `json:"user_id"` + Scam bool `json:"scam"` + Fake bool `json:"fake"` +} + +func (s *server) handleSetUserFlagsAPI(w http.ResponseWriter, r *http.Request) { + var body setUserFlagsAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetUserFlagsRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-account-flags"), + UserID: body.UserID, + Scam: body.Scam, + Fake: body.Fake, + } + result, err := s.callAdminAPI(r.Context(), "/v1/accounts/set-flags", req) + writeCommandResultAPI(w, result, err) +} + +type setChannelFlagsAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + ChannelID int64 `json:"channel_id"` + Scam bool `json:"scam"` + Fake bool `json:"fake"` +} + +func (s *server) handleSetChannelFlagsAPI(w http.ResponseWriter, r *http.Request) { + var body setChannelFlagsAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetChannelFlagsRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-channel-flags"), + ChannelID: body.ChannelID, + Scam: body.Scam, + Fake: body.Fake, + } + result, err := s.callAdminAPI(r.Context(), "/v1/channels/set-flags", req) + writeCommandResultAPI(w, result, err) +} + +type setSupportAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + UserID int64 `json:"user_id"` + Support bool `json:"support"` +} + +func (s *server) handleSetSupportAPI(w http.ResponseWriter, r *http.Request) { + var body setSupportAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetSupportRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-support"), + UserID: body.UserID, + Support: body.Support, + } + result, err := s.callAdminAPI(r.Context(), "/v1/accounts/set-support", req) + writeCommandResultAPI(w, result, err) +} + +type setUsernameAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + UserID int64 `json:"user_id"` + Username string `json:"username"` +} + +func (s *server) handleSetUsernameAPI(w http.ResponseWriter, r *http.Request) { + var body setUsernameAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetUsernameRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-username"), + UserID: body.UserID, + Username: body.Username, + } + result, err := s.callAdminAPI(r.Context(), "/v1/accounts/set-username", req) + writeCommandResultAPI(w, result, err) +} + +type setUserColorAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + UserID int64 `json:"user_id"` + ForProfile bool `json:"for_profile"` + HasColor bool `json:"has_color"` + Color int `json:"color"` + BackgroundEmojiID int64 `json:"background_emoji_id,string"` +} + +func (s *server) handleSetUserColorAPI(w http.ResponseWriter, r *http.Request) { + var body setUserColorAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetUserColorRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-account-color"), + UserID: body.UserID, + PeerColorInput: admin.PeerColorInput{ + ForProfile: body.ForProfile, HasColor: body.HasColor, Color: body.Color, BackgroundEmojiID: body.BackgroundEmojiID, + }, + } + result, err := s.callAdminAPI(r.Context(), "/v1/accounts/set-color", req) + writeCommandResultAPI(w, result, err) +} + +type setUserEmojiStatusAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + UserID int64 `json:"user_id"` + DocumentID int64 `json:"document_id,string"` + Until int `json:"until"` +} + +func (s *server) handleSetUserEmojiStatusAPI(w http.ResponseWriter, r *http.Request) { + var body setUserEmojiStatusAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetUserEmojiStatusRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-account-emoji-status"), + UserID: body.UserID, + EmojiStatusInput: admin.EmojiStatusInput{DocumentID: body.DocumentID, Until: body.Until}, + } + result, err := s.callAdminAPI(r.Context(), "/v1/accounts/set-emoji-status", req) + writeCommandResultAPI(w, result, err) +} + +type setChannelSettingsAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + ChannelID int64 `json:"channel_id"` + Gigagroup *bool `json:"gigagroup,omitempty"` + AntiSpam *bool `json:"antispam,omitempty"` + ParticipantsHidden *bool `json:"participants_hidden,omitempty"` + NoForwards *bool `json:"noforwards,omitempty"` + JoinToSend *bool `json:"join_to_send,omitempty"` + JoinRequest *bool `json:"join_request,omitempty"` + SlowmodeSeconds *int `json:"slowmode_seconds,omitempty"` +} + +func (s *server) handleSetChannelSettingsAPI(w http.ResponseWriter, r *http.Request) { + var body setChannelSettingsAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetChannelSettingsRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-channel-settings"), + ChannelID: body.ChannelID, + Gigagroup: body.Gigagroup, + AntiSpam: body.AntiSpam, + ParticipantsHidden: body.ParticipantsHidden, + NoForwards: body.NoForwards, + JoinToSend: body.JoinToSend, + JoinRequest: body.JoinRequest, + SlowmodeSeconds: body.SlowmodeSeconds, + } + result, err := s.callAdminAPI(r.Context(), "/v1/channels/set-settings", req) + writeCommandResultAPI(w, result, err) +} + +type setChannelUsernameAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + ChannelID int64 `json:"channel_id"` + Username string `json:"username"` +} + +func (s *server) handleSetChannelUsernameAPI(w http.ResponseWriter, r *http.Request) { + var body setChannelUsernameAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetChannelUsernameRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-channel-username"), + ChannelID: body.ChannelID, + Username: body.Username, + } + result, err := s.callAdminAPI(r.Context(), "/v1/channels/set-username", req) + writeCommandResultAPI(w, result, err) +} + +type setChannelColorAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + ChannelID int64 `json:"channel_id"` + ForProfile bool `json:"for_profile"` + HasColor bool `json:"has_color"` + Color int `json:"color"` + BackgroundEmojiID int64 `json:"background_emoji_id,string"` +} + +func (s *server) handleSetChannelColorAPI(w http.ResponseWriter, r *http.Request) { + var body setChannelColorAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetChannelColorRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-channel-color"), + ChannelID: body.ChannelID, + PeerColorInput: admin.PeerColorInput{ + ForProfile: body.ForProfile, HasColor: body.HasColor, Color: body.Color, BackgroundEmojiID: body.BackgroundEmojiID, + }, + } + result, err := s.callAdminAPI(r.Context(), "/v1/channels/set-color", req) + writeCommandResultAPI(w, result, err) +} + +type setChannelEmojiStatusAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + ChannelID int64 `json:"channel_id"` + DocumentID int64 `json:"document_id,string"` + Until int `json:"until"` +} + +func (s *server) handleSetChannelEmojiStatusAPI(w http.ResponseWriter, r *http.Request) { + var body setChannelEmojiStatusAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.SetChannelEmojiStatusRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-channel-emoji-status"), + ChannelID: body.ChannelID, + EmojiStatusInput: admin.EmojiStatusInput{DocumentID: body.DocumentID, Until: body.Until}, + } + result, err := s.callAdminAPI(r.Context(), "/v1/channels/set-emoji-status", req) + writeCommandResultAPI(w, result, err) +} + type setChannelVerifiedAPIRequest struct { CommandID string `json:"command_id"` Reason string `json:"reason"` @@ -1029,6 +1357,46 @@ func (s *server) handleSetStarGiftSortOrderAPI(w http.ResponseWriter, r *http.Re writeCommandResultAPI(w, result, err) } +type giveGiftAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + SenderUserID int64 `json:"sender_user_id"` + UserID int64 `json:"user_id"` + ChannelID int64 `json:"channel_id"` + GiftID int64 `json:"gift_id,string"` + HideName bool `json:"hide_name"` + Message string `json:"message"` + Upgrade bool `json:"upgrade"` + ModelAttributeID int64 `json:"model_attribute_id,string"` + PatternAttributeID int64 `json:"pattern_attribute_id,string"` + BackdropAttributeID int64 `json:"backdrop_attribute_id,string"` + Num int `json:"num"` +} + +func (s *server) handleGiveGiftAPI(w http.ResponseWriter, r *http.Request) { + var body giveGiftAPIRequest + if !decodeAction(w, r, &body) { + return + } + req := admin.GiveGiftRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "give-gift"), + SenderUserID: body.SenderUserID, + UserID: body.UserID, + ChannelID: body.ChannelID, + GiftID: body.GiftID, + HideName: body.HideName, + Message: body.Message, + Upgrade: body.Upgrade, + ModelAttributeID: body.ModelAttributeID, + PatternAttributeID: body.PatternAttributeID, + BackdropAttributeID: body.BackdropAttributeID, + Num: body.Num, + } + result, err := s.callAdminAPI(r.Context(), "/v1/gifts/give", req) + writeCommandResultAPI(w, result, err) +} + func (s *server) commandMetaFromAPI(r *http.Request, commandID, reason string, confirm bool, prefix string) admin.CommandMeta { commandID = strings.TrimSpace(commandID) if confirm && strings.HasPrefix(commandID, "dry-") { diff --git a/cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js b/cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js deleted file mode 100644 index 3278d88a..00000000 --- a/cmd/telesrv-admin/web/dist/assets/index-BB8hN3NX.js +++ /dev/null @@ -1,9 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-Ee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` -`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{re=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ne(e):``}function ae(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 2:case 15:return e=ie(e.type,!1),e;case 11:return e=ie(e.type.render,!1),e;case 1:return e=ie(e.type,!0),e;default:return``}}function oe(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?oe(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return oe(e(t))}catch{}}return null}function se(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return oe(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function ce(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function le(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ue(e){var t=le(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function z(e){e._valueTracker||=ue(e)}function B(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=le(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function de(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function fe(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=ce(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function me(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function he(e,t){me(e,t);var n=ce(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?_e(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&_e(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ge(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function _e(e,t,n){(t!==`number`||de(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var ve=Array.isArray;function ye(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Te(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var W={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(W).forEach(function(e){Ee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),W[t]=W[e]})});function De(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||W.hasOwnProperty(e)&&W[e]?(``+t).trim():t+`px`}function Oe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=De(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var ke=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ae(e,t){if(t){if(ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function je(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Me=null;function Ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pe=null,Fe=null,Ie=null;function Le(e){if(e=ji(e)){if(typeof Pe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ni(t),Pe(e.stateNode,e.type,t))}}function Re(e){Fe?Ie?Ie.push(e):Ie=[e]:Fe=e}function ze(){if(Fe){var e=Fe,t=Ie;if(Ie=Fe=null,Le(e),t)for(e=0;e>>=0,e===0?32:31-(_t(e)/vt|0)|0}var bt=64,xt=4194304;function St(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ct(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=St(a))):r=St(s)}else o=n&~i,o===0?a!==0&&(r=St(a)):r=St(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function kt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function At(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gn),Jn=` `,Yn=!1;function Xn(e,t){switch(e){case`keyup`:return Un.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Zn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Qn=!1;function $n(e,t){switch(e){case`compositionend`:return Zn(t);case`keypress`:return t.which===32?(Yn=!0,Jn):null;case`textInput`:return e=t.data,e===Jn&&Yn?null:e;default:return null}}function er(e,t){if(Qn)return e===`compositionend`||!Wn&&Xn(e,t)?(e=mn(),pn=fn=dn=null,Qn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(){for(var e=window,t=de();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=de(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Er(e){var t=wr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Cr(n.ownerDocument.documentElement,n)){if(r!==null&&Tr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Sr(n,a);var o=Sr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Or=null,kr=null,Ar=null,jr=!1;function Mr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Or==null||Or!==de(r)||(r=Or,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ar&&br(Ar,r)||(Ar=r,r=ii(kr,`onSelect`),0Fi||(e.current=Pi[Fi],Pi[Fi]=null,Fi--)}function Ri(e,t){Fi++,Pi[Fi]=e.current,e.current=t}var zi={},Bi=Ii(zi),Vi=Ii(!1),Hi=zi;function Ui(e,t){var n=e.type.contextTypes;if(!n)return zi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Wi(e){return e=e.childContextTypes,e!=null}function Gi(){Li(Vi),Li(Bi)}function Ki(e,t,n){if(Bi.current!==zi)throw Error(r(168));Ri(Bi,t),Ri(Vi,n)}function qi(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,se(e)||`Unknown`,a));return R({},n,i)}function Ji(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zi,Hi=Bi.current,Ri(Bi,e),Ri(Vi,Vi.current),!0}function Yi(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=qi(e,t,Hi),i.__reactInternalMemoizedMergedChildContext=e,Li(Vi),Li(Bi),Ri(Bi,e)):Li(Vi),Ri(Vi,n)}var Xi=null,Zi=!1,Qi=!1;function $i(e){Xi===null?Xi=[e]:Xi.push(e)}function ea(e){Zi=!0,$i(e)}function ta(){if(!Qi&&Xi!==null){Qi=!0;var e=0,t=X;try{var n=Xi;for(X=1;e>=o,i-=o,la=1<<32-gt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),_a&&da(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),_a&&da(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return _a&&da(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),_a&&da(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&ja(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=ka(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=ka(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(ve(i))return h(e,r,i,o);if(ee(i))return g(e,r,i,o);Aa(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Na=Ma(!0),Pa=Ma(!1),Fa=Ii(null),Ia=null,La=null,Ra=null;function za(){Ra=La=Ia=null}function Ba(e){var t=Fa.current;Li(Fa),e._currentValue=t}function Va(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ha(e,t){Ia=e,Ra=La=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ms=!0),e.firstContext=null)}function Ua(e){var t=e._currentValue;if(Ra!==e)if(e={context:e,memoizedValue:t,next:null},La===null){if(Ia===null)throw Error(r(308));La=e,Ia.dependencies={lanes:0,firstContext:e}}else La=La.next=e;return t}var Wa=null;function Ga(e){Wa===null?Wa=[e]:Wa.push(e)}function Ka(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ga(t)):(n.next=i.next,i.next=n),t.interleaved=n,qa(e,r)}function qa(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ja=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Za(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,qa(e,n)}return i=r.interleaved,i===null?(t.next=t,Ga(r)):(t.next=i.next,i.next=t),r.interleaved=t,qa(e,n)}function $a(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}function eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ja=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:Ja=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function no(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vo.transition;vo.transition={};try{e(!1),t()}finally{X=n,vo.transition=r}}function as(){return Mo().memoizedState}function os(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cs(e))ls(t,n);else if(n=Ka(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),us(n,t,r)}}function ss(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cs(e))ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Z(s,o)){var c=t.interleaved;c===null?(i.next=i,Ga(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ka(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),us(n,t,r))}}function cs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function ls(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function us(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jt(e,n)}}var ds={readContext:Ua,useCallback:Do,useContext:Do,useEffect:Do,useImperativeHandle:Do,useInsertionEffect:Do,useLayoutEffect:Do,useMemo:Do,useReducer:Do,useRef:Do,useState:Do,useDebugValue:Do,useDeferredValue:Do,useTransition:Do,useMutableSource:Do,useSyncExternalStore:Do,useId:Do,unstable_isNewReconciler:!1},fs={readContext:Ua,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:Jo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Ko(4194308,4,Qo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ko(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ko(4,2,e,t)},useMemo:function(e,t){var n=jo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=jo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=os.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:Uo,useDebugValue:es,useDeferredValue:function(e){return jo().memoizedState=e},useTransition:function(){var e=Uo(!1),t=e[0];return e=is.bind(null,e[1]),jo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=bo,a=jo();if(_a){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Vc===null)throw Error(r(349));yo&30||Ro(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Jo(Bo.bind(null,i,o,e),[e]),i.flags|=2048,Wo(9,zo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=jo(),t=Vc.identifierPrefix;if(_a){var n=ua,r=la;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=To++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[wi]=t,e[Ti]=i,nc(e,t,!1,!1),t.stateNode=e;a:{switch(c=je(n,i),n){case`dialog`:Zr(`cancel`,e),Zr(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:Zr(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;oel&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304)}else{if(!i)if(e=mo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ac(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!_a)return oc(t),null}else 2*ot()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,i=!0,ac(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(oc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ot(),t.sibling=null,n=po.current,Ri(po,i?n&1|2:n&1),t);case 22:case 23:return wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Wc&1073741824&&(oc(t),t.subtreeFlags&6&&(t.flags|=8192)):oc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function cc(e,t){switch(ma(t),t.tag){case 1:return Wi(t.type)&&Gi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),Li(Vi),Li(Bi),go(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fo(t),null;case 13:if(Li(po),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Li(po),null;case 4:return lo(),null;case 10:return Ba(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var lc=!1,uc=!1,dc=typeof WeakSet==`function`?WeakSet:Set,Q=null;function fc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}function pc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var mc=!1;function hc(e,t){if(fi=rn,e=wr(),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(pi={focusedElem:e,selectionRange:n},rn=!1,Q=t;Q!==null;)if(t=Q,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:hs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=mc,mc=!1,h}function gc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&pc(t,n,a)}i=i.next}while(i!==r)}}function _c(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function vc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function yc(e){var t=e.alternate;t!==null&&(e.alternate=null,yc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wi],delete t[Ti],delete t[Di],delete t[Oi],delete t[ki])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function bc(e){return e.tag===5||e.tag===3||e.tag===4}function xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=di));else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}function Cc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Cc(e,t,n),e=e.sibling;e!==null;)Cc(e,t,n),e=e.sibling}var wc=null,Tc=!1;function Ec(e,t,n){for(n=n.child;n!==null;)Dc(e,t,n),n=n.sibling}function Dc(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount==`function`)try{mt.onCommitFiberUnmount(pt,n)}catch{}switch(n.tag){case 5:uc||fc(n,t);case 6:var r=wc,i=Tc;wc=null,Ec(e,t,n),wc=r,Tc=i,wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wc.removeChild(n.stateNode));break;case 18:wc!==null&&(Tc?(e=wc,n=n.stateNode,e.nodeType===8?bi(e.parentNode,n):e.nodeType===1&&bi(e,n),tn(e)):bi(wc,n.stateNode));break;case 4:r=wc,i=Tc,wc=n.stateNode.containerInfo,Tc=!0,Ec(e,t,n),wc=r,Tc=i;break;case 0:case 11:case 14:case 15:if(!uc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&pc(n,t,o),i=i.next}while(i!==r)}Ec(e,t,n);break;case 1:if(!uc&&(fc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Ec(e,t,n);break;case 21:Ec(e,t,n);break;case 22:n.mode&1?(uc=(r=uc)||n.memoizedState!==null,Ec(e,t,n),uc=r):Ec(e,t,n);break;default:Ec(e,t,n)}}function Oc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new dc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function kc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=ot()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Lc(i/1960))-i,10e?16:e,ol===null)var i=!1;else{if(e=ol,ol=null,sl=0,$&6)throw Error(r(331));var a=$;for($|=4,Q=e.current;Q!==null;){var o=Q,s=o.child;if(Q.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lot()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=xt,xt<<=1,!(xt&130023424)&&(xt=4194304)):t=1);var n=fl();e=qa(e,t),e!==null&&(kt(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vi.current)Ms=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ms=!1,tc(e,t,n);Ms=!!(e.flags&131072)}else Ms=!1,_a&&t.flags&1048576&&fa(t,aa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;$s(e,t),e=t.pendingProps;var a=Ui(t,Bi.current);Ha(t,n),a=ko(null,t,i,e,a,n);var o=Ao();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Wi(i)?(o=!0,Ji(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ya(t),a.updater=_s,t.stateNode=a,a._reactInternals=t,xs(t,i,e,n),t=Vs(null,t,i,!0,o,n)):(t.tag=0,_a&&o&&pa(t),Ns(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch($s(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=hs(i,e),a){case 0:t=zs(null,t,i,e,n);break a;case 1:t=Bs(null,t,i,e,n);break a;case 11:t=Ps(null,t,i,e,n);break a;case 14:t=Fs(null,t,i,hs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),zs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Bs(e,t,i,a,n);case 3:a:{if(Hs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Xa(e,t),to(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ss(Error(r(423)),t),t=Us(e,t,i,n,a);break a}else if(i!==a){a=Ss(Error(r(424)),t),t=Us(e,t,i,n,a);break a}else for(ga=xi(t.stateNode.containerInfo.firstChild),ha=t,_a=!0,va=null,n=Pa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ea(),i===a){t=ec(e,t,n);break a}Ns(e,t,i,n)}t=t.child}return t;case 5:return uo(t),e===null&&Sa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,mi(i,a)?s=null:o!==null&&mi(i,o)&&(t.flags|=32),Rs(e,t),Ns(e,t,s,n),t.child;case 6:return e===null&&Sa(t),null;case 13:return Ks(e,t,n);case 4:return co(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Na(t,null,i,n):Ns(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),Ps(e,t,i,a,n);case 7:return Ns(e,t,t.pendingProps,n),t.child;case 8:return Ns(e,t,t.pendingProps.children,n),t.child;case 12:return Ns(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ri(Fa,i._currentValue),i._currentValue=s,o!==null)if(Z(o.value,s)){if(o.children===a.children&&!Vi.current){t=ec(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Za(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Va(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Va(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ns(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Ha(t,n),a=Ua(a),i=i(a),t.flags|=1,Ns(e,t,i,n),t.child;case 14:return i=t.type,a=hs(i,t.pendingProps),a=hs(i.type,a),Fs(e,t,i,a,n);case 15:return Is(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:hs(i,a),$s(e,t),t.tag=1,Wi(i)?(e=!0,Ji(t)):e=!1,Ha(t,n),ys(t,i,a),xs(t,i,a,n),Vs(null,t,i,!0,e,n);case 19:return Qs(e,t,n);case 22:return Ls(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return nt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Kl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ot(0),this.expirationTimes=Ot(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ot(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=typeof FormData<`u`&&t.body instanceof FormData,r=await fetch(e,{credentials:`same-origin`,headers:n?t.headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok){let e=a?.error||a?.Error||a?.message||r.statusText;throw new v(r.status,e)}return a}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),bots:e=>y(`/api/bots?${e.toString()}`),bot:e=>y(`/api/bots/${e}`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),gifts:()=>y(`/api/gifts`),officialGifts:()=>y(`/api/official-gifts`),officialGiftAnimation:e=>y(`/api/official-gifts/${encodeURIComponent(e)}/animation`),giftAnimation:e=>y(`/api/gifts/${encodeURIComponent(e)}/animation`),giftCollectibles:e=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles`),giftCollectibleAnimation:(e,t,n)=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles/${t}/${encodeURIComponent(n)}/animation`),importGift:e=>y(`/api/actions/import-gift`,{method:`POST`,body:e}),importOfficialGift:e=>y(`/api/actions/import-official-gift`,{method:`POST`,body:JSON.stringify(e)}),publishGiftCollectibles:(e,t)=>y(`/api/actions/publish-gift-collectibles?gift_id=${encodeURIComponent(e)}`,{method:`POST`,body:t}),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},S=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),C=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...w,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),E=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(T,{ref:i,iconNode:t,className:C(`lucide-${S(e)}`,n),...r}));return n.displayName=`${e}`,n},D=E(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=E(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),k=E(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),A=E(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),j=E(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),M=E(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),N=E(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),P=E(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),F=E(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),I=E(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),L=E(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ee=E(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),R=E(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),te=E(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),ne=E(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),re=E(`Gem`,[[`path`,{d:`M6 3h12l4 6-10 13L2 9Z`,key:`1pcd5k`}],[`path`,{d:`M11 3 8 9l4 13 4-13-3-6`,key:`1fcu3u`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),ie=E(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),ae=E(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),oe=E(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),se=E(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),ce=E(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),le=E(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),ue=E(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),z=E(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),B=E(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),de=E(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),fe=E(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),pe=E(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),me=E(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),he=E(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ge=E(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),_e=E(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ve=E(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),ye=E(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),be=E(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),V=E(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),H=E(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),xe=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),U=o(((e,t)=>{t.exports=xe()}))(),Se=`telesrv.admin.lang`,Ce={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"route.gifts":`Star Gifts`,"route.giftsSubtitle":`Console / Star Gifts`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.gifts":`Star Gifts`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Switch to dark theme`,"theme.switchToLight":`Switch to light theme`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.accountFrozen":`Account frozen`,"account.accountActive":`Account active`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeAccount":`Freeze account`,"account.updateFreeze":`Update freeze`,"account.unfreezeAccount":`Unfreeze account`,"account.freezeSince":`Frozen since`,"account.freezeUntil":`Appeal deadline`,"account.freezeUntilAria":`Freeze appeal deadline`,"account.freezeAppealURL":`Appeal URL`,"account.freezeAppealURLAria":`Freeze appeal URL`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"route.bots":`Bots`,"route.botsSubtitle":`Console / Bots`,"layout.bots":`Bots`,"bots.pageTitle":`Bots`,"bots.queryResults":`Search results`,"bots.recent":`Recently created bots`,"bots.currentPage":`Bots on page`,"bots.banned":`Banned`,"bots.active":`Active`,"bots.createTitle":`Create a system bot`,"bots.createHint":`Provision a bot account owned by the given user. The token is shown once after confirmation.`,"bots.ownerUserID":`Owner user ID`,"bots.name":`Display name`,"bots.namePlaceholder":`e.g. Service Bot`,"bots.username":`Username`,"bots.usernameHint":`Username must be 5-32 characters and end with 'bot'.`,"bots.create":`Create bot`,"bots.searchPlaceholder":`Bot ID / username`,"bots.botID":`Bot ID`,"bots.owner":`Owner`,"bots.status":`Status`,"bots.detailTitle":`Bot #{id}`,"bots.profile":`Bot Profile`,"bots.loadingDetail":`Loading bot detail`,"bots.unnamed":`Unnamed bot`,"bots.restriction":`Restriction`,"bots.actionDock":`Bot Actions`,"bots.banUntil":`Ban until`,"bots.ban":`Ban bot`,"bots.updateBan":`Update ban`,"bots.unban":`Unban bot`,"bots.type":`Type`,"bots.system":`System`,"bots.user":`User`,"bots.delete":`Delete bot`,"bots.deleteHint":`Permanently deletes this user-created bot and invalidates its token. This cannot be undone.`,"bots.systemHint":`System bots are built in and cannot be deleted.`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"gifts.pageTitle":`Star Gift Catalog`,"gifts.eyebrow":`Catalog, immutable revisions and animation assets`,"gifts.total":`Catalog entries`,"gifts.enabled":`Enabled`,"gifts.received":`Received gifts`,"gifts.formats":`Accepted formats`,"gifts.add":`Add gift`,"gifts.searchPlaceholder":`Search gift ID, title or format`,"gifts.listSummary":`Showing {shown} of {total}`,"gifts.idRevision":`ID / Revision`,"gifts.price":`Price / Conversion`,"gifts.importTitle":`Import a Star Gift`,"gifts.importEyebrow":`Gift catalog operation`,"gifts.newRevision":`Create revision for gift #{id}`,"gifts.importHint":`Upload TGS or plain Lottie JSON. Lottie is normalized and compressed to TGS.`,"gifts.officialSource":`Official snapshot`,"gifts.fileSource":`Upload file`,"gifts.officialHint":`Choose a verified gift from data/official-gifts. Complete collectible pools are imported atomically.`,"gifts.officialSearch":`Search official gift ID or title`,"gifts.officialSelect":`Choose an official gift`,"gifts.officialRequired":`Choose an official gift first`,"gifts.officialResults":`Showing {shown} of {total}`,"gifts.officialCategoryLabel":`Official gift capability category`,"gifts.officialCategory.all":`All`,"gifts.officialCategory.upgrade":`Upgradable`,"gifts.officialCategory.craft":`Craftable`,"gifts.officialCategory.basic":`Not upgradable`,"gifts.officialUnnamed":`Unnamed official gift #{id}`,"gifts.officialAttributes":`{count} attributes`,"gifts.canUpgrade":`Can upgrade`,"gifts.cannotUpgrade":`Cannot upgrade`,"gifts.canCraft":`Can Craft`,"gifts.cannotCraft":`Cannot Craft`,"gifts.officialEmpty":`No official gifts match this category and search.`,"gifts.includeCollectible":`Import the complete collectible pool, including crafted models`,"gifts.animation":`Animation file`,"gifts.filePrompt":`Drop or choose a TGS / Lottie file`,"gifts.fileHint":`TGS, JSON or Lottie · validated before import`,"gifts.chooseFile":`Choose file`,"gifts.changeFile":`Change file`,"gifts.title":`Display title`,"gifts.titlePlaceholder":`e.g. Celebration Star`,"gifts.stars":`Price in Stars`,"gifts.convertStars":`Conversion Stars`,"gifts.sortOrder":`Sort order`,"gifts.reason":`Audit reason`,"gifts.reasonPlaceholder":`Briefly describe why this gift is being imported`,"gifts.enableAfterImport":`Enable after import`,"gifts.validate":`Dry-run validation`,"gifts.confirmImport":`Confirm import`,"gifts.stepDetails":`File and details`,"gifts.stepValidate":`Dry-run validation`,"gifts.stepImport":`Confirm import`,"gifts.fileRequired":`Choose a TGS or Lottie file first`,"gifts.source":`Source`,"gifts.replace":`New revision`,"gifts.disable":`Disable`,"gifts.enable":`Enable`,"gifts.empty":`No Star Gifts have been imported.`,"gifts.emptyHint":`Import the first animation above to build the gift catalog.`,"gifts.validationReady":`Validation passed`,"gifts.validationHint":`Review the normalized metadata, then confirm the import.`,"gifts.confirmState":`Apply the validated state change to gift #{id}?`,"collectibles.manage":`Attribute pool`,"collectibles.title":`Collectible pool · Gift #{id}`,"collectibles.eyebrow":`Unique gift attributes`,"collectibles.activeRevision":`Published revision {revision}`,"collectibles.published":`Published`,"collectibles.noPool":`No collectible pool published`,"collectibles.noPoolHint":`Publish models, patterns and backdrops to enable upgrades.`,"collectibles.publishNew":`Publish a new immutable revision`,"collectibles.immutableHint":`Dry-run checks every file and the attribute-pool structure before the revision becomes active.`,"collectibles.upgradeStars":`Upgrade price in Stars`,"collectibles.supply":`Unique supply`,"collectibles.slug":`Public slug prefix`,"collectibles.models":`Models`,"collectibles.patterns":`Patterns`,"collectibles.backdrops":`Backdrops`,"collectibles.model":`Model`,"collectibles.pattern":`Pattern`,"collectibles.backdrop":`Backdrop`,"collectibles.rarity":`Rarity ‰`,"collectibles.rarityHint":`Keep at least two attributes. Permille values are relative regular-upgrade weights; add/remove redistributes them to 1000.`,"collectibles.minimumAttributes":`Models, patterns, and backdrops must each contain at least two attributes.`,"collectibles.duplicateBackdropID":`Backdrop IDs must be unique within the pool.`,"collectibles.colorHint":`Colors are stored as 24-bit RGB values.`,"collectibles.addAttribute":`Add`,"collectibles.remove":`Remove attribute`,"collectibles.fileRequired":`Every model and pattern needs a TGS or Lottie file.`,"collectibles.backdropID":`Backdrop ID`,"collectibles.color.center":`Center`,"collectibles.color.edge":`Edge`,"collectibles.color.pattern":`Pattern`,"collectibles.color.text":`Text`,"collectibles.validationReady":`Attribute pool is valid`,"collectibles.validationHint":`Review the normalized assets, then publish this immutable revision.`,"collectibles.publish":`Publish revision`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"route.gifts":`星星礼物`,"route.giftsSubtitle":`控制台 / 星星礼物`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.gifts":`礼物目录`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`切换到深色主题`,"theme.switchToLight":`切换到浅色主题`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.accountFrozen":`账号已冻结`,"account.accountActive":`账号正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeAccount":`冻结账号`,"account.updateFreeze":`更新冻结信息`,"account.unfreezeAccount":`解冻账号`,"account.freezeSince":`冻结开始时间`,"account.freezeUntil":`申诉截止时间`,"account.freezeUntilAria":`账号冻结申诉截止时间`,"account.freezeAppealURL":`申诉链接`,"account.freezeAppealURLAria":`账号冻结申诉链接`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"route.bots":`机器人`,"route.botsSubtitle":`控制台 / 机器人`,"layout.bots":`机器人`,"bots.pageTitle":`机器人`,"bots.queryResults":`查询结果`,"bots.recent":`最近创建的机器人`,"bots.currentPage":`当前页机器人`,"bots.banned":`已封禁`,"bots.active":`正常`,"bots.createTitle":`创建系统机器人`,"bots.createHint":`为指定用户创建机器人账号。确认后 token 只显示一次。`,"bots.ownerUserID":`所属用户 ID`,"bots.name":`显示名称`,"bots.namePlaceholder":`例如:服务机器人`,"bots.username":`用户名`,"bots.usernameHint":`用户名需 5-32 个字符,且以 bot 结尾。`,"bots.create":`创建机器人`,"bots.searchPlaceholder":`机器人 ID / 用户名`,"bots.botID":`机器人 ID`,"bots.owner":`所属用户`,"bots.status":`状态`,"bots.detailTitle":`机器人 #{id}`,"bots.profile":`机器人档案`,"bots.loadingDetail":`加载机器人详情`,"bots.unnamed":`未命名机器人`,"bots.restriction":`限制状态`,"bots.actionDock":`机器人操作`,"bots.banUntil":`封禁至`,"bots.ban":`封禁机器人`,"bots.updateBan":`更新封禁`,"bots.unban":`解封机器人`,"bots.type":`类型`,"bots.system":`系统`,"bots.user":`用户`,"bots.delete":`删除机器人`,"bots.deleteHint":`永久删除该用户创建的机器人并使其 token 失效。此操作不可撤销。`,"bots.systemHint":`系统内置机器人不可删除。`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"gifts.pageTitle":`星星礼物目录`,"gifts.eyebrow":`目录、不可变版本与动画资源`,"gifts.total":`目录条目`,"gifts.enabled":`已启用`,"gifts.received":`已领取礼物`,"gifts.formats":`支持格式`,"gifts.add":`添加礼物`,"gifts.searchPlaceholder":`搜索礼物 ID、标题或格式`,"gifts.listSummary":`显示 {shown} / {total} 项`,"gifts.idRevision":`ID / 版本`,"gifts.price":`售价 / 兑换`,"gifts.importTitle":`导入星星礼物`,"gifts.importEyebrow":`礼物目录操作`,"gifts.newRevision":`为礼物 #{id} 创建新版本`,"gifts.importHint":`支持 TGS 或纯 Lottie JSON;Lottie 会规范化并压缩成 TGS。`,"gifts.officialSource":`官方资源库`,"gifts.fileSource":`上传文件`,"gifts.officialHint":`从 data/official-gifts 的已校验快照中选择;完整 collectible 属性池会与礼物原子导入。`,"gifts.officialSearch":`搜索官方礼物 ID 或标题`,"gifts.officialSelect":`请选择官方礼物`,"gifts.officialRequired":`请先选择一个官方礼物`,"gifts.officialResults":`显示 {shown} / {total} 项`,"gifts.officialCategoryLabel":`官方礼物能力分类`,"gifts.officialCategory.all":`全部`,"gifts.officialCategory.upgrade":`可升级`,"gifts.officialCategory.craft":`可 Craft`,"gifts.officialCategory.basic":`不可升级`,"gifts.officialUnnamed":`未命名官方礼物 #{id}`,"gifts.officialAttributes":`{count} 个属性`,"gifts.canUpgrade":`可升级`,"gifts.cannotUpgrade":`不可升级`,"gifts.canCraft":`可 Craft`,"gifts.cannotCraft":`不可 Craft`,"gifts.officialEmpty":`当前分类和搜索条件下没有官方礼物。`,"gifts.includeCollectible":`完整导入 collectible 属性池(包含 crafted 模型)`,"gifts.animation":`动画文件`,"gifts.filePrompt":`拖放或选择 TGS / Lottie 文件`,"gifts.fileHint":`支持 TGS、JSON、Lottie,导入前会先进行校验`,"gifts.chooseFile":`选择文件`,"gifts.changeFile":`更换文件`,"gifts.title":`显示标题`,"gifts.titlePlaceholder":`例如:庆典星星`,"gifts.stars":`售价 Stars`,"gifts.convertStars":`可兑换 Stars`,"gifts.sortOrder":`排序值`,"gifts.reason":`审计原因`,"gifts.reasonPlaceholder":`简要说明本次导入礼物的原因`,"gifts.enableAfterImport":`导入后启用`,"gifts.validate":`Dry-run 校验`,"gifts.confirmImport":`确认导入`,"gifts.stepDetails":`文件与信息`,"gifts.stepValidate":`Dry-run 校验`,"gifts.stepImport":`确认导入`,"gifts.fileRequired":`请先选择 TGS 或 Lottie 文件`,"gifts.source":`来源`,"gifts.replace":`创建新版本`,"gifts.disable":`停用`,"gifts.enable":`启用`,"gifts.empty":`尚未导入星星礼物。`,"gifts.emptyHint":`从上方导入第一个动画,开始搭建礼物目录。`,"gifts.validationReady":`校验已通过`,"gifts.validationHint":`确认规范化后的元数据无误,再执行正式导入。`,"gifts.confirmState":`确认执行礼物 #{id} 的状态变更吗?`,"collectibles.manage":`属性池`,"collectibles.title":`Collectibles 属性池 · 礼物 #{id}`,"collectibles.eyebrow":`唯一礼物属性管理`,"collectibles.activeRevision":`已发布版本 {revision}`,"collectibles.published":`已发布`,"collectibles.noPool":`尚未发布 Collectibles 属性池`,"collectibles.noPoolHint":`发布模型、图案与背景后,客户端即可升级为唯一礼物。`,"collectibles.publishNew":`发布新的不可变版本`,"collectibles.immutableHint":`Dry-run 会校验全部文件和属性池结构,通过后才切换为当前版本。`,"collectibles.upgradeStars":`升级价格 Stars`,"collectibles.supply":`唯一礼物总量`,"collectibles.slug":`公开 Slug 前缀`,"collectibles.models":`模型`,"collectibles.patterns":`图案`,"collectibles.backdrops":`背景`,"collectibles.model":`模型`,"collectibles.pattern":`图案`,"collectibles.backdrop":`背景`,"collectibles.rarity":`稀有度 ‰`,"collectibles.rarityHint":`每类至少保留两项。Permille 是普通升级的相对权重,增删时会自动重新分配为 1000。`,"collectibles.minimumAttributes":`模型、图案和背景每类都必须至少包含两个属性。`,"collectibles.duplicateBackdropID":`同一属性池中的背景 ID 必须唯一。`,"collectibles.colorHint":`颜色会按 24 位 RGB 数值保存。`,"collectibles.addAttribute":`添加`,"collectibles.remove":`删除属性`,"collectibles.fileRequired":`每个模型和图案都必须选择 TGS 或 Lottie 文件。`,"collectibles.backdropID":`背景 ID`,"collectibles.color.center":`中心色`,"collectibles.color.edge":`边缘色`,"collectibles.color.pattern":`图案色`,"collectibles.color.text":`文字色`,"collectibles.validationReady":`属性池校验通过`,"collectibles.validationHint":`确认规范化资源无误后,即可发布这个不可变版本。`,"collectibles.publish":`发布版本`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`},ru:{"app.adminConsole":`Панель администратора`,"app.localAccess":`Локальный доступ`,"app.title":`telesrv admin`,"common.actions":`Действия`,"common.admins":`Администраторы`,"common.backToList":`Назад к списку`,"common.channel":`Канал`,"common.channelOrGroup":`Канал / Группа`,"common.clear":`Очистить`,"common.close":`Закрыть`,"common.count":`Количество`,"common.deleted":`Удалено`,"common.detail":`Детали`,"common.device":`Устройство`,"common.disabled":`Отключено`,"common.enabled":`Включено`,"common.fromPeer":`От пира`,"common.group":`Группа`,"common.id":`ID`,"common.limit":`Лимит`,"common.loading":`Загрузка…`,"common.member":`Участник`,"common.members":`Участники`,"common.messageId":`ID сообщения`,"common.name":`Имя`,"common.no":`Нет`,"common.noResults":`Нет результатов`,"common.none":`Нет`,"common.normal":`Обычный`,"common.operations":`Операции`,"common.owner":`Владелец`,"common.platform":`Платформа`,"common.refresh":`Обновить`,"common.search":`Поиск`,"common.sender":`Отправитель`,"common.status":`Статус`,"common.survived":`Уцелело`,"common.time":`Время`,"common.type":`Тип`,"common.updatedAt":`Обновлено`,"common.username":`Имя пользователя`,"common.valid":`Действителен`,"common.verified":`Подтверждён`,"common.views":`Просмотры`,"common.yes":`Да`,"route.accounts":`Аккаунты`,"route.accountsSubtitle":`Консоль / Аккаунты`,"route.channels":`Супергруппы и каналы`,"route.channelsSubtitle":`Консоль / Каналы`,"route.dashboard":`Панель управления`,"route.dashboardSubtitle":`Консоль / Обзор`,"route.messages":`Аудит сообщений`,"route.messagesSubtitle":`Консоль / Сообщения`,"route.gifts":`Звёздные подарки`,"route.giftsSubtitle":`Консоль / Звёздные подарки`,"layout.navigation":`Навигация`,"layout.primaryNav":`Основное меню`,"layout.dashboard":`Обзор`,"layout.accounts":`Аккаунты`,"layout.channels":`Супергруппы / Каналы`,"layout.messages":`Сообщения`,"layout.gifts":`Звёздные подарки`,"layout.privateMessages":`Личные`,"layout.groupMessages":`Группы`,"layout.runtime":`Среда выполнения`,"layout.adminBackend":`Админ-бэкенд`,"layout.ready":`Готов`,"layout.pgRead":`Чтение из PG`,"layout.readOnly":`Только чтение`,"layout.writeOps":`Операции записи`,"layout.dryRun":`Тестовый запуск`,"layout.actor":`Вы вошли как: {actor}`,"layout.logout":`Выйти`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Тёмная тема`,"theme.switchToLight":`Светлая тема`,"login.heading":`Панель администратора`,"login.body":`Введите учётные данные для входа в консоль.`,"login.secret":`Пароль или токен администратора`,"login.submit":`Войти`,"login.submitting":`Вход…`,"dashboard.eyebrow":`Состояние системы`,"dashboard.title":`Обзор консоли`,"dashboard.readPath":`Путь чтения`,"dashboard.readPathValue":`PG только для чтения`,"dashboard.writePath":`Путь записи`,"dashboard.executionPolicy":`Политика выполнения`,"dashboard.dryRunFirst":`Сначала тестовый запуск`,"dashboard.accountsText":`Статус аккаунтов, Premium, подтверждение, сессии.`,"dashboard.channelsText":`Публичные каналы и группы, число участников, статус подтверждения.`,"dashboard.messagesText":`Ящики сообщений, обновления, состояние исходящих.`,"dashboard.strip.dryRun":`Все опасные действия начинаются с тестового запуска`,"dashboard.strip.token":`Браузер никогда не сохраняет внутренние токены`,"dashboard.strip.pagination":`Списки используют курсорную пагинацию`,"dashboard.strip.snapshot":`Детальные страницы сохраняют моментальные снимки исходного состояния`,"account.pageTitle":`Аккаунты`,"account.queryResults":`Результаты поиска`,"account.recentActive":`Недавно активные аккаунты`,"account.currentPage":`Аккаунты на странице`,"account.onlineDevices":`Активные сессии устройств`,"account.premium":`Premium`,"account.frozen":`Заморожен`,"account.searchPlaceholder":`ID пользователя / телефон / имя пользователя`,"account.userID":`ID пользователя`,"account.phone":`Телефон`,"account.lastActive":`Последняя активность`,"account.notVerified":`Не подтверждён`,"account.notPremium":`Без Premium`,"account.premiumUntil":`Premium истекает`,"account.starsBalance":`Баланс Звёзд`,"account.startingGrantApplied":`стартовый бонус начислен`,"account.startingGrantPending":`ожидает стартового бонуса`,"account.activeSessions":`Авторизованные устройства`,"account.accountFlags":`Флаги аккаунта`,"account.restriction":`Ограничение`,"account.restricted":`Ограничен`,"account.createdAt":`Создан`,"account.detailTitle":`Аккаунт #{id}`,"account.profile":`Профиль аккаунта`,"account.loadingDetail":`Загрузка данных аккаунта`,"account.waitingData":`Ожидание данных`,"account.noUsername":`Нет имени пользователя`,"account.noPhone":`Нет телефона`,"account.accountFrozen":`Аккаунт заморожен`,"account.accountActive":`Аккаунт активен`,"account.authorizationsTitle":`Авторизованные устройства`,"account.authorizationsCount":`Авторизаций: {count}`,"account.recentAdminOps":`Последние действия администратора`,"account.recent30Audit":`Последние 30 записей аудита`,"account.actionDock":`Действия с аккаунтом`,"account.freezeAccount":`Заморозить аккаунт`,"account.updateFreeze":`Обновить параметры заморозки`,"account.unfreezeAccount":`Разморозить аккаунт`,"account.freezeSince":`Заморожен с`,"account.freezeUntil":`Срок подачи апелляции`,"account.freezeUntilAria":`Срок подачи апелляции на заморозку`,"account.freezeAppealURL":`URL для апелляции`,"account.freezeAppealURLAria":`URL для апелляции на заморозку`,"account.premiumMonths":`Срок действия Premium (в месяцах)`,"account.premiumMonthsAria":`Указать срок действия Premium в месяцах`,"account.setPremium":`Выдать Premium`,"account.clearPremium":`Снять Premium`,"account.starsAmount":`Количество Звёзд`,"account.starsAmountAria":`Указать количество начисляемых Звёзд`,"account.grantStars":`Начислить Звёзды`,"account.setVerified":`Подтвердить аккаунт`,"account.clearVerified":`Снять подтверждение`,"channel.pageTitle":`Супергруппы и каналы`,"channel.recentUpdated":`Недавно обновлённые`,"channel.currentPage":`Объекты на странице`,"channel.megagroups":`Супергруппы`,"channel.broadcasts":`Каналы`,"channel.verifiedCount":`Подтверждённые`,"channel.searchPlaceholder":`ID канала / имя пользователя / название`,"channel.channelID":`ID канала`,"channel.kind":`Тип`,"channel.title":`Название`,"channel.pts":`PTS`,"channel.detailProfile":`Профиль канала`,"channel.loadingDetail":`Загрузка данных канала`,"channel.creator":`Создатель: {id}`,"channel.governance":`Модерация`,"channel.governanceValue":`Заблокировано {banned} / Исключено {kicked}`,"channel.flags":`Флаги канала`,"channel.rawRow":`Исходная строка БД`,"channel.rawRowText":`Снимок базы данных только для чтения`,"channel.actionDock":`Действия с каналом`,"channel.setVerified":`Подтвердить канал`,"channel.clearVerified":`Снять подтверждение`,"channel.kind.broadcast":`Канал`,"channel.kind.forum":`Супергруппа / Форум`,"channel.kind.megagroup":`Супергруппа`,"channel.kind.generic":`Канал / Группа`,"route.bots":`Боты`,"route.botsSubtitle":`Консоль / Боты`,"layout.bots":`Боты`,"bots.pageTitle":`Боты`,"bots.queryResults":`Результаты поиска`,"bots.recent":`Недавно созданные боты`,"bots.currentPage":`Боты на странице`,"bots.banned":`Забанен`,"bots.active":`Активен`,"bots.createTitle":`Создать системного бота`,"bots.createHint":`Создаёт бота, принадлежащего указанному пользователю. Токен показывается один раз после подтверждения.`,"bots.ownerUserID":`ID владельца`,"bots.name":`Отображаемое имя`,"bots.namePlaceholder":`например, Service Bot`,"bots.username":`Имя пользователя`,"bots.usernameHint":`Имя пользователя: 5–32 символа, обязательно оканчивается на «bot».`,"bots.create":`Создать бота`,"bots.searchPlaceholder":`ID бота / имя пользователя`,"bots.botID":`ID бота`,"bots.owner":`Владелец`,"bots.status":`Статус`,"bots.detailTitle":`Бот #{id}`,"bots.profile":`Профиль бота`,"bots.loadingDetail":`Загрузка данных бота`,"bots.unnamed":`Без имени`,"bots.restriction":`Ограничение`,"bots.actionDock":`Действия с ботом`,"bots.banUntil":`Забанить до`,"bots.ban":`Забанить бота`,"bots.updateBan":`Обновить бан`,"bots.unban":`Разбанить бота`,"bots.type":`Тип`,"bots.system":`Системный`,"bots.user":`Пользовательский`,"bots.delete":`Удалить бота`,"bots.deleteHint":`Безвозвратно удаляет созданного пользователем бота и аннулирует его токен. Действие необратимо.`,"bots.systemHint":`Системные боты встроены и не могут быть удалены.`,"messages.privateTitle":`Личные сообщения`,"messages.privateEyebrow":`Личные ящики сообщений`,"messages.groupTitle":`Групповые сообщения`,"messages.groupEyebrow":`Сообщения супергрупп и каналов`,"messages.selectPrivatePeers":`Сначала найдите и выберите владельца и собеседника`,"messages.selectChannel":`Сначала найдите и выберите супергруппу или канал`,"messages.ownerUser":`Пользователь-владелец`,"messages.peerUser":`Собеседник`,"messages.beforeDatePlaceholder":`курсор before_date`,"messages.beforeIDPlaceholder":`курсор before_msg_id`,"messages.limitPlaceholder":`лимит <= 100`,"messages.searchMessages":`Поиск сообщений`,"messages.nextPage":`Следующая страница`,"messages.currentPage":`Сообщения на странице`,"messages.deleted":`Удалено`,"messages.outgoing":`Исходящее`,"messages.incoming":`Входящее`,"messages.ownerPeer":`Владелец / Собеседник`,"messages.deleteSelected":`Удалить выбранные сообщения`,"messages.idsPlaceholder":`ID сообщений через запятую`,"messages.revoke":`Удалить для обеих сторон`,"messages.previewDelete":`Тестовое удаление`,"messages.clearHistory":`Очистить историю личной переписки`,"messages.maxIDPlaceholder":`граница max_id`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Очистить только у себя`,"messages.previewClearHistory":`Тестовая очистка истории`,"messages.direction":`Направление`,"messages.body":`Текст сообщения`,"messages.privateDetailTitle":`Сообщение #{id}`,"messages.detailEyebrow":`Детали сообщения`,"messages.backPrivate":`Назад к личным сообщениям`,"messages.backGroup":`Назад к групповым сообщениям`,"messages.ownerPeerTitle":`Владелец {owner} · Собеседник {peer}`,"messages.senderSubtitle":`Отправитель {sender} · {date}`,"messages.boxID":`ID ящика сообщений`,"messages.privateMessageID":`ID личного сообщения`,"messages.messageSender":`Отправитель сообщения`,"messages.messageBox":`Ящик сообщений`,"messages.dialogRow":`Строка диалога`,"messages.privateRow":`Строка личного сообщения`,"messages.channelMessageRow":`Строка сообщения канала`,"messages.channelRow":`Строка канала`,"messages.userUpdateEvents":`События обновления пользователей`,"messages.channelUpdateEvents":`События обновления каналов`,"messages.eventJson":`JSON события`,"messages.dispatchOutbox":`Очередь отправки (Outbox)`,"messages.messageBoxesSnapshot":`Снимок message_boxes только для чтения`,"messages.dialogSnapshot":`Снимок dialogs только для чтения`,"messages.privateSnapshot":`Снимок private_messages только для чтения`,"messages.channelMessagesSnapshot":`Снимок channel_messages только для чтения`,"messages.channelSnapshot":`Снимок channels только для чтения`,"messages.userEventsSource":`постоянные user_update_events`,"messages.channelEventsSource":`постоянные channel_update_events`,"messages.outboxSource":`онлайн/офлайн dispatch_outbox`,"messages.attempts":`Попытки`,"messages.deleteThis":`Удалить это сообщение`,"messages.groupDetailTitle":`Групповое сообщение #{id}`,"messages.channelGroupTitle":`Канал / Группа {id}`,"messages.mediaCount":`С медиафайлами`,"messages.channelPosts":`Посты канала`,"messages.channelGroup":`Канал / Группа`,"messages.pinned":`Закреплено`,"messages.channelPost":`Пост в канале`,"gifts.pageTitle":`Каталог звёздных подарков`,"gifts.eyebrow":`Каталог, неизменяемые версии и файлы анимаций`,"gifts.total":`Подарков в каталоге`,"gifts.enabled":`Включено`,"gifts.received":`Полученные подарки`,"gifts.formats":`Поддерживаемые форматы`,"gifts.add":`Добавить подарок`,"gifts.searchPlaceholder":`Поиск по ID подарка, названию или формату`,"gifts.listSummary":`Показано {shown} из {total}`,"gifts.idRevision":`ID / Версия`,"gifts.price":`Цена / Конвертация`,"gifts.importTitle":`Импорт звёздного подарка`,"gifts.importEyebrow":`Управление каталогом подарков`,"gifts.newRevision":`Создать версию для подарка #{id}`,"gifts.importHint":`Загрузите файл TGS или обычный Lottie JSON. Lottie нормализуется и сжимается в формат TGS.`,"gifts.officialSource":`Официальный снимок`,"gifts.fileSource":`Загрузить файл`,"gifts.officialHint":`Выберите проверенный подарок из data/official-gifts. Полные пулы коллекционных предметов импортируются атомарно.`,"gifts.officialSearch":`Поиск по ID или названию официального подарка`,"gifts.officialSelect":`Выберите официальный подарок`,"gifts.officialRequired":`Сначала выберите официальный подарок`,"gifts.officialResults":`Показано {shown} из {total}`,"gifts.officialCategoryLabel":`Категория возможностей официального подарка`,"gifts.officialCategory.all":`Все`,"gifts.officialCategory.upgrade":`Можно улучшить`,"gifts.officialCategory.craft":`Можно создать`,"gifts.officialCategory.basic":`Нельзя улучшить`,"gifts.officialUnnamed":`Официальный подарок без названия #{id}`,"gifts.officialAttributes":`Атрибутов: {count}`,"gifts.canUpgrade":`Можно улучшить`,"gifts.cannotUpgrade":`Нельзя улучшить`,"gifts.canCraft":`Можно создать`,"gifts.cannotCraft":`Нельзя создать`,"gifts.officialEmpty":`Нет подарков, соответствующих категории и поиску.`,"gifts.includeCollectible":`Импортировать полный пул коллекционных предметов, включая созданные модели`,"gifts.animation":`Файл анимации`,"gifts.filePrompt":`Перетащите или выберите файл TGS / Lottie`,"gifts.fileHint":`TGS, JSON или Lottie · файл проверяется перед импортом`,"gifts.chooseFile":`Выбрать файл`,"gifts.changeFile":`Изменить файл`,"gifts.title":`Отображаемое название`,"gifts.titlePlaceholder":`например, Праздничная звезда`,"gifts.stars":`Цена в Звёздах`,"gifts.convertStars":`Звёзд при конвертации`,"gifts.sortOrder":`Порядок сортировки`,"gifts.reason":`Причина для аудита`,"gifts.reasonPlaceholder":`Кратко опишите причину импорта этого подарка`,"gifts.enableAfterImport":`Включить после импорта`,"gifts.validate":`Тестовая проверка`,"gifts.confirmImport":`Подтвердить импорт`,"gifts.stepDetails":`Файл и описание`,"gifts.stepValidate":`Тестовая проверка`,"gifts.stepImport":`Подтверждение импорта`,"gifts.fileRequired":`Сначала выберите файл TGS или Lottie`,"gifts.source":`Источник`,"gifts.replace":`Новая версия`,"gifts.disable":`Отключить`,"gifts.enable":`Включить`,"gifts.empty":`Звёздные подарки ещё не импортированы.`,"gifts.emptyHint":`Импортируйте первую анимацию, чтобы начать наполнение каталога.`,"gifts.validationReady":`Проверка пройдена`,"gifts.validationHint":`Проверьте нормализованные метаданные и подтвердите импорт.`,"gifts.confirmState":`Применить проверенные изменения состояния к подарку #{id}?`,"collectibles.manage":`Пул атрибутов`,"collectibles.title":`Пул коллекционных предметов · Подарок #{id}`,"collectibles.eyebrow":`Уникальные атрибуты подарка`,"collectibles.activeRevision":`Опубликованная версия {revision}`,"collectibles.published":`Опубликовано`,"collectibles.noPool":`Нет опубликованного пула коллекционных предметов`,"collectibles.noPoolHint":`Опубликуйте модели, узоры и фоны для активации улучшений.`,"collectibles.publishNew":`Опубликовать новую неизменяемую версию`,"collectibles.immutableHint":`Тестовый запуск проверяет каждый файл и структуру набора атрибутов перед активацией версии.`,"collectibles.upgradeStars":`Цена улучшения в Звёздах`,"collectibles.supply":`Уникальный тираж`,"collectibles.slug":`Публичный префикс ссылки (slug)`,"collectibles.models":`Модели`,"collectibles.patterns":`Узоры`,"collectibles.backdrops":`Фоны`,"collectibles.model":`Модель`,"collectibles.pattern":`Узор`,"collectibles.backdrop":`Фон`,"collectibles.rarity":`Редкость ‰`,"collectibles.rarityHint":`В каждой категории должно быть не менее двух атрибутов. Значения в промилле задают относительные веса обычного улучшения; при добавлении или удалении они перераспределяются до суммы 1000.`,"collectibles.minimumAttributes":`Модели, узоры и фоны должны содержать не менее двух атрибутов в каждой категории.`,"collectibles.duplicateBackdropID":`ID фонов в одном наборе должны быть уникальными.`,"collectibles.colorHint":`Цвета сохраняются как 24-битные RGB-значения.`,"collectibles.addAttribute":`Добавить`,"collectibles.remove":`Удалить атрибут`,"collectibles.fileRequired":`Для каждой модели и узора требуется файл TGS или Lottie.`,"collectibles.backdropID":`ID фона`,"collectibles.color.center":`Центр`,"collectibles.color.edge":`Край`,"collectibles.color.pattern":`Узор`,"collectibles.color.text":`Текст`,"collectibles.validationReady":`Пул атрибутов корректен`,"collectibles.validationHint":`Проверьте нормализованные ресурсы и опубликуйте эту неизменяемую версию.`,"collectibles.publish":`Опубликовать версию`,"messages.msgIDsInvalid":`Некорректные ID сообщений`,"auth.device":`Устройство`,"auth.platform":`Платформа`,"auth.ip":`IP-адрес`,"auth.lastActive":`Последняя активность`,"auth.revokeCurrent":`Отозвать текущую`,"auth.keepCurrent":`Оставить текущую`,"auth.revokeAll":`Отозвать все устройства`,"picker.userPlaceholder":`Поиск по user_id / телефону / имени пользователя`,"picker.channelPlaceholder":`Поиск по channel_id / имени пользователя / названию`,"picker.verified":`Подтверждённые`,"picker.regular":`Обычные`,"action.reasonRequired":`Пожалуйста, укажите причину операции`,"action.flow":`Процесс выполнения`,"action.close":`Закрыть`,"action.stepReason":`Укажите причину`,"action.stepDryRun":`Тестовый запуск`,"action.stepConfirm":`Подтверждение выполнения`,"action.reason":`Причина операции`,"action.reasonPlaceholder":`Опишите, почему выполняется эта операция`,"action.requestPreview":`Запросить предпросмотр`,"action.result":`Результат действия`,"action.commandID":`ID команды`,"action.status":`Статус`,"action.dryRun":`Тестовый запуск`,"action.runAgain":`Повторить тестовый запуск`,"action.runDry":`Сначала выполните тестовый запуск`,"action.confirm":`Подтвердить выполнение`,"audit.id":`ID`,"audit.commandID":`ID команды`,"audit.action":`Действие`,"audit.actor":`Исполнитель`,"audit.status":`Статус`,"audit.dryRun":`Тестовый запуск`,"audit.reason":`Причина`,"audit.time":`Время`}},we=(0,g.createContext)(null);function Te({children:e}){let[t,n]=(0,g.useState)(()=>Oe());(0,g.useEffect)(()=>{try{localStorage.setItem(Se,t)}catch{}let e=t===`zh`?`zh-CN`:t===`ru`?`ru`:`en`;document.documentElement.lang=e,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=De(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>De(t,e,n)}),[t]);return(0,U.jsx)(we.Provider,{value:r,children:e})}function W(){let e=(0,g.useContext)(we);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function Ee(){let{lang:e,setLang:t,t:n}=W();return(0,U.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`,`ru`].map(r=>(0,U.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function De(e,t,n){let r=Ce[e][t]??Ce.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function Oe(){try{let e=ke(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=ke(localStorage.getItem(Se));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=ke(t);if(e)return e}return`en`}function ke(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:t===`ru`||t.startsWith(`ru-`)?`ru`:null}function Ae(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function je(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/bots`)?t(`route.bots`):e.startsWith(`/messages`)?t(`route.messages`):e.startsWith(`/gifts`)?t(`route.gifts`):t(`route.dashboard`)}function Me(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/bots`)?t(`route.botsSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):e.startsWith(`/gifts`)?t(`route.giftsSubtitle`):t(`route.dashboardSubtitle`)}var Ne=`telesrv.admin.theme`,Pe=(0,g.createContext)(null);function Fe(e){document.documentElement.setAttribute(`data-theme`,e),document.documentElement.style.colorScheme=e}function Ie({children:e}){let[t,n]=(0,g.useState)(()=>ze());(0,g.useEffect)(()=>{Fe(t);try{localStorage.setItem(Ne,t)}catch{}},[t]),(0,g.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>{let t=null;try{t=localStorage.getItem(Ne)}catch{t=null}t!==`light`&&t!==`dark`&&n(e.matches?`dark`:`light`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let r=(0,g.useCallback)(e=>n(e),[]),i=(0,g.useCallback)(()=>n(e=>e===`dark`?`light`:`dark`),[]),a=(0,g.useMemo)(()=>({theme:t,setTheme:r,toggleTheme:i}),[t,r,i]);return(0,U.jsx)(Pe.Provider,{value:a,children:e})}function Le(){let e=(0,g.useContext)(Pe);if(!e)throw Error(`useTheme must be used inside ThemeProvider`);return e}function Re(){let{theme:e,toggleTheme:t}=Le(),{t:n}=W(),r=n(e===`light`?`theme.switchToDark`:`theme.switchToLight`);return(0,U.jsx)(`button`,{className:`theme-toggle`,type:`button`,onClick:t,"aria-label":r,title:r,children:e===`dark`?(0,U.jsx)(ve,{size:16}):(0,U.jsx)(ue,{size:16})})}function ze(){try{let e=localStorage.getItem(Ne);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches)return`dark`}catch{}return`light`}function G({href:e,navigate:t,className:n,children:r}){return(0,U.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function Be(){let{t:e}=W();return(0,U.jsxs)(`div`,{className:`boot-screen`,children:[(0,U.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,U.jsx)(`div`,{className:`loader-bar`})]})}function Ve({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=W(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,U.jsxs)(`div`,{className:`shell`,children:[(0,U.jsxs)(`aside`,{className:`sidebar`,children:[(0,U.jsxs)(G,{className:`brand`,href:`/`,navigate:n,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,U.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,U.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,U.jsx)(He,{icon:(0,U.jsx)(se,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(V,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(he,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(N,{size:16}),href:`/bots`,route:t,navigate:n,children:a(`layout.bots`)}),(0,U.jsx)(He,{icon:(0,U.jsx)(ie,{size:16}),href:`/gifts`,route:t,navigate:n,children:a(`layout.gifts`)}),(0,U.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,U.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,U.jsx)(le,{size:16}),(0,U.jsx)(`span`,{children:a(`layout.messages`)}),(0,U.jsx)(I,{className:`nav-section-chevron`,size:15})]}),s&&(0,U.jsxs)(`div`,{className:`nav-children`,children:[(0,U.jsx)(He,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,U.jsx)(He,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,U.jsxs)(`div`,{className:`sidebar-status`,children:[(0,U.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(me,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,U.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(R,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,U.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(ge,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,U.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,U.jsxs)(`div`,{className:`workspace`,children:[(0,U.jsxs)(`header`,{className:`topbar`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:Me(t.path,a)}),(0,U.jsx)(`h1`,{children:je(t.path,a)})]}),(0,U.jsxs)(`div`,{className:`topbar-actions`,children:[(0,U.jsx)(Re,{}),(0,U.jsx)(Ee,{}),(0,U.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,U.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,U.jsx)(ce,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,U.jsx)(`main`,{className:`content`,children:i})]})]})}function He({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,U.jsxs)(G,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,U.jsx)(`span`,{children:i})]})}function Ue(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function We(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function Ge(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function Ke(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function K(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function qe(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function q(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function Je(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function Ye({title:e,eyebrow:t,children:n,actions:r}){return(0,U.jsxs)(`div`,{className:`page-frame`,children:[(0,U.jsxs)(`div`,{className:`page-title-row`,children:[(0,U.jsxs)(`div`,{children:[t&&(0,U.jsx)(`div`,{className:`eyebrow`,children:t}),(0,U.jsx)(`h2`,{children:e})]}),r&&(0,U.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function Xe({children:e}){return(0,U.jsx)(`div`,{className:`query-panel`,children:e})}function Ze({main:e,side:t}){return(0,U.jsxs)(`div`,{className:`split-layout`,children:[(0,U.jsx)(`div`,{className:`split-main`,children:e}),(0,U.jsx)(`aside`,{className:`split-side`,children:t})]})}function Qe({title:e,text:t,action:n}){return(0,U.jsxs)(`div`,{className:`section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{children:e}),t&&(0,U.jsx)(`p`,{children:t})]}),n&&(0,U.jsx)(`div`,{className:`section-action`,children:n})]})}function $e({children:e}){return(0,U.jsxs)(`div`,{className:`alert`,children:[(0,U.jsx)(O,{size:16}),` `,(0,U.jsx)(`span`,{children:e})]})}function J({children:e,tone:t=`neutral`}){return(0,U.jsx)(`span`,{className:`badge ${t}`,children:e})}function et({label:e,value:t,tone:n}){return(0,U.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{children:t})]})}function tt({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,U.jsxs)(`div`,{className:`metric ${n}`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function Y({label:e,value:t,mono:n=!1}){return(0,U.jsxs)(`div`,{className:`summary-item`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function nt({rows:e}){let{t}=W();return(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`audit.id`)}),(0,U.jsx)(`th`,{children:t(`audit.commandID`)}),(0,U.jsx)(`th`,{children:t(`audit.action`)}),(0,U.jsx)(`th`,{children:t(`audit.actor`)}),(0,U.jsx)(`th`,{children:t(`audit.status`)}),(0,U.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,U.jsx)(`th`,{children:t(`audit.reason`)}),(0,U.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[e.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.ID}),(0,U.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,U.jsx)(`td`,{children:e.Action}),(0,U.jsx)(`td`,{children:e.Actor}),(0,U.jsx)(`td`,{children:e.Status}),(0,U.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,U.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,U.jsx)(`td`,{children:K(e.CreatedAt)})]},e.ID)),e.length===0&&(0,U.jsx)(rt,{colSpan:8})]})]})})}function rt({colSpan:e}){let{t}=W();return(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function it({label:e}){return(0,U.jsx)(`section`,{className:`surface`,children:(0,U.jsx)(`div`,{className:`loading-line`,children:e})})}function at({value:e}){return(0,U.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function ot({onLogin:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,U.jsx)(`main`,{className:`login-page`,children:(0,U.jsxs)(`section`,{className:`login-panel`,children:[(0,U.jsxs)(`div`,{className:`login-head`,children:[(0,U.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,U.jsxs)(`div`,{className:`login-head-actions`,children:[(0,U.jsx)(Re,{}),(0,U.jsx)(Ee,{}),(0,U.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,U.jsxs)(`div`,{className:`login-copy`,children:[(0,U.jsx)(`h1`,{children:t(`login.heading`)}),(0,U.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,U.jsx)($e,{children:i}),(0,U.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:t(`login.secret`)}),(0,U.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,U.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var st=m();function ct({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=W(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function S(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let C=f?.dry_run&&!f.error,w=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,T=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{className:w,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,st.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,U.jsx)(`h2`,{children:e})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,U.jsx)(H,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body`,children:[(0,U.jsxs)(`div`,{className:`command-steps`,children:[(0,U.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,U.jsx)(`span`,{children:`1`}),(0,U.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`2`}),(0,U.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:C?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`3`}),(0,U.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,U.jsxs)(`label`,{className:`form-field`,children:[(0,U.jsx)(`span`,{children:s(`action.reason`)}),(0,U.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,U.jsxs)(`div`,{className:`command-preview`,children:[(0,U.jsxs)(`div`,{className:`preview-head`,children:[(0,U.jsx)(ne,{size:14}),` `,s(`action.requestPreview`)]}),(0,U.jsx)(at,{value:JSON.stringify(T,null,2)})]}),m&&(0,U.jsx)($e,{children:m}),f&&(0,U.jsxs)(`div`,{className:`result-box`,children:[(0,U.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,U.jsx)(O,{size:16}):(0,U.jsx)(k,{size:16}),(0,U.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.commandID`)}),(0,U.jsx)(`strong`,{children:f.command_id})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.status`)}),(0,U.jsx)(`strong`,{children:f.status})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.dryRun`)}),(0,U.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,U.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,U.jsx)(at,{value:JSON.stringify(f.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>S(!1),disabled:_,children:[_?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(B,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,U.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>S(!0),disabled:_||!C,children:[(0,U.jsx)(k,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function lt({rows:e,userID:t,onDone:n}){let{t:r}=W(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,U.jsxs)(`div`,{className:`authorization-block`,children:[(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:r(`auth.device`)}),(0,U.jsx)(`th`,{children:r(`auth.platform`)}),(0,U.jsx)(`th`,{children:r(`auth.ip`)}),(0,U.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,U.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,U.jsxs)(`tbody`,{children:[o.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,U.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,U.jsx)(`td`,{children:n.IP}),(0,U.jsx)(`td`,{children:K(n.ActiveAt)}),(0,U.jsx)(`td`,{className:`device-actions-cell`,children:(0,U.jsxs)(`div`,{className:`device-actions`,children:[(0,U.jsx)(ct,{label:r(`auth.revokeCurrent`),icon:(0,U.jsx)(ce,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,U.jsx)(ct,{label:r(`auth.keepCurrent`),icon:(0,U.jsx)(he,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,U.jsx)(rt,{colSpan:5})]})]})}),(0,U.jsx)(`div`,{className:`danger-zone`,children:(0,U.jsx)(ct,{label:r(`auth.revokeAll`),icon:(0,U.jsx)(P,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function ut({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`),[p,m]=(0,g.useState)(()=>dt(new Date(Date.now()+7*864e5))),[h,_]=(0,g.useState)(``);async function v(){c(!0),o(``);try{let t=await x.account(e);i(t),t.Restriction.Frozen&&(t.Restriction.Until&&m(dt(new Date(t.Restriction.Until))),_(t.Restriction.AppealURL||``))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{v()},[e]),a)return(0,U.jsx)($e,{children:a});if(!r)return(0,U.jsx)(it,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let y=r.Account;return(0,U.jsx)(Ye,{title:n(`account.detailTitle`,{id:y.ID}),eyebrow:n(`account.profile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,U.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:Ge(y)}),(0,U.jsxs)(`div`,{className:`entity-subtitle`,children:[We(y.Username)||n(`account.noUsername`),` · `,Ue(y.Phone)||n(`account.noPhone`)]})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[y.PremiumUntil>0?(0,U.jsx)(J,{tone:`good`,children:n(`account.premium`)}):(0,U.jsx)(J,{children:n(`account.notPremium`)}),r.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)}),y.Frozen?(0,U.jsx)(J,{tone:`danger`,children:n(`account.accountFrozen`)}):(0,U.jsx)(J,{children:n(`account.accountActive`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:n(`account.userID`),value:String(y.ID),mono:!0}),(0,U.jsx)(Y,{label:n(`account.lastActive`),value:qe(r.LastSeenAt)||`-`}),(0,U.jsx)(Y,{label:n(`account.premiumUntil`),value:y.PremiumUntil>0?qe(y.PremiumUntil):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,U.jsx)(Y,{label:n(`common.updatedAt`),value:K(y.UpdatedAt)||`-`}),(0,U.jsx)(Y,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,U.jsx)(Y,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,U.jsx)(Y,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.freezeSince`),value:r.Restriction.Since?K(r.Restriction.Since):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.freezeUntil`),value:r.Restriction.Until?K(r.Restriction.Until):n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.freezeAppealURL`),value:r.Restriction.AppealURL||n(`common.none`)}),(0,U.jsx)(Y,{label:n(`account.createdAt`),value:K(y.CreatedAt)||`-`})]}),r.About&&(0,U.jsx)(`p`,{className:`about-text`,children:r.About}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,U.jsx)(lt,{rows:r.Authorizations,userID:y.ID,onDone:v})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(nt,{rows:r.AuditLogs})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.freezeUntil`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.freezeUntilAria`),value:p,onChange:e=>m(e.target.value),type:`datetime-local`})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.freezeAppealURL`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.freezeAppealURLAria`),value:h,onChange:e=>_(e.target.value),type:`url`,placeholder:`https://...`})]}),(0,U.jsx)(ct,{label:y.Frozen?n(`account.updateFreeze`):n(`account.freezeAccount`),icon:(0,U.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!0,freeze_until:new Date(p).toISOString(),freeze_appeal_url:h.trim()}),onDone:v}),y.Frozen&&(0,U.jsx)(ct,{label:n(`account.unfreezeAccount`),icon:(0,U.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!1}),onDone:v}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,U.jsxs)(`div`,{className:`action-stack`,children:[(0,U.jsx)(ct,{label:n(`account.setPremium`),icon:(0,U.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:q(l)}),onDone:v}),(0,U.jsx)(ct,{label:n(`account.clearPremium`),icon:(0,U.jsx)(j,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:0}),onDone:v}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,U.jsx)(ct,{label:n(`account.grantStars`),icon:(0,U.jsx)(_e,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:y.ID,amount:q(d)}),onDone:v}),(0,U.jsx)(ct,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:y.ID,verified:!r.Verified}),onDone:v})]})]})})})}function dt(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function ft(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function pt(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function mt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=ft(o?.rows??[]);return(0,U.jsxs)(Ye,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,U.jsx)(fe,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,U.jsx)(tt,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,U.jsx)(tt,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,U.jsx)(tt,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(pe,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`account.userID`)}),(0,U.jsx)(`th`,{children:t(`account.phone`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`common.name`)}),(0,U.jsx)(`th`,{children:t(`common.device`)}),(0,U.jsx)(`th`,{children:t(`account.lastActive`)}),(0,U.jsx)(`th`,{children:t(`account.premium`)}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`account.frozen`)}),(0,U.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:Ue(n.Phone)}),(0,U.jsx)(`td`,{children:We(n.Username)}),(0,U.jsx)(`td`,{children:Ge(n)}),(0,U.jsx)(`td`,{children:n.DeviceCount}),(0,U.jsx)(`td`,{children:K(n.LastActiveAt)}),(0,U.jsx)(`td`,{children:n.PremiumUntil>0?(0,U.jsxs)(J,{tone:`good`,children:[t(`account.premium`),` `,qe(n.PremiumUntil)]}):(0,U.jsx)(J,{children:t(`common.none`)})}),(0,U.jsx)(`td`,{children:n.Verified?(0,U.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,U.jsx)(J,{children:t(`account.notVerified`)})}),(0,U.jsx)(`td`,{children:n.Frozen?(0,U.jsx)(J,{tone:`danger`,children:t(`account.frozen`)}):(0,U.jsx)(J,{children:t(`common.normal`)})}),(0,U.jsx)(`td`,{children:K(n.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,U.jsx)(rt,{colSpan:11})]})]})})]})}function ht({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,U.jsx)($e,{children:a});if(!r)return(0,U.jsx)(it,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,U.jsx)(Ye,{title:`${Ke(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,U.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,U.jsxs)(`div`,{className:`entity-subtitle`,children:[We(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[(0,U.jsx)(J,{children:Ke(c,n)}),c.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)}),c.Deleted?(0,U.jsx)(J,{tone:`danger`,children:n(`common.deleted`)}):(0,U.jsx)(J,{children:n(`common.valid`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,U.jsx)(Y,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,U.jsx)(Y,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,U.jsx)(Y,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,U.jsx)(Y,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,U.jsx)(Y,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,U.jsx)(Y,{label:n(`account.createdAt`),value:qe(c.Date)||`-`}),(0,U.jsx)(Y,{label:n(`common.updatedAt`),value:K(c.UpdatedAt)||`-`})]}),c.About&&(0,U.jsx)(`p`,{className:`about-text`,children:c.About}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(nt,{rows:r.AuditLogs})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,U.jsx)(at,{value:r.ChannelJSON})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,U.jsx)(ct,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s})]})})})}function gt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=pt(o?.rows??[]);return(0,U.jsxs)(Ye,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,U.jsx)(fe,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,U.jsx)(tt,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,U.jsx)(tt,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,U.jsx)(tt,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(pe,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`channel.channelID`)}),(0,U.jsx)(`th`,{children:t(`channel.kind`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`channel.title`)}),(0,U.jsx)(`th`,{children:t(`common.members`)}),(0,U.jsx)(`th`,{children:t(`common.admins`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:Ke(n,t)}),(0,U.jsx)(`td`,{children:We(n.Username)}),(0,U.jsx)(`td`,{children:n.Title}),(0,U.jsx)(`td`,{children:n.ParticipantsCount}),(0,U.jsx)(`td`,{children:n.AdminsCount}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.Verified?(0,U.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,U.jsx)(J,{children:t(`account.notVerified`)})}),(0,U.jsx)(`td`,{children:K(n.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,U.jsx)(rt,{colSpan:10})]})]})})]})}function _t({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1);async function l(){c(!0),o(``);try{i(await x.bot(e))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{l()},[e]),a)return(0,U.jsx)($e,{children:a});if(!r)return(0,U.jsx)(it,{label:n(s?`bots.loadingDetail`:`account.waitingData`)});let u=r.Bot;return(0,U.jsx)(Ye,{title:n(`bots.detailTitle`,{id:u.ID}),eyebrow:n(`bots.profile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/bots`),children:[(0,U.jsx)(M,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:u.FirstName||n(`bots.unnamed`)}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:We(u.Username)||n(`account.noUsername`)})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[(0,U.jsx)(J,{tone:u.System?`warn`:`neutral`,children:u.System?n(`bots.system`):n(`bots.user`)}),u.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:n(`bots.botID`),value:String(u.ID),mono:!0}),(0,U.jsx)(Y,{label:n(`bots.owner`),value:u.OwnerUserID>0?`${u.OwnerUserID} ${We(r.OwnerUsername)}`.trim():n(`common.none`)}),(0,U.jsx)(Y,{label:n(`bots.type`),value:u.System?n(`bots.system`):n(`bots.user`)}),(0,U.jsx)(Y,{label:n(`common.updatedAt`),value:K(u.UpdatedAt)||`-`}),(0,U.jsx)(Y,{label:n(`account.createdAt`),value:K(u.CreatedAt)||`-`})]}),r.About&&(0,U.jsx)(`p`,{className:`about-text`,children:r.About}),r.Description&&r.Description.trim()!==r.About.trim()&&(0,U.jsx)(`p`,{className:`about-text`,children:r.Description}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(nt,{rows:r.AuditLogs})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`bots.actionDock`)}),(0,U.jsx)(`div`,{className:`action-stack`,children:(0,U.jsx)(ct,{label:u.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`neutral`,path:`/api/actions/set-verified`,payload:()=>({user_id:u.ID,verified:!u.Verified}),onDone:l})}),u.System?(0,U.jsx)(`p`,{className:`bot-create-note`,children:n(`bots.systemHint`)}):(0,U.jsxs)(`div`,{className:`danger-zone`,children:[(0,U.jsx)(ct,{label:n(`bots.delete`),icon:(0,U.jsx)(ye,{size:15}),tone:`danger`,path:`/api/actions/delete-bot`,payload:()=>({bot_user_id:u.ID}),onDone:()=>t(`/bots`)}),(0,U.jsx)(`p`,{className:`bot-create-note`,children:n(`bots.deleteHint`)})]})]})})})}function vt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(0),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(``),[y,S]=(0,g.useState)(``);async function C(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&t.set(`before_id`,String(c));try{let e=await x.bots(t);s(e),l(e.next_before_id)}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{C(!1)},[]);let w=o?.rows??[],T=w.filter(e=>e.Verified).length,E=w.filter(e=>e.System).length;return(0,U.jsxs)(Ye,{title:t(`bots.pageTitle`),eyebrow:o?.listing===!1?t(`bots.queryResults`):t(`bots.recent`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>C(!1),disabled:u,children:[(0,U.jsx)(fe,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`bots.currentPage`),value:String(w.length)}),(0,U.jsx)(tt,{label:t(`common.verified`),value:String(T),tone:`good`}),(0,U.jsx)(tt,{label:t(`bots.system`),value:String(E)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(`div`,{className:`section-head`,children:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{children:t(`bots.createTitle`)}),(0,U.jsx)(`p`,{children:t(`bots.createHint`)})]})}),(0,U.jsxs)(`div`,{className:`bot-create-fields`,children:[(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.ownerUserID`)}),(0,U.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),type:`number`,min:`1`,placeholder:`123456789`})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.name`)}),(0,U.jsx)(`input`,{value:_,onChange:e=>v(e.target.value),placeholder:t(`bots.namePlaceholder`),maxLength:64})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.username`)}),(0,U.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:`my_service_bot`})]})]}),(0,U.jsxs)(`div`,{className:`bot-create-actions`,children:[(0,U.jsx)(`span`,{className:`bot-create-note`,children:t(`bots.usernameHint`)}),(0,U.jsx)(ct,{label:t(`bots.create`),icon:(0,U.jsx)(de,{size:15}),tone:`neutral`,path:`/api/actions/create-bot`,payload:()=>({owner_user_id:q(m),name:_.trim(),username:y.trim().replace(/^@/,``)}),onDone:()=>C(!1)})]})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),C(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`bots.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(pe,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>C(!0),disabled:u,children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`bots.botID`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`common.name`)}),(0,U.jsx)(`th`,{children:t(`bots.owner`)}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`bots.type`)}),(0,U.jsx)(`th`,{children:t(`account.createdAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[w.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:We(n.Username)||`-`}),(0,U.jsx)(`td`,{children:n.FirstName||`-`}),(0,U.jsx)(`td`,{className:`mono`,children:n.OwnerUserID>0?n.OwnerUserID:`-`}),(0,U.jsx)(`td`,{children:n.Verified?(0,U.jsxs)(J,{tone:`good`,children:[(0,U.jsx)(D,{size:12}),` `,t(`common.verified`)]}):(0,U.jsx)(J,{children:t(`account.notVerified`)})}),(0,U.jsx)(`td`,{children:n.System?(0,U.jsx)(J,{tone:`warn`,children:t(`bots.system`)}):(0,U.jsx)(J,{children:t(`bots.user`)})}),(0,U.jsx)(`td`,{children:K(n.CreatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/bots/${n.ID}`),children:[(0,U.jsx)(N,{size:14}),` `,t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},n.ID)),w.length===0&&(0,U.jsx)(rt,{colSpan:8})]})]})})]})}function yt({navigate:e}){let{t}=W();return(0,U.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,U.jsxs)(`section`,{className:`overview-band`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,U.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,U.jsxs)(`div`,{className:`overview-metrics`,children:[(0,U.jsx)(et,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,U.jsx)(et,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,U.jsx)(et,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,U.jsxs)(`div`,{className:`command-grid`,children:[(0,U.jsx)(bt,{icon:(0,U.jsx)(V,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,U.jsx)(bt,{icon:(0,U.jsx)(he,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,U.jsx)(bt,{icon:(0,U.jsx)(le,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,U.jsxs)(`section`,{className:`work-strip`,children:[(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(k,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(oe,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(ee,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(ne,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function bt({icon:e,title:t,text:n,href:r,navigate:i}){return(0,U.jsxs)(G,{className:`launcher`,href:r,navigate:i,children:[(0,U.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,U.jsxs)(`span`,{className:`launcher-copy`,children:[(0,U.jsx)(`strong`,{children:t}),(0,U.jsx)(`span`,{children:n})]}),(0,U.jsx)(L,{size:16})]})}function xt({channelID:e,msgID:t,navigate:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,U.jsx)($e,{children:o});if(!i)return(0,U.jsx)(it,{label:r(`common.loading`)});let l=i.Message;return(0,U.jsx)(Ye,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,U.jsx)(M,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:qe(l.Date)})})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,U.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,U.jsx)(J,{children:r(`common.survived`)}),l.Pinned&&(0,U.jsx)(J,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,U.jsx)(J,{children:r(`messages.channelPost`)}),(0,U.jsxs)(J,{children:[`pts `,l.PTS]})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,U.jsx)(Y,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,U.jsx)(Y,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,U.jsx)(Y,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,U.jsx)(at,{value:i.MessageJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,U.jsx)(at,{value:i.ChannelJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.count`)}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.messageId`)}),(0,U.jsx)(`th`,{children:r(`common.sender`)}),(0,U.jsx)(`th`,{children:r(`common.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.PTSCount}),(0,U.jsx)(`td`,{children:e.Type}),(0,U.jsx)(`td`,{children:e.MessageID}),(0,U.jsx)(`td`,{children:e.SenderUserID}),(0,U.jsx)(`td`,{children:qe(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,U.jsx)(rt,{colSpan:6})]})]})})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.eventJson`)}),(0,U.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,U.jsx)(at,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,U.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function St({label:e,value:t,onChange:n}){let{t:r}=W(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,U.jsxs)(`div`,{className:`entity-picker`,children:[(0,U.jsxs)(`div`,{className:`picker-head`,children:[(0,U.jsx)(`span`,{children:e}),t?(0,U.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,U.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,U.jsxs)(`div`,{className:`selected-entity`,children:[(0,U.jsx)(F,{size:15}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:Ge(t)}),(0,U.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,U.jsx)(`span`,{children:We(t.Username)||Ue(t.Phone)||`-`})]}):null,(0,U.jsxs)(`div`,{className:`picker-search`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,U.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,U.jsx)(`div`,{className:`picker-error`,children:u}),(0,U.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,U.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,U.jsx)(`span`,{className:`mono`,children:e.ID}),(0,U.jsx)(`strong`,{children:Ge(e)}),(0,U.jsx)(`span`,{children:We(e.Username)||Ue(e.Phone)||`-`}),e.Verified?(0,U.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,U.jsx)(J,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,U.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function Ct({label:e,value:t,onChange:n}){let{t:r}=W(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,U.jsxs)(`div`,{className:`entity-picker`,children:[(0,U.jsxs)(`div`,{className:`picker-head`,children:[(0,U.jsx)(`span`,{children:e}),t?(0,U.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,U.jsx)(H,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,U.jsxs)(`div`,{className:`selected-entity`,children:[(0,U.jsx)(F,{size:15}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:t.Title||`-`}),(0,U.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,U.jsx)(`span`,{children:We(t.Username)||Ke(t,r)})]}):null,(0,U.jsxs)(`div`,{className:`picker-search`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,U.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,U.jsx)(`div`,{className:`picker-error`,children:u}),(0,U.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,U.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,U.jsx)(`span`,{className:`mono`,children:e.ID}),(0,U.jsx)(`strong`,{children:e.Title||`-`}),(0,U.jsx)(`span`,{children:We(e.Username)||Ke(e,r)}),e.Verified?(0,U.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,U.jsx)(J,{children:Ke(e,r)})]},e.ID)),o.length===0&&!c?(0,U.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function wt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,U.jsxs)(Ye,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,U.jsx)($e,{children:f}),(0,U.jsxs)(Xe,{children:[(0,U.jsx)(`div`,{className:`message-selector-grid single`,children:(0,U.jsx)(Ct,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,U.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,U.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,U.jsx)(pe,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`messages.currentPage`),value:String(_.length)}),(0,U.jsx)(tt,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,U.jsx)(tt,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,U.jsx)(tt,{label:t(`messages.channelGroup`),value:n?`${n.Title||Ke(n,t)} (${n.ID})`:`-`})]}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`common.messageId`)}),(0,U.jsx)(`th`,{children:t(`common.time`)}),(0,U.jsx)(`th`,{children:t(`common.sender`)}),(0,U.jsx)(`th`,{children:`From Peer`}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.views`)}),(0,U.jsx)(`th`,{children:t(`common.status`)}),(0,U.jsx)(`th`,{children:t(`messages.body`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[_.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:qe(n.Date)}),(0,U.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,U.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.ViewsCount}),(0,U.jsx)(`td`,{children:n.Deleted?(0,U.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,U.jsx)(J,{tone:`warn`,children:t(`messages.pinned`)}):(0,U.jsx)(J,{children:t(`common.survived`)})}),(0,U.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,U.jsx)(rt,{colSpan:9})]})]})})]})}function Tt({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,U.jsx)($e,{children:o});if(!i)return(0,U.jsx)(it,{label:r(`common.loading`)});let l=i.Message;return(0,U.jsx)(Ye,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,U.jsx)(M,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,U.jsx)(Ze,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:qe(l.Date)})})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,U.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,U.jsx)(J,{children:r(`common.survived`)}),(0,U.jsxs)(J,{children:[`pts `,l.PTS]}),(0,U.jsx)(J,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(Y,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,U.jsx)(Y,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,U.jsx)(Y,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,U.jsx)(Y,{label:r(`common.time`),value:qe(l.Date)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,U.jsx)(at,{value:i.MessageJSON})]}),(0,U.jsxs)(`div`,{className:`raw-grid`,children:[(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,U.jsx)(at,{value:i.DialogJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,U.jsx)(at,{value:i.PrivateJSON})]})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.count`)}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.PTSCount}),(0,U.jsx)(`td`,{children:e.Type}),(0,U.jsx)(`td`,{children:qe(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,U.jsx)(rt,{colSpan:4})]})]})})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(Qe,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`ID`}),(0,U.jsx)(`th`,{children:r(`account.userID`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.status`)}),(0,U.jsx)(`th`,{children:r(`messages.attempts`)}),(0,U.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.ID}),(0,U.jsx)(`td`,{children:e.TargetUserID}),(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.EventType}),(0,U.jsx)(`td`,{children:e.Status}),(0,U.jsx)(`td`,{children:e.Attempts}),(0,U.jsx)(`td`,{children:K(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,U.jsx)(rt,{colSpan:7})]})]})})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,U.jsx)(ct,{label:r(`messages.deleteThis`),icon:(0,U.jsx)(ye,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function Et({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,S]=(0,g.useState)(``),[C,w]=(0,g.useState)(`1`),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(``);async function k(e=!1){if(O(``),!n||!i){O(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&T?.rows.length){let e=T.rows[T.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{E(await x.messages(r))}catch(e){O(b(e))}}function A(e){r(e),s(``),l(``),E(null)}function j(e){a(e),s(``),l(``),E(null)}return(0,U.jsxs)(Ye,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[D&&(0,U.jsx)($e,{children:D}),(0,U.jsxs)(Xe,{children:[(0,U.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,U.jsx)(St,{label:t(`messages.ownerUser`),value:n,onChange:A}),(0,U.jsx)(St,{label:t(`messages.peerUser`),value:i,onChange:j})]}),(0,U.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),k(!1)},children:[(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,U.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,U.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,U.jsx)(pe,{size:15}),` `,t(`messages.searchMessages`)]}),T?.rows.length?(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>k(!0),children:[(0,U.jsx)(L,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(tt,{label:t(`messages.currentPage`),value:String(T?.rows.length??0)}),(0,U.jsx)(tt,{label:t(`messages.deleted`),value:String((T?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,U.jsx)(tt,{label:t(`messages.outgoing`),value:String((T?.rows??[]).filter(e=>e.Outgoing).length)}),(0,U.jsx)(tt,{label:t(`messages.ownerPeer`),value:n&&i?`${Ge(n)} / ${Ge(i)}`:`-`})]}),(0,U.jsxs)(`div`,{className:`operation-row`,children:[(0,U.jsxs)(`div`,{className:`operation-box`,children:[(0,U.jsxs)(`div`,{className:`operation-title`,children:[(0,U.jsx)(ye,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,U.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,U.jsx)(ct,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:Je(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,U.jsxs)(`div`,{className:`operation-box`,children:[(0,U.jsxs)(`div`,{className:`operation-title`,children:[(0,U.jsx)(ae,{size:15}),` `,t(`messages.clearHistory`)]}),(0,U.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,U.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,U.jsx)(ct,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:q(y),max_batches:q(C),just_clear:_,revoke:m})})]})]}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`common.messageId`)}),(0,U.jsx)(`th`,{children:t(`common.time`)}),(0,U.jsx)(`th`,{children:t(`common.sender`)}),(0,U.jsx)(`th`,{children:t(`messages.direction`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.status`)}),(0,U.jsx)(`th`,{children:t(`messages.body`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[T?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,U.jsx)(`td`,{children:qe(n.Date)}),(0,U.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,U.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.Deleted?(0,U.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):(0,U.jsx)(J,{children:t(`common.survived`)})}),(0,U.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,U.jsx)(L,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!T||T.rows.length===0)&&(0,U.jsx)(rt,{colSpan:8})]})]})})]})}var Dt=c(o(((e,t)=>{typeof document<`u`&&typeof navigator<`u`&&(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.lottie=r())})(e,(function(){var n=``,r=!1,i=-999999,a=function(e){r=!!e},o=function(){return r},s=function(e){n=e},c=function(){return n};function l(e){return document.createElement(e)}function u(e,t){var n,r=e.length,i;for(n=0;n1?n[1]=1:n[1]<=0&&(n[1]=0),L(n[0],n[1],n[2])}function te(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),L(n[0],n[1],n[2])}function ne(e,t){var n=ee(e[0]*255,e[1]*255,e[2]*255);return n[0]+=t/360,n[0]>1?--n[0]:n[0]<0&&(n[0]+=1),L(n[0],n[1],n[2])}(function(){var e=[],t,n;for(t=0;t<256;t+=1)n=t.toString(16),e[t]=n.length===1?`0`+n:n;return function(t,n,r){return t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),`#`+e[t]+e[n]+e[r]}})();var re=function(e){g=!!e},ie=function(){return g},ae=function(e){_=e},oe=function(){return _},se=function(){return v},ce=function(e){E=e},le=function(){return E},ue=function(e){y=e};function z(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function B(e){"@babel/helpers - typeof";return B=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},B(e)}var de=function(){var e=1,t=[],n,r,i={onmessage:function(){},postMessage:function(e){n({data:e})}},a={postMessage:function(e){i.onmessage({data:e})}};function s(e){if(window.Worker&&window.Blob&&o()){var t=new Blob([`var _workerSelf = self; self.onmessage = `,e.toString()],{type:`text/javascript`}),r=URL.createObjectURL(t);return new Worker(r)}return n=e,i}function c(){r||(r=s(function(e){function t(){function e(t,n){var o,s,c=t.length,l,u,d,f;for(s=0;s=0;--t)if(e[t].ty===`sh`)if(e[t].ks.k.i)a(e[t].ks.k);else for(o=e[t].ks.k.length,r=0;rn[0]?!0:n[0]>e[0]?!1:e[1]>n[1]?!0:n[1]>e[1]?!1:e[2]>n[2]?!0:n[2]>e[2]?!1:null}var s=function(){var e=[4,4,14];function t(e){var t=e.t.d;e.t.d={k:[{s:t,t:0}]}}function n(e){var n,r=e.length;for(n=0;n=0;--n)if(e[n].ty===`sh`)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(a=e[n].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function a(t){var n=r(t,this.assetsPath,this.path),i=z(`image`);b?this.testImageLoaded(i):i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS(`http://www.w3.org/1999/xlink`,`href`,n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a}function o(t){var n=r(t,this.assetsPath,this.path),i=l(`img`);i.crossOrigin=`anonymous`,i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var a={img:i,assetData:t};return a}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return de.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function c(e,t){this.imagesLoadedCb=t;var n,r=e.length;for(n=0;nthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t=this.animationData.layers,n,r=t.length,i=e.layers,a,o=i.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(`enterFrame`),this.renderFrame(),this.trigger(`drawnFrame`)},V.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},V.prototype.play=function(e){e&&this.name!==e||this.isPaused===!0&&(this.isPaused=!1,this.trigger(`_play`),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger(`_active`)))},V.prototype.pause=function(e){e&&this.name!==e||this.isPaused===!1&&(this.isPaused=!0,this.trigger(`_pause`),this._idle=!0,this.trigger(`_idle`),this.audioController.pause())},V.prototype.togglePause=function(e){e&&this.name!==e||(this.isPaused===!0?this.play():this.pause())},V.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},V.prototype.getMarkerData=function(e){for(var t,n=0;n=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger(`loopComplete`))):this.setCurrentRawFrameValue(t):t<0?this.checkSegments(t%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger(`loopComplete`):this._completedLoop=!0):(n=!0,t=0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger(`complete`))}},V.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger(`segmentStart`)},V.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,n!==-1&&this.goToAndStop(n,!0)},V.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),be(e[0])===`object`){var n,r=e.length;for(n=0;n=0;--n)t[n].animation.destroy(e)}function T(e,t,n){var r=[].concat([].slice.call(document.getElementsByClassName(`lottie`)),[].slice.call(document.getElementsByClassName(`bodymovin`))),i,a=r.length;for(i=0;i0?n=c:t=c;while(Math.abs(s)>a&&++l=i?g(e,d,t,n):f===0?d:h(e,a,a+c,t,n)}},e}(),U=function(){function e(e){return e.concat(m(e.length))}return{double:e}}(),Se=function(){return function(e,t,n){var r=0,i=e,a=m(i),o={newElement:s,release:c};function s(){var e;return r?(--r,e=a[r]):e=t(),e}function c(e){r===i&&(a=U.double(a),i*=2),n&&n(e),a[r]=e,r+=1}return o}}(),Ce=function(){function e(){return{addedLength:0,percents:p(`float32`,le()),lengths:p(`float32`,le())}}return Se(8,e)}(),we=function(){function e(){return{lengths:[],totalLength:0}}function t(e){var t,n=e.lengths.length;for(t=0;t-.001&&o<.001}function n(n,r,i,a,o,s,c,l,u){if(i===0&&s===0&&u===0)return t(n,r,a,o,c,l);var d=e.sqrt(e.pow(a-n,2)+e.pow(o-r,2)+e.pow(s-i,2)),f=e.sqrt(e.pow(c-n,2)+e.pow(l-r,2)+e.pow(u-i,2)),p=e.sqrt(e.pow(c-a,2)+e.pow(l-o,2)+e.pow(u-s,2)),m=d>f?d>p?d-f-p:p-f-d:p>f?p-f-d:f-d-p;return m>-1e-4&&m<1e-4}var r=function(){return function(e,t,n,r){var i=le(),a,o,s,c,l,u=0,d,f=[],p=[],m=Ce.newElement();for(s=n.length,a=0;ao?-1:1,l=!0;l;)if(r[a]<=o&&r[a+1]>o?(s=(o-r[a])/(r[a+1]-r[a]),l=!1):a+=c,a<0||a>=i-1){if(a===i-1)return n[a];l=!1}return n[a]+(n[a+1]-n[a])*s}function l(t,n,r,i,a,o){var s=c(a,o),l=1-s;return[e.round((l*l*l*t[0]+(s*l*l+l*s*l+l*l*s)*r[0]+(s*s*l+l*s*s+s*l*s)*i[0]+s*s*s*n[0])*1e3)/1e3,e.round((l*l*l*t[1]+(s*l*l+l*s*l+l*l*s)*r[1]+(s*s*l+l*s*s+s*l*s)*i[1]+s*s*s*n[1])*1e3)/1e3]}var u=p(`float32`,8);function d(t,n,r,i,a,o,s){a<0?a=0:a>1&&(a=1);var l=c(a,s);o=o>1?1:o;var d=c(o,s),f,p=t.length,m=1-l,h=1-d,g=m*m*m,_=l*m*m*3,v=l*l*m*3,y=l*l*l,b=m*m*h,x=l*m*h+m*l*h+m*m*d,S=l*l*h+m*l*d+l*m*d,C=l*l*d,w=m*h*h,T=l*h*h+m*d*h+m*h*d,E=l*d*h+m*d*d+l*h*d,D=l*d*d,O=h*h*h,k=d*h*h+h*d*h+h*h*d,A=d*d*h+h*d*d+d*h*d,j=d*d*d;for(f=0;f=l.t-n){c.h&&(c=l),i=0;break}if(l.t-n>e){i=a;break}a=v||e=v?x.points.length-1:0;for(f=x.points[S].point.length,d=0;d=T&&C=v)r[0]=b[0],r[1]=b[1],r[2]=b[2];else if(e<=y)r[0]=c.s[0],r[1]=c.s[1],r[2]=c.s[2];else{var j=je(c.s),M=je(b),N=(e-y)/(v-y);Ae(r,ke(j,M,N))}else for(a=0;a=v?m=1:e1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-n)*f)/m,g=Math.sin(n*f)/m):(h=1-n,g=n),r[0]=h*i+g*c,r[1]=h*a+g*l,r[2]=h*o+g*u,r[3]=h*s+g*d,r}function Ae(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i),s=Math.asin(2*n*r+2*i*a),c=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i);e[0]=o/D,e[1]=s/D,e[2]=c/D}function je(e){var t=e[0]*D,n=e[1]*D,r=e[2]*D,i=Math.cos(t/2),a=Math.cos(n/2),o=Math.cos(r/2),s=Math.sin(t/2),c=Math.sin(n/2),l=Math.sin(r/2),u=i*a*o-s*c*l;return[s*c*o+i*a*l,s*a*o+i*c*l,i*c*o-s*a*l,u]}function Me(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==Ee&&(this._caching.lastFrame>=n&&e>=n||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function Ne(e){var t;if(this.propType===`unidimensional`)t=e*this.mult,De(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var n=0,r=this.v.length;n1e-5&&(this.v[n]=t,this._mdf=!0),n+=1}function Pe(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),n){case`v`:a=this.v;break;case`i`:a=this.i;break;case`o`:a=this.o;break;default:a=[];break}(!a[r]||a[r]&&!i)&&(a[r]=Ve.newElement()),a[r][0]=e,a[r][1]=t},He.prototype.setTripleAt=function(e,t,n,r,i,a,o,s){this.setXYAt(e,t,`v`,o,s),this.setXYAt(n,r,`o`,o,s),this.setXYAt(i,a,`i`,o,s)},He.prototype.reverse=function(){var e=new He;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var a=this._length-1,o=this._length,s;for(s=i;s=p[p.length-1].t-this.offsetTime)i=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],o=!0;else{for(var m=r,h=p.length-1,g=!0,_,v,y;g&&(_=p[m],v=p[m+1],!(v.t-this.offsetTime>e));)m=v.t-this.offsetTime)d=1;else if(e<_.t-this.offsetTime)d=0;else{var b;y.__fnct?b=y.__fnct:(b=xe.getBezierEasing(_.o.x,_.o.y,_.i.x,_.i.y).get,y.__fnct=b),d=b((e-(_.t-this.offsetTime))/(v.t-this.offsetTime-(_.t-this.offsetTime)))}a=v.s?v.s[0]:_.e[0]}i=_.s[0]}for(l=t._length,u=i.i[0].length,n.lastIndex=r,s=0;sr&&t>r)||(this._caching.lastIndex=i0||e>-1e-6&&e<0?r(e*t)/t:e}function P(){var e=this.props,t=N(e[0]),n=N(e[1]),r=N(e[4]),i=N(e[5]),a=N(e[12]),o=N(e[13]);return`matrix(`+t+`,`+n+`,`+r+`,`+i+`,`+a+`,`+o+`)`}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=c,this.skew=u,this.skewFromAxis=d,this.shear=l,this.scale=f,this.setTransform=m,this.translate=h,this.transform=g,this.multiply=_,this.applyToPoint=S,this.applyToX=C,this.applyToY=w,this.applyToZ=T,this.applyToPointArray=A,this.applyToTriplePoints=k,this.applyToPointStringified=j,this.toCSS=M,this.to2dCSS=P,this.clone=b,this.cloneFromProps=x,this.equals=y,this.inversePoints=O,this.inversePoint=D,this.getInverseMatrix=E,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=p(`float32`,16),this.reset()}}();function qe(e){"@babel/helpers - typeof";return qe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},qe(e)}var q={},Je=`__[STANDALONE]__`,Ye=`__[ANIMATIONDATA]__`,Xe=``;function Ze(e){s(e)}function Qe(){Je===!0?H.searchAnimations(Ye,Je,Xe):H.searchAnimations()}function $e(e){re(e)}function J(e){ue(e)}function et(e){return Je===!0&&(e.animationData=JSON.parse(Ye)),H.loadAnimation(e)}function tt(e){if(typeof e==`string`)switch(e){case`high`:ce(200);break;default:case`medium`:ce(50);break;case`low`:ce(10);break}else!isNaN(e)&&e>1&&ce(e)}function Y(){return typeof navigator<`u`}function nt(e,t){e===`expressions`&&ae(t)}function rt(e){switch(e){case`propertyFactory`:return G;case`shapePropertyFactory`:return Ke;case`matrix`:return K;default:return null}}q.play=H.play,q.pause=H.pause,q.setLocationHref=Ze,q.togglePause=H.togglePause,q.setSpeed=H.setSpeed,q.setDirection=H.setDirection,q.stop=H.stop,q.searchAnimations=Qe,q.registerAnimation=H.registerAnimation,q.loadAnimation=et,q.setSubframeRendering=$e,q.resize=H.resize,q.goToAndStop=H.goToAndStop,q.destroy=H.destroy,q.setQuality=tt,q.inBrowser=Y,q.installPlugin=nt,q.freeze=H.freeze,q.unfreeze=H.unfreeze,q.setVolume=H.setVolume,q.mute=H.mute,q.unmute=H.unmute,q.getRegisteredAnimations=H.getRegisteredAnimations,q.useWebWorker=a,q.setIDPrefix=J,q.__getFactory=rt,q.version=`5.13.0`;function it(){document.readyState===`complete`&&(clearInterval(lt),Qe())}function at(e){for(var t=ot.split(`&`),n=0;n=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o=[],s,c=a.length,l;for(s=0;sr+n)){var u=l.s*i<=r?0:(l.s*i-r)/n,d=l.e*i>=r+n?1:(l.e*i-r)/n;o.push([u,d])}return o.length||o.push([0,0]),o},ft.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1+r:this.s.v<0?0+r:this.s.v+r,n=this.e.v>1?1+r:this.e.v<0?0+r:this.e.v+r,t>n){var i=t;t=n,n=i}t=Math.round(t*1e4)*1e-4,n=Math.round(n*1e4)*1e-4,this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,o,s=this.shapes.length,c,l,u,d,f,p=0;if(n===t)for(o=0;o=0;--o)if(h=this.shapes[o],h.shape._mdf){for(g=h.localShapeCollection,g.releaseShapes(),this.m===2&&s>1?(b=this.calculateShapeEdges(t,n,h.totalShapeLength,y,p),y+=h.totalShapeLength):b=[[_,v]],l=b.length,c=0;c=1?m.push({s:h.totalShapeLength*(_-1),e:h.totalShapeLength*(v-1)}):(m.push({s:h.totalShapeLength*_,e:h.totalShapeLength}),m.push({s:0,e:h.totalShapeLength*(v-1)}));var x=this.addShapes(h,m[0]);if(m[0].s!==m[0].e){if(m.length>1)if(h.shape.paths.shapes[h.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,g),x=this.addShapes(h,m[1],S)}else this.addPaths(x,g),x=this.addShapes(h,m[1]);this.addPaths(x,g)}}h.shape.paths=g}}else if(this._mdf)for(o=0;ot.e){n.c=!1;break}else t.s<=l&&t.e>=l+u.addedLength?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[s],i[a].v[s],n,d,g),g=!1):(p=W.getNewSegment(i[a].v[s-1],i[a].v[s],i[a].o[s-1],i[a].i[s],(t.s-l)/u.addedLength,(t.e-l)/u.addedLength,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1),l+=u.addedLength,d+=1;if(i[a].c&&f.length){if(u=f[s-1],l<=t.e){var _=f[s-1].addedLength;t.s<=l&&t.e>=l+_?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[0],i[a].v[0],n,d,g),g=!1):(p=W.getNewSegment(i[a].v[s-1],i[a].v[0],i[a].o[s-1],i[a].i[0],(t.s-l)/_,(t.e-l)/_,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1)}else n.c=!1;l+=u.addedLength,d+=1}if(n._length&&(n.setXYAt(n.v[h][0],n.v[h][1],`i`,h),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],`o`,n._length-1)),l>t.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(r[0]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),r[1]=o.getValueAtTime((o.keyframes[0].t+.01)/n,0),i[0]=a.getValueAtTime(a.keyframes[0].t/n,0),i[1]=o.getValueAtTime(o.keyframes[0].t/n,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(r[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),r[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/n,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/n,0)):(r=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/n,o.offsetTime))}else i=e,r=i;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function r(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function i(){}function a(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0}function o(e,t,n){if(this.elem=e,this.frameId=-1,this.propType=`transform`,this.data=t,this.v=new K,this.pre=new K,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=G.getProp(e,t.p.x,0,0,this),this.py=G.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=G.getProp(e,t.p.z,0,0,this))):this.p=G.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=G.getProp(e,t.rx,0,D,this),this.ry=G.getProp(e,t.ry,0,D,this),this.rz=G.getProp(e,t.rz,0,D,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r0;)--n,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ht.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(f):Math.ceil(f),h=this.pMatrix.props,g=this.rMatrix.props,_=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v=0;if(f>0){for(;vm;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),--v;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),v-=p)}r=this.data.m===1?0:this._currentCopies-1,i=this.data.m===1?1:-1,a=this._currentCopies;for(var y,b;a;){if(t=this.elemsData[r].it,n=t[t.length-1].transform.mProps.v.props,b=n.length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),v!==0){for((r!==0&&i===1||r!==this._currentCopies-1&&i===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15]),this.matrix.transform(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]),y=0;y0&&r<1?[t]:[]:[t-r,t+r].filter(function(e){return e>0&&e<1})},wt.prototype.split=function(e){if(e<=0)return[Ct(this.points[0]),this];if(e>=1)return[this,Ct(this.points[this.points.length-1])];var t=bt(this.points[0],this.points[1],e),n=bt(this.points[1],this.points[2],e),r=bt(this.points[2],this.points[3],e),i=bt(t,n,e),a=bt(n,r,e),o=bt(i,a,e);return[new wt(this.points[0],t,i,o,!0),new wt(o,a,r,this.points[3],!0)]};function Tt(e,t){var n=e.points[0][t],r=e.points[e.points.length-1][t];if(n>r){var i=r;r=n,n=i}for(var a=xt(3*e.a[t],2*e.b[t],e.c[t]),o=0;o0&&a[o]<1){var s=e.point(a[o])[t];sr&&(r=s)}return{min:n,max:r}}wt.prototype.bounds=function(){return{x:Tt(this,0),y:Tt(this,1)}},wt.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}};function Et(e,t,n){var r=e.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:e,t:(t+n)/2,t1:t,t2:n}}function Dt(e){var t=e.bez.split(.5);return[Et(t[0],e.t1,e.t),Et(t[1],e.t,e.t2)]}function Ot(e,t){return Math.abs(e.cx-t.cx)*2=a||e.width<=r&&e.height<=r&&t.width<=r&&t.height<=r){i.push([e.t,t.t]);return}var o=Dt(e),s=Dt(t);kt(o[0],s[0],n+1,r,i,a),kt(o[0],s[1],n+1,r,i,a),kt(o[1],s[0],n+1,r,i,a),kt(o[1],s[1],n+1,r,i,a)}}wt.prototype.intersections=function(e,t,n){t===void 0&&(t=2),n===void 0&&(n=7);var r=[];return kt(Et(this,0,1),Et(e,0,1),0,t,r,n),r},wt.shapeSegment=function(e,t){var n=(t+1)%e.length();return new wt(e.v[t],e.o[t],e.i[n],e.v[n],!0)},wt.shapeSegmentInverted=function(e,t){var n=(t+1)%e.length();return new wt(e.v[n],e.i[n],e.o[t],e.v[t],!0)};function At(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function jt(e,t,n,r){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],s=[r[0],r[1],1],c=At(At(i,a),At(o,s));return vt(c[2])?null:[c[0]/c[2],c[1]/c[2]]}function X(e,t,n){return[e[0]+Math.cos(t)*n,e[1]-Math.sin(t)*n]}function Mt(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function Nt(e,t){return _t(e[0],t[0])&&_t(e[1],t[1])}function Pt(){}u([dt],Pt),Pt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=G.getProp(e,t.s,0,null,this),this.frequency=G.getProp(e,t.r,0,null,this),this.pointsType=G.getProp(e,t.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function Ft(e,t,n,r,i,a,o){var s=n-Math.PI/2,c=n+Math.PI/2,l=t[0]+Math.cos(n)*r*i,u=t[1]-Math.sin(n)*r*i;e.setTripleAt(l,u,l+Math.cos(s)*a,u-Math.sin(s)*a,l+Math.cos(c)*o,u-Math.sin(c)*o,e.length())}function It(e,t){var n=[t[0]-e[0],t[1]-e[1]],r=-Math.PI*.5;return[Math.cos(r)*n[0]-Math.sin(r)*n[1],Math.sin(r)*n[0]+Math.cos(r)*n[1]]}function Lt(e,t){var n=t===0?e.length()-1:t-1,r=(t+1)%e.length(),i=e.v[n],a=e.v[r],o=It(i,a);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function Rt(e,t,n,r,i,a,o){var s=Lt(t,n),c=t.v[n%t._length],l=t.v[n===0?t._length-1:n-1],u=t.v[(n+1)%t._length],d=a===2?Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2):0,f=a===2?Math.sqrt((c[0]-u[0])**2+(c[1]-u[1])**2):0;Ft(e,t.v[n%t._length],s,o,r,f/((i+1)*2),d/((i+1)*2),a)}function zt(e,t,n,r,i,a){for(var o=0;o1&&t.length>1&&(i=Ut(e[0],t[t.length-1]),i)?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[n,r]}function Gt(e){for(var t,n=1;n1&&(t=Wt(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function Kt(e,t){var n=e.inflectionPoints(),r,i,a,o;if(n.length===0)return[Vt(e,t)];if(n.length===1||_t(n[1],1))return a=e.split(n[0]),r=a[0],i=a[1],[Vt(r,t),Vt(i,t)];a=e.split(n[0]),r=a[0];var s=(n[1]-n[0])/(1-n[0]);return a=a[1].split(s),o=a[0],i=a[1],[Vt(r,t),Vt(o,t),Vt(i,t)]}function qt(){}u([dt],qt),qt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=G.getProp(e,t.a,0,null,this),this.miterLimit=G.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=this.amount.effectsSequence.length!==0},qt.prototype.processPath=function(e,t,n,r){var i=Ue.newElement();i.c=e.c;var a=e.length();e.c||--a;var o,s,c,l=[];for(o=0;o=0;--o)c=wt.shapeSegmentInverted(e,o),l.push(Kt(c,t));l=Gt(l);var u=null,d=null;for(o=0;o0&&(o=!1),o){var u=l(`style`);u.setAttribute(`f-forigin`,n[r].fOrigin),u.setAttribute(`f-origin`,n[r].origin),u.setAttribute(`f-family`,n[r].fFamily),u.type=`text/css`,u.innerText=`@font-face {font-family: `+n[r].fFamily+`; font-style: normal; src: url('`+n[r].fPath+`');}`,t.appendChild(u)}}else if(n[r].fOrigin===`g`||n[r].origin===1){for(s=document.querySelectorAll(`link[f-forigin="g"], link[f-origin="1"]`),c=0;c=55296&&n<=56319){var r=e.charCodeAt(1);r>=56320&&r<=57343&&(t=(n-55296)*1024+r-56320+65536)}return t}function S(e,t){var n=e.toString(16)+t.toString(16);return d.indexOf(n)!==-1}function C(e){return e===s}function w(e){return e===o}function T(e){var t=x(e);return t>=c&&t<=u}function E(e){return T(e.substr(0,2))&&T(e.substr(2,2))}function D(e){return t.indexOf(e)!==-1}function O(e,t){var o=x(e.substr(t,2));if(o!==n)return!1;var s=0;for(t+=2;s<5;){if(o=x(e.substr(t,2)),oa)return!1;s+=1,t+=2}return x(e.substr(t,2))===r}function k(){this.isLoaded=!0}var A=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return A.isModifier=S,A.isZeroWidthJoiner=C,A.isFlagEmoji=E,A.isRegionalCode=T,A.isCombinedCharacter=D,A.isRegionalFlag=O,A.isVariationSelector=w,A.BLACK_FLAG_CODE_POINT=n,A.prototype={addChars:_,addFonts:g,getCharData:v,getFontByName:b,measureText:y,checkLoadedFonts:m,setIsLoaded:k},A}();function Xt(e){this.animationData=e}Xt.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e};function Zt(e){return new Xt(e)}function Qt(){}Qt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},mn.prototype.show=function(){},mn.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},mn.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},mn.prototype.resume=function(){this._canPlay=!0},mn.prototype.setRate=function(e){this.audio.rate(e)},mn.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},mn.prototype.getBaseElement=function(){return null},mn.prototype.destroy=function(){},mn.prototype.sourceRectAtTime=function(){},mn.prototype.initExpressions=function(){};function hn(){}hn.prototype.checkLayers=function(e){var t,n=this.layers.length,r;for(this.completeLayers=!0,t=n-1;t>=0;--t)this.elements[t]||(r=this.layers[t],r.ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t)),this.completeLayers=this.elements[t]?this.completeLayers:!1;this.checkPendingElements()},hn.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},hn.prototype.createCamera=function(){throw Error(`You're using a 3d camera. Try the html renderer.`)},hn.prototype.createAudio=function(e){return new mn(e,this.globalData,this)},hn.prototype.createFootage=function(e){return new pn(e,this.globalData,this)},hn.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e0&&(this.maskElement.setAttribute(`id`,p),this.element.maskedElement.setAttribute(b,`url(`+c()+`#`+p+`)`),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}vn.prototype.getMaskProperty=function(e){return this.viewData[e].prop},vn.prototype.renderFrame=function(e){var t=this.element.finalTransform.mat,n,r=this.masksProperties.length;for(n=0;n1&&(r+=` C`+t.o[i-1][0]+`,`+t.o[i-1][1]+` `+t.i[0][0]+`,`+t.i[0][1]+` `+t.v[0][0]+`,`+t.v[0][1]),n.lastPath!==r){var o=``;n.elem&&(t.c&&(o=e.inv?this.solidPath+r:r),n.elem.setAttribute(`d`,o)),n.lastPath=r}},vn.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var yn=function(){var e={};e.createFilter=t,e.createAlphaToLuminanceFilter=n;function t(e,t){var n=z(`filter`);return n.setAttribute(`id`,e),t!==!0&&(n.setAttribute(`filterUnits`,`objectBoundingBox`),n.setAttribute(`x`,`0%`),n.setAttribute(`y`,`0%`),n.setAttribute(`width`,`100%`),n.setAttribute(`height`,`100%`)),n}function n(){var e=z(`feColorMatrix`);return e.setAttribute(`type`,`matrix`),e.setAttribute(`color-interpolation-filters`,`sRGB`),e.setAttribute(`values`,`0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1`),e}return e}(),bn=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<`u`};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),xn={},Sn=`filter_result_`;function Cn(e){var t,n=`SourceGraphic`,r=e.data.ef?e.data.ef.length:0,i=I(),a=yn.createFilter(i,!0),o=0;this.filters=[];var s;for(t=0;t=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);--e);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n.01)return!1;n+=1}return!0},Rn.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)c=r.transformers[g].mProps._mdf||c,--h,--g;if(c)for(h=f-r.styles[u].lvl,g=r.transformers.length-1;h>0;)m.multiply(r.transformers[g].mProps.v),--h,--g}else m=e;if(p=r.sh.paths,o=p._length,c){for(s=``,a=0;a=1?v=.99:v<=-1&&(v=-.99);var y=g*v,b=Math.cos(_+t.a.v)*y+a[0],x=Math.sin(_+t.a.v)*y+a[1];r.setAttribute(`fx`,b),r.setAttribute(`fy`,x),i&&!t.g._collapsable&&(t.of.setAttribute(`fx`,b),t.of.setAttribute(`fy`,x))}}}function u(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute(`stroke-dasharray`,i.dashStr),r.pElem.setAttribute(`stroke-dashoffset`,i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute(`stroke`,`rgb(`+C(t.c.v[0])+`,`+C(t.c.v[1])+`,`+C(t.c.v[2])+`)`),(t.o._mdf||n)&&r.pElem.setAttribute(`stroke-opacity`,t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute(`stroke-width`,t.w.v),r.msElem&&r.msElem.setAttribute(`stroke-width`,t.w.v))}return n}();function Gn(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}u([dn,_n,wn,kn,Tn,fn,En],Gn),Gn.prototype.initSecondaryElement=function(){},Gn.prototype.identityMatrix=new K,Gn.prototype.buildExpressionInterface=function(){},Gn.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Gn.prototype.filterUniqueShapes=function(){var e,t=this.shapes.length,n,r,i=this.stylesList.length,a,o=[],s=!1;for(r=0;r1&&s&&this.setShapesAsAnimated(o)}},Gn.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;--c){if(g=this.searchProcessedElement(e[c]),g?t[c]=n[g-1]:e[c]._render=o,e[c].ty===`fl`||e[c].ty===`st`||e[c].ty===`gf`||e[c].ty===`gs`||e[c].ty===`no`)g?t[c].style.closed=e[c].hd:t[c]=this.createStyleElement(e[c],i),e[c]._render&&t[c].style.pElem.parentNode!==r&&r.appendChild(t[c].style.pElem),f.push(t[c].style);else if(e[c].ty===`gr`){if(!g)t[c]=this.createGroupElement(e[c]);else for(d=t[c].it.length,u=0;u1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},qn.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},qn.prototype.getValue=function(e){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!e)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var r,i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(r=0;rt);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},qn.prototype.buildFinalText=function(e){for(var t=[],n=0,r=e.length,i,a,o=!1,s=!1,c=``;n=55296&&i<=56319?Yt.isRegionalFlag(e,n)?c=e.substr(n,14):(a=e.charCodeAt(n+1),a>=56320&&a<=57343&&(Yt.isModifier(i,a)?(c=e.substr(n,2),o=!0):c=Yt.isFlagEmoji(e.substr(n,4))?e.substr(n,4):e.substr(n,2))):i>56319?(a=e.charCodeAt(n+1),Yt.isVariationSelector(i)&&(o=!0)):Yt.isZeroWidthJoiner(i)&&(o=!0,s=!0),o?(t[t.length-1]+=c,o=!1):t.push(c),n+=c.length;return t},qn.prototype.completeTextData=function(e){e.__complete=!0;var t=this.elem.globalData.fontManager,n=this.data,r=[],i,a,o,s=0,c,l=n.m.g,u=0,d=0,f=0,p=[],m=0,h=0,g,_,v=t.getFontByName(e.f),y,b=0,x=Jt(v);e.fWeight=x.weight,e.fStyle=x.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),a=e.finalText.length,e.finalLineHeight=e.lh;var S=e.tr/1e3*e.finalSize,C;if(e.sz)for(var w=!0,T=e.sz[0],E=e.sz[1],D,O;w;){O=this.buildFinalText(e.t),D=0,m=0,a=O.length,S=e.tr/1e3*e.finalSize;var k=-1;for(i=0;iT&&O[i]!==` `?(k===-1?a+=1:i=k,D+=e.finalLineHeight||e.finalSize*1.2,O.splice(i,+(k===i),`\r`),k=-1,m=0):(m+=b,m+=S);D+=v.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Eh?m:h,m=-2*S,c=``,o=!0,f+=1):c=j,t.chars?(y=t.getCharData(j,v.fStyle,t.getFontByName(e.f).fFamily),b=o?0:y.w*e.finalSize/100):b=t.measureText(c,e.f,e.finalSize),j===` `?A+=b+S:(m+=b+S+A,A=0),r.push({l:b,an:b,add:u,n:o,anIndexes:[],val:c,line:f,animatorJustifyOffset:0}),l==2){if(u+=b,c===``||c===` `||i===a-1){for((c===``||c===` `)&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;s+=1,u=0}}else if(l==3){if(u+=b,c===``||i===a-1){for(c===``&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;u=0,s+=1}}else r[s].ind=s,r[s].extra=0,s+=1;if(e.l=r,h=m>h?m:h,p.push(m),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=h,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=p;var M=n.a,N,P;_=M.length;var F,I,L=[];for(g=0;g<_;g+=1){for(N=M[g],N.a.sc&&(e.strokeColorAnim=!0),N.a.sw&&(e.strokeWidthAnim=!0),(N.a.fc||N.a.fh||N.a.fs||N.a.fb)&&(e.fillColorAnim=!0),I=0,F=N.s.b,i=0;i0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var c=xe.getBezierEasing(i,a,o,s).get,l=0,u=this.finalS,d=this.finalE,f=this.data.sh;if(f===2)l=d===u?+(r>=d):e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===3)l=d===u?r>=d?0:1:1-e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===4)d===u?l=0:(l=e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l<.5?l*=2:l=1-2*(l-.5)),l=c(l);else if(f===5){if(d===u)l=0;else{var p=d-u;r=t(e(0,r+.5-u),d-u);var m=-p/2+r,h=p/2;l=Math.sqrt(1-m*m/(h*h))}l=c(l)}else f===6?(d===u?l=0:(r=t(e(0,r+.5-u),d-u),l=(1+Math.cos(Math.PI+Math.PI*2*r/(d-u)))/2),l=c(l)):(r>=n(u)&&(l=r-u<0?e(0,t(t(d,1)-(u-r),1)):e(0,t(d-r,1))),l=c(l));if(this.sm.v!==100){var g=this.sm.v*.01;g===0&&(g=1e-8);var _=.5-g*.5;l<_?l=0:(l=(l-_)/g,l>1&&(l=1))}return l*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&this.data.r===2&&(this.e.v=this._currentTextLength);var t=this.data.r===2?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var a=r;r=i,i=a}this.finalS=r,this.finalE=i}},u([Be],r);function i(e,t,n){return new r(e,t,n)}return{getTextSelectorProp:i}}();function Yn(e,t,n){var r={propType:!1},i=G.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,D,n):r,rx:a.rx?i(e,a.rx,0,D,n):r,ry:a.ry?i(e,a.ry,0,D,n):r,sk:a.sk?i(e,a.sk,0,D,n):r,sa:a.sa?i(e,a.sa,0,D,n):r,s:a.s?i(e,a.s,1,.01,n):r,a:a.a?i(e,a.a,1,0,n):r,o:a.o?i(e,a.o,0,.01,n):r,p:a.p?i(e,a.p,1,0,n):r,sw:a.sw?i(e,a.sw,0,0,n):r,sc:a.sc?i(e,a.sc,1,0,n):r,fc:a.fc?i(e,a.fc,1,0,n):r,fh:a.fh?i(e,a.fh,0,0,n):r,fs:a.fs?i(e,a.fs,0,.01,n):r,fb:a.fb?i(e,a.fb,0,.01,n):r,t:a.t?i(e,a.t,0,0,n):r},this.s=Jn.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function Xn(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=m(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}Xn.prototype.searchProperties=function(){var e,t=this._textData.a.length,n,r=G.getProp;for(e=0;e=m+U||!x?(T=(m+U-g)/h.partialLength,ie=b.point[0]+(h.point[0]-b.point[0])*T,ae=b.point[1]+(h.point[1]-b.point[1])*T,a.translate(-n[0]*f[u].an*.005,-(n[1]*A)*.01),_=!1):x&&(g+=h.partialLength,v+=1,v>=x.length&&(v=0,y+=1,S[y]?x=S[y].points:D.v.c?(v=0,y=0,x=S[y].points):(g-=h.partialLength,x=null)),x&&(b=h,h=x[v],C=h.partialLength));re=f[u].an/2-f[u].add,a.translate(-re,0,0)}else re=f[u].an/2-f[u].add,a.translate(-re,0,0),a.translate(-n[0]*f[u].an*.005,-n[1]*A*.01,0);for(P=0;Pe?this.textSpans[e].span:z(s?`g`:`text`),b<=e){if(c.setAttribute(`stroke-linecap`,`butt`),c.setAttribute(`stroke-linejoin`,`round`),c.setAttribute(`stroke-miterlimit`,`4`),this.textSpans[e].span=c,s){var S=z(`g`);c.appendChild(S),this.textSpans[e].childSpan=S}this.textSpans[e].span=c,this.layerElement.appendChild(c)}c.style.display=`inherit`}if(l.reset(),d&&(o[e].n&&(f=-g,p+=n.yOffset,p+=+!!h,h=!1),this.applyTextPropertiesToMatrix(n,l,o[e].line,f,p),f+=o[e].l||0,f+=g),s){x=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily);var C;if(x.t===1)C=new ir(x.data,this.globalData,this);else{var w=Qn;x.data&&x.data.shapes&&(w=this.buildShapeData(x.data,n.finalSize)),C=new Gn(w,this.globalData,this)}if(this.textSpans[e].glyph){var T=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(T.layerElement),T.destroy()}this.textSpans[e].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[e].childSpan.appendChild(C.layerElement),x.t===1&&this.textSpans[e].childSpan.setAttribute(`transform`,`scale(`+n.finalSize/100+`,`+n.finalSize/100+`)`)}else d&&c.setAttribute(`transform`,`translate(`+l.props[12]+`,`+l.props[13]+`)`),c.textContent=o[e].val,c.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`)}d&&c&&c.setAttribute(`d`,u)}for(;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;--n)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},rr.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=0;--n)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t=1){this.buffers=[];var e=this.globalData.canvasContext,t=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=lr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&lr.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new dr(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=$t(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new fr(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(gn.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext(`2d`);this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext(`2d`);if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById(`tp`in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=lr.getLumaCanvas(this.canvasContext.canvas);n.getContext(`2d`).drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=mr[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation=`destination-over`,this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation=`source-over`}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&=!1}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new K},pr.prototype.hide=pr.prototype.hideElement,pr.prototype.show=pr.prototype.showElement;function hr(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i=4;t.ty===`rc`?i=5:t.ty===`el`?i=6:t.ty===`sr`&&(i=7),this.sh=Ke.getShapeProp(e,t,i,e);var a,o=n.length,s;for(a=0;a=0;--a){if(d=this.searchProcessedElement(e[a]),d?t[a]=n[d-1]:e[a]._shouldRender=r,e[a].ty===`fl`||e[a].ty===`st`||e[a].ty===`gf`||e[a].ty===`gs`)d?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],m),l.push(t[a].style);else if(e[a].ty===`gr`){if(!d)t[a]=this.createGroupElement(e[a]);else for(c=t[a].it.length,s=0;s=0;--i)t[i].ty===`tr`?(o=n[i].transform,this.renderShapeTransform(e,o)):t[i].ty===`sh`||t[i].ty===`el`||t[i].ty===`rc`||t[i].ty===`sr`?this.renderPath(t[i],n[i]):t[i].ty===`fl`?this.renderFill(t[i],n[i],o):t[i].ty===`st`?this.renderStroke(t[i],n[i],o):t[i].ty===`gf`||t[i].ty===`gs`?this.renderGradientFill(t[i],n[i],o):t[i].ty===`gr`?this.renderShape(o,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},gr.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n=e.trNodes,r=t.paths,i,a,o,s=r._length;n.length=0;var c=e.transforms.finalTransform;for(o=0;o=1?u=.99:u<=-1&&(u=-.99);var d=c*u,f=Math.cos(l+t.a.v)*d+o[0],p=Math.sin(l+t.a.v)*d+o[1];i=a.createRadialGradient(f,p,0,o[0],o[1],c)}var m,h=e.g.p,g=t.g.c,_=1;for(m=0;ma&&c===`xMidYMid slice`||ii&&s===`meet`||ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:l===`xMax`&&(ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u===`YMid`&&(a>i&&s===`meet`||ai&&s===`meet`||a=0;--e)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},Z.prototype.renderFrame=function(e,t){if(!(this.renderedFrame===e&&this.renderConfig.clearCanvas===!0&&!t||this.destroyed||e===-1)){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n,r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},Z.prototype.buildItem=function(e){var t=this.elements;if(!(t[e]||this.layers[e].ty===99)){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},Z.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},Z.prototype.hide=function(){this.animationItem.container.style.display=`none`},Z.prototype.show=function(){this.animationItem.container.style.display=`block`};function br(){this.opacity=-1,this.transform=p(`float32`,16),this.fillStyle=``,this.strokeStyle=``,this.lineWidth=``,this.lineCap=``,this.lineJoin=``,this.miterLimit=``,this.id=Math.random()}function xr(){this.stack=[],this.cArrPos=0,this.cTr=new K;var e,t=15;for(e=0;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Sr.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;--e)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},Sr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)};function Cr(e,t){this.animationItem=e,this.renderConfig={clearCanvas:t&&t.clearCanvas!==void 0?t.clearCanvas:!0,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||`xMidYMid meet`,imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||`xMidYMid slice`,contentVisibility:t&&t.contentVisibility||`visible`,className:t&&t.className||``,id:t&&t.id||``,runExpressions:!t||t.runExpressions===void 0||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new xr,this.elements=[],this.pendingElements=[],this.transformMat=new K,this.completeLayers=!1,this.rendererType=`canvas`,this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}return u([Z],Cr),Cr.prototype.createComp=function(e){return new Sr(e,this.globalData,this)},_e(`canvas`,Cr),ut.registerModifier(`tm`,ft),ut.registerModifier(`pb`,pt),ut.registerModifier(`rp`,ht),ut.registerModifier(`rd`,gt),ut.registerModifier(`zz`,Pt),ut.registerModifier(`op`,qt),q}))}))(),1),Ot=0,kt=e=>`${e}-${++Ot}`,At=[{center:`#6f5bea`,edge:`#34278f`,pattern:`#a89df5`,text:`#ffffff`},{center:`#32a86b`,edge:`#17613e`,pattern:`#8ee0b3`,text:`#ffffff`},{center:`#df8d2f`,edge:`#8c421e`,pattern:`#ffd08a`,text:`#ffffff`},{center:`#d95878`,edge:`#7b2944`,pattern:`#f5a1b6`,text:`#ffffff`}];function jt(e){if(!e.length)return e;let t=Math.floor(1e3/e.length),n=1e3%e.length;return e.map((e,r)=>({...e,rarity:String(t+ +(r({key:kt(e),name:``,rarity:`1`,sortOrder:String(t),file:null,animation:null,fileError:``});function Mt(e){let t=e.reduce((e,t)=>{let n=Number(t.backdropID);return Number.isInteger(n)?Math.max(e,n):e},0)+1,n=At[e.length%At.length];return{key:kt(`backdrop`),name:``,backdropID:String(t),rarity:`1`,sortOrder:String(e.length),...n}}var Nt=e=>jt([X(e,0),X(e,1)]),Pt=()=>{let e=Mt([]);return jt([e,Mt([e])])};function Ft({data:e,compact:t=!1}){let n=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!n.current)return;let t=Dt.default.loadAnimation({container:n.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)});return()=>t.destroy()},[e]),(0,U.jsx)(`div`,{className:`collectible-animation ${t?`compact`:``}`,ref:n})}function It({giftID:e,attribute:t}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let n=!1;return a(!1),x.giftCollectibleAnimation(e,t.kind,t.id).then(e=>{n||r(e)}).catch(()=>{n||a(!0)}),()=>{n=!0}},[e,t.id,t.kind]),i?(0,U.jsx)(`div`,{className:`collectible-animation compact failed`,children:`!`}):n?(0,U.jsx)(Ft,{data:n,compact:!0}):(0,U.jsx)(`div`,{className:`collectible-animation compact loading`,children:(0,U.jsx)(A,{className:`spin`,size:15})})}async function Lt(e){let t=new Uint8Array(await e.arrayBuffer()),n=t;if(t.length>=2&&t[0]===31&&t[1]===139){if(!(`DecompressionStream`in window))throw Error(`This browser cannot preview TGS files`);let e=new Blob([t]).stream().pipeThrough(new DecompressionStream(`gzip`));n=new Uint8Array(await new Response(e).arrayBuffer())}let r=JSON.parse(new TextDecoder().decode(n));if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`Invalid Lottie JSON`);return r}var Rt=e=>Number.parseInt(e.replace(`#`,``),16),zt=e=>e.rarity_kind===`permille`?`${e.rarity_permille}‰`:e.rarity_kind;function Bt({gift:e,onClose:t,onPublished:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!0),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(`100`),[_,v]=(0,g.useState)(`1000`),[y,S]=(0,g.useState)(`gift-${e.GiftID}`),[C,w]=(0,g.useState)(``),[T,E]=(0,g.useState)(()=>Nt(`model`)),[D,O]=(0,g.useState)(()=>Nt(`pattern`)),[M,N]=(0,g.useState)(Pt);(0,g.useEffect)(()=>{let t=!1;return x.giftCollectibles(e.GiftID).then(n=>{t||(a(n),n.found&&(h(String(n.upgrade_stars??100)),v(String(n.supply_total??1e3)),S(n.slug_prefix??`gift-${e.GiftID}`)))}).catch(e=>d(b(e))).finally(()=>{t||s(!1)}),()=>{t=!0}},[e.GiftID]);let P=(0,g.useMemo)(()=>({models:T.reduce((e,t)=>e+Number(t.rarity||0),0),patterns:D.reduce((e,t)=>e+Number(t.rarity||0),0),backdrops:M.reduce((e,t)=>e+Number(t.rarity||0),0)}),[T,D,M]),F=()=>p(null),I=(e,t,n)=>{(e===`models`?E:O)(e=>e.map(e=>e.key===t?{...e,...n}:e)),F()};async function L(e,t,n){if(I(e,t.key,{file:n,animation:null,fileError:``}),n)try{let r=await Lt(n);I(e,t.key,{animation:r,fileError:``})}catch(n){I(e,t.key,{animation:null,fileError:b(n)})}}function ee(e,t=``){if(!C.trim())throw Error(r(`action.reasonRequired`));if(T.length<2||D.length<2||M.length<2)throw Error(r(`collectibles.minimumAttributes`));let n=M.map(e=>Number(e.backdropID));if(new Set(n).size!==n.length)throw Error(r(`collectibles.duplicateBackdropID`));for(let e of[...T,...D])if(!e.file)throw Error(r(`collectibles.fileRequired`));let i=new FormData,a=e=>e.map(e=>({name:e.name.trim(),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),file_key:e.key}));i.set(`metadata`,JSON.stringify({command_id:t,reason:C.trim(),confirm:e,upgrade_stars:m,supply_total:Number(_),slug_prefix:y.trim().toLowerCase(),models:a(T),patterns:a(D),backdrops:M.map(e=>({name:e.name.trim(),backdrop_id:Number(e.backdropID),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),center_color:Rt(e.center),edge_color:Rt(e.edge),pattern_color:Rt(e.pattern),text_color:Rt(e.text)}))}));for(let e of[...T,...D])i.set(e.key,e.file,e.file.name);return i}async function R(){l(!0),d(``),p(null);try{p(await x.publishGiftCollectibles(e.GiftID,ee(!1)))}catch(e){d(b(e))}finally{l(!1)}}async function ne(){if(f){l(!0),d(``);try{await x.publishGiftCollectibles(e.GiftID,ee(!0,f.command_id)),n(),t()}catch(e){d(b(e))}finally{l(!1)}}}let ie=(e,t,n)=>(0,U.jsxs)(`section`,{className:`collectible-section`,children:[(0,U.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.${e}`)}),(0,U.jsx)(`span`,{children:r(`collectibles.rarityHint`)})]}),(0,U.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,U.jsxs)(J,{tone:P[e]>0?`good`:`neutral`,children:[P[e],`‰`]}),(0,U.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{n(jt([...t,X(e===`models`?`model`:`pattern`,t.length)])),F()},children:[(0,U.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,U.jsx)(`div`,{className:`collectible-rows`,children:t.map((i,a)=>(0,U.jsxs)(`div`,{className:`collectible-row animated`,children:[(0,U.jsx)(`div`,{className:`collectible-row-index`,children:a+1}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`common.name`)}),(0,U.jsx)(`input`,{value:i.name,maxLength:128,onChange:t=>I(e,i.key,{name:t.target.value})})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:i.rarity,onChange:t=>I(e,i.key,{rarity:t.target.value})})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:i.sortOrder,onChange:t=>I(e,i.key,{sortOrder:t.target.value})})]}),(0,U.jsxs)(`label`,{className:`collectible-file`,children:[(0,U.jsx)(`span`,{children:r(`gifts.animation`)}),(0,U.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:t=>void L(e,i,t.target.files?.[0]??null)}),(0,U.jsxs)(`em`,{children:[(0,U.jsx)(te,{size:13}),i.file?.name??r(`gifts.chooseFile`)]})]}),(0,U.jsx)(`div`,{className:`collectible-inline-preview`,children:i.animation?(0,U.jsx)(Ft,{data:i.animation,compact:!0}):(0,U.jsx)(j,{size:16})}),(0,U.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:t.length<=2,onClick:()=>{n(jt(t.filter(e=>e.key!==i.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,U.jsx)(ye,{size:14})}),i.fileError&&(0,U.jsx)(`span`,{className:`collectible-file-error`,children:i.fileError})]},i.key))})]});return(0,st.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal collectible-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`collectibles.title`,{id:e.GiftID}),children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:r(`collectibles.eyebrow`)}),(0,U.jsx)(`h2`,{children:r(`collectibles.title`,{id:e.GiftID})}),(0,U.jsx)(`p`,{children:e.Title||`Gift #${e.GiftID}`})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:t,disabled:c,"aria-label":r(`action.close`),children:(0,U.jsx)(H,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body collectible-modal-body`,children:[o?(0,U.jsxs)(`div`,{className:`collectible-loading`,children:[(0,U.jsx)(A,{className:`spin`}),r(`common.loading`)]}):i?.found?(0,U.jsxs)(`section`,{className:`collectible-active`,children:[(0,U.jsxs)(`div`,{className:`collectible-active-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(re,{size:18}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.activeRevision`,{revision:i.revision??0})}),(0,U.jsxs)(`span`,{children:[i.slug_prefix,` · ⭐ `,i.upgrade_stars,` · `,i.issued,` / `,i.supply_total]})]})]}),(0,U.jsx)(J,{tone:`good`,children:r(`collectibles.published`)})]}),(0,U.jsxs)(`div`,{className:`collectible-active-grid`,children:[[...i.models??[],...i.patterns??[]].map(t=>(0,U.jsxs)(`article`,{children:[(0,U.jsx)(It,{giftID:e.GiftID,attribute:t}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`strong`,{children:[t.name,t.crafted&&(0,U.jsx)(J,{children:`crafted`})]}),(0,U.jsxs)(`span`,{children:[r(`collectibles.${t.kind}`),` · `,zt(t)]})]})]},`${t.kind}-${t.id}`)),(i.backdrops??[]).map(e=>(0,U.jsxs)(`article`,{children:[(0,U.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, #${(e.center_color??0).toString(16).padStart(6,`0`)}, #${(e.edge_color??0).toString(16).padStart(6,`0`)})`,color:`#${(e.text_color??16777215).toString(16).padStart(6,`0`)}`},children:`Aa`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e.name}),(0,U.jsxs)(`span`,{children:[r(`collectibles.backdrop`),` · `,zt(e)]})]})]},`backdrop-${e.id}`))]})]}):(0,U.jsxs)(`div`,{className:`collectible-empty`,children:[(0,U.jsx)(re,{size:22}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.noPool`)}),(0,U.jsx)(`span`,{children:r(`collectibles.noPoolHint`)})]})]}),(0,U.jsxs)(`section`,{className:`collectible-definition`,children:[(0,U.jsxs)(`div`,{className:`collectible-definition-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.publishNew`)}),(0,U.jsx)(`span`,{children:r(`collectibles.immutableHint`)})]}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,U.jsx)(`span`,{children:`TGS`}),(0,U.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,U.jsxs)(`div`,{className:`gift-fields-grid collectible-main-fields`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.upgradeStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:m,onChange:e=>{h(e.target.value),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.supply`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:_,onChange:e=>{v(e.target.value),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.slug`)}),(0,U.jsx)(`input`,{value:y,maxLength:48,onChange:e=>{S(e.target.value.toLowerCase()),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.reason`)}),(0,U.jsx)(`input`,{value:C,maxLength:1e3,placeholder:r(`gifts.reasonPlaceholder`),onChange:e=>w(e.target.value)})]})]}),ie(`models`,T,E),ie(`patterns`,D,O),(0,U.jsxs)(`section`,{className:`collectible-section`,children:[(0,U.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.backdrops`)}),(0,U.jsx)(`span`,{children:r(`collectibles.colorHint`)})]}),(0,U.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,U.jsxs)(J,{tone:P.backdrops>0?`good`:`neutral`,children:[P.backdrops,`‰`]}),(0,U.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{N(jt([...M,Mt(M)])),F()},children:[(0,U.jsx)(de,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,U.jsx)(`div`,{className:`collectible-rows`,children:M.map((e,t)=>(0,U.jsxs)(`div`,{className:`collectible-row backdrop`,children:[(0,U.jsx)(`div`,{className:`collectible-row-index`,children:t+1}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`common.name`)}),(0,U.jsx)(`input`,{value:e.name,maxLength:128,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,name:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.backdropID`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,value:e.backdropID,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,backdropID:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:e.rarity,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,rarity:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:e.sortOrder,onChange:t=>{N(M.map(n=>n.key===e.key?{...n,sortOrder:t.target.value}:n)),F()}})]}),[`center`,`edge`,`pattern`,`text`].map(t=>(0,U.jsxs)(`label`,{className:`collectible-color`,children:[(0,U.jsx)(`span`,{children:r(`collectibles.color.${t}`)}),(0,U.jsx)(`input`,{type:`color`,value:e[t],onChange:n=>{N(M.map(r=>r.key===e.key?{...r,[t]:n.target.value}:r)),F()}})]},t)),(0,U.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, ${e.center}, ${e.edge})`,color:e.text},children:`Aa`}),(0,U.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:M.length<=2,onClick:()=>{N(jt(M.filter(t=>t.key!==e.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,U.jsx)(ye,{size:14})})]},e.key))})]})]}),u&&(0,U.jsx)($e,{children:u}),f&&(0,U.jsxs)(`div`,{className:`gift-validation`,children:[(0,U.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,U.jsx)(k,{size:17}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.validationReady`)}),(0,U.jsx)(`span`,{children:r(`collectibles.validationHint`)})]})]}),(0,U.jsx)(`pre`,{children:JSON.stringify(f.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:t,disabled:c,children:r(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:R,disabled:c,children:[c?(0,U.jsx)(A,{className:`spin`,size:15}):(0,U.jsx)(he,{size:15}),r(`gifts.validate`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:ne,disabled:c||!f,children:[(0,U.jsx)(be,{size:15}),r(`collectibles.publish`)]})]})]})}),document.body)}function Vt(e){return e.model_count+e.pattern_count+e.backdrop_count}function Ht(e){let t=Number(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Ut({giftID:e,revision:t,compact:n=!1}){let r=(0,g.useRef)(null),i=(0,g.useRef)(null),[a,o]=(0,g.useState)(!0),[s,c]=(0,g.useState)(``);(0,g.useEffect)(()=>{let t=!1;return x.giftAnimation(e).then(e=>{t||!r.current||(i.current?.destroy(),i.current=Dt.default.loadAnimation({container:r.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(e=>c(b(e))),()=>{t=!0,i.current?.destroy(),i.current=null}},[e,t]);function l(){i.current&&(a?i.current.pause():i.current.play(),o(!a))}return(0,U.jsxs)(`div`,{className:`gift-animation-shell ${n?`compact`:``}`,children:[(0,U.jsx)(`div`,{className:`gift-animation`,ref:r,children:s&&(0,U.jsx)(`span`,{children:s})}),(0,U.jsx)(`button`,{className:`gift-play`,type:`button`,onClick:l,"aria-label":a?`Pause`:`Play`,children:a?(0,U.jsx)(z,{size:14}):(0,U.jsx)(B,{size:14})})]})}function Wt({sourceGiftID:e}){let t=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let n=!1,r=null;return x.officialGiftAnimation(e).then(e=>{n||!t.current||(r=Dt.default.loadAnimation({container:t.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(()=>void 0),()=>{n=!0,r?.destroy()}},[e]),(0,U.jsx)(`div`,{className:`gift-animation-shell`,children:(0,U.jsx)(`div`,{className:`gift-animation`,ref:t})})}function Gt(){let{t:e}=W(),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`official`),[p,m]=(0,g.useState)([]),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!0),[E,D]=(0,g.useState)(`0`),[O,j]=(0,g.useState)(`0`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(`0`),[I,L]=(0,g.useState)(``),[ee,R]=(0,g.useState)(`50`),[ne,ie]=(0,g.useState)(`50`),[ae,oe]=(0,g.useState)(`0`),[se,ce]=(0,g.useState)(!0),[le,ue]=(0,g.useState)(``),[z,B]=(0,g.useState)(null),[me,ge]=(0,g.useState)(!1),[_e,ve]=(0,g.useState)(``),[ye,V]=(0,g.useState)(``);async function xe(){ve(``);try{n((await x.gifts()).Gifts??[])}catch(e){ve(b(e))}}(0,g.useEffect)(()=>{xe()},[]),(0,g.useEffect)(()=>{!a||d!==`official`||p.length>0||x.officialGifts().then(e=>m(e.gifts??[])).catch(e=>V(b(e)))},[a,d,p.length]);let Se=(0,g.useMemo)(()=>p.find(e=>e.source_gift_id===S)??null,[p,S]),Ce=(0,g.useMemo)(()=>({all:p.length,upgrade:p.filter(e=>e.can_upgrade).length,craft:p.filter(e=>e.can_craft).length,basic:p.filter(e=>!e.can_upgrade).length}),[p]),we=(0,g.useMemo)(()=>{let e=h.trim().toLowerCase();return p.filter(t=>(v===`all`||v===`upgrade`&&t.can_upgrade||v===`craft`&&t.can_craft||v===`basic`&&!t.can_upgrade)&&(!e||t.source_gift_id.includes(e)||t.title.toLowerCase().includes(e)))},[p,h,v]),Te=(0,g.useMemo)(()=>{let e=r.trim().toLowerCase();return e?t.filter(t=>String(t.GiftID).includes(e)||t.Title.toLowerCase().includes(e)||t.SourceFormat.toLowerCase().includes(e)):t},[t,r]);function Ee(t,n=``){if(!l)throw Error(e(`gifts.fileRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));let r=new FormData;return r.set(`metadata`,JSON.stringify({command_id:n,reason:le.trim(),confirm:t,gift_id:P,title:I.trim(),stars:ee,convert_stars:ne,enabled:se,sort_order:Number(ae)})),r.set(`file`,l,l.name),r}function De(t,n=``){if(!S)throw Error(e(`gifts.officialRequired`));if(!le.trim())throw Error(e(`action.reasonRequired`));return{command_id:n,reason:le.trim(),confirm:t,source_gift_id:S,gift_id:P,title:I.trim(),stars:ee,convert_stars:ne,enabled:se,sort_order:Number(ae),include_collectible:w,upgrade_stars:E,supply_total:Number(O),slug_prefix:M.trim().toLowerCase()}}function Oe(t){C(t.source_gift_id),L(t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})),R(String(t.stars)),ie(String(t.convert_stars)),T(t.can_upgrade),D(t.upgrade_stars),j(String(t.availability_total||1)),N(`official-${t.source_gift_id}`),B(null)}async function ke(){ge(!0),V(``),B(null);try{B(d===`official`?await x.importOfficialGift(De(!1)):await x.importGift(Ee(!1)))}catch(e){V(b(e))}finally{ge(!1)}}async function Ae(){if(z){ge(!0),V(``);try{d===`official`?await x.importOfficialGift(De(!0,z.command_id)):await x.importGift(Ee(!0,z.command_id)),B(null),u(null),F(`0`),L(``),C(``),await xe(),o(!1)}catch(e){V(b(e))}finally{ge(!1)}}}function je(){F(`0`),L(``),R(`50`),ie(`50`),oe(`0`),ce(!0),ue(``),u(null),B(null),V(``),f(`official`),C(``),_(``),y(`all`),o(!0)}function Me(e){F(e.GiftID),L(e.Title),R(String(e.Stars)),ie(String(e.ConvertStars)),oe(String(e.SortOrder)),ce(e.Enabled),ue(``),u(null),B(null),V(``),f(`official`),C(``),_(``),y(`all`),o(!0)}return(0,U.jsxs)(Ye,{title:e(`gifts.pageTitle`),eyebrow:e(`gifts.eyebrow`),actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>xe(),disabled:me,children:[(0,U.jsx)(fe,{size:15}),` `,e(`common.refresh`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:je,children:[(0,U.jsx)(de,{size:15}),` `,e(`gifts.add`)]})]}),children:[_e&&(0,U.jsx)($e,{children:_e}),(0,U.jsxs)(`div`,{className:`metric-row gift-metrics`,children:[(0,U.jsx)(tt,{label:e(`gifts.total`),value:String(t.length)}),(0,U.jsx)(tt,{label:e(`gifts.enabled`),value:String(t.filter(e=>e.Enabled).length),tone:`good`}),(0,U.jsx)(tt,{label:e(`gifts.received`),value:t.reduce((e,t)=>e+BigInt(t.ReceivedCount),0n).toString()}),(0,U.jsx)(tt,{label:e(`gifts.formats`),value:`TGS / Lottie`})]}),(0,U.jsx)(Xe,{children:(0,U.jsxs)(`div`,{className:`toolbar`,children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:e(`gifts.searchPlaceholder`)})]}),(0,U.jsx)(`span`,{className:`gift-list-summary`,children:e(`gifts.listSummary`,{shown:Te.length,total:t.length})})]})}),(0,U.jsx)(`div`,{className:`table-wrap gift-table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table gift-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:e(`gifts.animation`)}),(0,U.jsx)(`th`,{children:e(`gifts.idRevision`)}),(0,U.jsx)(`th`,{children:e(`gifts.title`)}),(0,U.jsx)(`th`,{children:e(`gifts.price`)}),(0,U.jsx)(`th`,{children:e(`gifts.source`)}),(0,U.jsx)(`th`,{children:e(`gifts.received`)}),(0,U.jsx)(`th`,{children:e(`common.status`)}),(0,U.jsx)(`th`,{children:e(`common.updatedAt`)}),(0,U.jsx)(`th`,{children:e(`common.actions`)})]})}),(0,U.jsxs)(`tbody`,{children:[Te.map(t=>(0,U.jsxs)(`tr`,{className:t.Enabled?``:`gift-row-disabled`,children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(Ut,{giftID:t.GiftID,revision:t.Revision,compact:!0})}),(0,U.jsxs)(`td`,{className:`mono`,children:[t.GiftID,` / `,t.Revision]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{className:`gift-table-title`,children:t.Title||`Gift #${t.GiftID}`}),(0,U.jsxs)(`span`,{className:`gift-sort-order`,children:[e(`gifts.sortOrder`),`: `,t.SortOrder]})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsxs)(`strong`,{className:`gift-table-price`,children:[`⭐ `,t.Stars]}),(0,U.jsxs)(`span`,{className:`gift-convert-price`,children:[`→ `,t.ConvertStars]})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(J,{children:t.SourceFormat}),(0,U.jsx)(`span`,{className:`gift-source-size`,children:Ht(t.AnimationSize)})]}),(0,U.jsx)(`td`,{children:t.ReceivedCount}),(0,U.jsx)(`td`,{children:(0,U.jsx)(J,{tone:t.Enabled?`good`:`neutral`,children:t.Enabled?e(`common.enabled`):e(`common.disabled`)})}),(0,U.jsx)(`td`,{children:K(t.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`div`,{className:`gift-table-actions`,children:[(0,U.jsxs)(`button`,{className:`btn compact-btn collectible-button`,type:`button`,onClick:()=>c(t),children:[(0,U.jsx)(re,{size:13}),e(`collectibles.manage`)]}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>Me(t),children:e(`gifts.replace`)}),(0,U.jsx)(ct,{compact:!0,tone:`neutral`,label:t.Enabled?e(`gifts.disable`):e(`gifts.enable`),path:`/api/actions/set-gift-enabled`,payload:()=>({gift_id:t.GiftID,enabled:!t.Enabled}),onDone:()=>void xe()})]})})]},t.GiftID)),Te.length===0&&(0,U.jsx)(rt,{colSpan:9})]})]})}),a&&(0,st.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal gift-import-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P}),children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:e(`gifts.importEyebrow`)}),(0,U.jsx)(`h2`,{children:P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P})})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>o(!1),disabled:me,"aria-label":e(`action.close`),children:(0,U.jsx)(H,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body gift-import-modal-body`,children:[(0,U.jsxs)(`div`,{className:`command-steps`,children:[(0,U.jsxs)(`div`,{className:`command-step ${(d===`official`?S:l)?`done`:`active`}`,children:[(0,U.jsx)(`span`,{children:`1`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepDetails`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${z?`done`:(d===`official`?S:l)?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`2`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepValidate`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${z?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`3`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepImport`)})]})]}),(0,U.jsxs)(`div`,{className:`gift-source-tabs`,children:[(0,U.jsx)(`button`,{className:`btn ${d===`official`?`primary`:``}`,type:`button`,onClick:()=>{f(`official`),B(null)},children:e(`gifts.officialSource`)}),(0,U.jsx)(`button`,{className:`btn ${d===`file`?`primary`:``}`,type:`button`,onClick:()=>{f(`file`),B(null)},children:e(`gifts.fileSource`)})]}),d===`official`?(0,U.jsxs)(`section`,{className:`official-gift-picker`,children:[(0,U.jsxs)(`div`,{className:`gift-import-note`,children:[(0,U.jsx)(`span`,{children:e(`gifts.officialHint`)}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,U.jsx)(`span`,{children:p.length}),(0,U.jsx)(`span`,{children:`SHA-256`})]})]}),(0,U.jsxs)(`div`,{className:`official-gift-tools`,children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(pe,{size:15}),(0,U.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),placeholder:e(`gifts.officialSearch`)})]}),(0,U.jsx)(`span`,{children:e(`gifts.officialResults`,{shown:we.length,total:p.length})})]}),(0,U.jsx)(`div`,{className:`official-gift-categories`,role:`group`,"aria-label":e(`gifts.officialCategoryLabel`),children:[`all`,`upgrade`,`craft`,`basic`].map(t=>(0,U.jsxs)(`button`,{className:v===t?`active`:``,type:`button`,"aria-pressed":v===t,onClick:()=>y(t),children:[e(`gifts.officialCategory.${t}`),(0,U.jsx)(`span`,{children:Ce[t]})]},t))}),(0,U.jsxs)(`div`,{className:`official-gift-list`,role:`listbox`,"aria-label":e(`gifts.officialSelect`),children:[we.map(t=>{let n=t.source_gift_id===S;return(0,U.jsxs)(`button`,{className:`official-gift-option ${n?`selected`:``}`,type:`button`,role:`option`,"aria-selected":n,onClick:()=>Oe(t),children:[(0,U.jsxs)(`span`,{className:`official-gift-option-head`,children:[(0,U.jsx)(`strong`,{children:t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})}),(0,U.jsxs)(`span`,{className:`mono`,children:[`#`,t.source_gift_id]})]}),(0,U.jsxs)(`span`,{className:`official-gift-option-meta`,children:[(0,U.jsxs)(`span`,{children:[`⭐ `,t.stars]}),(0,U.jsx)(`span`,{children:e(`gifts.officialAttributes`,{count:Vt(t)})})]}),(0,U.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,U.jsx)(`span`,{className:t.can_upgrade?`yes`:`no`,children:t.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,U.jsx)(`span`,{className:t.can_craft?`craft`:`no`,children:t.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]},t.source_gift_id)}),we.length===0&&(0,U.jsx)(`div`,{className:`official-gift-empty`,children:e(`gifts.officialEmpty`)})]}),Se&&(0,U.jsxs)(`div`,{className:`official-gift-selected`,children:[(0,U.jsx)(Wt,{sourceGiftID:Se.source_gift_id}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:Se.title||e(`gifts.officialUnnamed`,{id:Se.source_gift_id})}),(0,U.jsx)(`span`,{className:`mono`,children:Se.source_gift_id}),(0,U.jsxs)(`small`,{children:[Se.model_count,` `,e(`collectibles.models`),` · `,Se.pattern_count,` `,e(`collectibles.patterns`),` · `,Se.backdrop_count,` `,e(`collectibles.backdrops`)]}),(0,U.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,U.jsx)(`span`,{className:Se.can_upgrade?`yes`:`no`,children:Se.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,U.jsx)(`span`,{className:Se.can_craft?`craft`:`no`,children:Se.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]})]}),Se?.can_upgrade&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>{T(e.target.checked),B(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:e(`gifts.includeCollectible`)})]}),w&&(0,U.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.upgradeStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:E,onChange:e=>{D(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.supply`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:O,onChange:e=>{j(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.slug`)}),(0,U.jsx)(`input`,{value:M,maxLength:48,onChange:e=>{N(e.target.value.toLowerCase()),B(null)}})]})]})]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`gift-import-note`,children:[(0,U.jsx)(`span`,{children:e(`gifts.importHint`)}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,"aria-label":e(`gifts.formats`),children:[(0,U.jsx)(`span`,{children:`TGS`}),(0,U.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,U.jsxs)(`label`,{className:`gift-file-picker ${l?`has-file`:``}`,children:[(0,U.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:e=>{u(e.target.files?.[0]??null),B(null)}}),(0,U.jsx)(`span`,{className:`gift-file-icon`,children:(0,U.jsx)(te,{size:22})}),(0,U.jsxs)(`span`,{className:`gift-file-copy`,children:[(0,U.jsx)(`span`,{className:`gift-field-label`,children:e(`gifts.animation`)}),(0,U.jsx)(`strong`,{children:l?l.name:e(`gifts.filePrompt`)}),(0,U.jsx)(`small`,{children:l?Ht(l.size):e(`gifts.fileHint`)})]}),(0,U.jsx)(`span`,{className:`gift-file-action`,children:e(l?`gifts.changeFile`:`gifts.chooseFile`)})]})]}),(0,U.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.title`)}),(0,U.jsx)(`input`,{value:I,maxLength:128,placeholder:e(`gifts.titlePlaceholder`),onChange:e=>{L(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.stars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:ee,onChange:e=>{R(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.convertStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,value:ne,onChange:e=>{ie(e.target.value),B(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:ae,onChange:e=>{oe(e.target.value),B(null)}})]})]}),(0,U.jsxs)(`label`,{className:`gift-reason-field`,children:[(0,U.jsx)(`span`,{children:e(`gifts.reason`)}),(0,U.jsx)(`input`,{value:le,placeholder:e(`gifts.reasonPlaceholder`),onChange:e=>ue(e.target.value)})]}),(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:se,onChange:e=>{ce(e.target.checked),B(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:e(`gifts.enableAfterImport`)})]}),ye&&(0,U.jsx)($e,{children:ye}),z&&(0,U.jsxs)(`div`,{className:`gift-validation`,children:[(0,U.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,U.jsx)(k,{size:17}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e(`gifts.validationReady`)}),(0,U.jsx)(`span`,{children:e(`gifts.validationHint`)})]})]}),(0,U.jsx)(`pre`,{children:JSON.stringify(z.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>o(!1),disabled:me,children:e(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:ke,disabled:me,children:[me?(0,U.jsx)(A,{className:`spin`,size:15}):(0,U.jsx)(he,{size:15}),e(`gifts.validate`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:Ae,disabled:me||!z,children:[(0,U.jsx)(be,{size:15}),e(`gifts.confirmImport`)]})]})]})}),document.body),s&&(0,U.jsx)(Bt,{gift:s,onClose:()=>c(null),onPublished:()=>void xe()})]})}function Kt({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1],i=e.path.match(/^\/bots\/(\d+)$/)?.[1];return n?(0,U.jsx)(ut,{id:Number(n),navigate:t}):r?(0,U.jsx)(ht,{id:Number(r),navigate:t}):i?(0,U.jsx)(_t,{id:Number(i),navigate:t}):e.path===`/accounts`?(0,U.jsx)(mt,{navigate:t}):e.path===`/channels`?(0,U.jsx)(gt,{navigate:t}):e.path===`/bots`?(0,U.jsx)(vt,{navigate:t}):e.path===`/gifts`?(0,U.jsx)(Gt,{}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,U.jsx)(Tt,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,U.jsx)(xt,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,U.jsx)(wt,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,U.jsx)(Et,{navigate:t}):(0,U.jsx)(yt,{navigate:t})}function qt(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>Ae());(0,g.useEffect)(()=>{let e=()=>r(Ae());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(Ae())};return e===void 0?(0,U.jsx)(Be,{}):e===null?(0,U.jsx)(ot,{onLogin:t}):(0,U.jsx)(Ve,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,U.jsx)(Kt,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,U.jsx)(g.StrictMode,{children:(0,U.jsx)(Ie,{children:(0,U.jsx)(Te,{children:(0,U.jsx)(qt,{})})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css b/cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css deleted file mode 100644 index a538e8da..00000000 --- a/cmd/telesrv-admin/web/dist/assets/index-BlWlOvtx.css +++ /dev/null @@ -1 +0,0 @@ -:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#eef1f5;--bg-accent:#e7ecf1;--panel:#fff;--panel-subtle:#f5f8fb;--panel-strong:#eef2f6;--surface-soft:#f2f7f6;--overlay:#18222f6b;--topbar-bg:#ffffffdb;--line:#e5eaf0;--line-strong:#d3dce4;--heading:#253040;--text:#333f4d;--text-soft:#45525f;--muted:#6d7885;--muted-2:#9aa4b1;--brand:#1f7d6f;--brand-strong:#196155;--brand-2:#3a6cae;--brand-tint:#e8f4f0;--brand-tint-border:#c8e2db;--brand-tint-text:#235d53;--good:#1f8a57;--good-tint:#eaf6ef;--good-border:#c1e1cf;--warn:#a86a12;--warn-tint:#fcf4e4;--warn-border:#e7d09e;--danger:#c0392b;--danger-tint:#fcefec;--danger-border:#eecac3;--danger-text:#8f2f27;--purple:#6a4fa3;--purple-tint:#f4effb;--purple-border:#dcd0f0;--purple-text:#5a4590;--input-bg:#fff;--btn-bg:#fff;--btn-text:#29323d;--btn-hover:#f4f7fa;--switch-track:#c8d0d6;--code-bg:#1b2733;--code-text:#d6e3ef;--code-border:#2b3a49;--sidebar:#1c2530;--sidebar-soft:#26313d;--sidebar-line:#313c4a;--sidebar-row:#232d38;--sidebar-text:#dbe3ec;--sidebar-muted:#8b98a8;--sidebar-faint:#7c8a9a;--sidebar-heading:#fff;--focus:#1f7d6f29;--shadow:0 12px 34px #1827381a;--shadow-sm:0 2px 10px #1827380d;--shadow-brand:0 8px 22px #1f7d6f38;--radius-xs:8px;--radius-sm:9px;--radius:11px;--radius-lg:14px}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0f141a;--bg-accent:#131a22;--panel:#171f28;--panel-subtle:#1c2530;--panel-strong:#212c38;--surface-soft:#1a232d;--overlay:#05080c9e;--topbar-bg:#151c24db;--line:#29333f;--line-strong:#38434f;--heading:#eef3f8;--text:#d5dde6;--text-soft:#c2ccd6;--muted:#98a4b1;--muted-2:#6d7885;--brand:#37a596;--brand-strong:#45b6a6;--brand-2:#6fa8e6;--brand-tint:#14322d;--brand-tint-border:#245349;--brand-tint-text:#7fd3c4;--good:#47c281;--good-tint:#12301f;--good-border:#245639;--warn:#e0aa4d;--warn-tint:#322810;--warn-border:#574413;--danger:#e6695c;--danger-tint:#35201d;--danger-border:#5c332d;--danger-text:#f0a49b;--purple:#ac90e2;--purple-tint:#221b31;--purple-border:#3d3357;--purple-text:#c9b6ef;--input-bg:#131a22;--btn-bg:#1e2731;--btn-text:#dbe2ea;--btn-hover:#26313d;--switch-track:#3a454f;--code-bg:#0c1218;--code-text:#cdd9e5;--code-border:#232f3b;--sidebar:#10151b;--sidebar-soft:#1c242f;--sidebar-line:#262f3a;--sidebar-row:#161d25;--sidebar-text:#cbd4de;--sidebar-muted:#7c8794;--sidebar-faint:#6f7b88;--sidebar-heading:#f0f4f8;--focus:#37a5963d;--shadow:0 16px 40px #00000075;--shadow-sm:0 2px 12px #00000061;--shadow-brand:0 8px 22px #37a59642}*{box-sizing:border-box}html,body,#root{min-height:100%}body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;margin:0;font:13px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;transition:background-color .2s,color .2s}button,input,textarea{font:inherit}a{color:inherit;text-decoration:none}.shell{grid-template-columns:232px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{height:100vh;color:var(--sidebar-text);background:var(--sidebar);border-right:1px solid var(--sidebar-line);flex-direction:column;gap:16px;padding:18px 12px;display:flex;position:sticky;top:0;overflow-y:auto}.brand{align-items:center;gap:10px;min-height:42px;padding:0 4px;display:flex}.brand.compact{justify-content:center}.brand-elevated .brand-mark{box-shadow:var(--shadow-brand)}.brand-mark{color:#fff;background:var(--brand);border-radius:var(--radius-sm);border:1px solid #fff3;place-items:center;width:34px;height:34px;font-weight:800;display:grid}.brand strong{font-size:14px;line-height:1.1;display:block}.brand small{color:var(--sidebar-muted);margin-top:3px;font-size:11px;display:block}.sidebar-label{color:var(--sidebar-faint);text-transform:uppercase;letter-spacing:.04em;padding:0 8px;font-size:11px;font-weight:700}.nav-list,.nav-section{gap:4px;display:grid}.nav-section-toggle{width:100%;min-height:38px;color:var(--sidebar-muted);border-radius:var(--radius-sm);cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;grid-template-columns:18px minmax(0,1fr) 16px;align-items:center;gap:9px;padding:0 10px;font-size:12px;font-weight:800;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-section-toggle:hover,.nav-section.active .nav-section-toggle{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-section-chevron{color:var(--sidebar-muted);justify-self:end;transition:transform .14s}.nav-section.open .nav-section-chevron{transform:rotate(180deg)}.nav-children{gap:4px;padding:2px 0 2px 18px;display:grid}.nav-item{min-height:38px;color:var(--sidebar-text);border-radius:var(--radius-sm);border:1px solid #0000;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;padding:0 10px;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-dot{background:var(--sidebar-faint);border-radius:999px;justify-self:center;width:6px;height:6px}.nav-item:hover,.nav-item.active{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-item.active .nav-dot{background:var(--brand)}.sidebar-status{gap:7px;margin-top:auto;display:grid}.runtime-row{min-height:32px;color:var(--sidebar-text);background:var(--sidebar-row);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;padding:0 8px;display:grid}.runtime-row strong{color:var(--sidebar-heading);font-size:11px}.workspace{min-width:0}.topbar{z-index:20;background:var(--topbar-bg);border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);justify-content:space-between;align-items:center;gap:18px;min-height:66px;padding:12px 24px;display:flex;position:sticky;top:0}.topbar h1{color:var(--heading);margin:2px 0 0;font-size:20px;line-height:1.2}.topbar-actions,.page-actions,.section-action,.entity-badges,.row-actions,.modal-actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.language-switch{background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;min-height:30px;padding:2px;display:inline-flex}.language-switch button{min-width:42px;min-height:24px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:999px;padding:0 9px;font-weight:800;transition:color .14s,background-color .14s}.language-switch button.active{color:#fff;background:var(--brand)}.language-switch button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.theme-toggle{width:34px;height:34px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);cursor:pointer;border-radius:999px;place-items:center;transition:color .16s,background-color .16s,border-color .16s;display:inline-grid}.theme-toggle:hover{color:var(--brand);border-color:var(--brand-tint-border);background:var(--brand-tint)}.theme-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.actor-pill{min-height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;padding:0 10px;display:inline-flex}.content{gap:16px;padding:18px 24px 30px;display:grid}.eyebrow{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:800}.dashboard-layout,.stacked-sections{gap:14px;display:grid}.overview-band,.page-frame{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm)}.overview-band{grid-template-columns:minmax(220px,1fr) minmax(420px,.9fr);align-items:center;gap:16px;padding:16px;display:grid}.overview-band h2,.page-title-row h2,.section-head h2,.modal h2{color:var(--heading);margin:0;font-size:18px;line-height:1.25}.overview-metrics,.metric-row{grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;display:grid}.overview-metrics{grid-template-columns:repeat(3,minmax(120px,1fr))}.status-item,.metric,.summary-item{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:0;padding:10px}.status-item span,.metric span,.summary-item span{color:var(--muted);margin-bottom:6px;font-size:11px;display:block}.status-item strong,.metric strong,.summary-item strong{overflow-wrap:anywhere;color:var(--text);font-weight:800;display:block}.status-item.good,.metric.good{border-color:var(--good-border)}.status-item.warn,.metric.warn{border-color:var(--warn-border)}.metric.danger{border-color:var(--danger-border)}.command-grid{grid-template-columns:repeat(3,minmax(220px,1fr));gap:12px;display:grid}.launcher{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-height:94px;box-shadow:var(--shadow-sm);grid-template-columns:38px minmax(0,1fr) 18px;align-items:center;gap:12px;padding:14px;transition:border-color .16s,box-shadow .16s,transform .16s;display:grid}.launcher:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.launcher-icon{width:38px;height:38px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);place-items:center;display:grid}.launcher-copy{gap:4px;display:grid}.launcher-copy strong{color:var(--heading);font-size:15px}.launcher-copy span{color:var(--muted)}.work-strip{grid-template-columns:repeat(4,minmax(160px,1fr));gap:8px;display:grid}.strip-item{min-height:38px;color:var(--text-soft);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.page-frame{gap:14px;padding:14px;display:grid}.page-title-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:14px;padding-bottom:12px;display:flex}.query-panel{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.message-query input{width:150px}.message-selector-grid{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;margin-bottom:10px;display:grid}.message-selector-grid.single{grid-template-columns:minmax(320px,620px)}.entity-picker{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);gap:8px;min-width:0;padding:10px;display:grid}.picker-head{min-height:24px;color:var(--text-soft);justify-content:space-between;align-items:center;gap:8px;font-weight:800;display:flex}.selected-entity{min-height:40px;color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 9px;display:grid}.selected-entity strong,.selected-entity span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.selected-entity div{gap:2px;min-width:0;display:grid}.selected-entity div span{color:var(--brand-tint-text);opacity:.85;font-size:11px}.picker-search{background:var(--panel-subtle);border:1px solid var(--line-strong);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;height:34px;padding:0 6px 0 9px;display:grid}.picker-search input{width:100%;height:30px;box-shadow:none;background:0 0;border:0;padding:0}.picker-results{border:1px solid var(--line);border-radius:var(--radius-sm);max-height:236px;display:grid;overflow:auto}.picker-row{min-height:36px;color:var(--text);background:var(--panel);border:0;border-bottom:1px solid var(--line);cursor:pointer;text-align:left;grid-template-columns:96px minmax(120px,1fr) minmax(120px,1fr) auto;align-items:center;gap:8px;padding:6px 8px;display:grid}.picker-row:last-child{border-bottom:0}.picker-row:hover,.picker-row.selected{background:var(--surface-soft)}.picker-row strong,.picker-row span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.picker-empty,.picker-error{color:var(--muted);text-align:center;padding:9px}.picker-error{color:var(--danger);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius-sm)}input,textarea{color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);outline:none;transition:border-color .14s,box-shadow .14s}input::placeholder,textarea::placeholder{color:var(--muted-2)}input{width:190px;height:34px;padding:0 10px}textarea{resize:vertical;width:100%;padding:9px 10px}input:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus)}.small-input{width:88px}.field-inline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.field-inline span{font-size:11px;font-weight:700}.searchbox{width:min(380px,100%);height:34px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:inline-flex}.searchbox input{width:100%;height:30px;box-shadow:none;border:0;padding:0}.btn{min-height:34px;color:var(--btn-text);background:var(--btn-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;justify-content:center;align-items:center;gap:6px;padding:0 12px;transition:background-color .14s,border-color .14s,color .14s,box-shadow .14s;display:inline-flex}.btn:hover:not(:disabled){background:var(--btn-hover)}.btn:disabled{color:var(--muted-2);cursor:not-allowed}.btn.primary{color:#fff;background:var(--brand);border-color:var(--brand)}.btn.primary:hover:not(:disabled){background:var(--brand-strong);border-color:var(--brand-strong)}.btn.ghost{background:var(--panel-subtle)}.btn.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.btn.danger:hover:not(:disabled){background:var(--danger-tint);border-color:var(--danger)}.btn.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.btn.warn:hover:not(:disabled){background:var(--warn-tint);border-color:var(--warn)}.btn:disabled,.btn.primary:disabled,.btn.warn:disabled,.btn.danger:disabled{color:var(--muted-2);background:var(--panel-strong);border-color:var(--line);cursor:not-allowed}.btn.full{width:100%}.icon-text{gap:7px}.compact-btn{min-height:28px;padding:0 8px;font-size:12px}.row-link,.link-button{color:var(--brand-2);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:0;display:inline-flex}.table-wrap{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);width:100%;overflow-x:auto}.data-table{border-collapse:collapse;width:100%;font-size:12.5px}.data-table th,.data-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;white-space:nowrap;height:38px;padding:7px 9px}.data-table th{z-index:0;color:var(--muted);background:var(--panel-strong);font-weight:800;position:sticky;top:0}.data-table tbody tr:hover{background:var(--panel-subtle)}.data-table tr:last-child td{border-bottom:0}.mono{font-family:SFMono-Regular,Consolas,Liberation Mono,monospace}.truncate{text-overflow:ellipsis;max-width:380px;overflow:hidden}.badge{min-height:22px;color:var(--muted);background:var(--panel-strong);border:1px solid var(--line-strong);white-space:nowrap;border-radius:999px;align-items:center;padding:1px 8px;display:inline-flex}.badge.good{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.badge.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.badge.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.empty-cell{color:var(--muted);text-align:center}.bot-create-fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.bot-create-fields .duration-field input{width:100%}.bot-create-actions{border-top:1px solid var(--line);justify-content:space-between;align-items:center;gap:14px;margin-top:14px;padding-top:14px;display:flex}.bot-create-note{color:var(--muted);font-size:12px;line-height:1.4}@media (width<=760px){.bot-create-fields{grid-template-columns:1fr}.bot-create-actions{flex-direction:column;align-items:stretch}}.split-layout{grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:14px;display:grid}.split-main,.split-side{min-width:0}.entity-head{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);justify-content:space-between;align-items:flex-start;gap:14px;padding:14px;display:flex}.entity-title{color:var(--heading);font-size:20px;font-weight:800;line-height:1.25}.entity-subtitle{color:var(--muted);margin-top:4px}.summary-grid{grid-template-columns:repeat(4,minmax(150px,1fr));gap:8px;display:grid}.about-text{color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);margin:0;padding:10px}.section-block,.action-dock,.surface{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm);padding:12px}.section-head{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.section-head p{color:var(--muted);margin:5px 0 0}.action-dock{gap:10px;display:grid;position:sticky;top:82px}.dock-title{color:var(--text-soft);border-bottom:1px solid var(--line);padding-bottom:4px;font-weight:800}.action-dock>.btn,.action-dock .action-stack .btn{justify-content:center;width:100%}.duration-field{gap:4px;display:grid}.duration-field span{color:var(--muted);font-size:11px;font-weight:800}.duration-field input{width:100%}.action-stack{gap:10px;display:grid}.action-stack .btn,.action-dock>.btn{min-height:42px}.danger-zone{border-top:1px solid var(--line);flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;display:flex}.authorization-block{gap:10px;display:grid}.authorization-table{table-layout:fixed;min-width:720px}.authorization-table th,.authorization-table td{height:46px}.device-text{text-overflow:ellipsis;max-width:260px;overflow:hidden}.device-actions-head{width:190px}.device-actions-cell{width:190px;min-width:190px}.device-actions{white-space:normal;grid-template-columns:repeat(2,minmax(82px,1fr));gap:6px;min-width:178px;display:grid}.device-actions .btn{justify-content:center;width:100%}.operation-row{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;display:grid}.operation-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}.operation-title{width:100%;color:var(--heading);align-items:center;gap:6px;font-weight:800;display:flex}.checkline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.checkline input{width:auto;height:auto}.alert{color:var(--danger-text);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius);align-items:flex-start;gap:8px;padding:9px 10px;display:flex}.json-block{max-height:520px;color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius);margin:0;padding:12px;font-size:12px;overflow:auto}.raw-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.loading-line{min-height:80px;color:var(--muted);place-items:center;display:grid}.empty-panel{min-height:92px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);place-items:center;display:grid}.gift-metrics .metric{background:var(--panel-subtle);min-height:68px;padding:12px}.gift-metrics .metric strong{font-size:17px}.gift-file-icon{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);flex:none;place-items:center;display:grid}.gift-format-chips{flex-wrap:wrap;flex:none;justify-content:flex-end;gap:6px;display:flex}.gift-format-chips span{color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);letter-spacing:.02em;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.gift-list-summary{color:var(--muted);margin-left:auto;font-size:11px;font-weight:700}.gift-import-modal{width:min(860px,100%)}.gift-import-modal-body{gap:14px}.gift-source-tabs{gap:8px;display:flex}.official-gift-picker{gap:12px;min-width:0;display:grid}.official-gift-tools{align-items:center;gap:12px;display:flex}.official-gift-tools .searchbox{width:100%}.official-gift-tools>span{color:var(--muted);flex:none;font-size:11px;font-weight:750}.official-gift-categories{flex-wrap:wrap;gap:7px;display:flex}.official-gift-categories button{min-height:32px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line-strong);font:inherit;cursor:pointer;border-radius:999px;align-items:center;gap:7px;padding:5px 10px;font-size:11px;font-weight:800;transition:color .15s,background .15s,border-color .15s,box-shadow .15s;display:inline-flex}.official-gift-categories button:hover{color:var(--brand);border-color:var(--brand-tint-border)}.official-gift-categories button.active{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:var(--shadow-brand)}.official-gift-categories button span{min-width:20px;height:20px;color:inherit;background:#7d8c9b38;border-radius:999px;place-items:center;padding:0 5px;font-size:10px;display:grid}.official-gift-categories button.active span{color:var(--brand);background:#ffffffd9}.official-gift-list{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel-subtle);scrollbar-gutter:stable;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-height:126px;max-height:314px;padding:8px;display:grid;overflow:auto}.official-gift-option{text-align:left;min-width:0;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);cursor:pointer;box-shadow:var(--shadow-sm);gap:8px;padding:11px 12px;transition:border-color .15s,box-shadow .15s,transform .15s;display:grid}.official-gift-option:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.official-gift-option.selected{border-color:var(--brand);box-shadow:0 0 0 2px var(--focus), var(--shadow)}.official-gift-option-head{grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:8px;display:grid}.official-gift-option-head strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.official-gift-option-head .mono{color:var(--muted);font-size:9px}.official-gift-option-meta{color:var(--muted);flex-wrap:wrap;gap:10px;font-size:10px;font-weight:700;display:flex}.official-gift-capabilities{flex-wrap:wrap;gap:5px;display:flex}.official-gift-capabilities>span{letter-spacing:.01em;border:1px solid #0000;border-radius:999px;padding:3px 7px;font-size:9px;font-weight:850}.official-gift-capabilities>span.yes{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.official-gift-capabilities>span.craft{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.official-gift-capabilities>span.no{color:var(--muted);background:var(--panel-strong);border-color:var(--line-strong)}.official-gift-empty{min-height:108px;color:var(--muted);text-align:center;grid-column:1/-1;place-items:center;padding:20px;font-size:12px;display:grid}.official-gift-selected{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface-soft);grid-template-columns:108px minmax(0,1fr);align-items:center;gap:14px;padding:12px;display:grid}.official-gift-selected .gift-animation-shell{width:96px;height:96px}.official-gift-selected>div:last-child{gap:5px;min-width:0;display:grid}.official-gift-selected small{color:var(--muted)}.gift-import-note{color:var(--muted);justify-content:space-between;align-items:center;gap:12px;line-height:1.45;display:flex}.gift-file-picker{min-height:78px;color:var(--text);background:var(--panel);border:1px dashed var(--line-strong);border-radius:var(--radius);cursor:pointer;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;transition:border-color .16s,background .16s,box-shadow .16s;display:grid;position:relative}.gift-file-picker:hover,.gift-file-picker.has-file{background:var(--brand-tint);border-color:var(--brand);box-shadow:0 0 0 2px var(--focus)}.gift-file-picker input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.gift-file-icon{border-radius:var(--radius-sm);width:40px;height:40px}.gift-file-copy{gap:2px;min-width:0;display:grid}.gift-field-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10px;font-weight:800}.gift-file-copy strong{color:var(--heading);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.gift-file-copy small{color:var(--muted);font-size:11px;font-weight:500}.gift-file-action{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);padding:7px 10px;font-size:11px;font-weight:800}.gift-fields-grid{grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(120px,1fr));gap:10px;display:grid}.gift-fields-grid label,.gift-reason-field{color:var(--muted);gap:6px;font-size:11px;font-weight:700;display:grid}.gift-fields-grid input,.gift-reason-field input{width:100%;min-width:0;height:38px;color:var(--text);background:var(--input-bg);border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 10px}.gift-fields-grid input:focus,.gift-reason-field input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus);outline:none}.gift-switch{color:var(--text-soft);cursor:pointer;align-items:center;gap:9px;font-size:12px;font-weight:700;display:inline-flex}.gift-switch input{opacity:0;width:1px;height:1px;position:absolute}.gift-switch-track{background:var(--switch-track);border-radius:999px;align-items:center;width:34px;height:19px;padding:2px;transition:background .16s;display:flex}.gift-switch-track span{background:#fff;border-radius:50%;width:15px;height:15px;transition:transform .16s;box-shadow:0 1px 3px #10182838}.gift-switch input:checked+.gift-switch-track{background:var(--brand)}.gift-switch input:checked+.gift-switch-track span{transform:translate(15px)}.gift-switch input:focus-visible+.gift-switch-track{outline:3px solid var(--focus);outline-offset:2px}.gift-validation{color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius-sm);overflow:hidden}.gift-validation-head{color:var(--code-text);background:#ffffff09;border-bottom:1px solid #ffffff17;align-items:center;gap:9px;padding:10px 12px;display:flex}.gift-validation-head div{gap:2px;display:grid}.gift-validation-head span{color:var(--brand);font-size:10px}.gift-validation pre{max-height:180px;color:var(--code-text);margin:0;padding:11px 12px;font-size:11px;overflow:auto}.gift-animation-shell{background:var(--surface-soft);place-items:center;min-height:210px;display:grid;position:relative}.gift-animation{width:200px;height:200px}.gift-animation canvas{width:100%!important;height:100%!important}.gift-play{width:30px;height:30px;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:50%;place-items:center;display:grid;position:absolute;bottom:8px;right:8px}.gift-table-wrap{background:var(--panel)}.gift-table{min-width:1080px}.gift-table th:first-child{width:74px}.gift-table td{vertical-align:middle}.gift-animation-shell.compact{border:1px solid var(--line);border-radius:var(--radius-sm);width:56px;min-height:56px;overflow:hidden}.gift-animation-shell.compact .gift-animation{width:54px;height:54px}.gift-animation-shell.compact .gift-play{width:20px;height:20px;bottom:3px;right:3px}.gift-row-disabled{opacity:.68}.gift-table-title,.gift-sort-order,.gift-source-size,.gift-convert-price{display:block}.gift-table-title{text-overflow:ellipsis;white-space:nowrap;max-width:220px;overflow:hidden}.gift-sort-order,.gift-source-size,.gift-convert-price{color:var(--muted);margin-top:3px;font-size:10px}.gift-table-price{color:var(--warn)}.gift-table-actions{align-items:center;gap:6px;display:flex}.collectible-button{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.collectible-button:hover{background:var(--purple-tint);border-color:var(--purple)}.collectible-modal{width:min(1180px,100%);max-height:min(92vh,980px)}.collectible-modal .modal-head p{color:var(--muted);margin:4px 0 0;font-size:11px}.collectible-modal-body{background:var(--bg);gap:16px;padding:16px 18px 22px;overflow:auto}.collectible-loading{min-height:90px;color:var(--muted);justify-content:center;align-items:center;gap:8px;display:flex}.collectible-empty{color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius);align-items:center;gap:12px;padding:16px;display:flex}.collectible-empty div,.collectible-definition-head>div:first-child,.collectible-section-head>div:first-child{gap:3px;display:grid}.collectible-empty span,.collectible-definition-head span,.collectible-section-head span{color:var(--muted);font-size:10px;font-weight:500}.collectible-active{background:var(--panel);border:1px solid var(--purple-border);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-active-head{background:var(--purple-tint);border-bottom:1px solid var(--purple-border);justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.collectible-active-head>div{color:var(--purple-text);align-items:center;gap:9px;display:flex}.collectible-active-head>div>div{gap:2px;display:grid}.collectible-active-head span{color:var(--muted);font-size:10px}.collectible-active-grid{background:var(--line);grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:1px;display:grid}.collectible-active-grid article{background:var(--panel);align-items:center;gap:9px;min-width:0;padding:9px 11px;display:flex}.collectible-active-grid article>div:last-child{gap:2px;min-width:0;display:grid}.collectible-active-grid article strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.collectible-active-grid article span{color:var(--muted);font-size:9px}.collectible-definition{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-definition-head{background:var(--panel-subtle);border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.collectible-main-fields{background:var(--panel-subtle);border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section{border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section:last-child{border-bottom:0}.collectible-section-head{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.collectible-section-tools{align-items:center;gap:7px;display:flex}.collectible-rows{gap:7px;display:grid}.collectible-row{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:end;gap:7px;padding:9px 9px 9px 36px;display:grid;position:relative}.collectible-row:hover{background:var(--panel);border-color:var(--line-strong);box-shadow:var(--shadow-sm)}.collectible-row.animated{grid-template-columns:minmax(120px,1.2fr) 90px 78px minmax(160px,1.4fr) 48px 30px}.collectible-row.backdrop{grid-template-columns:minmax(110px,1.2fr) 70px 80px 70px repeat(4,52px) 48px 30px}.collectible-row-index{width:27px;color:var(--purple-text);background:var(--purple-tint);border-right:1px solid var(--purple-border);border-radius:var(--radius-xs) 0 0 var(--radius-xs);place-items:center;font-size:10px;font-weight:800;display:grid;position:absolute;top:0;bottom:0;left:0}.collectible-row label{gap:4px;min-width:0;display:grid}.collectible-row label>span{color:var(--muted);text-transform:uppercase;letter-spacing:.025em;font-size:9px;font-weight:800}.collectible-row input:not([type=file]){width:100%;min-width:0;height:32px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;padding:0 8px;font-size:11px}.collectible-row input:focus{border-color:var(--purple);box-shadow:0 0 0 3px var(--purple-tint);outline:none}.collectible-file input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.collectible-file em{min-width:0;height:32px;color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius-sm);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;align-items:center;gap:5px;padding:0 8px;font-size:10px;font-style:normal;font-weight:700;display:flex;overflow:hidden}.collectible-inline-preview{width:42px;height:42px;color:var(--purple);background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);place-items:center;display:grid;overflow:hidden}.collectible-animation{width:100%;height:100%;overflow:hidden}.collectible-animation.compact{background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);flex:0 0 42px;place-items:center;width:42px;height:42px;display:grid}.collectible-animation canvas{width:100%!important;height:100%!important}.collectible-animation.failed{color:var(--danger);background:var(--danger-tint)}.collectible-animation.loading{color:var(--purple-text)}.collectible-file-error{color:var(--danger);grid-column:1/-1;font-size:10px}.collectible-color input{cursor:pointer;height:32px!important;padding:3px!important}.collectible-backdrop-preview{border-radius:var(--radius-sm);border:1px solid #2a1f472e;flex:0 0 42px;place-items:center;width:42px;height:42px;font-size:11px;font-weight:900;display:grid;box-shadow:inset 0 0 0 1px #fff3}.collectible-row .icon-btn{align-self:center}.collectible-row .icon-btn:disabled{opacity:.28}@media (width<=900px){.gift-fields-grid,.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:repeat(2,minmax(0,1fr))}.collectible-inline-preview,.collectible-backdrop-preview,.collectible-row .icon-btn{place-self:center start}}@media (width<=620px){.gift-import-note{flex-direction:column;align-items:flex-start}.gift-format-chips{justify-content:flex-start}.gift-file-picker{grid-template-columns:40px minmax(0,1fr)}.gift-file-action{display:none}.gift-fields-grid{grid-template-columns:1fr}.gift-list-summary{width:100%;margin-left:0}.official-gift-tools{flex-direction:column;align-items:stretch}.official-gift-list{grid-template-columns:1fr;max-height:340px}.official-gift-selected{grid-template-columns:82px minmax(0,1fr)}.official-gift-selected .gift-animation-shell{width:72px;height:72px}.collectible-modal-body{padding:10px}.collectible-definition-head,.collectible-section-head{flex-direction:column;align-items:flex-start}.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:1fr}.collectible-active-grid{grid-template-columns:1fr 1fr}}.modal-backdrop{z-index:10000;background:var(--overlay);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);place-items:center;padding:24px;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(760px,100%);max-height:min(820px,100vh - 48px);box-shadow:var(--shadow);padding:0;overflow:hidden}.command-modal{flex-direction:column;display:flex}.command-modal>.modal-head,.command-modal>.modal-actions{flex:none}.modal-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 18px 12px;display:flex}.icon-btn{width:30px;height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;place-items:center;transition:background-color .14s,border-color .14s,color .14s;display:grid}.icon-btn:hover{background:var(--btn-hover);border-color:var(--line-strong)}.command-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.command-body{grid-auto-rows:max-content;gap:12px;min-height:0;padding:14px 18px;display:grid;overflow:auto}.command-step{min-height:38px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.command-step span{background:var(--panel);border:1px solid var(--line);border-radius:999px;place-items:center;width:20px;height:20px;font-size:11px;font-weight:800;display:grid}.command-step.active{color:var(--brand);border-color:var(--brand-tint-border)}.command-step.done{color:var(--good);border-color:var(--good-border)}.form-field{gap:6px;display:grid}.form-field span,.form-stack span{color:var(--text-soft);font-weight:800}.command-preview{gap:8px;display:grid}.command-preview .json-block{max-height:150px}.preview-head,.result-title{color:var(--text-soft);align-items:center;gap:7px;font-weight:800;display:flex}.result-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);gap:8px;padding:10px;display:grid}.result-line{grid-template-columns:92px minmax(0,1fr);gap:8px;display:grid}.result-line span{color:var(--muted)}.result-line strong{overflow-wrap:anywhere}.result-message{color:var(--text-soft)}.modal-actions{background:var(--panel);border-top:1px solid var(--line);justify-content:flex-end;padding:12px 18px}.login-page{background:var(--bg);place-items:center;min-height:100vh;padding:24px;display:grid}.login-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(420px,100%);box-shadow:var(--shadow);gap:18px;padding:22px;display:grid}.login-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.login-head-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.login-chip{min-height:24px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:999px;align-items:center;padding:0 8px;font-size:12px;display:inline-flex}.login-copy h1{color:var(--heading);margin:0;font-size:22px}.login-copy p{color:var(--muted);margin:8px 0 0}.form-stack{gap:12px;display:grid}.form-stack label{gap:6px;display:grid}.form-stack input{width:100%}.boot-screen{background:var(--bg);align-content:center;place-items:center;gap:18px;min-height:100vh;display:grid}.loader-bar{background:var(--line-strong);border-radius:999px;width:180px;height:4px;overflow:hidden}.loader-bar:before{content:"";background:var(--brand);width:42%;height:100%;animation:1s ease-in-out infinite load;display:block}.spin{animation:.8s linear infinite spin}@keyframes load{0%{transform:translate(-120%)}to{transform:translate(260%)}}@keyframes spin{to{transform:rotate(360deg)}}@media (width<=1120px){.shell{grid-template-columns:1fr}.sidebar{height:auto;position:static}.nav-list{grid-template-columns:repeat(4,minmax(0,1fr))}.sidebar-status{display:none}.overview-band,.split-layout,.operation-row,.raw-grid,.message-selector-grid,.message-selector-grid.single{grid-template-columns:1fr}.action-dock{position:static}}@media (width<=760px){.content,.topbar{padding-left:14px;padding-right:14px}.command-grid,.work-strip,.overview-metrics,.metric-row,.summary-grid,.command-steps{grid-template-columns:1fr}.sidebar{gap:12px;padding:14px}.nav-list{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar,.page-title-row,.entity-head{flex-direction:column;align-items:flex-start}input,.searchbox{width:100%}.toolbar{align-items:stretch}.picker-row,.selected-entity{grid-template-columns:1fr}} diff --git a/cmd/telesrv-admin/web/dist/assets/index-Bx7A77x9.js b/cmd/telesrv-admin/web/dist/assets/index-Bx7A77x9.js new file mode 100644 index 00000000..e36e2012 --- /dev/null +++ b/cmd/telesrv-admin/web/dist/assets/index-Bx7A77x9.js @@ -0,0 +1,9 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-Ee||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[: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]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` +`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?te(e):``}function ie(e){switch(e.tag){case 5:return te(e.type);case 16:return te(`Lazy`);case 13:return te(`Suspense`);case 19:return te(`SuspenseList`);case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return``}}function ae(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}function oe(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ae(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function se(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function ce(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function le(e){var t=ce(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function B(e){e._valueTracker||=le(e)}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=ce(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function V(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function de(e,t){var n=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=se(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function pe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function me(e,t){pe(e,t);var n=se(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ge(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ge(e,t.type,se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function he(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ge(e,t,n){(t!==`number`||V(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var _e=Array.isArray;function ve(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=we.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ee(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var De={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Oe=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(De).forEach(function(e){Oe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),De[t]=De[e]})});function ke(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||De.hasOwnProperty(e)&&De[e]?(``+t).trim():t+`px`}function Ae(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=ke(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var je=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function U(e,t){if(t){if(je[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Me(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 Ne=null;function Pe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fe=null,W=null,Ie=null;function Le(e){if(e=Ai(e)){if(typeof Fe!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Mi(t),Fe(e.stateNode,e.type,t))}}function Re(e){W?Ie?Ie.push(e):Ie=[e]:W=e}function ze(){if(W){var e=W,t=Ie;if(Ie=W=null,Le(e),t)for(e=0;e>>=0,e===0?32:31-(gt(e)/_t|0)|0}var yt=64,bt=4194304;function xt(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function St(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=xt(a))):r=xt(s)}else o=n&~i,o===0?a!==0&&(r=xt(a)):r=xt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ot(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ht(t),e[t]=n}function kt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=pn(),fn=dn=un=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(){for(var e=window,t=V();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=V(e.document)}return t}function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Tr(e){var t=Cr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Sr(n.ownerDocument.documentElement,n)){if(r!==null&&wr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=xr(n,a);var o=xr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==V(r)||(r=Dr,`selectionStart`in r&&wr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kr&&yr(kr,r)||(kr=r,r=ri(Or,`onSelect`),0Pi||(e.current=Ni[Pi],Ni[Pi]=null,Pi--)}function Li(e,t){Pi++,Ni[Pi]=e.current,e.current=t}var Ri={},zi=Fi(Ri),Bi=Fi(!1),Vi=Ri;function Hi(e,t){var n=e.type.contextTypes;if(!n)return Ri;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ui(e){return e=e.childContextTypes,e!=null}function Wi(){Ii(Bi),Ii(zi)}function Gi(e,t,n){if(zi.current!==Ri)throw Error(r(168));Li(zi,t),Li(Bi,n)}function Ki(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,oe(e)||`Unknown`,a));return z({},n,i)}function qi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ri,Vi=zi.current,Li(zi,e),Li(Bi,Bi.current),!0}function Ji(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=Ki(e,t,Vi),i.__reactInternalMemoizedMergedChildContext=e,Ii(Bi),Ii(zi),Li(zi,e)):Ii(Bi),Li(Bi,n)}var Yi=null,Xi=!1,Zi=!1;function Qi(e){Yi===null?Yi=[e]:Yi.push(e)}function $i(e){Xi=!0,Qi(e)}function ea(){if(!Zi&&Yi!==null){Zi=!0;var e=0,t=Z;try{var n=Yi;for(Z=1;e>=o,i-=o,ca=1<<32-ht(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),ga&&ua(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),ga&&ua(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ga&&ua(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),ga&&ua(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&Aa(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Oa(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=Oa(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(_e(i))return h(e,r,i,o);if(R(i))return g(e,r,i,o);ka(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ma=ja(!0),Na=ja(!1),Pa=Fi(null),Fa=null,Ia=null,La=null;function Ra(){La=Ia=Fa=null}function za(e){var t=Pa.current;Ii(Pa),e._currentValue=t}function Ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Va(e,t){Fa=e,La=Ia=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(js=!0),e.firstContext=null)}function Ha(e){var t=e._currentValue;if(La!==e)if(e={context:e,memoizedValue:t,next:null},Ia===null){if(Fa===null)throw Error(r(308));Ia=e,Fa.dependencies={lanes:0,firstContext:e}}else Ia=Ia.next=e;return t}var Ua=null;function Wa(e){Ua===null?Ua=[e]:Ua.push(e)}function Ga(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Wa(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ka(e,r)}function Ka(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var qa=!1;function Ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ya(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Xa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Bc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ka(e,n)}return i=r.interleaved,i===null?(t.next=t,Wa(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ka(e,n)}function Qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,At(e,n)}}function $a(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function eo(e,t,n,r){var i=e.updateQueue;qa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=z({},d,f);break a;case 2:qa=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Jc|=o,e.lanes=o,e.memoizedState=d}}function to(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=_o.transition;_o.transition={};try{e(!1),t()}finally{Z=n,_o.transition=r}}function is(){return jo().memoizedState}function as(e,t,n){var r=pl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ss(e))cs(t,n);else if(n=Ga(e,t,n,r),n!==null){var i=fl();ml(n,e,r,i),ls(n,t,r)}}function os(e,t,n){var r=pl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ss(e))cs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Q(s,o)){var c=t.interleaved;c===null?(i.next=i,Wa(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=Ga(e,t,i,r),n!==null&&(i=fl(),ml(n,e,r,i),ls(n,t,r))}}function ss(e){var t=e.alternate;return e===yo||t!==null&&t===yo}function cs(e,t){Co=So=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ls(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,At(e,n)}}var us={readContext:Ha,useCallback:Eo,useContext:Eo,useEffect:Eo,useImperativeHandle:Eo,useInsertionEffect:Eo,useLayoutEffect:Eo,useMemo:Eo,useReducer:Eo,useRef:Eo,useState:Eo,useDebugValue:Eo,useDeferredValue:Eo,useTransition:Eo,useMutableSource:Eo,useSyncExternalStore:Eo,useId:Eo,unstable_isNewReconciler:!1},ds={readContext:Ha,useCallback:function(e,t){return Ao().memoizedState=[e,t===void 0?null:t],e},useContext:Ha,useEffect:qo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Go(4194308,4,Zo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Go(4194308,4,e,t)},useInsertionEffect:function(e,t){return Go(4,2,e,t)},useMemo:function(e,t){var n=Ao();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ao();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=as.bind(null,yo,e),[r.memoizedState,e]},useRef:function(e){var t=Ao();return e={current:e},t.memoizedState=e},useState:Ho,useDebugValue:$o,useDeferredValue:function(e){return Ao().memoizedState=e},useTransition:function(){var e=Ho(!1),t=e[0];return e=rs.bind(null,e[1]),Ao().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=yo,a=Ao();if(ga){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Vc===null)throw Error(r(349));vo&30||Lo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,qo(zo.bind(null,i,o,e),[e]),i.flags|=2048,Uo(9,Ro.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Ao(),t=Vc.identifierPrefix;if(ga){var n=la,r=ca;n=(r&~(1<<32-ht(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=wo++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ci]=t,e[wi]=i,tc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Me(n,i),n){case`dialog`:Xr(`cancel`,e),Xr(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:Xr(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;oel&&(t.flags|=128,i=!0,ic(s,!1),t.lanes=4194304)}else{if(!i)if(e=po(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ic(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!ga)return ac(t),null}else 2*q()-s.renderingStartTime>el&&n!==1073741824&&(t.flags|=128,i=!0,ic(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(ac(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=q(),t.sibling=null,n=fo.current,Li(fo,i?n&1|2:n&1),t);case 22:case 23:return wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Wc&1073741824&&(ac(t),t.subtreeFlags&6&&(t.flags|=8192)):ac(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function sc(e,t){switch(pa(t),t.tag){case 1:return Ui(t.type)&&Wi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return co(),Ii(Bi),Ii(zi),ho(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return uo(t),null;case 13:if(Ii(fo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ii(fo),null;case 4:return co(),null;case 10:return za(t.type._context),null;case 22:case 23:return wl(),null;case 24:return null;default:return null}}var cc=!1,lc=!1,uc=typeof WeakSet==`function`?WeakSet:Set,$=null;function dc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Rl(e,t,n)}else n.current=null}function fc(e,t,n){try{n()}catch(n){Rl(e,t,n)}}var pc=!1;function mc(e,t){if(di=nn,e=Cr(),wr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(fi={focusedElem:e,selectionRange:n},nn=!1,$=t;$!==null;)if(t=$,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$=e;else for(;$!==null;){t=$;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ms(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Rl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,$=e;break}$=t.return}return h=pc,pc=!1,h}function hc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&fc(t,n,a)}i=i.next}while(i!==r)}}function gc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function _c(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function vc(e){var t=e.alternate;t!==null&&(e.alternate=null,vc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ci],delete t[wi],delete t[Ei],delete t[Di],delete t[Oi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function yc(e){return e.tag===5||e.tag===3||e.tag===4}function bc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ui));else if(r!==4&&(e=e.child,e!==null))for(xc(e,t,n),e=e.sibling;e!==null;)xc(e,t,n),e=e.sibling}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}var Cc=null,wc=!1;function Tc(e,t,n){for(n=n.child;n!==null;)Ec(e,t,n),n=n.sibling}function Ec(e,t,n){if(pt&&typeof pt.onCommitFiberUnmount==`function`)try{pt.onCommitFiberUnmount(ft,n)}catch{}switch(n.tag){case 5:lc||dc(n,t);case 6:var r=Cc,i=wc;Cc=null,Tc(e,t,n),Cc=r,wc=i,Cc!==null&&(wc?(e=Cc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Cc.removeChild(n.stateNode));break;case 18:Cc!==null&&(wc?(e=Cc,n=n.stateNode,e.nodeType===8?yi(e.parentNode,n):e.nodeType===1&&yi(e,n),en(e)):yi(Cc,n.stateNode));break;case 4:r=Cc,i=wc,Cc=n.stateNode.containerInfo,wc=!0,Tc(e,t,n),Cc=r,wc=i;break;case 0:case 11:case 14:case 15:if(!lc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&fc(n,t,o),i=i.next}while(i!==r)}Tc(e,t,n);break;case 1:if(!lc&&(dc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Rl(n,t,e)}Tc(e,t,n);break;case 21:Tc(e,t,n);break;case 22:n.mode&1?(lc=(r=lc)||n.memoizedState!==null,Tc(e,t,n),lc=r):Tc(e,t,n);break;default:Tc(e,t,n)}}function Dc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uc),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Oc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=q()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Ic(i/1960))-i,10e?16:e,ol===null)var i=!1;else{if(e=ol,ol=null,sl=0,Bc&6)throw Error(r(331));var a=Bc;for(Bc|=4,$=e.current;$!==null;){var o=$,s=o.child;if($.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lq()-$c?Tl(e,0):Xc|=n),hl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=bt,bt<<=1,!(bt&130023424)&&(bt=4194304)):t=1);var n=fl();e=Ka(e,t),e!==null&&(Ot(e,t,n),hl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bi.current)js=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return js=!1,ec(e,t,n);js=!!(e.flags&131072)}else js=!1,ga&&t.flags&1048576&&da(t,ia,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Qs(e,t),e=t.pendingProps;var a=Hi(t,zi.current);Va(t,n),a=Oo(null,t,i,e,a,n);var o=ko();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ui(i)?(o=!0,qi(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Ja(t),a.updater=gs,t.stateNode=a,a._reactInternals=t,bs(t,i,e,n),t=Bs(null,t,i,!0,o,n)):(t.tag=0,ga&&o&&fa(t),Ms(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(Qs(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=ms(i,e),a){case 0:t=Rs(null,t,i,e,n);break a;case 1:t=zs(null,t,i,e,n);break a;case 11:t=Ns(null,t,i,e,n);break a;case 14:t=Ps(null,t,i,ms(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ms(i,a),Rs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ms(i,a),zs(e,t,i,a,n);case 3:a:{if(Vs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,Ya(e,t),eo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=xs(Error(r(423)),t),t=Hs(e,t,i,n,a);break a}else if(i!==a){a=xs(Error(r(424)),t),t=Hs(e,t,i,n,a);break a}else for(ha=bi(t.stateNode.containerInfo.firstChild),ma=t,ga=!0,_a=null,n=Na(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ta(),i===a){t=$s(e,t,n);break a}Ms(e,t,i,n)}t=t.child}return t;case 5:return lo(t),e===null&&xa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,pi(i,a)?s=null:o!==null&&pi(i,o)&&(t.flags|=32),Ls(e,t),Ms(e,t,s,n),t.child;case 6:return e===null&&xa(t),null;case 13:return Gs(e,t,n);case 4:return so(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ma(t,null,i,n):Ms(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ms(i,a),Ns(e,t,i,a,n);case 7:return Ms(e,t,t.pendingProps,n),t.child;case 8:return Ms(e,t,t.pendingProps.children,n),t.child;case 12:return Ms(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Li(Pa,i._currentValue),i._currentValue=s,o!==null)if(Q(o.value,s)){if(o.children===a.children&&!Bi.current){t=$s(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=Xa(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ba(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ba(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ms(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Va(t,n),a=Ha(a),i=i(a),t.flags|=1,Ms(e,t,i,n),t.child;case 14:return i=t.type,a=ms(i,t.pendingProps),a=ms(i.type,a),Ps(e,t,i,a,n);case 15:return Fs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ms(i,a),Qs(e,t),t.tag=1,Ui(i)?(e=!0,qi(t)):e=!1,Va(t,n),vs(t,i,a),bs(t,i,a,n),Bs(null,t,i,!0,e,n);case 19:return Zs(e,t,n);case 22:return Is(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return at(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return Zl(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=Kl(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=Kl(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=Kl(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Dt(0),this.expirationTimes=Dt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ja(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=typeof FormData<`u`&&t.body instanceof FormData,r=await fetch(e,{credentials:`same-origin`,headers:n?t.headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),i=await r.text(),a=i?JSON.parse(i):null;if(!r.ok){let e=a?.error||a?.Error||a?.message||r.statusText;throw new v(r.status,e)}return a}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),bots:e=>y(`/api/bots?${e.toString()}`),bot:e=>y(`/api/bots/${e}`),emoji:e=>y(`/api/emoji?${e.toString()}`),emojiAnimation:e=>y(`/api/emoji/${encodeURIComponent(e)}/animation`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),gifts:()=>y(`/api/gifts`),officialGifts:()=>y(`/api/official-gifts`),officialGiftAnimation:e=>y(`/api/official-gifts/${encodeURIComponent(e)}/animation`),giftAnimation:e=>y(`/api/gifts/${encodeURIComponent(e)}/animation`),giftCollectibles:e=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles`),giftCollectibleAnimation:(e,t,n)=>y(`/api/gifts/${encodeURIComponent(e)}/collectibles/${t}/${encodeURIComponent(n)}/animation`),importGift:e=>y(`/api/actions/import-gift`,{method:`POST`,body:e}),importOfficialGift:e=>y(`/api/actions/import-official-gift`,{method:`POST`,body:JSON.stringify(e)}),publishGiftCollectibles:(e,t)=>y(`/api/actions/publish-gift-collectibles?gift_id=${encodeURIComponent(e)}`,{method:`POST`,body:t}),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},S=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),C=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),w={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},T=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...w,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:C(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),E=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(T,{ref:i,iconNode:t,className:C(`lucide-${S(e)}`,n),...r}));return n.displayName=`${e}`,n},D=E(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),O=E(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),k=E(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),A=E(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),j=E(`ShieldX`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]]),M=E(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),N=E(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),P=E(`AtSign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),F=E(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),I=E(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),L=E(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),R=E(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),z=E(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ee=E(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),te=E(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ne=E(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),re=E(`FileJson2`,[[`path`,{d:`M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4`,key:`1pf5j1`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`fq0c9t`}],[`path`,{d:`M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`4gibmv`}]]),ie=E(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),ae=E(`Gem`,[[`path`,{d:`M6 3h12l4 6-10 13L2 9Z`,key:`1pcd5k`}],[`path`,{d:`M11 3 8 9l4 13 4-13-3-6`,key:`1fcu3u`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),oe=E(`Gift`,[[`rect`,{x:`3`,y:`8`,width:`18`,height:`4`,rx:`1`,key:`bkv52`}],[`path`,{d:`M12 8v13`,key:`1c76mn`}],[`path`,{d:`M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7`,key:`6wjy6b`}],[`path`,{d:`M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5`,key:`1ihvrl`}]]),se=E(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ce=E(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),le=E(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),B=E(`LifeBuoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),ue=E(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),V=E(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),de=E(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),fe=E(`Palette`,[[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`path`,{d:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z`,key:`12rzf8`}]]),pe=E(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),me=E(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),he=E(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ge=E(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),_e=E(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),ve=E(`Send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),ye=E(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),H=E(`Settings2`,[[`path`,{d:`M20 7h-9`,key:`3s1dr2`}],[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),be=E(`ShieldAlert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),xe=E(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Se=E(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ce=E(`Smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),we=E(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Te=E(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Ee=E(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),De=E(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),Oe=E(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),ke=E(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),Ae=E(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),je=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),U=o(((e,t)=>{t.exports=je()}))(),Me=`telesrv.admin.lang`,Ne={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"route.gifts":`Star Gifts`,"route.giftsSubtitle":`Console / Star Gifts`,"route.giveGifts":`Give Gifts`,"route.giveGiftsSubtitle":`Console / Give Gifts`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.gifts":`Star Gifts`,"layout.giveGifts":`Give Gifts`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Switch to dark theme`,"theme.switchToLight":`Switch to light theme`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.accountFrozen":`Account frozen`,"account.accountActive":`Account active`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeAccount":`Freeze account`,"account.updateFreeze":`Update freeze`,"account.unfreezeAccount":`Unfreeze account`,"account.freezeSince":`Frozen since`,"account.freezeUntil":`Appeal deadline`,"account.freezeUntilAria":`Freeze appeal deadline`,"account.freezeAppealURL":`Appeal URL`,"account.freezeAppealURLAria":`Freeze appeal URL`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"route.bots":`Bots`,"route.botsSubtitle":`Console / Bots`,"layout.bots":`Bots`,"bots.pageTitle":`Bots`,"bots.queryResults":`Search results`,"bots.recent":`Recently created bots`,"bots.currentPage":`Bots on page`,"bots.banned":`Banned`,"bots.active":`Active`,"bots.createTitle":`Create a system bot`,"bots.createHint":`Provision a bot account owned by the given user. The token is shown once after confirmation.`,"bots.ownerUserID":`Owner user ID`,"bots.name":`Display name`,"bots.namePlaceholder":`e.g. Service Bot`,"bots.username":`Username`,"bots.usernameHint":`Username must be 5-32 characters and end with 'bot'.`,"bots.create":`Create bot`,"bots.searchPlaceholder":`Bot ID / username`,"bots.botID":`Bot ID`,"bots.owner":`Owner`,"bots.status":`Status`,"bots.detailTitle":`Bot #{id}`,"bots.profile":`Bot Profile`,"bots.loadingDetail":`Loading bot detail`,"bots.unnamed":`Unnamed bot`,"bots.restriction":`Restriction`,"bots.actionDock":`Bot Actions`,"bots.banUntil":`Ban until`,"bots.ban":`Ban bot`,"bots.updateBan":`Update ban`,"bots.unban":`Unban bot`,"bots.type":`Type`,"bots.system":`System`,"bots.user":`User`,"bots.delete":`Delete bot`,"bots.deleteHint":`Permanently deletes this user-created bot and invalidates its token. This cannot be undone.`,"bots.systemHint":`System bots are built in and cannot be deleted.`,"flags.scam":`SCAM`,"flags.fake":`FAKE`,"flags.setScam":`Mark as SCAM`,"flags.clearScam":`Clear SCAM`,"flags.setFake":`Mark as FAKE`,"flags.clearFake":`Clear FAKE`,"attr.attributes":`Attributes`,"attr.settings":`Settings`,"attr.username":`Username`,"attr.setUsername":`Set username`,"attr.setSupport":`Mark as support`,"attr.clearSupport":`Clear support`,"attr.forProfile":`Profile color`,"attr.hasColor":`Enable color`,"attr.colorIndex":`Color index`,"attr.bgEmojiID":`Background emoji ID`,"attr.setColor":`Set color`,"attr.emojiDocID":`Emoji document ID`,"attr.emojiUntil":`Until (unix, 0 = permanent)`,"attr.setEmojiStatus":`Set emoji status`,"attr.gigagroup":`Gigagroup`,"attr.antispam":`Aggressive anti-spam`,"attr.participantsHidden":`Hide members`,"attr.noforwards":`Restrict forwarding`,"attr.joinToSend":`Join to send messages`,"attr.joinRequest":`Join by request`,"attr.slowmode":`Slowmode (seconds)`,"attr.applySettings":`Apply settings`,"route.emoji":`Emoji`,"route.emojiSubtitle":`Console / Emoji`,"layout.emoji":`Emoji`,"emoji.pageTitle":`Custom Emoji`,"emoji.queryResults":`Search results`,"emoji.recent":`Custom emoji catalog`,"emoji.currentPage":`Emoji on page`,"emoji.searchPlaceholder":`Document ID or emoji`,"emoji.copyID":`Copy document ID`,"emoji.noSet":`No set`,"emoji.hint":`Document IDs here can be pasted into the Emoji status field on account, bot and channel profiles.`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"gifts.pageTitle":`Star Gift Catalog`,"giveGift.action":`Give`,"giveGift.eyebrow":`Grant a gift · no charge`,"giveGift.title":`Give gift`,"giveGift.recipientKind":`Recipient type`,"giveGift.recipientUser":`User`,"giveGift.recipientChannel":`Channel`,"giveGift.pickUser":`Recipient user`,"giveGift.pickChannel":`Recipient channel`,"giveGift.recipientRequired":`Select a recipient first`,"giveGift.sender":`Sender account ID`,"giveGift.senderHint":`Defaults to the system account 777000 (Telesrv).`,"giveGift.message":`Attached message (optional)`,"giveGift.messagePlaceholder":`Shown with the gift`,"giveGift.hideName":`Hide sender name from recipient`,"giveGift.upgrade":`Deliver as upgraded collectible`,"giveGift.upgradeNote":`The gift is minted as a unique collectible. Pick specific attributes and a number below, or leave them on Random to draw from the published pool. Requires a published collectible upgrade with remaining supply.`,"giveGift.model":`Model`,"giveGift.pattern":`Pattern`,"giveGift.backdrop":`Backdrop`,"giveGift.number":`Number`,"giveGift.numberAuto":`Auto`,"giveGift.random":`Random`,"giveGift.confirm":`Give gift`,"giveGifts.pageTitle":`Give Gifts`,"giveGifts.eyebrow":`Grant catalog gifts to any user or channel`,"giveGifts.available":`Available gifts`,"giveGifts.sender":`Default sender`,"giveGifts.searchPlaceholder":`Search by title or gift ID`,"giveGifts.hint":`Pick a gift to grant. Delivery is free of charge and sent from the system account 777000 (Telesrv) by default.`,"giveGifts.pickGift":`Select a gift`,"giveGifts.selectPrompt":`Select a gift from the list to start.`,"gifts.eyebrow":`Catalog, immutable revisions and animation assets`,"gifts.total":`Catalog entries`,"gifts.enabled":`Enabled`,"gifts.received":`Received gifts`,"gifts.formats":`Accepted formats`,"gifts.add":`Add gift`,"gifts.searchPlaceholder":`Search gift ID, title or format`,"gifts.listSummary":`Showing {shown} of {total}`,"gifts.idRevision":`ID / Revision`,"gifts.price":`Price / Conversion`,"gifts.importTitle":`Import a Star Gift`,"gifts.importEyebrow":`Gift catalog operation`,"gifts.newRevision":`Create revision for gift #{id}`,"gifts.importHint":`Upload TGS or plain Lottie JSON. Lottie is normalized and compressed to TGS.`,"gifts.officialSource":`Official snapshot`,"gifts.fileSource":`Upload file`,"gifts.officialHint":`Choose a verified gift from data/official-gifts. Complete collectible pools are imported atomically.`,"gifts.officialSearch":`Search official gift ID or title`,"gifts.officialSelect":`Choose an official gift`,"gifts.officialRequired":`Choose an official gift first`,"gifts.officialResults":`Showing {shown} of {total}`,"gifts.officialCategoryLabel":`Official gift capability category`,"gifts.officialCategory.all":`All`,"gifts.officialCategory.upgrade":`Upgradable`,"gifts.officialCategory.craft":`Craftable`,"gifts.officialCategory.basic":`Not upgradable`,"gifts.officialUnnamed":`Unnamed official gift #{id}`,"gifts.officialAttributes":`{count} attributes`,"gifts.canUpgrade":`Can upgrade`,"gifts.cannotUpgrade":`Cannot upgrade`,"gifts.canCraft":`Can Craft`,"gifts.cannotCraft":`Cannot Craft`,"gifts.officialEmpty":`No official gifts match this category and search.`,"gifts.includeCollectible":`Import the complete collectible pool, including crafted models`,"gifts.animation":`Animation file`,"gifts.filePrompt":`Drop or choose a TGS / Lottie file`,"gifts.fileHint":`TGS, JSON or Lottie · validated before import`,"gifts.chooseFile":`Choose file`,"gifts.changeFile":`Change file`,"gifts.title":`Display title`,"gifts.titlePlaceholder":`e.g. Celebration Star`,"gifts.stars":`Price in Stars`,"gifts.convertStars":`Conversion Stars`,"gifts.sortOrder":`Sort order`,"gifts.reason":`Audit reason`,"gifts.reasonPlaceholder":`Briefly describe why this gift is being imported`,"gifts.enableAfterImport":`Enable after import`,"gifts.validate":`Dry-run validation`,"gifts.confirmImport":`Confirm import`,"gifts.stepDetails":`File and details`,"gifts.stepValidate":`Dry-run validation`,"gifts.stepImport":`Confirm import`,"gifts.fileRequired":`Choose a TGS or Lottie file first`,"gifts.source":`Source`,"gifts.replace":`New revision`,"gifts.disable":`Disable`,"gifts.enable":`Enable`,"gifts.empty":`No Star Gifts have been imported.`,"gifts.emptyHint":`Import the first animation above to build the gift catalog.`,"gifts.validationReady":`Validation passed`,"gifts.validationHint":`Review the normalized metadata, then confirm the import.`,"gifts.confirmState":`Apply the validated state change to gift #{id}?`,"collectibles.manage":`Attribute pool`,"collectibles.title":`Collectible pool · Gift #{id}`,"collectibles.eyebrow":`Unique gift attributes`,"collectibles.activeRevision":`Published revision {revision}`,"collectibles.published":`Published`,"collectibles.noPool":`No collectible pool published`,"collectibles.noPoolHint":`Publish models, patterns and backdrops to enable upgrades.`,"collectibles.publishNew":`Publish a new immutable revision`,"collectibles.immutableHint":`Dry-run checks every file and the attribute-pool structure before the revision becomes active.`,"collectibles.upgradeStars":`Upgrade price in Stars`,"collectibles.supply":`Unique supply`,"collectibles.slug":`Public slug prefix`,"collectibles.models":`Models`,"collectibles.patterns":`Patterns`,"collectibles.backdrops":`Backdrops`,"collectibles.model":`Model`,"collectibles.pattern":`Pattern`,"collectibles.backdrop":`Backdrop`,"collectibles.rarity":`Rarity ‰`,"collectibles.rarityHint":`Keep at least two attributes. Permille values are relative regular-upgrade weights; add/remove redistributes them to 1000.`,"collectibles.minimumAttributes":`Models, patterns, and backdrops must each contain at least two attributes.`,"collectibles.duplicateBackdropID":`Backdrop IDs must be unique within the pool.`,"collectibles.colorHint":`Colors are stored as 24-bit RGB values.`,"collectibles.addAttribute":`Add`,"collectibles.remove":`Remove attribute`,"collectibles.fileRequired":`Every model and pattern needs a TGS or Lottie file.`,"collectibles.backdropID":`Backdrop ID`,"collectibles.color.center":`Center`,"collectibles.color.edge":`Edge`,"collectibles.color.pattern":`Pattern`,"collectibles.color.text":`Text`,"collectibles.validationReady":`Attribute pool is valid`,"collectibles.validationHint":`Review the normalized assets, then publish this immutable revision.`,"collectibles.publish":`Publish revision`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"route.gifts":`星星礼物`,"route.giftsSubtitle":`控制台 / 星星礼物`,"route.giveGifts":`赠送礼物`,"route.giveGiftsSubtitle":`控制台 / 赠送礼物`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.gifts":`礼物目录`,"layout.giveGifts":`赠送礼物`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`切换到深色主题`,"theme.switchToLight":`切换到浅色主题`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.accountFrozen":`账号已冻结`,"account.accountActive":`账号正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeAccount":`冻结账号`,"account.updateFreeze":`更新冻结信息`,"account.unfreezeAccount":`解冻账号`,"account.freezeSince":`冻结开始时间`,"account.freezeUntil":`申诉截止时间`,"account.freezeUntilAria":`账号冻结申诉截止时间`,"account.freezeAppealURL":`申诉链接`,"account.freezeAppealURLAria":`账号冻结申诉链接`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"route.bots":`机器人`,"route.botsSubtitle":`控制台 / 机器人`,"layout.bots":`机器人`,"bots.pageTitle":`机器人`,"bots.queryResults":`查询结果`,"bots.recent":`最近创建的机器人`,"bots.currentPage":`当前页机器人`,"bots.banned":`已封禁`,"bots.active":`正常`,"bots.createTitle":`创建系统机器人`,"bots.createHint":`为指定用户创建机器人账号。确认后 token 只显示一次。`,"bots.ownerUserID":`所属用户 ID`,"bots.name":`显示名称`,"bots.namePlaceholder":`例如:服务机器人`,"bots.username":`用户名`,"bots.usernameHint":`用户名需 5-32 个字符,且以 bot 结尾。`,"bots.create":`创建机器人`,"bots.searchPlaceholder":`机器人 ID / 用户名`,"bots.botID":`机器人 ID`,"bots.owner":`所属用户`,"bots.status":`状态`,"bots.detailTitle":`机器人 #{id}`,"bots.profile":`机器人档案`,"bots.loadingDetail":`加载机器人详情`,"bots.unnamed":`未命名机器人`,"bots.restriction":`限制状态`,"bots.actionDock":`机器人操作`,"bots.banUntil":`封禁至`,"bots.ban":`封禁机器人`,"bots.updateBan":`更新封禁`,"bots.unban":`解封机器人`,"bots.type":`类型`,"bots.system":`系统`,"bots.user":`用户`,"bots.delete":`删除机器人`,"bots.deleteHint":`永久删除该用户创建的机器人并使其 token 失效。此操作不可撤销。`,"bots.systemHint":`系统内置机器人不可删除。`,"flags.scam":`SCAM`,"flags.fake":`FAKE`,"flags.setScam":`标记为 SCAM`,"flags.clearScam":`移除 SCAM`,"flags.setFake":`标记为 FAKE`,"flags.clearFake":`移除 FAKE`,"attr.attributes":`属性`,"attr.settings":`设置`,"attr.username":`用户名`,"attr.setUsername":`设置用户名`,"attr.setSupport":`标记为客服`,"attr.clearSupport":`取消客服`,"attr.forProfile":`资料颜色`,"attr.hasColor":`启用颜色`,"attr.colorIndex":`颜色编号`,"attr.bgEmojiID":`背景 emoji ID`,"attr.setColor":`设置颜色`,"attr.emojiDocID":`Emoji 文档 ID`,"attr.emojiUntil":`有效期 (unix, 0 = 永久)`,"attr.setEmojiStatus":`设置 emoji 状态`,"attr.gigagroup":`广播群 (gigagroup)`,"attr.antispam":`激进反垃圾`,"attr.participantsHidden":`隐藏成员`,"attr.noforwards":`禁止转发`,"attr.joinToSend":`先加入才能发言`,"attr.joinRequest":`加入需审批`,"attr.slowmode":`慢速模式 (秒)`,"attr.applySettings":`应用设置`,"route.emoji":`Emoji`,"route.emojiSubtitle":`控制台 / Emoji`,"layout.emoji":`Emoji`,"emoji.pageTitle":`自定义 Emoji`,"emoji.queryResults":`查询结果`,"emoji.recent":`自定义 Emoji 目录`,"emoji.currentPage":`当前页 Emoji`,"emoji.searchPlaceholder":`文档 ID 或表情`,"emoji.copyID":`复制文档 ID`,"emoji.noSet":`无所属集合`,"emoji.hint":`这里的文档 ID 可直接填入账号、机器人和频道资料的 Emoji 状态字段。`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"gifts.pageTitle":`星星礼物目录`,"giveGift.action":`赠送`,"giveGift.eyebrow":`发放礼物 · 免费`,"giveGift.title":`赠送礼物`,"giveGift.recipientKind":`接收方类型`,"giveGift.recipientUser":`用户`,"giveGift.recipientChannel":`频道`,"giveGift.pickUser":`接收用户`,"giveGift.pickChannel":`接收频道`,"giveGift.recipientRequired":`请先选择接收方`,"giveGift.sender":`发送方账号 ID`,"giveGift.senderHint":`默认使用系统账号 777000(Telesrv)。`,"giveGift.message":`附加留言(可选)`,"giveGift.messagePlaceholder":`随礼物一起显示`,"giveGift.hideName":`对接收方隐藏发送方名称`,"giveGift.upgrade":`作为升级收藏品发放`,"giveGift.upgradeNote":`礼物将铸造为唯一收藏品。可在下方指定具体属性和编号,或保持“随机”从已发布的属性池中抽取。需要存在有剩余供应量的已发布收藏品升级。`,"giveGift.model":`模型`,"giveGift.pattern":`图案`,"giveGift.backdrop":`背景`,"giveGift.number":`编号`,"giveGift.numberAuto":`自动`,"giveGift.random":`随机`,"giveGift.confirm":`赠送礼物`,"giveGifts.pageTitle":`赠送礼物`,"giveGifts.eyebrow":`向任意用户或频道发放目录礼物`,"giveGifts.available":`可用礼物`,"giveGifts.sender":`默认发送方`,"giveGifts.searchPlaceholder":`按标题或礼物 ID 搜索`,"giveGifts.hint":`选择要发放的礼物。发放免费,默认由系统账号 777000(Telesrv)发送。`,"giveGifts.pickGift":`选择礼物`,"giveGifts.selectPrompt":`从列表中选择一个礼物开始。`,"gifts.eyebrow":`目录、不可变版本与动画资源`,"gifts.total":`目录条目`,"gifts.enabled":`已启用`,"gifts.received":`已领取礼物`,"gifts.formats":`支持格式`,"gifts.add":`添加礼物`,"gifts.searchPlaceholder":`搜索礼物 ID、标题或格式`,"gifts.listSummary":`显示 {shown} / {total} 项`,"gifts.idRevision":`ID / 版本`,"gifts.price":`售价 / 兑换`,"gifts.importTitle":`导入星星礼物`,"gifts.importEyebrow":`礼物目录操作`,"gifts.newRevision":`为礼物 #{id} 创建新版本`,"gifts.importHint":`支持 TGS 或纯 Lottie JSON;Lottie 会规范化并压缩成 TGS。`,"gifts.officialSource":`官方资源库`,"gifts.fileSource":`上传文件`,"gifts.officialHint":`从 data/official-gifts 的已校验快照中选择;完整 collectible 属性池会与礼物原子导入。`,"gifts.officialSearch":`搜索官方礼物 ID 或标题`,"gifts.officialSelect":`请选择官方礼物`,"gifts.officialRequired":`请先选择一个官方礼物`,"gifts.officialResults":`显示 {shown} / {total} 项`,"gifts.officialCategoryLabel":`官方礼物能力分类`,"gifts.officialCategory.all":`全部`,"gifts.officialCategory.upgrade":`可升级`,"gifts.officialCategory.craft":`可 Craft`,"gifts.officialCategory.basic":`不可升级`,"gifts.officialUnnamed":`未命名官方礼物 #{id}`,"gifts.officialAttributes":`{count} 个属性`,"gifts.canUpgrade":`可升级`,"gifts.cannotUpgrade":`不可升级`,"gifts.canCraft":`可 Craft`,"gifts.cannotCraft":`不可 Craft`,"gifts.officialEmpty":`当前分类和搜索条件下没有官方礼物。`,"gifts.includeCollectible":`完整导入 collectible 属性池(包含 crafted 模型)`,"gifts.animation":`动画文件`,"gifts.filePrompt":`拖放或选择 TGS / Lottie 文件`,"gifts.fileHint":`支持 TGS、JSON、Lottie,导入前会先进行校验`,"gifts.chooseFile":`选择文件`,"gifts.changeFile":`更换文件`,"gifts.title":`显示标题`,"gifts.titlePlaceholder":`例如:庆典星星`,"gifts.stars":`售价 Stars`,"gifts.convertStars":`可兑换 Stars`,"gifts.sortOrder":`排序值`,"gifts.reason":`审计原因`,"gifts.reasonPlaceholder":`简要说明本次导入礼物的原因`,"gifts.enableAfterImport":`导入后启用`,"gifts.validate":`Dry-run 校验`,"gifts.confirmImport":`确认导入`,"gifts.stepDetails":`文件与信息`,"gifts.stepValidate":`Dry-run 校验`,"gifts.stepImport":`确认导入`,"gifts.fileRequired":`请先选择 TGS 或 Lottie 文件`,"gifts.source":`来源`,"gifts.replace":`创建新版本`,"gifts.disable":`停用`,"gifts.enable":`启用`,"gifts.empty":`尚未导入星星礼物。`,"gifts.emptyHint":`从上方导入第一个动画,开始搭建礼物目录。`,"gifts.validationReady":`校验已通过`,"gifts.validationHint":`确认规范化后的元数据无误,再执行正式导入。`,"gifts.confirmState":`确认执行礼物 #{id} 的状态变更吗?`,"collectibles.manage":`属性池`,"collectibles.title":`Collectibles 属性池 · 礼物 #{id}`,"collectibles.eyebrow":`唯一礼物属性管理`,"collectibles.activeRevision":`已发布版本 {revision}`,"collectibles.published":`已发布`,"collectibles.noPool":`尚未发布 Collectibles 属性池`,"collectibles.noPoolHint":`发布模型、图案与背景后,客户端即可升级为唯一礼物。`,"collectibles.publishNew":`发布新的不可变版本`,"collectibles.immutableHint":`Dry-run 会校验全部文件和属性池结构,通过后才切换为当前版本。`,"collectibles.upgradeStars":`升级价格 Stars`,"collectibles.supply":`唯一礼物总量`,"collectibles.slug":`公开 Slug 前缀`,"collectibles.models":`模型`,"collectibles.patterns":`图案`,"collectibles.backdrops":`背景`,"collectibles.model":`模型`,"collectibles.pattern":`图案`,"collectibles.backdrop":`背景`,"collectibles.rarity":`稀有度 ‰`,"collectibles.rarityHint":`每类至少保留两项。Permille 是普通升级的相对权重,增删时会自动重新分配为 1000。`,"collectibles.minimumAttributes":`模型、图案和背景每类都必须至少包含两个属性。`,"collectibles.duplicateBackdropID":`同一属性池中的背景 ID 必须唯一。`,"collectibles.colorHint":`颜色会按 24 位 RGB 数值保存。`,"collectibles.addAttribute":`添加`,"collectibles.remove":`删除属性`,"collectibles.fileRequired":`每个模型和图案都必须选择 TGS 或 Lottie 文件。`,"collectibles.backdropID":`背景 ID`,"collectibles.color.center":`中心色`,"collectibles.color.edge":`边缘色`,"collectibles.color.pattern":`图案色`,"collectibles.color.text":`文字色`,"collectibles.validationReady":`属性池校验通过`,"collectibles.validationHint":`确认规范化资源无误后,即可发布这个不可变版本。`,"collectibles.publish":`发布版本`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`},ru:{"app.adminConsole":`Панель администратора`,"app.localAccess":`Локальный доступ`,"app.title":`telesrv admin`,"common.actions":`Действия`,"common.admins":`Администраторы`,"common.backToList":`Назад к списку`,"common.channel":`Канал`,"common.channelOrGroup":`Канал / Группа`,"common.clear":`Очистить`,"common.close":`Закрыть`,"common.count":`Количество`,"common.deleted":`Удалено`,"common.detail":`Детали`,"common.device":`Устройство`,"common.disabled":`Отключено`,"common.enabled":`Включено`,"common.fromPeer":`От пира`,"common.group":`Группа`,"common.id":`ID`,"common.limit":`Лимит`,"common.loading":`Загрузка…`,"common.member":`Участник`,"common.members":`Участники`,"common.messageId":`ID сообщения`,"common.name":`Имя`,"common.no":`Нет`,"common.noResults":`Нет результатов`,"common.none":`Нет`,"common.normal":`Обычный`,"common.operations":`Операции`,"common.owner":`Владелец`,"common.platform":`Платформа`,"common.refresh":`Обновить`,"common.search":`Поиск`,"common.sender":`Отправитель`,"common.status":`Статус`,"common.survived":`Уцелело`,"common.time":`Время`,"common.type":`Тип`,"common.updatedAt":`Обновлено`,"common.username":`Имя пользователя`,"common.valid":`Действителен`,"common.verified":`Подтверждён`,"common.views":`Просмотры`,"common.yes":`Да`,"route.accounts":`Аккаунты`,"route.accountsSubtitle":`Консоль / Аккаунты`,"route.channels":`Супергруппы и каналы`,"route.channelsSubtitle":`Консоль / Каналы`,"route.dashboard":`Панель управления`,"route.dashboardSubtitle":`Консоль / Обзор`,"route.messages":`Аудит сообщений`,"route.messagesSubtitle":`Консоль / Сообщения`,"route.gifts":`Звёздные подарки`,"route.giftsSubtitle":`Консоль / Звёздные подарки`,"route.giveGifts":`Выдача подарков`,"route.giveGiftsSubtitle":`Консоль / Выдача подарков`,"layout.navigation":`Навигация`,"layout.primaryNav":`Основное меню`,"layout.dashboard":`Обзор`,"layout.accounts":`Аккаунты`,"layout.channels":`Супергруппы / Каналы`,"layout.messages":`Сообщения`,"layout.gifts":`Звёздные подарки`,"layout.giveGifts":`Выдача подарков`,"layout.privateMessages":`Личные`,"layout.groupMessages":`Группы`,"layout.runtime":`Среда выполнения`,"layout.adminBackend":`Админ-бэкенд`,"layout.ready":`Готов`,"layout.pgRead":`Чтение из PG`,"layout.readOnly":`Только чтение`,"layout.writeOps":`Операции записи`,"layout.dryRun":`Тестовый запуск`,"layout.actor":`Вы вошли как: {actor}`,"layout.logout":`Выйти`,"language.en":`EN`,"language.zh":`中文`,"language.ru":`RU`,"theme.switchToDark":`Тёмная тема`,"theme.switchToLight":`Светлая тема`,"login.heading":`Панель администратора`,"login.body":`Введите учётные данные для входа в консоль.`,"login.secret":`Пароль или токен администратора`,"login.submit":`Войти`,"login.submitting":`Вход…`,"dashboard.eyebrow":`Состояние системы`,"dashboard.title":`Обзор консоли`,"dashboard.readPath":`Путь чтения`,"dashboard.readPathValue":`PG только для чтения`,"dashboard.writePath":`Путь записи`,"dashboard.executionPolicy":`Политика выполнения`,"dashboard.dryRunFirst":`Сначала тестовый запуск`,"dashboard.accountsText":`Статус аккаунтов, Premium, подтверждение, сессии.`,"dashboard.channelsText":`Публичные каналы и группы, число участников, статус подтверждения.`,"dashboard.messagesText":`Ящики сообщений, обновления, состояние исходящих.`,"dashboard.strip.dryRun":`Все опасные действия начинаются с тестового запуска`,"dashboard.strip.token":`Браузер никогда не сохраняет внутренние токены`,"dashboard.strip.pagination":`Списки используют курсорную пагинацию`,"dashboard.strip.snapshot":`Детальные страницы сохраняют моментальные снимки исходного состояния`,"account.pageTitle":`Аккаунты`,"account.queryResults":`Результаты поиска`,"account.recentActive":`Недавно активные аккаунты`,"account.currentPage":`Аккаунты на странице`,"account.onlineDevices":`Активные сессии устройств`,"account.premium":`Premium`,"account.frozen":`Заморожен`,"account.searchPlaceholder":`ID пользователя / телефон / имя пользователя`,"account.userID":`ID пользователя`,"account.phone":`Телефон`,"account.lastActive":`Последняя активность`,"account.notVerified":`Не подтверждён`,"account.notPremium":`Без Premium`,"account.premiumUntil":`Premium истекает`,"account.starsBalance":`Баланс Звёзд`,"account.startingGrantApplied":`стартовый бонус начислен`,"account.startingGrantPending":`ожидает стартового бонуса`,"account.activeSessions":`Авторизованные устройства`,"account.accountFlags":`Флаги аккаунта`,"account.restriction":`Ограничение`,"account.restricted":`Ограничен`,"account.createdAt":`Создан`,"account.detailTitle":`Аккаунт #{id}`,"account.profile":`Профиль аккаунта`,"account.loadingDetail":`Загрузка данных аккаунта`,"account.waitingData":`Ожидание данных`,"account.noUsername":`Нет имени пользователя`,"account.noPhone":`Нет телефона`,"account.accountFrozen":`Аккаунт заморожен`,"account.accountActive":`Аккаунт активен`,"account.authorizationsTitle":`Авторизованные устройства`,"account.authorizationsCount":`Авторизаций: {count}`,"account.recentAdminOps":`Последние действия администратора`,"account.recent30Audit":`Последние 30 записей аудита`,"account.actionDock":`Действия с аккаунтом`,"account.freezeAccount":`Заморозить аккаунт`,"account.updateFreeze":`Обновить параметры заморозки`,"account.unfreezeAccount":`Разморозить аккаунт`,"account.freezeSince":`Заморожен с`,"account.freezeUntil":`Срок подачи апелляции`,"account.freezeUntilAria":`Срок подачи апелляции на заморозку`,"account.freezeAppealURL":`URL для апелляции`,"account.freezeAppealURLAria":`URL для апелляции на заморозку`,"account.premiumMonths":`Срок действия Premium (в месяцах)`,"account.premiumMonthsAria":`Указать срок действия Premium в месяцах`,"account.setPremium":`Выдать Premium`,"account.clearPremium":`Снять Premium`,"account.starsAmount":`Количество Звёзд`,"account.starsAmountAria":`Указать количество начисляемых Звёзд`,"account.grantStars":`Начислить Звёзды`,"account.setVerified":`Подтвердить аккаунт`,"account.clearVerified":`Снять подтверждение`,"channel.pageTitle":`Супергруппы и каналы`,"channel.recentUpdated":`Недавно обновлённые`,"channel.currentPage":`Объекты на странице`,"channel.megagroups":`Супергруппы`,"channel.broadcasts":`Каналы`,"channel.verifiedCount":`Подтверждённые`,"channel.searchPlaceholder":`ID канала / имя пользователя / название`,"channel.channelID":`ID канала`,"channel.kind":`Тип`,"channel.title":`Название`,"channel.pts":`PTS`,"channel.detailProfile":`Профиль канала`,"channel.loadingDetail":`Загрузка данных канала`,"channel.creator":`Создатель: {id}`,"channel.governance":`Модерация`,"channel.governanceValue":`Заблокировано {banned} / Исключено {kicked}`,"channel.flags":`Флаги канала`,"channel.rawRow":`Исходная строка БД`,"channel.rawRowText":`Снимок базы данных только для чтения`,"channel.actionDock":`Действия с каналом`,"channel.setVerified":`Подтвердить канал`,"channel.clearVerified":`Снять подтверждение`,"channel.kind.broadcast":`Канал`,"channel.kind.forum":`Супергруппа / Форум`,"channel.kind.megagroup":`Супергруппа`,"channel.kind.generic":`Канал / Группа`,"route.bots":`Боты`,"route.botsSubtitle":`Консоль / Боты`,"layout.bots":`Боты`,"bots.pageTitle":`Боты`,"bots.queryResults":`Результаты поиска`,"bots.recent":`Недавно созданные боты`,"bots.currentPage":`Боты на странице`,"bots.banned":`Забанен`,"bots.active":`Активен`,"bots.createTitle":`Создать системного бота`,"bots.createHint":`Создаёт бота, принадлежащего указанному пользователю. Токен показывается один раз после подтверждения.`,"bots.ownerUserID":`ID владельца`,"bots.name":`Отображаемое имя`,"bots.namePlaceholder":`например, Service Bot`,"bots.username":`Имя пользователя`,"bots.usernameHint":`Имя пользователя: 5–32 символа, обязательно оканчивается на «bot».`,"bots.create":`Создать бота`,"bots.searchPlaceholder":`ID бота / имя пользователя`,"bots.botID":`ID бота`,"bots.owner":`Владелец`,"bots.status":`Статус`,"bots.detailTitle":`Бот #{id}`,"bots.profile":`Профиль бота`,"bots.loadingDetail":`Загрузка данных бота`,"bots.unnamed":`Без имени`,"bots.restriction":`Ограничение`,"bots.actionDock":`Действия с ботом`,"bots.banUntil":`Забанить до`,"bots.ban":`Забанить бота`,"bots.updateBan":`Обновить бан`,"bots.unban":`Разбанить бота`,"bots.type":`Тип`,"bots.system":`Системный`,"bots.user":`Пользовательский`,"bots.delete":`Удалить бота`,"bots.deleteHint":`Безвозвратно удаляет созданного пользователем бота и аннулирует его токен. Действие необратимо.`,"bots.systemHint":`Системные боты встроены и не могут быть удалены.`,"flags.scam":`SCAM`,"flags.fake":`FAKE`,"flags.setScam":`Пометить как SCAM`,"flags.clearScam":`Снять метку SCAM`,"flags.setFake":`Пометить как FAKE`,"flags.clearFake":`Снять метку FAKE`,"attr.attributes":`Атрибуты`,"attr.settings":`Настройки`,"attr.username":`Имя пользователя`,"attr.setUsername":`Задать имя пользователя`,"attr.setSupport":`Пометить как support`,"attr.clearSupport":`Снять support`,"attr.forProfile":`Цвет профиля`,"attr.hasColor":`Включить цвет`,"attr.colorIndex":`Индекс цвета`,"attr.bgEmojiID":`ID фонового эмодзи`,"attr.setColor":`Задать цвет`,"attr.emojiDocID":`ID документа эмодзи`,"attr.emojiUntil":`До (unix, 0 = бессрочно)`,"attr.setEmojiStatus":`Задать emoji-статус`,"attr.gigagroup":`Гигагруппа`,"attr.antispam":`Агрессивный антиспам`,"attr.participantsHidden":`Скрыть участников`,"attr.noforwards":`Запретить пересылку`,"attr.joinToSend":`Вступление для отправки`,"attr.joinRequest":`Вступление по заявке`,"attr.slowmode":`Медленный режим (сек)`,"attr.applySettings":`Применить настройки`,"route.emoji":`Emoji`,"route.emojiSubtitle":`Консоль / Emoji`,"layout.emoji":`Emoji`,"emoji.pageTitle":`Кастом-эмодзи`,"emoji.queryResults":`Результаты поиска`,"emoji.recent":`Каталог кастом-эмодзи`,"emoji.currentPage":`Эмодзи на странице`,"emoji.searchPlaceholder":`ID документа или эмодзи`,"emoji.copyID":`Скопировать ID документа`,"emoji.noSet":`Без набора`,"emoji.hint":`ID документов отсюда можно вставлять в поле Emoji-статуса в профилях аккаунтов, ботов и каналов.`,"messages.privateTitle":`Личные сообщения`,"messages.privateEyebrow":`Личные ящики сообщений`,"messages.groupTitle":`Групповые сообщения`,"messages.groupEyebrow":`Сообщения супергрупп и каналов`,"messages.selectPrivatePeers":`Сначала найдите и выберите владельца и собеседника`,"messages.selectChannel":`Сначала найдите и выберите супергруппу или канал`,"messages.ownerUser":`Пользователь-владелец`,"messages.peerUser":`Собеседник`,"messages.beforeDatePlaceholder":`курсор before_date`,"messages.beforeIDPlaceholder":`курсор before_msg_id`,"messages.limitPlaceholder":`лимит <= 100`,"messages.searchMessages":`Поиск сообщений`,"messages.nextPage":`Следующая страница`,"messages.currentPage":`Сообщения на странице`,"messages.deleted":`Удалено`,"messages.outgoing":`Исходящее`,"messages.incoming":`Входящее`,"messages.ownerPeer":`Владелец / Собеседник`,"messages.deleteSelected":`Удалить выбранные сообщения`,"messages.idsPlaceholder":`ID сообщений через запятую`,"messages.revoke":`Удалить для обеих сторон`,"messages.previewDelete":`Тестовое удаление`,"messages.clearHistory":`Очистить историю личной переписки`,"messages.maxIDPlaceholder":`граница max_id`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Очистить только у себя`,"messages.previewClearHistory":`Тестовая очистка истории`,"messages.direction":`Направление`,"messages.body":`Текст сообщения`,"messages.privateDetailTitle":`Сообщение #{id}`,"messages.detailEyebrow":`Детали сообщения`,"messages.backPrivate":`Назад к личным сообщениям`,"messages.backGroup":`Назад к групповым сообщениям`,"messages.ownerPeerTitle":`Владелец {owner} · Собеседник {peer}`,"messages.senderSubtitle":`Отправитель {sender} · {date}`,"messages.boxID":`ID ящика сообщений`,"messages.privateMessageID":`ID личного сообщения`,"messages.messageSender":`Отправитель сообщения`,"messages.messageBox":`Ящик сообщений`,"messages.dialogRow":`Строка диалога`,"messages.privateRow":`Строка личного сообщения`,"messages.channelMessageRow":`Строка сообщения канала`,"messages.channelRow":`Строка канала`,"messages.userUpdateEvents":`События обновления пользователей`,"messages.channelUpdateEvents":`События обновления каналов`,"messages.eventJson":`JSON события`,"messages.dispatchOutbox":`Очередь отправки (Outbox)`,"messages.messageBoxesSnapshot":`Снимок message_boxes только для чтения`,"messages.dialogSnapshot":`Снимок dialogs только для чтения`,"messages.privateSnapshot":`Снимок private_messages только для чтения`,"messages.channelMessagesSnapshot":`Снимок channel_messages только для чтения`,"messages.channelSnapshot":`Снимок channels только для чтения`,"messages.userEventsSource":`постоянные user_update_events`,"messages.channelEventsSource":`постоянные channel_update_events`,"messages.outboxSource":`онлайн/офлайн dispatch_outbox`,"messages.attempts":`Попытки`,"messages.deleteThis":`Удалить это сообщение`,"messages.groupDetailTitle":`Групповое сообщение #{id}`,"messages.channelGroupTitle":`Канал / Группа {id}`,"messages.mediaCount":`С медиафайлами`,"messages.channelPosts":`Посты канала`,"messages.channelGroup":`Канал / Группа`,"messages.pinned":`Закреплено`,"messages.channelPost":`Пост в канале`,"gifts.pageTitle":`Каталог звёздных подарков`,"giveGift.action":`Выдать`,"giveGift.eyebrow":`Выдача подарка · без списания`,"giveGift.title":`Выдать подарок`,"giveGift.recipientKind":`Тип получателя`,"giveGift.recipientUser":`Пользователь`,"giveGift.recipientChannel":`Канал`,"giveGift.pickUser":`Получатель (пользователь)`,"giveGift.pickChannel":`Получатель (канал)`,"giveGift.recipientRequired":`Сначала выберите получателя`,"giveGift.sender":`ID аккаунта-отправителя`,"giveGift.senderHint":`По умолчанию системный аккаунт 777000 (Telesrv).`,"giveGift.message":`Сообщение к подарку (необязательно)`,"giveGift.messagePlaceholder":`Показывается вместе с подарком`,"giveGift.hideName":`Скрыть имя отправителя от получателя`,"giveGift.upgrade":`Выдать как улучшенный коллекционный`,"giveGift.upgradeNote":`Подарок будет отчеканен как уникальный коллекционный. Ниже можно выбрать конкретные атрибуты и номер или оставить «Случайно» для выбора из опубликованного пула. Требуется опубликованное коллекционное улучшение с остатком тиража.`,"giveGift.model":`Модель`,"giveGift.pattern":`Узор`,"giveGift.backdrop":`Фон`,"giveGift.number":`Номер`,"giveGift.numberAuto":`Авто`,"giveGift.random":`Случайно`,"giveGift.confirm":`Выдать подарок`,"giveGifts.pageTitle":`Выдача подарков`,"giveGifts.eyebrow":`Выдача каталожных подарков любому пользователю или каналу`,"giveGifts.available":`Доступно подарков`,"giveGifts.sender":`Отправитель по умолчанию`,"giveGifts.searchPlaceholder":`Поиск по названию или ID подарка`,"giveGifts.hint":`Выберите подарок для выдачи. Выдача бесплатна и по умолчанию отправляется от системного аккаунта 777000 (Telesrv).`,"giveGifts.pickGift":`Выберите подарок`,"giveGifts.selectPrompt":`Выберите подарок из списка, чтобы начать.`,"gifts.eyebrow":`Каталог, неизменяемые версии и файлы анимаций`,"gifts.total":`Подарков в каталоге`,"gifts.enabled":`Включено`,"gifts.received":`Полученные подарки`,"gifts.formats":`Поддерживаемые форматы`,"gifts.add":`Добавить подарок`,"gifts.searchPlaceholder":`Поиск по ID подарка, названию или формату`,"gifts.listSummary":`Показано {shown} из {total}`,"gifts.idRevision":`ID / Версия`,"gifts.price":`Цена / Конвертация`,"gifts.importTitle":`Импорт звёздного подарка`,"gifts.importEyebrow":`Управление каталогом подарков`,"gifts.newRevision":`Создать версию для подарка #{id}`,"gifts.importHint":`Загрузите файл TGS или обычный Lottie JSON. Lottie нормализуется и сжимается в формат TGS.`,"gifts.officialSource":`Официальный снимок`,"gifts.fileSource":`Загрузить файл`,"gifts.officialHint":`Выберите проверенный подарок из data/official-gifts. Полные пулы коллекционных предметов импортируются атомарно.`,"gifts.officialSearch":`Поиск по ID или названию официального подарка`,"gifts.officialSelect":`Выберите официальный подарок`,"gifts.officialRequired":`Сначала выберите официальный подарок`,"gifts.officialResults":`Показано {shown} из {total}`,"gifts.officialCategoryLabel":`Категория возможностей официального подарка`,"gifts.officialCategory.all":`Все`,"gifts.officialCategory.upgrade":`Можно улучшить`,"gifts.officialCategory.craft":`Можно создать`,"gifts.officialCategory.basic":`Нельзя улучшить`,"gifts.officialUnnamed":`Официальный подарок без названия #{id}`,"gifts.officialAttributes":`Атрибутов: {count}`,"gifts.canUpgrade":`Можно улучшить`,"gifts.cannotUpgrade":`Нельзя улучшить`,"gifts.canCraft":`Можно создать`,"gifts.cannotCraft":`Нельзя создать`,"gifts.officialEmpty":`Нет подарков, соответствующих категории и поиску.`,"gifts.includeCollectible":`Импортировать полный пул коллекционных предметов, включая созданные модели`,"gifts.animation":`Файл анимации`,"gifts.filePrompt":`Перетащите или выберите файл TGS / Lottie`,"gifts.fileHint":`TGS, JSON или Lottie · файл проверяется перед импортом`,"gifts.chooseFile":`Выбрать файл`,"gifts.changeFile":`Изменить файл`,"gifts.title":`Отображаемое название`,"gifts.titlePlaceholder":`например, Праздничная звезда`,"gifts.stars":`Цена в Звёздах`,"gifts.convertStars":`Звёзд при конвертации`,"gifts.sortOrder":`Порядок сортировки`,"gifts.reason":`Причина для аудита`,"gifts.reasonPlaceholder":`Кратко опишите причину импорта этого подарка`,"gifts.enableAfterImport":`Включить после импорта`,"gifts.validate":`Тестовая проверка`,"gifts.confirmImport":`Подтвердить импорт`,"gifts.stepDetails":`Файл и описание`,"gifts.stepValidate":`Тестовая проверка`,"gifts.stepImport":`Подтверждение импорта`,"gifts.fileRequired":`Сначала выберите файл TGS или Lottie`,"gifts.source":`Источник`,"gifts.replace":`Новая версия`,"gifts.disable":`Отключить`,"gifts.enable":`Включить`,"gifts.empty":`Звёздные подарки ещё не импортированы.`,"gifts.emptyHint":`Импортируйте первую анимацию, чтобы начать наполнение каталога.`,"gifts.validationReady":`Проверка пройдена`,"gifts.validationHint":`Проверьте нормализованные метаданные и подтвердите импорт.`,"gifts.confirmState":`Применить проверенные изменения состояния к подарку #{id}?`,"collectibles.manage":`Пул атрибутов`,"collectibles.title":`Пул коллекционных предметов · Подарок #{id}`,"collectibles.eyebrow":`Уникальные атрибуты подарка`,"collectibles.activeRevision":`Опубликованная версия {revision}`,"collectibles.published":`Опубликовано`,"collectibles.noPool":`Нет опубликованного пула коллекционных предметов`,"collectibles.noPoolHint":`Опубликуйте модели, узоры и фоны для активации улучшений.`,"collectibles.publishNew":`Опубликовать новую неизменяемую версию`,"collectibles.immutableHint":`Тестовый запуск проверяет каждый файл и структуру набора атрибутов перед активацией версии.`,"collectibles.upgradeStars":`Цена улучшения в Звёздах`,"collectibles.supply":`Уникальный тираж`,"collectibles.slug":`Публичный префикс ссылки (slug)`,"collectibles.models":`Модели`,"collectibles.patterns":`Узоры`,"collectibles.backdrops":`Фоны`,"collectibles.model":`Модель`,"collectibles.pattern":`Узор`,"collectibles.backdrop":`Фон`,"collectibles.rarity":`Редкость ‰`,"collectibles.rarityHint":`В каждой категории должно быть не менее двух атрибутов. Значения в промилле задают относительные веса обычного улучшения; при добавлении или удалении они перераспределяются до суммы 1000.`,"collectibles.minimumAttributes":`Модели, узоры и фоны должны содержать не менее двух атрибутов в каждой категории.`,"collectibles.duplicateBackdropID":`ID фонов в одном наборе должны быть уникальными.`,"collectibles.colorHint":`Цвета сохраняются как 24-битные RGB-значения.`,"collectibles.addAttribute":`Добавить`,"collectibles.remove":`Удалить атрибут`,"collectibles.fileRequired":`Для каждой модели и узора требуется файл TGS или Lottie.`,"collectibles.backdropID":`ID фона`,"collectibles.color.center":`Центр`,"collectibles.color.edge":`Край`,"collectibles.color.pattern":`Узор`,"collectibles.color.text":`Текст`,"collectibles.validationReady":`Пул атрибутов корректен`,"collectibles.validationHint":`Проверьте нормализованные ресурсы и опубликуйте эту неизменяемую версию.`,"collectibles.publish":`Опубликовать версию`,"messages.msgIDsInvalid":`Некорректные ID сообщений`,"auth.device":`Устройство`,"auth.platform":`Платформа`,"auth.ip":`IP-адрес`,"auth.lastActive":`Последняя активность`,"auth.revokeCurrent":`Отозвать текущую`,"auth.keepCurrent":`Оставить текущую`,"auth.revokeAll":`Отозвать все устройства`,"picker.userPlaceholder":`Поиск по user_id / телефону / имени пользователя`,"picker.channelPlaceholder":`Поиск по channel_id / имени пользователя / названию`,"picker.verified":`Подтверждённые`,"picker.regular":`Обычные`,"action.reasonRequired":`Пожалуйста, укажите причину операции`,"action.flow":`Процесс выполнения`,"action.close":`Закрыть`,"action.stepReason":`Укажите причину`,"action.stepDryRun":`Тестовый запуск`,"action.stepConfirm":`Подтверждение выполнения`,"action.reason":`Причина операции`,"action.reasonPlaceholder":`Опишите, почему выполняется эта операция`,"action.requestPreview":`Запросить предпросмотр`,"action.result":`Результат действия`,"action.commandID":`ID команды`,"action.status":`Статус`,"action.dryRun":`Тестовый запуск`,"action.runAgain":`Повторить тестовый запуск`,"action.runDry":`Сначала выполните тестовый запуск`,"action.confirm":`Подтвердить выполнение`,"audit.id":`ID`,"audit.commandID":`ID команды`,"audit.action":`Действие`,"audit.actor":`Исполнитель`,"audit.status":`Статус`,"audit.dryRun":`Тестовый запуск`,"audit.reason":`Причина`,"audit.time":`Время`}},Pe=(0,g.createContext)(null);function Fe({children:e}){let[t,n]=(0,g.useState)(()=>Re());(0,g.useEffect)(()=>{try{localStorage.setItem(Me,t)}catch{}let e=t===`zh`?`zh-CN`:t===`ru`?`ru`:`en`;document.documentElement.lang=e,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=Le(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>Le(t,e,n)}),[t]);return(0,U.jsx)(Pe.Provider,{value:r,children:e})}function W(){let e=(0,g.useContext)(Pe);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function Ie(){let{lang:e,setLang:t,t:n}=W();return(0,U.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`,`ru`].map(r=>(0,U.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function Le(e,t,n){let r=Ne[e][t]??Ne.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function Re(){try{let e=ze(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=ze(localStorage.getItem(Me));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=ze(t);if(e)return e}return`en`}function ze(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:t===`ru`||t.startsWith(`ru-`)?`ru`:null}function G(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function Be(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/bots`)?t(`route.bots`):e.startsWith(`/emoji`)?t(`route.emoji`):e.startsWith(`/messages`)?t(`route.messages`):e.startsWith(`/give-gifts`)?t(`route.giveGifts`):e.startsWith(`/gifts`)?t(`route.gifts`):t(`route.dashboard`)}function Ve(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/bots`)?t(`route.botsSubtitle`):e.startsWith(`/emoji`)?t(`route.emojiSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):e.startsWith(`/give-gifts`)?t(`route.giveGiftsSubtitle`):e.startsWith(`/gifts`)?t(`route.giftsSubtitle`):t(`route.dashboardSubtitle`)}var He=`telesrv.admin.theme`,Ue=(0,g.createContext)(null);function We(e){document.documentElement.setAttribute(`data-theme`,e),document.documentElement.style.colorScheme=e}function Ge({children:e}){let[t,n]=(0,g.useState)(()=>Je());(0,g.useEffect)(()=>{We(t);try{localStorage.setItem(He,t)}catch{}},[t]),(0,g.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>{let t=null;try{t=localStorage.getItem(He)}catch{t=null}t!==`light`&&t!==`dark`&&n(e.matches?`dark`:`light`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let r=(0,g.useCallback)(e=>n(e),[]),i=(0,g.useCallback)(()=>n(e=>e===`dark`?`light`:`dark`),[]),a=(0,g.useMemo)(()=>({theme:t,setTheme:r,toggleTheme:i}),[t,r,i]);return(0,U.jsx)(Ue.Provider,{value:a,children:e})}function Ke(){let e=(0,g.useContext)(Ue);if(!e)throw Error(`useTheme must be used inside ThemeProvider`);return e}function qe(){let{theme:e,toggleTheme:t}=Ke(),{t:n}=W(),r=n(e===`light`?`theme.switchToDark`:`theme.switchToLight`);return(0,U.jsx)(`button`,{className:`theme-toggle`,type:`button`,onClick:t,"aria-label":r,title:r,children:e===`dark`?(0,U.jsx)(Te,{size:16}):(0,U.jsx)(de,{size:16})})}function Je(){try{let e=localStorage.getItem(He);if(e===`light`||e===`dark`)return e}catch{}try{if(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches)return`dark`}catch{}return`light`}function K({href:e,navigate:t,className:n,children:r}){return(0,U.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function Ye(){let{t:e}=W();return(0,U.jsxs)(`div`,{className:`boot-screen`,children:[(0,U.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,U.jsx)(`div`,{className:`loader-bar`})]})}function Xe({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=W(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,U.jsxs)(`div`,{className:`shell`,children:[(0,U.jsxs)(`aside`,{className:`sidebar`,children:[(0,U.jsxs)(K,{className:`brand`,href:`/`,navigate:n,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,U.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,U.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,U.jsx)(Ze,{icon:(0,U.jsx)(le,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,U.jsx)(Ze,{icon:(0,U.jsx)(ke,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,U.jsx)(Ze,{icon:(0,U.jsx)(xe,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,U.jsx)(Ze,{icon:(0,U.jsx)(F,{size:16}),href:`/bots`,route:t,navigate:n,children:a(`layout.bots`)}),(0,U.jsx)(Ze,{icon:(0,U.jsx)(oe,{size:16}),href:`/gifts`,route:t,navigate:n,children:a(`layout.gifts`)}),(0,U.jsx)(Ze,{icon:(0,U.jsx)(ve,{size:16}),href:`/give-gifts`,route:t,navigate:n,children:a(`layout.giveGifts`)}),(0,U.jsx)(Ze,{icon:(0,U.jsx)(Ce,{size:16}),href:`/emoji`,route:t,navigate:n,children:a(`layout.emoji`)}),(0,U.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,U.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,U.jsx)(V,{size:16}),(0,U.jsx)(`span`,{children:a(`layout.messages`)}),(0,U.jsx)(R,{className:`nav-section-chevron`,size:15})]}),s&&(0,U.jsxs)(`div`,{className:`nav-children`,children:[(0,U.jsx)(Ze,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,U.jsx)(Ze,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,U.jsxs)(`div`,{className:`sidebar-status`,children:[(0,U.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(ye,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,U.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(ne,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,U.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,U.jsxs)(`div`,{className:`runtime-row`,children:[(0,U.jsx)(Se,{size:14}),(0,U.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,U.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,U.jsxs)(`div`,{className:`workspace`,children:[(0,U.jsxs)(`header`,{className:`topbar`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:Ve(t.path,a)}),(0,U.jsx)(`h1`,{children:Be(t.path,a)})]}),(0,U.jsxs)(`div`,{className:`topbar-actions`,children:[(0,U.jsx)(qe,{}),(0,U.jsx)(Ie,{}),(0,U.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,U.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,U.jsx)(ue,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,U.jsx)(`main`,{className:`content`,children:i})]})]})}function Ze({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,U.jsxs)(K,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,U.jsx)(`span`,{children:i})]})}function Qe(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function $e(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function et(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function tt(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function nt(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function rt(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function it(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function at(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function ot({title:e,eyebrow:t,children:n,actions:r}){return(0,U.jsxs)(`div`,{className:`page-frame`,children:[(0,U.jsxs)(`div`,{className:`page-title-row`,children:[(0,U.jsxs)(`div`,{children:[t&&(0,U.jsx)(`div`,{className:`eyebrow`,children:t}),(0,U.jsx)(`h2`,{children:e})]}),r&&(0,U.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function st({children:e}){return(0,U.jsx)(`div`,{className:`query-panel`,children:e})}function ct({main:e,side:t}){return(0,U.jsxs)(`div`,{className:`split-layout`,children:[(0,U.jsx)(`div`,{className:`split-main`,children:e}),(0,U.jsx)(`aside`,{className:`split-side`,children:t})]})}function q({title:e,text:t,action:n}){return(0,U.jsxs)(`div`,{className:`section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{children:e}),t&&(0,U.jsx)(`p`,{children:t})]}),n&&(0,U.jsx)(`div`,{className:`section-action`,children:n})]})}function lt({children:e}){return(0,U.jsxs)(`div`,{className:`alert`,children:[(0,U.jsx)(O,{size:16}),` `,(0,U.jsx)(`span`,{children:e})]})}function J({children:e,tone:t=`neutral`}){return(0,U.jsx)(`span`,{className:`badge ${t}`,children:e})}function ut({label:e,value:t,tone:n}){return(0,U.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{children:t})]})}function Y({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,U.jsxs)(`div`,{className:`metric ${n}`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function X({label:e,value:t,mono:n=!1}){return(0,U.jsxs)(`div`,{className:`summary-item`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function dt({rows:e}){let{t}=W();return(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`audit.id`)}),(0,U.jsx)(`th`,{children:t(`audit.commandID`)}),(0,U.jsx)(`th`,{children:t(`audit.action`)}),(0,U.jsx)(`th`,{children:t(`audit.actor`)}),(0,U.jsx)(`th`,{children:t(`audit.status`)}),(0,U.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,U.jsx)(`th`,{children:t(`audit.reason`)}),(0,U.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[e.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.ID}),(0,U.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,U.jsx)(`td`,{children:e.Action}),(0,U.jsx)(`td`,{children:e.Actor}),(0,U.jsx)(`td`,{children:e.Status}),(0,U.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,U.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,U.jsx)(`td`,{children:nt(e.CreatedAt)})]},e.ID)),e.length===0&&(0,U.jsx)(ft,{colSpan:8})]})]})})}function ft({colSpan:e}){let{t}=W();return(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function pt({label:e}){return(0,U.jsx)(`section`,{className:`surface`,children:(0,U.jsx)(`div`,{className:`loading-line`,children:e})})}function mt({value:e}){return(0,U.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function ht({onLogin:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,U.jsx)(`main`,{className:`login-page`,children:(0,U.jsxs)(`section`,{className:`login-panel`,children:[(0,U.jsxs)(`div`,{className:`login-head`,children:[(0,U.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,U.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`telesrv`}),(0,U.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,U.jsxs)(`div`,{className:`login-head-actions`,children:[(0,U.jsx)(qe,{}),(0,U.jsx)(Ie,{}),(0,U.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,U.jsxs)(`div`,{className:`login-copy`,children:[(0,U.jsx)(`h1`,{children:t(`login.heading`)}),(0,U.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,U.jsx)(lt,{children:i}),(0,U.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:t(`login.secret`)}),(0,U.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,U.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var gt=m();function _t({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=W(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function S(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let C=f?.dry_run&&!f.error,w=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,T=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{className:w,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,gt.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,U.jsx)(`h2`,{children:e})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,U.jsx)(Ae,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body`,children:[(0,U.jsxs)(`div`,{className:`command-steps`,children:[(0,U.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,U.jsx)(`span`,{children:`1`}),(0,U.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`2`}),(0,U.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:C?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`3`}),(0,U.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,U.jsxs)(`label`,{className:`form-field`,children:[(0,U.jsx)(`span`,{children:s(`action.reason`)}),(0,U.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,U.jsxs)(`div`,{className:`command-preview`,children:[(0,U.jsxs)(`div`,{className:`preview-head`,children:[(0,U.jsx)(ie,{size:14}),` `,s(`action.requestPreview`)]}),(0,U.jsx)(mt,{value:JSON.stringify(T,null,2)})]}),m&&(0,U.jsx)(lt,{children:m}),f&&(0,U.jsxs)(`div`,{className:`result-box`,children:[(0,U.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,U.jsx)(O,{size:16}):(0,U.jsx)(k,{size:16}),(0,U.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.commandID`)}),(0,U.jsx)(`strong`,{children:f.command_id})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.status`)}),(0,U.jsx)(`strong`,{children:f.status})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:s(`action.dryRun`)}),(0,U.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,U.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,U.jsx)(mt,{value:JSON.stringify(f.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>S(!1),disabled:_,children:[_?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(me,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,U.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>S(!0),disabled:_||!C,children:[(0,U.jsx)(k,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function vt({rows:e,userID:t,onDone:n}){let{t:r}=W(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,U.jsxs)(`div`,{className:`authorization-block`,children:[(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:r(`auth.device`)}),(0,U.jsx)(`th`,{children:r(`auth.platform`)}),(0,U.jsx)(`th`,{children:r(`auth.ip`)}),(0,U.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,U.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,U.jsxs)(`tbody`,{children:[o.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,U.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,U.jsx)(`td`,{children:n.IP}),(0,U.jsx)(`td`,{children:nt(n.ActiveAt)}),(0,U.jsx)(`td`,{className:`device-actions-cell`,children:(0,U.jsxs)(`div`,{className:`device-actions`,children:[(0,U.jsx)(_t,{label:r(`auth.revokeCurrent`),icon:(0,U.jsx)(ue,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,U.jsx)(_t,{label:r(`auth.keepCurrent`),icon:(0,U.jsx)(xe,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,U.jsx)(ft,{colSpan:5})]})]})}),(0,U.jsx)(`div`,{className:`danger-zone`,children:(0,U.jsx)(_t,{label:r(`auth.revokeAll`),icon:(0,U.jsx)(I,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function yt({scam:e,fake:t}){let{t:n}=W();return!e&&!t?null:(0,U.jsxs)(U.Fragment,{children:[e&&(0,U.jsx)(J,{tone:`danger`,children:n(`flags.scam`)}),t&&(0,U.jsx)(J,{tone:`danger`,children:n(`flags.fake`)})]})}function bt({idKey:e,id:t,path:n,scam:r,fake:i,onDone:a}){let{t:o}=W();return(0,U.jsxs)(`div`,{className:`action-stack`,children:[(0,U.jsx)(_t,{label:o(r?`flags.clearScam`:`flags.setScam`),icon:(0,U.jsx)(be,{size:15}),tone:`danger`,path:n,payload:()=>({[e]:t,scam:!r,fake:i}),onDone:a}),(0,U.jsx)(_t,{label:o(i?`flags.clearFake`:`flags.setFake`),icon:(0,U.jsx)(j,{size:15}),tone:`danger`,path:n,payload:()=>({[e]:t,scam:r,fake:!i}),onDone:a})]})}function xt({id:e,support:t,onDone:n}){let{t:r}=W();return(0,U.jsx)(_t,{label:r(t?`attr.clearSupport`:`attr.setSupport`),icon:(0,U.jsx)(B,{size:15}),tone:`neutral`,path:`/api/actions/set-support`,payload:()=>({user_id:e,support:!t}),onDone:n})}function St({idKey:e,id:t,path:n,current:r,onDone:i}){let{t:a}=W(),[o,s]=(0,g.useState)(r.replace(/^@/,``));return(0,U.jsxs)(`div`,{className:`attr-block`,children:[(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:a(`attr.username`)}),(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:`username`})]}),(0,U.jsx)(_t,{label:a(`attr.setUsername`),icon:(0,U.jsx)(P,{size:15}),tone:`neutral`,path:n,payload:()=>({[e]:t,username:o.trim().replace(/^@/,``)}),onDone:i})]})}function Ct({idKey:e,id:t,path:n,onDone:r}){let{t:i}=W(),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(!0),[l,u]=(0,g.useState)(`0`),[d,f]=(0,g.useState)(``);return(0,U.jsxs)(`div`,{className:`attr-block`,children:[(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),` `,i(`attr.forProfile`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),` `,i(`attr.hasColor`)]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:i(`attr.colorIndex`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,max:`20`,value:l,onChange:e=>u(e.target.value)})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:i(`attr.bgEmojiID`)}),(0,U.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`0`})]}),(0,U.jsx)(_t,{label:i(`attr.setColor`),icon:(0,U.jsx)(fe,{size:15}),tone:`neutral`,path:n,payload:()=>({[e]:t,for_profile:a,has_color:s,color:it(l),background_emoji_id:d.trim()||`0`}),onDone:r})]})}function wt({idKey:e,id:t,path:n,onDone:r}){let{t:i}=W(),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(`0`);return(0,U.jsxs)(`div`,{className:`attr-block`,children:[(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:i(`attr.emojiDocID`)}),(0,U.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:`0 = clear`})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:i(`attr.emojiUntil`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,value:s,onChange:e=>c(e.target.value)})]}),(0,U.jsx)(_t,{label:i(`attr.setEmojiStatus`),icon:(0,U.jsx)(Ce,{size:15}),tone:`neutral`,path:n,payload:()=>({[e]:t,document_id:a.trim()||`0`,until:it(s)}),onDone:r})]})}function Tt({channel:e,onDone:t}){let{t:n}=W(),[r,i]=(0,g.useState)(e.Gigagroup),[a,o]=(0,g.useState)(e.AntiSpam),[s,c]=(0,g.useState)(e.ParticipantsHidden),[l,u]=(0,g.useState)(e.NoForwards),[d,f]=(0,g.useState)(e.JoinToSend),[p,m]=(0,g.useState)(e.JoinRequest),[h,_]=(0,g.useState)(String(e.SlowmodeSeconds));return(0,U.jsxs)(`div`,{className:`attr-block`,children:[(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),` `,n(`attr.gigagroup`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),` `,n(`attr.antispam`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),` `,n(`attr.participantsHidden`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked)}),` `,n(`attr.noforwards`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked)}),` `,n(`attr.joinToSend`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>m(e.target.checked)}),` `,n(`attr.joinRequest`)]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`attr.slowmode`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,max:`86400`,value:h,onChange:e=>_(e.target.value)})]}),(0,U.jsx)(_t,{label:n(`attr.applySettings`),icon:(0,U.jsx)(H,{size:15}),tone:`warn`,path:`/api/actions/set-channel-settings`,payload:()=>({channel_id:e.ID,gigagroup:r,antispam:a,participants_hidden:s,noforwards:l,join_to_send:d,join_request:p,slowmode_seconds:it(h)}),onDone:t})]})}function Et({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`),[p,m]=(0,g.useState)(()=>Dt(new Date(Date.now()+7*864e5))),[h,_]=(0,g.useState)(``);async function v(){c(!0),o(``);try{let t=await x.account(e);i(t),t.Restriction.Frozen&&(t.Restriction.Until&&m(Dt(new Date(t.Restriction.Until))),_(t.Restriction.AppealURL||``))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{v()},[e]),a)return(0,U.jsx)(lt,{children:a});if(!r)return(0,U.jsx)(pt,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let y=r.Account;return(0,U.jsx)(ot,{title:n(`account.detailTitle`,{id:y.ID}),eyebrow:n(`account.profile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,U.jsx)(N,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(ct,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:et(y)}),(0,U.jsxs)(`div`,{className:`entity-subtitle`,children:[$e(y.Username)||n(`account.noUsername`),` · `,Qe(y.Phone)||n(`account.noPhone`)]})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[y.PremiumUntil>0?(0,U.jsx)(J,{tone:`good`,children:n(`account.premium`)}):(0,U.jsx)(J,{children:n(`account.notPremium`)}),r.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)}),(0,U.jsx)(yt,{scam:r.Scam,fake:r.Fake}),y.Frozen?(0,U.jsx)(J,{tone:`danger`,children:n(`account.accountFrozen`)}):(0,U.jsx)(J,{children:n(`account.accountActive`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(X,{label:n(`account.userID`),value:String(y.ID),mono:!0}),(0,U.jsx)(X,{label:n(`account.lastActive`),value:rt(r.LastSeenAt)||`-`}),(0,U.jsx)(X,{label:n(`account.premiumUntil`),value:y.PremiumUntil>0?rt(y.PremiumUntil):n(`common.none`)}),(0,U.jsx)(X,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,U.jsx)(X,{label:n(`common.updatedAt`),value:nt(y.UpdatedAt)||`-`}),(0,U.jsx)(X,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,U.jsx)(X,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,U.jsx)(X,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,U.jsx)(X,{label:n(`account.freezeSince`),value:r.Restriction.Since?nt(r.Restriction.Since):n(`common.none`)}),(0,U.jsx)(X,{label:n(`account.freezeUntil`),value:r.Restriction.Until?nt(r.Restriction.Until):n(`common.none`)}),(0,U.jsx)(X,{label:n(`account.freezeAppealURL`),value:r.Restriction.AppealURL||n(`common.none`)}),(0,U.jsx)(X,{label:n(`account.createdAt`),value:nt(y.CreatedAt)||`-`})]}),r.About&&(0,U.jsx)(`p`,{className:`about-text`,children:r.About}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,U.jsx)(vt,{rows:r.Authorizations,userID:y.ID,onDone:v})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(dt,{rows:r.AuditLogs})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.freezeUntil`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.freezeUntilAria`),value:p,onChange:e=>m(e.target.value),type:`datetime-local`})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.freezeAppealURL`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.freezeAppealURLAria`),value:h,onChange:e=>_(e.target.value),type:`url`,placeholder:`https://...`})]}),(0,U.jsx)(_t,{label:y.Frozen?n(`account.updateFreeze`):n(`account.freezeAccount`),icon:(0,U.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!0,freeze_until:new Date(p).toISOString(),freeze_appeal_url:h.trim()}),onDone:v}),y.Frozen&&(0,U.jsx)(_t,{label:n(`account.unfreezeAccount`),icon:(0,U.jsx)(O,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!1}),onDone:v}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,U.jsxs)(`div`,{className:`action-stack`,children:[(0,U.jsx)(_t,{label:n(`account.setPremium`),icon:(0,U.jsx)(M,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:it(l)}),onDone:v}),(0,U.jsx)(_t,{label:n(`account.clearPremium`),icon:(0,U.jsx)(M,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:0}),onDone:v}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,U.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,U.jsx)(_t,{label:n(`account.grantStars`),icon:(0,U.jsx)(we,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:y.ID,amount:it(d)}),onDone:v}),(0,U.jsx)(_t,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:y.ID,verified:!r.Verified}),onDone:v})]}),(0,U.jsx)(bt,{idKey:`user_id`,id:y.ID,path:`/api/actions/set-account-flags`,scam:r.Scam,fake:r.Fake,onDone:v}),(0,U.jsx)(`div`,{className:`dock-title`,children:n(`attr.attributes`)}),(0,U.jsx)(xt,{id:y.ID,support:r.Support,onDone:v}),(0,U.jsx)(St,{idKey:`user_id`,id:y.ID,path:`/api/actions/set-account-username`,current:y.Username,onDone:v}),(0,U.jsx)(Ct,{idKey:`user_id`,id:y.ID,path:`/api/actions/set-account-color`,onDone:v}),(0,U.jsx)(wt,{idKey:`user_id`,id:y.ID,path:`/api/actions/set-account-emoji-status`,onDone:v})]})})})}function Dt(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function Ot(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function kt(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function At({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=Ot(o?.rows??[]);return(0,U.jsxs)(ot,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,U.jsx)(ge,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)(lt,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(Y,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,U.jsx)(Y,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,U.jsx)(Y,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,U.jsx)(Y,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,U.jsx)(st,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(_e,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,U.jsx)(z,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`account.userID`)}),(0,U.jsx)(`th`,{children:t(`account.phone`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`common.name`)}),(0,U.jsx)(`th`,{children:t(`common.device`)}),(0,U.jsx)(`th`,{children:t(`account.lastActive`)}),(0,U.jsx)(`th`,{children:t(`account.premium`)}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`account.frozen`)}),(0,U.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:Qe(n.Phone)}),(0,U.jsx)(`td`,{children:$e(n.Username)}),(0,U.jsx)(`td`,{children:et(n)}),(0,U.jsx)(`td`,{children:n.DeviceCount}),(0,U.jsx)(`td`,{children:nt(n.LastActiveAt)}),(0,U.jsx)(`td`,{children:n.PremiumUntil>0?(0,U.jsxs)(J,{tone:`good`,children:[t(`account.premium`),` `,rt(n.PremiumUntil)]}):(0,U.jsx)(J,{children:t(`common.none`)})}),(0,U.jsxs)(`td`,{children:[n.Verified?(0,U.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,U.jsx)(J,{children:t(`account.notVerified`)}),` `,(0,U.jsx)(yt,{scam:n.Scam,fake:n.Fake})]}),(0,U.jsx)(`td`,{children:n.Frozen?(0,U.jsx)(J,{tone:`danger`,children:t(`account.frozen`)}):(0,U.jsx)(J,{children:t(`common.normal`)})}),(0,U.jsx)(`td`,{children:nt(n.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(z,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,U.jsx)(ft,{colSpan:11})]})]})})]})}function Z({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,U.jsx)(lt,{children:a});if(!r)return(0,U.jsx)(pt,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,U.jsx)(ot,{title:`${tt(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,U.jsx)(N,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(ct,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,U.jsxs)(`div`,{className:`entity-subtitle`,children:[$e(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[(0,U.jsx)(J,{children:tt(c,n)}),c.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)}),(0,U.jsx)(yt,{scam:c.Scam,fake:c.Fake}),c.Deleted?(0,U.jsx)(J,{tone:`danger`,children:n(`common.deleted`)}):(0,U.jsx)(J,{children:n(`common.valid`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(X,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,U.jsx)(X,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,U.jsx)(X,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,U.jsx)(X,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,U.jsx)(X,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,U.jsx)(X,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,U.jsx)(X,{label:n(`account.createdAt`),value:rt(c.Date)||`-`}),(0,U.jsx)(X,{label:n(`common.updatedAt`),value:nt(c.UpdatedAt)||`-`})]}),c.About&&(0,U.jsx)(`p`,{className:`about-text`,children:c.About}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(dt,{rows:r.AuditLogs})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,U.jsx)(mt,{value:r.ChannelJSON})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,U.jsx)(_t,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s}),(0,U.jsx)(bt,{idKey:`channel_id`,id:c.ID,path:`/api/actions/set-channel-flags`,scam:c.Scam,fake:c.Fake,onDone:s}),(0,U.jsx)(`div`,{className:`dock-title`,children:n(`attr.settings`)}),(0,U.jsx)(Tt,{channel:c,onDone:s}),(0,U.jsx)(`div`,{className:`dock-title`,children:n(`attr.attributes`)}),(0,U.jsx)(St,{idKey:`channel_id`,id:c.ID,path:`/api/actions/set-channel-username`,current:c.Username,onDone:s}),(0,U.jsx)(Ct,{idKey:`channel_id`,id:c.ID,path:`/api/actions/set-channel-color`,onDone:s}),(0,U.jsx)(wt,{idKey:`channel_id`,id:c.ID,path:`/api/actions/set-channel-emoji-status`,onDone:s})]})})})}function jt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=kt(o?.rows??[]);return(0,U.jsxs)(ot,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,U.jsx)(ge,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)(lt,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(Y,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,U.jsx)(Y,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,U.jsx)(Y,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,U.jsx)(Y,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,U.jsx)(st,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(_e,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,U.jsx)(z,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`channel.channelID`)}),(0,U.jsx)(`th`,{children:t(`channel.kind`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`channel.title`)}),(0,U.jsx)(`th`,{children:t(`common.members`)}),(0,U.jsx)(`th`,{children:t(`common.admins`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:tt(n,t)}),(0,U.jsx)(`td`,{children:$e(n.Username)}),(0,U.jsx)(`td`,{children:n.Title}),(0,U.jsx)(`td`,{children:n.ParticipantsCount}),(0,U.jsx)(`td`,{children:n.AdminsCount}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsxs)(`td`,{children:[n.Verified?(0,U.jsx)(J,{tone:`good`,children:t(`common.verified`)}):(0,U.jsx)(J,{children:t(`account.notVerified`)}),` `,(0,U.jsx)(yt,{scam:n.Scam,fake:n.Fake})]}),(0,U.jsx)(`td`,{children:nt(n.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(z,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,U.jsx)(ft,{colSpan:10})]})]})})]})}function Mt({id:e,navigate:t}){let{t:n}=W(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1);async function l(){c(!0),o(``);try{i(await x.bot(e))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{l()},[e]),a)return(0,U.jsx)(lt,{children:a});if(!r)return(0,U.jsx)(pt,{label:n(s?`bots.loadingDetail`:`account.waitingData`)});let u=r.Bot;return(0,U.jsx)(ot,{title:n(`bots.detailTitle`,{id:u.ID}),eyebrow:n(`bots.profile`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/bots`),children:[(0,U.jsx)(N,{size:15}),` `,n(`common.backToList`)]}),children:(0,U.jsx)(ct,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:u.FirstName||n(`bots.unnamed`)}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:$e(u.Username)||n(`account.noUsername`)})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[(0,U.jsx)(J,{tone:u.System?`warn`:`neutral`,children:u.System?n(`bots.system`):n(`bots.user`)}),u.Verified?(0,U.jsx)(J,{tone:`good`,children:n(`common.verified`)}):(0,U.jsx)(J,{children:n(`account.notVerified`)}),(0,U.jsx)(yt,{scam:u.Scam,fake:u.Fake})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(X,{label:n(`bots.botID`),value:String(u.ID),mono:!0}),(0,U.jsx)(X,{label:n(`bots.owner`),value:u.OwnerUserID>0?`${u.OwnerUserID} ${$e(r.OwnerUsername)}`.trim():n(`common.none`)}),(0,U.jsx)(X,{label:n(`bots.type`),value:u.System?n(`bots.system`):n(`bots.user`)}),(0,U.jsx)(X,{label:n(`common.updatedAt`),value:nt(u.UpdatedAt)||`-`}),(0,U.jsx)(X,{label:n(`account.createdAt`),value:nt(u.CreatedAt)||`-`})]}),r.About&&(0,U.jsx)(`p`,{className:`about-text`,children:r.About}),r.Description&&r.Description.trim()!==r.About.trim()&&(0,U.jsx)(`p`,{className:`about-text`,children:r.Description}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,U.jsx)(dt,{rows:r.AuditLogs})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:n(`bots.actionDock`)}),(0,U.jsx)(`div`,{className:`action-stack`,children:(0,U.jsx)(_t,{label:u.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,U.jsx)(D,{size:15}),tone:`neutral`,path:`/api/actions/set-verified`,payload:()=>({user_id:u.ID,verified:!u.Verified}),onDone:l})}),(0,U.jsx)(bt,{idKey:`user_id`,id:u.ID,path:`/api/actions/set-account-flags`,scam:u.Scam,fake:u.Fake,onDone:l}),(0,U.jsx)(`div`,{className:`dock-title`,children:n(`attr.attributes`)}),(0,U.jsx)(St,{idKey:`user_id`,id:u.ID,path:`/api/actions/set-account-username`,current:u.Username,onDone:l}),(0,U.jsx)(Ct,{idKey:`user_id`,id:u.ID,path:`/api/actions/set-account-color`,onDone:l}),(0,U.jsx)(wt,{idKey:`user_id`,id:u.ID,path:`/api/actions/set-account-emoji-status`,onDone:l}),u.System?(0,U.jsx)(`p`,{className:`bot-create-note`,children:n(`bots.systemHint`)}):(0,U.jsxs)(`div`,{className:`danger-zone`,children:[(0,U.jsx)(_t,{label:n(`bots.delete`),icon:(0,U.jsx)(Ee,{size:15}),tone:`danger`,path:`/api/actions/delete-bot`,payload:()=>({bot_user_id:u.ID}),onDone:()=>t(`/bots`)}),(0,U.jsx)(`p`,{className:`bot-create-note`,children:n(`bots.deleteHint`)})]})]})})})}function Nt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(0),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(``),[y,S]=(0,g.useState)(``);async function C(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&t.set(`before_id`,String(c));try{let e=await x.bots(t);s(e),l(e.next_before_id)}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{C(!1)},[]);let w=o?.rows??[],T=w.filter(e=>e.Verified).length,E=w.filter(e=>e.System).length;return(0,U.jsxs)(ot,{title:t(`bots.pageTitle`),eyebrow:o?.listing===!1?t(`bots.queryResults`):t(`bots.recent`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>C(!1),disabled:u,children:[(0,U.jsx)(ge,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,U.jsx)(lt,{children:f}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(Y,{label:t(`bots.currentPage`),value:String(w.length)}),(0,U.jsx)(Y,{label:t(`common.verified`),value:String(T),tone:`good`}),(0,U.jsx)(Y,{label:t(`bots.system`),value:String(E)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(`div`,{className:`section-head`,children:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{children:t(`bots.createTitle`)}),(0,U.jsx)(`p`,{children:t(`bots.createHint`)})]})}),(0,U.jsxs)(`div`,{className:`bot-create-fields`,children:[(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.ownerUserID`)}),(0,U.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),type:`number`,min:`1`,placeholder:`123456789`})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.name`)}),(0,U.jsx)(`input`,{value:_,onChange:e=>v(e.target.value),placeholder:t(`bots.namePlaceholder`),maxLength:64})]}),(0,U.jsxs)(`label`,{className:`duration-field`,children:[(0,U.jsx)(`span`,{children:t(`bots.username`)}),(0,U.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:`my_service_bot`})]})]}),(0,U.jsxs)(`div`,{className:`bot-create-actions`,children:[(0,U.jsx)(`span`,{className:`bot-create-note`,children:t(`bots.usernameHint`)}),(0,U.jsx)(_t,{label:t(`bots.create`),icon:(0,U.jsx)(he,{size:15}),tone:`neutral`,path:`/api/actions/create-bot`,payload:()=>({owner_user_id:it(m),name:_.trim(),username:y.trim().replace(/^@/,``)}),onDone:()=>C(!1)})]})]}),(0,U.jsx)(st,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),C(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`bots.searchPlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`field-inline`,children:[(0,U.jsx)(`span`,{children:t(`common.limit`)}),(0,U.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(_e,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>C(!0),disabled:u,children:[(0,U.jsx)(z,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`bots.botID`)}),(0,U.jsx)(`th`,{children:t(`common.username`)}),(0,U.jsx)(`th`,{children:t(`common.name`)}),(0,U.jsx)(`th`,{children:t(`bots.owner`)}),(0,U.jsx)(`th`,{children:t(`common.verified`)}),(0,U.jsx)(`th`,{children:t(`bots.type`)}),(0,U.jsx)(`th`,{children:t(`account.createdAt`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[w.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:$e(n.Username)||`-`}),(0,U.jsx)(`td`,{children:n.FirstName||`-`}),(0,U.jsx)(`td`,{className:`mono`,children:n.OwnerUserID>0?n.OwnerUserID:`-`}),(0,U.jsxs)(`td`,{children:[n.Verified?(0,U.jsxs)(J,{tone:`good`,children:[(0,U.jsx)(D,{size:12}),` `,t(`common.verified`)]}):(0,U.jsx)(J,{children:t(`account.notVerified`)}),` `,(0,U.jsx)(yt,{scam:n.Scam,fake:n.Fake})]}),(0,U.jsx)(`td`,{children:n.System?(0,U.jsx)(J,{tone:`warn`,children:t(`bots.system`)}):(0,U.jsx)(J,{children:t(`bots.user`)})}),(0,U.jsx)(`td`,{children:nt(n.CreatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/bots/${n.ID}`),children:[(0,U.jsx)(F,{size:14}),` `,t(`common.detail`),` `,(0,U.jsx)(z,{size:14})]})})]},n.ID)),w.length===0&&(0,U.jsx)(ft,{colSpan:8})]})]})})]})}var Pt=c(o(((e,t)=>{typeof document<`u`&&typeof navigator<`u`&&(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.lottie=r())})(e,(function(){var n=``,r=!1,i=-999999,a=function(e){r=!!e},o=function(){return r},s=function(e){n=e},c=function(){return n};function l(e){return document.createElement(e)}function u(e,t){var n,r=e.length,i;for(n=0;n1?n[1]=1:n[1]<=0&&(n[1]=0),L(n[0],n[1],n[2])}function ee(e,t){var n=R(e[0]*255,e[1]*255,e[2]*255);return n[2]+=t,n[2]>1?n[2]=1:n[2]<0&&(n[2]=0),L(n[0],n[1],n[2])}function te(e,t){var n=R(e[0]*255,e[1]*255,e[2]*255);return n[0]+=t/360,n[0]>1?--n[0]:n[0]<0&&(n[0]+=1),L(n[0],n[1],n[2])}(function(){var e=[],t,n;for(t=0;t<256;t+=1)n=t.toString(16),e[t]=n.length===1?`0`+n:n;return function(t,n,r){return t<0&&(t=0),n<0&&(n=0),r<0&&(r=0),`#`+e[t]+e[n]+e[r]}})();var ne=function(e){g=!!e},re=function(){return g},ie=function(e){_=e},ae=function(){return _},oe=function(){return v},se=function(e){E=e},ce=function(){return E},le=function(e){y=e};function B(e){return document.createElementNS(`http://www.w3.org/2000/svg`,e)}function ue(e){"@babel/helpers - typeof";return ue=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ue(e)}var V=function(){var e=1,t=[],n,r,i={onmessage:function(){},postMessage:function(e){n({data:e})}},a={postMessage:function(e){i.onmessage({data:e})}};function s(e){if(window.Worker&&window.Blob&&o()){var t=new Blob([`var _workerSelf = self; self.onmessage = `,e.toString()],{type:`text/javascript`}),r=URL.createObjectURL(t);return new Worker(r)}return n=e,i}function c(){r||(r=s(function(e){function t(){function e(t,n){var o,s,c=t.length,l,u,d,f;for(s=0;s=0;--t)if(e[t].ty===`sh`)if(e[t].ks.k.i)a(e[t].ks.k);else for(o=e[t].ks.k.length,r=0;rn[0]?!0:n[0]>e[0]?!1:e[1]>n[1]?!0:n[1]>e[1]?!1:e[2]>n[2]?!0:n[2]>e[2]?!1:null}var s=function(){var e=[4,4,14];function t(e){var t=e.t.d;e.t.d={k:[{s:t,t:0}]}}function n(e){var n,r=e.length;for(n=0;n=0;--n)if(e[n].ty===`sh`)if(e[n].ks.k.i)e[n].ks.k.c=e[n].closed;else for(a=e[n].ks.k.length,i=0;i500)&&(this._imageLoaded(),clearInterval(n)),t+=1}.bind(this),50)}function a(t){var n=r(t,this.assetsPath,this.path),i=B(`image`);b?this.testImageLoaded(i):i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS(`http://www.w3.org/1999/xlink`,`href`,n),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a}function o(t){var n=r(t,this.assetsPath,this.path),i=l(`img`);i.crossOrigin=`anonymous`,i.addEventListener(`load`,this._imageLoaded,!1),i.addEventListener(`error`,function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=n;var a={img:i,assetData:t};return a}function s(e){var t={assetData:e},n=r(e,this.assetsPath,this.path);return V.loadData(n,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function c(e,t){this.imagesLoadedCb=t;var n,r=e.length;for(n=0;nthis.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t=this.animationData.layers,n,r=t.length,i=e.layers,a,o=i.length;for(a=0;athis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(`enterFrame`),this.renderFrame(),this.trigger(`drawnFrame`)},H.prototype.renderFrame=function(){if(!(this.isLoaded===!1||!this.renderer))try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},H.prototype.play=function(e){e&&this.name!==e||this.isPaused===!0&&(this.isPaused=!1,this.trigger(`_play`),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger(`_active`)))},H.prototype.pause=function(e){e&&this.name!==e||this.isPaused===!1&&(this.isPaused=!0,this.trigger(`_pause`),this._idle=!0,this.trigger(`_idle`),this.audioController.pause())},H.prototype.togglePause=function(e){e&&this.name!==e||(this.isPaused===!0?this.play():this.pause())},H.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},H.prototype.getMarkerData=function(e){for(var t,n=0;n=this.totalFrames-1&&this.frameModifier>0?!this.loop||this.playCount===this.loop?this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(n=!0,t=this.totalFrames-1):t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger(`loopComplete`))):this.setCurrentRawFrameValue(t):t<0?this.checkSegments(t%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&this.loop!==!0)?(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger(`loopComplete`):this._completedLoop=!0):(n=!0,t=0)):this.setCurrentRawFrameValue(t),n&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger(`complete`))}},H.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger(`segmentStart`)},H.prototype.setSegment=function(e,t){var n=-1;this.isPaused&&(this.currentRawFrame+this.firstFramet&&(n=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,n!==-1&&this.goToAndStop(n,!0)},H.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),ye(e[0])===`object`){var n,r=e.length;for(n=0;n=0;--n)t[n].animation.destroy(e)}function T(e,t,n){var r=[].concat([].slice.call(document.getElementsByClassName(`lottie`)),[].slice.call(document.getElementsByClassName(`bodymovin`))),i,a=r.length;for(i=0;i0?n=c:t=c;while(Math.abs(s)>a&&++l=i?g(e,d,t,n):f===0?d:h(e,a,a+c,t,n)}},e}(),Se=function(){function e(e){return e.concat(m(e.length))}return{double:e}}(),Ce=function(){return function(e,t,n){var r=0,i=e,a=m(i),o={newElement:s,release:c};function s(){var e;return r?(--r,e=a[r]):e=t(),e}function c(e){r===i&&(a=Se.double(a),i*=2),n&&n(e),a[r]=e,r+=1}return o}}(),we=function(){function e(){return{addedLength:0,percents:p(`float32`,ce()),lengths:p(`float32`,ce())}}return Ce(8,e)}(),Te=function(){function e(){return{lengths:[],totalLength:0}}function t(e){var t,n=e.lengths.length;for(t=0;t-.001&&o<.001}function n(n,r,i,a,o,s,c,l,u){if(i===0&&s===0&&u===0)return t(n,r,a,o,c,l);var d=e.sqrt(e.pow(a-n,2)+e.pow(o-r,2)+e.pow(s-i,2)),f=e.sqrt(e.pow(c-n,2)+e.pow(l-r,2)+e.pow(u-i,2)),p=e.sqrt(e.pow(c-a,2)+e.pow(l-o,2)+e.pow(u-s,2)),m=d>f?d>p?d-f-p:p-f-d:p>f?p-f-d:f-d-p;return m>-1e-4&&m<1e-4}var r=function(){return function(e,t,n,r){var i=ce(),a,o,s,c,l,u=0,d,f=[],p=[],m=we.newElement();for(s=n.length,a=0;ao?-1:1,l=!0;l;)if(r[a]<=o&&r[a+1]>o?(s=(o-r[a])/(r[a+1]-r[a]),l=!1):a+=c,a<0||a>=i-1){if(a===i-1)return n[a];l=!1}return n[a]+(n[a+1]-n[a])*s}function l(t,n,r,i,a,o){var s=c(a,o),l=1-s;return[e.round((l*l*l*t[0]+(s*l*l+l*s*l+l*l*s)*r[0]+(s*s*l+l*s*s+s*l*s)*i[0]+s*s*s*n[0])*1e3)/1e3,e.round((l*l*l*t[1]+(s*l*l+l*s*l+l*l*s)*r[1]+(s*s*l+l*s*s+s*l*s)*i[1]+s*s*s*n[1])*1e3)/1e3]}var u=p(`float32`,8);function d(t,n,r,i,a,o,s){a<0?a=0:a>1&&(a=1);var l=c(a,s);o=o>1?1:o;var d=c(o,s),f,p=t.length,m=1-l,h=1-d,g=m*m*m,_=l*m*m*3,v=l*l*m*3,y=l*l*l,b=m*m*h,x=l*m*h+m*l*h+m*m*d,S=l*l*h+m*l*d+l*m*d,C=l*l*d,w=m*h*h,T=l*h*h+m*d*h+m*h*d,E=l*d*h+m*d*d+l*h*d,D=l*d*d,O=h*h*h,k=d*h*h+h*d*h+h*h*d,A=d*d*h+h*d*d+d*h*d,j=d*d*d;for(f=0;f=l.t-n){c.h&&(c=l),i=0;break}if(l.t-n>e){i=a;break}a=v||e=v?x.points.length-1:0;for(f=x.points[S].point.length,d=0;d=T&&C=v)r[0]=b[0],r[1]=b[1],r[2]=b[2];else if(e<=y)r[0]=c.s[0],r[1]=c.s[1],r[2]=c.s[2];else{var j=Me(c.s),M=Me(b),N=(e-y)/(v-y);U(r,je(j,M,N))}else for(a=0;a=v?m=1:e1e-6?(f=Math.acos(p),m=Math.sin(f),h=Math.sin((1-n)*f)/m,g=Math.sin(n*f)/m):(h=1-n,g=n),r[0]=h*i+g*c,r[1]=h*a+g*l,r[2]=h*o+g*u,r[3]=h*s+g*d,r}function U(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i),s=Math.asin(2*n*r+2*i*a),c=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i);e[0]=o/D,e[1]=s/D,e[2]=c/D}function Me(e){var t=e[0]*D,n=e[1]*D,r=e[2]*D,i=Math.cos(t/2),a=Math.cos(n/2),o=Math.cos(r/2),s=Math.sin(t/2),c=Math.sin(n/2),l=Math.sin(r/2),u=i*a*o-s*c*l;return[s*c*o+i*a*l,s*a*o+i*c*l,i*c*o-s*a*l,u]}function Ne(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==Oe&&(this._caching.lastFrame>=n&&e>=n||this._caching.lastFrame=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(e,this._caching);this.pv=r}return this._caching.lastFrame=e,this.pv}function Pe(e){var t;if(this.propType===`unidimensional`)t=e*this.mult,ke(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var n=0,r=this.v.length;n1e-5&&(this.v[n]=t,this._mdf=!0),n+=1}function Fe(){if(!(this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var e,t=this.effectsSequence.length,n=this.kf?this.pv:this.data.k;for(e=0;e=this._maxLength&&this.doubleArrayLength(),n){case`v`:a=this.v;break;case`i`:a=this.i;break;case`o`:a=this.o;break;default:a=[];break}(!a[r]||a[r]&&!i)&&(a[r]=Ve.newElement()),a[r][0]=e,a[r][1]=t},He.prototype.setTripleAt=function(e,t,n,r,i,a,o,s){this.setXYAt(e,t,`v`,o,s),this.setXYAt(n,r,`o`,o,s),this.setXYAt(i,a,`i`,o,s)},He.prototype.reverse=function(){var e=new He;e.setPathData(this.c,this._length);var t=this.v,n=this.o,r=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],r[0][0],r[0][1],n[0][0],n[0][1],0,!1),i=1);var a=this._length-1,o=this._length,s;for(s=i;s=p[p.length-1].t-this.offsetTime)i=p[p.length-1].s?p[p.length-1].s[0]:p[p.length-2].e[0],o=!0;else{for(var m=r,h=p.length-1,g=!0,_,v,y;g&&(_=p[m],v=p[m+1],!(v.t-this.offsetTime>e));)m=v.t-this.offsetTime)d=1;else if(e<_.t-this.offsetTime)d=0;else{var b;y.__fnct?b=y.__fnct:(b=xe.getBezierEasing(_.o.x,_.o.y,_.i.x,_.i.y).get,y.__fnct=b),d=b((e-(_.t-this.offsetTime))/(v.t-this.offsetTime-(_.t-this.offsetTime)))}a=v.s?v.s[0]:_.e[0]}i=_.s[0]}for(l=t._length,u=i.i[0].length,n.lastIndex=r,s=0;sr&&t>r)||(this._caching.lastIndex=i0||e>-1e-6&&e<0?r(e*t)/t:e}function P(){var e=this.props,t=N(e[0]),n=N(e[1]),r=N(e[4]),i=N(e[5]),a=N(e[12]),o=N(e[13]);return`matrix(`+t+`,`+n+`,`+r+`,`+i+`,`+a+`,`+o+`)`}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=c,this.skew=u,this.skewFromAxis=d,this.shear=l,this.scale=f,this.setTransform=m,this.translate=h,this.transform=g,this.multiply=_,this.applyToPoint=S,this.applyToX=C,this.applyToY=w,this.applyToZ=T,this.applyToPointArray=A,this.applyToTriplePoints=k,this.applyToPointStringified=j,this.toCSS=M,this.to2dCSS=P,this.clone=b,this.cloneFromProps=x,this.equals=y,this.inversePoints=O,this.inversePoint=D,this.getInverseMatrix=E,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=p(`float32`,16),this.reset()}}();function Je(e){"@babel/helpers - typeof";return Je=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Je(e)}var K={},Ye=`__[STANDALONE]__`,Xe=`__[ANIMATIONDATA]__`,Ze=``;function Qe(e){s(e)}function $e(){Ye===!0?be.searchAnimations(Xe,Ye,Ze):be.searchAnimations()}function et(e){ne(e)}function tt(e){le(e)}function nt(e){return Ye===!0&&(e.animationData=JSON.parse(Xe)),be.loadAnimation(e)}function rt(e){if(typeof e==`string`)switch(e){case`high`:se(200);break;default:case`medium`:se(50);break;case`low`:se(10);break}else!isNaN(e)&&e>1&&se(e)}function it(){return typeof navigator<`u`}function at(e,t){e===`expressions`&&ie(t)}function ot(e){switch(e){case`propertyFactory`:return G;case`shapePropertyFactory`:return Ke;case`matrix`:return qe;default:return null}}K.play=be.play,K.pause=be.pause,K.setLocationHref=Qe,K.togglePause=be.togglePause,K.setSpeed=be.setSpeed,K.setDirection=be.setDirection,K.stop=be.stop,K.searchAnimations=$e,K.registerAnimation=be.registerAnimation,K.loadAnimation=nt,K.setSubframeRendering=et,K.resize=be.resize,K.goToAndStop=be.goToAndStop,K.destroy=be.destroy,K.setQuality=rt,K.inBrowser=it,K.installPlugin=at,K.freeze=be.freeze,K.unfreeze=be.unfreeze,K.setVolume=be.setVolume,K.mute=be.mute,K.unmute=be.unmute,K.getRegisteredAnimations=be.getRegisteredAnimations,K.useWebWorker=a,K.setIDPrefix=tt,K.__getFactory=ot,K.version=`5.13.0`;function st(){document.readyState===`complete`&&(clearInterval(ut),$e())}function ct(e){for(var t=q.split(`&`),n=0;n=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o=[],s,c=a.length,l;for(s=0;sr+n)){var u=l.s*i<=r?0:(l.s*i-r)/n,d=l.e*i>=r+n?1:(l.e*i-r)/n;o.push([u,d])}return o.length||o.push([0,0]),o},dt.prototype.releasePathsData=function(e){var t,n=e.length;for(t=0;t1?1+r:this.s.v<0?0+r:this.s.v+r,n=this.e.v>1?1+r:this.e.v<0?0+r:this.e.v+r,t>n){var i=t;t=n,n=i}t=Math.round(t*1e4)*1e-4,n=Math.round(n*1e4)*1e-4,this.sValue=t,this.eValue=n}else t=this.sValue,n=this.eValue;var a,o,s=this.shapes.length,c,l,u,d,f,p=0;if(n===t)for(o=0;o=0;--o)if(h=this.shapes[o],h.shape._mdf){for(g=h.localShapeCollection,g.releaseShapes(),this.m===2&&s>1?(b=this.calculateShapeEdges(t,n,h.totalShapeLength,y,p),y+=h.totalShapeLength):b=[[_,v]],l=b.length,c=0;c=1?m.push({s:h.totalShapeLength*(_-1),e:h.totalShapeLength*(v-1)}):(m.push({s:h.totalShapeLength*_,e:h.totalShapeLength}),m.push({s:0,e:h.totalShapeLength*(v-1)}));var x=this.addShapes(h,m[0]);if(m[0].s!==m[0].e){if(m.length>1)if(h.shape.paths.shapes[h.shape.paths._length-1].c){var S=x.pop();this.addPaths(x,g),x=this.addShapes(h,m[1],S)}else this.addPaths(x,g),x=this.addShapes(h,m[1]);this.addPaths(x,g)}}h.shape.paths=g}}else if(this._mdf)for(o=0;ot.e){n.c=!1;break}else t.s<=l&&t.e>=l+u.addedLength?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[s],i[a].v[s],n,d,g),g=!1):(p=De.getNewSegment(i[a].v[s-1],i[a].v[s],i[a].o[s-1],i[a].i[s],(t.s-l)/u.addedLength,(t.e-l)/u.addedLength,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1),l+=u.addedLength,d+=1;if(i[a].c&&f.length){if(u=f[s-1],l<=t.e){var _=f[s-1].addedLength;t.s<=l&&t.e>=l+_?(this.addSegment(i[a].v[s-1],i[a].o[s-1],i[a].i[0],i[a].v[0],n,d,g),g=!1):(p=De.getNewSegment(i[a].v[s-1],i[a].v[0],i[a].o[s-1],i[a].i[0],(t.s-l)/_,(t.e-l)/_,f[s-1]),this.addSegmentFromArray(p,n,d,g),g=!1,n.c=!1)}else n.c=!1;l+=u.addedLength,d+=1}if(n._length&&(n.setXYAt(n.v[h][0],n.v[h][1],`i`,h),n.setXYAt(n.v[n._length-1][0],n.v[n._length-1][1],`o`,n._length-1)),l>t.e)break;a=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/n,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/n,0)):(r=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/n,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(r[0]=a.getValueAtTime((a.keyframes[0].t+.01)/n,0),r[1]=o.getValueAtTime((o.keyframes[0].t+.01)/n,0),i[0]=a.getValueAtTime(a.keyframes[0].t/n,0),i[1]=o.getValueAtTime(o.keyframes[0].t/n,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(r[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/n,0),r[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/n,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/n,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/n,0)):(r=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/n,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/n,o.offsetTime))}else i=e,r=i;this.v.rotate(-Math.atan2(r[1]-i[1],r[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function r(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length)this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1;else return;if(!this.s.effectsSequence.length)this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2;else return;if(this.sk)if(!this.sk.effectsSequence.length&&!this.sa.effectsSequence.length)this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3;else return;this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):!this.rz.effectsSequence.length&&!this.ry.effectsSequence.length&&!this.rx.effectsSequence.length&&!this.or.effectsSequence.length&&(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}function i(){}function a(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0}function o(e,t,n){if(this.elem=e,this.frameId=-1,this.propType=`transform`,this.data=t,this.v=new qe,this.pre=new qe,this.appliedTransformations=0,this.initDynamicPropertyContainer(n||e),t.p&&t.p.s?(this.px=G.getProp(e,t.p.x,0,0,this),this.py=G.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=G.getProp(e,t.p.z,0,0,this))):this.p=G.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=G.getProp(e,t.rx,0,D,this),this.ry=G.getProp(e,t.ry,0,D,this),this.rz=G.getProp(e,t.rz,0,D,this),t.or.k[0].ti){var r,i=t.or.k.length;for(r=0;r0;)--n,this._elements.unshift(t[n]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},mt.prototype.resetElements=function(e){var t,n=e.length;for(t=0;t0?Math.floor(f):Math.ceil(f),h=this.pMatrix.props,g=this.rMatrix.props,_=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v=0;if(f>0){for(;vm;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),--v;p&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-p,!0),v-=p)}r=this.data.m===1?0:this._currentCopies-1,i=this.data.m===1?1:-1,a=this._currentCopies;for(var y,b;a;){if(t=this.elemsData[r].it,n=t[t.length-1].transform.mProps.v.props,b=n.length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=this._currentCopies===1?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),v!==0){for((r!==0&&i===1||r!==this._currentCopies-1&&i===-1)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(_[0],_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9],_[10],_[11],_[12],_[13],_[14],_[15]),this.matrix.transform(h[0],h[1],h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10],h[11],h[12],h[13],h[14],h[15]),y=0;y0&&r<1?[t]:[]:[t-r,t+r].filter(function(e){return e>0&&e<1})},Ct.prototype.split=function(e){if(e<=0)return[St(this.points[0]),this];if(e>=1)return[this,St(this.points[this.points.length-1])];var t=yt(this.points[0],this.points[1],e),n=yt(this.points[1],this.points[2],e),r=yt(this.points[2],this.points[3],e),i=yt(t,n,e),a=yt(n,r,e),o=yt(i,a,e);return[new Ct(this.points[0],t,i,o,!0),new Ct(o,a,r,this.points[3],!0)]};function wt(e,t){var n=e.points[0][t],r=e.points[e.points.length-1][t];if(n>r){var i=r;r=n,n=i}for(var a=bt(3*e.a[t],2*e.b[t],e.c[t]),o=0;o0&&a[o]<1){var s=e.point(a[o])[t];sr&&(r=s)}return{min:n,max:r}}Ct.prototype.bounds=function(){return{x:wt(this,0),y:wt(this,1)}},Ct.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}};function Tt(e,t,n){var r=e.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:e,t:(t+n)/2,t1:t,t2:n}}function Et(e){var t=e.bez.split(.5);return[Tt(t[0],e.t1,e.t),Tt(t[1],e.t,e.t2)]}function Dt(e,t){return Math.abs(e.cx-t.cx)*2=a||e.width<=r&&e.height<=r&&t.width<=r&&t.height<=r){i.push([e.t,t.t]);return}var o=Et(e),s=Et(t);Ot(o[0],s[0],n+1,r,i,a),Ot(o[0],s[1],n+1,r,i,a),Ot(o[1],s[0],n+1,r,i,a),Ot(o[1],s[1],n+1,r,i,a)}}Ct.prototype.intersections=function(e,t,n){t===void 0&&(t=2),n===void 0&&(n=7);var r=[];return Ot(Tt(this,0,1),Tt(e,0,1),0,t,r,n),r},Ct.shapeSegment=function(e,t){var n=(t+1)%e.length();return new Ct(e.v[t],e.o[t],e.i[n],e.v[n],!0)},Ct.shapeSegmentInverted=function(e,t){var n=(t+1)%e.length();return new Ct(e.v[n],e.i[n],e.o[t],e.v[t],!0)};function kt(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function At(e,t,n,r){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[n[0],n[1],1],s=[r[0],r[1],1],c=kt(kt(i,a),kt(o,s));return _t(c[2])?null:[c[0]/c[2],c[1]/c[2]]}function Z(e,t,n){return[e[0]+Math.cos(t)*n,e[1]-Math.sin(t)*n]}function jt(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function Mt(e,t){return gt(e[0],t[0])&>(e[1],t[1])}function Nt(){}u([X],Nt),Nt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=G.getProp(e,t.s,0,null,this),this.frequency=G.getProp(e,t.r,0,null,this),this.pointsType=G.getProp(e,t.pt,0,null,this),this._isAnimated=this.amplitude.effectsSequence.length!==0||this.frequency.effectsSequence.length!==0||this.pointsType.effectsSequence.length!==0};function Pt(e,t,n,r,i,a,o){var s=n-Math.PI/2,c=n+Math.PI/2,l=t[0]+Math.cos(n)*r*i,u=t[1]-Math.sin(n)*r*i;e.setTripleAt(l,u,l+Math.cos(s)*a,u-Math.sin(s)*a,l+Math.cos(c)*o,u-Math.sin(c)*o,e.length())}function Ft(e,t){var n=[t[0]-e[0],t[1]-e[1]],r=-Math.PI*.5;return[Math.cos(r)*n[0]-Math.sin(r)*n[1],Math.sin(r)*n[0]+Math.cos(r)*n[1]]}function It(e,t){var n=t===0?e.length()-1:t-1,r=(t+1)%e.length(),i=e.v[n],a=e.v[r],o=Ft(i,a);return Math.atan2(0,1)-Math.atan2(o[1],o[0])}function Lt(e,t,n,r,i,a,o){var s=It(t,n),c=t.v[n%t._length],l=t.v[n===0?t._length-1:n-1],u=t.v[(n+1)%t._length],d=a===2?Math.sqrt((c[0]-l[0])**2+(c[1]-l[1])**2):0,f=a===2?Math.sqrt((c[0]-u[0])**2+(c[1]-u[1])**2):0;Pt(e,t.v[n%t._length],s,o,r,f/((i+1)*2),d/((i+1)*2),a)}function Rt(e,t,n,r,i,a){for(var o=0;o1&&t.length>1&&(i=Ht(e[0],t[t.length-1]),i)?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[n,r]}function Wt(e){for(var t,n=1;n1&&(t=Ut(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function Gt(e,t){var n=e.inflectionPoints(),r,i,a,o;if(n.length===0)return[Bt(e,t)];if(n.length===1||gt(n[1],1))return a=e.split(n[0]),r=a[0],i=a[1],[Bt(r,t),Bt(i,t)];a=e.split(n[0]),r=a[0];var s=(n[1]-n[0])/(1-n[0]);return a=a[1].split(s),o=a[0],i=a[1],[Bt(r,t),Bt(o,t),Bt(i,t)]}function Kt(){}u([X],Kt),Kt.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=G.getProp(e,t.a,0,null,this),this.miterLimit=G.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=this.amount.effectsSequence.length!==0},Kt.prototype.processPath=function(e,t,n,r){var i=Ue.newElement();i.c=e.c;var a=e.length();e.c||--a;var o,s,c,l=[];for(o=0;o=0;--o)c=Ct.shapeSegmentInverted(e,o),l.push(Gt(c,t));l=Wt(l);var u=null,d=null;for(o=0;o0&&(o=!1),o){var u=l(`style`);u.setAttribute(`f-forigin`,n[r].fOrigin),u.setAttribute(`f-origin`,n[r].origin),u.setAttribute(`f-family`,n[r].fFamily),u.type=`text/css`,u.innerText=`@font-face {font-family: `+n[r].fFamily+`; font-style: normal; src: url('`+n[r].fPath+`');}`,t.appendChild(u)}}else if(n[r].fOrigin===`g`||n[r].origin===1){for(s=document.querySelectorAll(`link[f-forigin="g"], link[f-origin="1"]`),c=0;c=55296&&n<=56319){var r=e.charCodeAt(1);r>=56320&&r<=57343&&(t=(n-55296)*1024+r-56320+65536)}return t}function S(e,t){var n=e.toString(16)+t.toString(16);return d.indexOf(n)!==-1}function C(e){return e===s}function w(e){return e===o}function T(e){var t=x(e);return t>=c&&t<=u}function E(e){return T(e.substr(0,2))&&T(e.substr(2,2))}function D(e){return t.indexOf(e)!==-1}function O(e,t){var o=x(e.substr(t,2));if(o!==n)return!1;var s=0;for(t+=2;s<5;){if(o=x(e.substr(t,2)),oa)return!1;s+=1,t+=2}return x(e.substr(t,2))===r}function k(){this.isLoaded=!0}var A=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};return A.isModifier=S,A.isZeroWidthJoiner=C,A.isFlagEmoji=E,A.isRegionalCode=T,A.isCombinedCharacter=D,A.isRegionalFlag=O,A.isVariationSelector=w,A.BLACK_FLAG_CODE_POINT=n,A.prototype={addChars:_,addFonts:g,getCharData:v,getFontByName:b,measureText:y,checkLoadedFonts:m,setIsLoaded:k},A}();function Yt(e){this.animationData=e}Yt.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e};function Xt(e){return new Yt(e)}function Zt(){}Zt.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){this.renderableComponents.indexOf(e)===-1&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){this.renderableComponents.indexOf(e)!==-1&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?this.isInRange!==!0&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):this.isInRange!==!1&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},pn.prototype.show=function(){},pn.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},pn.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},pn.prototype.resume=function(){this._canPlay=!0},pn.prototype.setRate=function(e){this.audio.rate(e)},pn.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},pn.prototype.getBaseElement=function(){return null},pn.prototype.destroy=function(){},pn.prototype.sourceRectAtTime=function(){},pn.prototype.initExpressions=function(){};function mn(){}mn.prototype.checkLayers=function(e){var t,n=this.layers.length,r;for(this.completeLayers=!0,t=n-1;t>=0;--t)this.elements[t]||(r=this.layers[t],r.ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t)),this.completeLayers=this.elements[t]?this.completeLayers:!1;this.checkPendingElements()},mn.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e);default:return this.createNull(e)}},mn.prototype.createCamera=function(){throw Error(`You're using a 3d camera. Try the html renderer.`)},mn.prototype.createAudio=function(e){return new pn(e,this.globalData,this)},mn.prototype.createFootage=function(e){return new fn(e,this.globalData,this)},mn.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e0&&(this.maskElement.setAttribute(`id`,p),this.element.maskedElement.setAttribute(b,`url(`+c()+`#`+p+`)`),r.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}_n.prototype.getMaskProperty=function(e){return this.viewData[e].prop},_n.prototype.renderFrame=function(e){var t=this.element.finalTransform.mat,n,r=this.masksProperties.length;for(n=0;n1&&(r+=` C`+t.o[i-1][0]+`,`+t.o[i-1][1]+` `+t.i[0][0]+`,`+t.i[0][1]+` `+t.v[0][0]+`,`+t.v[0][1]),n.lastPath!==r){var o=``;n.elem&&(t.c&&(o=e.inv?this.solidPath+r:r),n.elem.setAttribute(`d`,o)),n.lastPath=r}},_n.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var vn=function(){var e={};e.createFilter=t,e.createAlphaToLuminanceFilter=n;function t(e,t){var n=B(`filter`);return n.setAttribute(`id`,e),t!==!0&&(n.setAttribute(`filterUnits`,`objectBoundingBox`),n.setAttribute(`x`,`0%`),n.setAttribute(`y`,`0%`),n.setAttribute(`width`,`100%`),n.setAttribute(`height`,`100%`)),n}function n(){var e=B(`feColorMatrix`);return e.setAttribute(`type`,`matrix`),e.setAttribute(`color-interpolation-filters`,`sRGB`),e.setAttribute(`values`,`0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1`),e}return e}(),yn=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:typeof OffscreenCanvas<`u`};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),bn={},xn=`filter_result_`;function Sn(e){var t,n=`SourceGraphic`,r=e.data.ef?e.data.ef.length:0,i=I(),a=vn.createFilter(i,!0),o=0;this.filters=[];var s;for(t=0;t=0&&(n=this.shapeModifiers[e].processShapes(this._isFirstFrame),!n);--e);}},searchProcessedElement:function(e){for(var t=this.processedElements,n=0,r=t.length;n.01)return!1;n+=1}return!0},Ln.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e0;)c=r.transformers[g].mProps._mdf||c,--h,--g;if(c)for(h=f-r.styles[u].lvl,g=r.transformers.length-1;h>0;)m.multiply(r.transformers[g].mProps.v),--h,--g}else m=e;if(p=r.sh.paths,o=p._length,c){for(s=``,a=0;a=1?v=.99:v<=-1&&(v=-.99);var y=g*v,b=Math.cos(_+t.a.v)*y+a[0],x=Math.sin(_+t.a.v)*y+a[1];r.setAttribute(`fx`,b),r.setAttribute(`fy`,x),i&&!t.g._collapsable&&(t.of.setAttribute(`fx`,b),t.of.setAttribute(`fy`,x))}}}function u(e,t,n){var r=t.style,i=t.d;i&&(i._mdf||n)&&i.dashStr&&(r.pElem.setAttribute(`stroke-dasharray`,i.dashStr),r.pElem.setAttribute(`stroke-dashoffset`,i.dashoffset[0])),t.c&&(t.c._mdf||n)&&r.pElem.setAttribute(`stroke`,`rgb(`+C(t.c.v[0])+`,`+C(t.c.v[1])+`,`+C(t.c.v[2])+`)`),(t.o._mdf||n)&&r.pElem.setAttribute(`stroke-opacity`,t.o.v),(t.w._mdf||n)&&(r.pElem.setAttribute(`stroke-width`,t.w.v),r.msElem&&r.msElem.setAttribute(`stroke-width`,t.w.v))}return n}();function Wn(e,t,n){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,n),this.prevViewData=[]}u([un,gn,Cn,On,wn,dn,Tn],Wn),Wn.prototype.initSecondaryElement=function(){},Wn.prototype.identityMatrix=new qe,Wn.prototype.buildExpressionInterface=function(){},Wn.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Wn.prototype.filterUniqueShapes=function(){var e,t=this.shapes.length,n,r,i=this.stylesList.length,a,o=[],s=!1;for(r=0;r1&&s&&this.setShapesAsAnimated(o)}},Wn.prototype.setShapesAsAnimated=function(e){var t,n=e.length;for(t=0;t=0;--c){if(g=this.searchProcessedElement(e[c]),g?t[c]=n[g-1]:e[c]._render=o,e[c].ty===`fl`||e[c].ty===`st`||e[c].ty===`gf`||e[c].ty===`gs`||e[c].ty===`no`)g?t[c].style.closed=e[c].hd:t[c]=this.createStyleElement(e[c],i),e[c]._render&&t[c].style.pElem.parentNode!==r&&r.appendChild(t[c].style.pElem),f.push(t[c].style);else if(e[c].ty===`gr`){if(!g)t[c]=this.createGroupElement(e[c]);else for(d=t[c].it.length,u=0;u1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},Kn.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},Kn.prototype.getValue=function(e){if(!((this.elem.globalData.frameId===this.frameId||!this.effectsSequence.length)&&!e)){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,n=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var r,i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(r=0;rt);)n+=1;return this.keysIndex!==n&&(this.keysIndex=n),this.data.d.k[this.keysIndex].s},Kn.prototype.buildFinalText=function(e){for(var t=[],n=0,r=e.length,i,a,o=!1,s=!1,c=``;n=55296&&i<=56319?Jt.isRegionalFlag(e,n)?c=e.substr(n,14):(a=e.charCodeAt(n+1),a>=56320&&a<=57343&&(Jt.isModifier(i,a)?(c=e.substr(n,2),o=!0):c=Jt.isFlagEmoji(e.substr(n,4))?e.substr(n,4):e.substr(n,2))):i>56319?(a=e.charCodeAt(n+1),Jt.isVariationSelector(i)&&(o=!0)):Jt.isZeroWidthJoiner(i)&&(o=!0,s=!0),o?(t[t.length-1]+=c,o=!1):t.push(c),n+=c.length;return t},Kn.prototype.completeTextData=function(e){e.__complete=!0;var t=this.elem.globalData.fontManager,n=this.data,r=[],i,a,o,s=0,c,l=n.m.g,u=0,d=0,f=0,p=[],m=0,h=0,g,_,v=t.getFontByName(e.f),y,b=0,x=qt(v);e.fWeight=x.weight,e.fStyle=x.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),a=e.finalText.length,e.finalLineHeight=e.lh;var S=e.tr/1e3*e.finalSize,C;if(e.sz)for(var w=!0,T=e.sz[0],E=e.sz[1],D,O;w;){O=this.buildFinalText(e.t),D=0,m=0,a=O.length,S=e.tr/1e3*e.finalSize;var k=-1;for(i=0;iT&&O[i]!==` `?(k===-1?a+=1:i=k,D+=e.finalLineHeight||e.finalSize*1.2,O.splice(i,+(k===i),`\r`),k=-1,m=0):(m+=b,m+=S);D+=v.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&Eh?m:h,m=-2*S,c=``,o=!0,f+=1):c=j,t.chars?(y=t.getCharData(j,v.fStyle,t.getFontByName(e.f).fFamily),b=o?0:y.w*e.finalSize/100):b=t.measureText(c,e.f,e.finalSize),j===` `?A+=b+S:(m+=b+S+A,A=0),r.push({l:b,an:b,add:u,n:o,anIndexes:[],val:c,line:f,animatorJustifyOffset:0}),l==2){if(u+=b,c===``||c===` `||i===a-1){for((c===``||c===` `)&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;s+=1,u=0}}else if(l==3){if(u+=b,c===``||i===a-1){for(c===``&&(u-=b);d<=i;)r[d].an=u,r[d].ind=s,r[d].extra=b,d+=1;u=0,s+=1}}else r[s].ind=s,r[s].extra=0,s+=1;if(e.l=r,h=m>h?m:h,p.push(m),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=h,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=p;var M=n.a,N,P;_=M.length;var F,I,L=[];for(g=0;g<_;g+=1){for(N=M[g],N.a.sc&&(e.strokeColorAnim=!0),N.a.sw&&(e.strokeWidthAnim=!0),(N.a.fc||N.a.fh||N.a.fs||N.a.fb)&&(e.fillColorAnim=!0),I=0,F=N.s.b,i=0;i0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var c=xe.getBezierEasing(i,a,o,s).get,l=0,u=this.finalS,d=this.finalE,f=this.data.sh;if(f===2)l=d===u?+(r>=d):e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===3)l=d===u?r>=d?0:1:1-e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l=c(l);else if(f===4)d===u?l=0:(l=e(0,t(.5/(d-u)+(r-u)/(d-u),1)),l<.5?l*=2:l=1-2*(l-.5)),l=c(l);else if(f===5){if(d===u)l=0;else{var p=d-u;r=t(e(0,r+.5-u),d-u);var m=-p/2+r,h=p/2;l=Math.sqrt(1-m*m/(h*h))}l=c(l)}else f===6?(d===u?l=0:(r=t(e(0,r+.5-u),d-u),l=(1+Math.cos(Math.PI+Math.PI*2*r/(d-u)))/2),l=c(l)):(r>=n(u)&&(l=r-u<0?e(0,t(t(d,1)-(u-r),1)):e(0,t(d-r,1))),l=c(l));if(this.sm.v!==100){var g=this.sm.v*.01;g===0&&(g=1e-8);var _=.5-g*.5;l<_?l=0:(l=(l-_)/g,l>1&&(l=1))}return l*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&this.data.r===2&&(this.e.v=this._currentTextLength);var t=this.data.r===2?1:100/this.data.totalChars,n=this.o.v/t,r=this.s.v/t+n,i=this.e.v/t+n;if(r>i){var a=r;r=i,i=a}this.finalS=r,this.finalE=i}},u([Be],r);function i(e,t,n){return new r(e,t,n)}return{getTextSelectorProp:i}}();function Jn(e,t,n){var r={propType:!1},i=G.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,D,n):r,rx:a.rx?i(e,a.rx,0,D,n):r,ry:a.ry?i(e,a.ry,0,D,n):r,sk:a.sk?i(e,a.sk,0,D,n):r,sa:a.sa?i(e,a.sa,0,D,n):r,s:a.s?i(e,a.s,1,.01,n):r,a:a.a?i(e,a.a,1,0,n):r,o:a.o?i(e,a.o,0,.01,n):r,p:a.p?i(e,a.p,1,0,n):r,sw:a.sw?i(e,a.sw,0,0,n):r,sc:a.sc?i(e,a.sc,1,0,n):r,fc:a.fc?i(e,a.fc,1,0,n):r,fh:a.fh?i(e,a.fh,0,0,n):r,fs:a.fs?i(e,a.fs,0,.01,n):r,fb:a.fb?i(e,a.fb,0,.01,n):r,t:a.t?i(e,a.t,0,0,n):r},this.s=qn.getTextSelectorProp(e,t.s,n),this.s.t=t.s.t}function Yn(e,t,n){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=n,this._animatorsData=m(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(n)}Yn.prototype.searchProperties=function(){var e,t=this._textData.a.length,n,r=G.getProp;for(e=0;e=m+Se||!x?(T=(m+Se-g)/h.partialLength,re=b.point[0]+(h.point[0]-b.point[0])*T,ie=b.point[1]+(h.point[1]-b.point[1])*T,a.translate(-n[0]*f[u].an*.005,-(n[1]*A)*.01),_=!1):x&&(g+=h.partialLength,v+=1,v>=x.length&&(v=0,y+=1,S[y]?x=S[y].points:D.v.c?(v=0,y=0,x=S[y].points):(g-=h.partialLength,x=null)),x&&(b=h,h=x[v],C=h.partialLength));ne=f[u].an/2-f[u].add,a.translate(-ne,0,0)}else ne=f[u].an/2-f[u].add,a.translate(-ne,0,0),a.translate(-n[0]*f[u].an*.005,-n[1]*A*.01,0);for(P=0;Pe?this.textSpans[e].span:B(s?`g`:`text`),b<=e){if(c.setAttribute(`stroke-linecap`,`butt`),c.setAttribute(`stroke-linejoin`,`round`),c.setAttribute(`stroke-miterlimit`,`4`),this.textSpans[e].span=c,s){var S=B(`g`);c.appendChild(S),this.textSpans[e].childSpan=S}this.textSpans[e].span=c,this.layerElement.appendChild(c)}c.style.display=`inherit`}if(l.reset(),d&&(o[e].n&&(f=-g,p+=n.yOffset,p+=+!!h,h=!1),this.applyTextPropertiesToMatrix(n,l,o[e].line,f,p),f+=o[e].l||0,f+=g),s){x=this.globalData.fontManager.getCharData(n.finalText[e],r.fStyle,this.globalData.fontManager.getFontByName(n.f).fFamily);var C;if(x.t===1)C=new rr(x.data,this.globalData,this);else{var w=Zn;x.data&&x.data.shapes&&(w=this.buildShapeData(x.data,n.finalSize)),C=new Wn(w,this.globalData,this)}if(this.textSpans[e].glyph){var T=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(T.layerElement),T.destroy()}this.textSpans[e].glyph=C,C._debug=!0,C.prepareFrame(0),C.renderFrame(),this.textSpans[e].childSpan.appendChild(C.layerElement),x.t===1&&this.textSpans[e].childSpan.setAttribute(`transform`,`scale(`+n.finalSize/100+`,`+n.finalSize/100+`)`)}else d&&c.setAttribute(`transform`,`translate(`+l.props[12]+`,`+l.props[13]+`)`),c.textContent=o[e].val,c.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`)}d&&c&&c.setAttribute(`d`,u)}for(;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t=0;--n)(this.completeLayers||this.elements[n])&&(this.elements[n].prepareFrame(this.renderedFrame-this.layers[n].st),this.elements[n]._mdf&&(this._mdf=!0))}},nr.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e=0;--n)e.finalTransform.multiply(e.transforms[n].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,n=this.sequenceList.length;for(t=0;t=1){this.buffers=[];var e=this.globalData.canvasContext,t=cr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var n=cr.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(n),this.data.tt>=3&&!document._isProxy&&cr.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new ur(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=Qt(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new dr(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(hn.TRANSFORM_EFFECT)},hideElement:function(){!this.hidden&&(!this.isInRange||this.isTransparent)&&(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext(`2d`);this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext(`2d`);if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById(`tp`in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var n=cr.getLumaCanvas(this.canvasContext.canvas);n.getContext(`2d`).drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(n,0,0)}this.canvasContext.globalCompositeOperation=pr[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation=`destination-over`,this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation=`source-over`}},renderFrame:function(e){if(!(this.hidden||this.data.hd)&&!(this.data.td===1&&!e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=this.data.ty===0;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&=!1}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new qe},fr.prototype.hide=fr.prototype.hideElement,fr.prototype.show=fr.prototype.showElement;function mr(e,t,n,r){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i=4;t.ty===`rc`?i=5:t.ty===`el`?i=6:t.ty===`sr`&&(i=7),this.sh=Ke.getShapeProp(e,t,i,e);var a,o=n.length,s;for(a=0;a=0;--a){if(d=this.searchProcessedElement(e[a]),d?t[a]=n[d-1]:e[a]._shouldRender=r,e[a].ty===`fl`||e[a].ty===`st`||e[a].ty===`gf`||e[a].ty===`gs`)d?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],m),l.push(t[a].style);else if(e[a].ty===`gr`){if(!d)t[a]=this.createGroupElement(e[a]);else for(c=t[a].it.length,s=0;s=0;--i)t[i].ty===`tr`?(o=n[i].transform,this.renderShapeTransform(e,o)):t[i].ty===`sh`||t[i].ty===`el`||t[i].ty===`rc`||t[i].ty===`sr`?this.renderPath(t[i],n[i]):t[i].ty===`fl`?this.renderFill(t[i],n[i],o):t[i].ty===`st`?this.renderStroke(t[i],n[i],o):t[i].ty===`gf`||t[i].ty===`gs`?this.renderGradientFill(t[i],n[i],o):t[i].ty===`gr`?this.renderShape(o,t[i].it,n[i].it):t[i].ty;r&&this.drawLayer()},hr.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var n=e.trNodes,r=t.paths,i,a,o,s=r._length;n.length=0;var c=e.transforms.finalTransform;for(o=0;o=1?u=.99:u<=-1&&(u=-.99);var d=c*u,f=Math.cos(l+t.a.v)*d+o[0],p=Math.sin(l+t.a.v)*d+o[1];i=a.createRadialGradient(f,p,0,o[0],o[1],c)}var m,h=e.g.p,g=t.g.c,_=1;for(m=0;ma&&c===`xMidYMid slice`||ii&&s===`meet`||ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:l===`xMax`&&(ai&&s===`slice`)?this.transformCanvas.tx=(n-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,u===`YMid`&&(a>i&&s===`meet`||ai&&s===`meet`||a=0;--e)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},Q.prototype.renderFrame=function(e,t){if(!(this.renderedFrame===e&&this.renderConfig.clearCanvas===!0&&!t||this.destroyed||e===-1)){this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n,r=this.layers.length;for(this.completeLayers||this.checkLayers(e),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].prepareFrame(e-this.layers[n].st);if(this.globalData._mdf){for(this.renderConfig.clearCanvas===!0?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),n=r-1;n>=0;--n)(this.completeLayers||this.elements[n])&&this.elements[n].renderFrame();this.renderConfig.clearCanvas!==!0&&this.restore()}}},Q.prototype.buildItem=function(e){var t=this.elements;if(!(t[e]||this.layers[e].ty===99)){var n=this.createItem(this.layers[e],this,this.globalData);t[e]=n,n.initExpressions()}},Q.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},Q.prototype.hide=function(){this.animationItem.container.style.display=`none`},Q.prototype.show=function(){this.animationItem.container.style.display=`block`};function yr(){this.opacity=-1,this.transform=p(`float32`,16),this.fillStyle=``,this.strokeStyle=``,this.lineWidth=``,this.lineCap=``,this.lineJoin=``,this.miterLimit=``,this.id=Math.random()}function br(){this.stack=[],this.cArrPos=0,this.cTr=new qe;var e,t=15;for(e=0;e=0;--t)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},xr.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;--e)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},xr.prototype.createComp=function(e){return new xr(e,this.globalData,this)};function Sr(e,t){this.animationItem=e,this.renderConfig={clearCanvas:t&&t.clearCanvas!==void 0?t.clearCanvas:!0,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||`xMidYMid meet`,imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||`xMidYMid slice`,contentVisibility:t&&t.contentVisibility||`visible`,className:t&&t.className||``,id:t&&t.id||``,runExpressions:!t||t.runExpressions===void 0||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new br,this.elements=[],this.pendingElements=[],this.transformMat=new qe,this.completeLayers=!1,this.rendererType=`canvas`,this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}return u([Q],Sr),Sr.prototype.createComp=function(e){return new xr(e,this.globalData,this)},ge(`canvas`,Sr),Y.registerModifier(`tm`,dt),Y.registerModifier(`pb`,ft),Y.registerModifier(`rp`,mt),Y.registerModifier(`rd`,ht),Y.registerModifier(`zz`,Nt),Y.registerModifier(`op`,Kt),K}))}))(),1);function Ft(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function It(e){let t=e.toLowerCase();return t.includes(`tgsticker`)||t.includes(`lottie`)||t.includes(`json`)}function Lt({row:e}){let t=(0,g.useRef)(null),n=(0,g.useRef)(null),[r,i]=(0,g.useState)(!It(e.MimeType));return(0,g.useEffect)(()=>{if(!It(e.MimeType)){i(!0);return}let r=!1;return x.emojiAnimation(e.DocumentID).then(e=>{r||!t.current||(n.current?.destroy(),n.current=Pt.default.loadAnimation({container:t.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(()=>i(!0)),()=>{r=!0,n.current?.destroy(),n.current=null}},[e.DocumentID,e.MimeType]),r?(0,U.jsx)(`div`,{className:`emoji-glyph`,children:e.Alt||`🙂`}):(0,U.jsx)(`div`,{className:`emoji-anim`,ref:t})}function Rt({row:e}){let{t}=W(),[n,r]=(0,g.useState)(!1);async function i(){try{await navigator.clipboard.writeText(e.DocumentID),r(!0),setTimeout(()=>r(!1),1200)}catch{}}return(0,U.jsxs)(`div`,{className:`emoji-card`,children:[(0,U.jsx)(`div`,{className:`emoji-preview`,children:(0,U.jsx)(Lt,{row:e})}),(0,U.jsxs)(`div`,{className:`emoji-meta`,children:[(0,U.jsx)(`span`,{className:`emoji-alt`,children:e.Alt||`—`}),(0,U.jsxs)(`button`,{className:`emoji-id`,type:`button`,onClick:i,title:t(`emoji.copyID`),children:[(0,U.jsx)(`span`,{className:`mono`,children:e.DocumentID}),n?(0,U.jsx)(L,{size:12}):(0,U.jsx)(te,{size:12})]}),(0,U.jsxs)(`span`,{className:`emoji-sub`,children:[e.SetTitle||t(`emoji.noSet`),` · `,Ft(e.Size)]})]})]})}function zt(){let{t:e}=W(),[t,n]=(0,g.useState)(``),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(0),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(``);async function d(e=!1){c(!0),u(``);let n=new URLSearchParams;t.trim()?n.set(`q`,t.trim()):e&&n.set(`before_id`,String(a));try{let e=await x.emoji(n);i(e),o(e.next_before_id)}catch(e){u(b(e))}finally{c(!1)}}(0,g.useEffect)(()=>{d(!1)},[]);let f=r?.rows??[];return(0,U.jsxs)(ot,{title:e(`emoji.pageTitle`),eyebrow:r?.listing===!1?e(`emoji.queryResults`):e(`emoji.recent`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>d(!1),disabled:s,children:[(0,U.jsx)(ge,{size:15}),` `,e(`common.refresh`)]}),children:[l&&(0,U.jsx)(lt,{children:l}),(0,U.jsx)(`div`,{className:`metric-row`,children:(0,U.jsx)(Y,{label:e(`emoji.currentPage`),value:String(f.length)})}),(0,U.jsx)(st,{children:(0,U.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),d(!1)},children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),placeholder:e(`emoji.searchPlaceholder`)})]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:s,children:[s?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(_e,{size:15}),` `,e(`common.search`)]}),r?.listing&&r.has_more&&(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>d(!0),disabled:s,children:[(0,U.jsx)(z,{size:15}),` `,e(`messages.nextPage`)]})]})}),(0,U.jsx)(`p`,{className:`about-text`,children:e(`emoji.hint`)}),f.length===0?(0,U.jsx)(`div`,{className:`empty-panel`,children:e(`common.noResults`)}):(0,U.jsx)(`div`,{className:`emoji-grid`,children:f.map(e=>(0,U.jsx)(Rt,{row:e},e.DocumentID))})]})}function Bt({navigate:e}){let{t}=W();return(0,U.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,U.jsxs)(`section`,{className:`overview-band`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,U.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,U.jsxs)(`div`,{className:`overview-metrics`,children:[(0,U.jsx)(ut,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,U.jsx)(ut,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,U.jsx)(ut,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,U.jsxs)(`div`,{className:`command-grid`,children:[(0,U.jsx)(Vt,{icon:(0,U.jsx)(ke,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,U.jsx)(Vt,{icon:(0,U.jsx)(xe,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,U.jsx)(Vt,{icon:(0,U.jsx)(V,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,U.jsxs)(`section`,{className:`work-strip`,children:[(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(k,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(ce,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(ee,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,U.jsxs)(`div`,{className:`strip-item`,children:[(0,U.jsx)(ie,{size:16}),(0,U.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function Vt({icon:e,title:t,text:n,href:r,navigate:i}){return(0,U.jsxs)(K,{className:`launcher`,href:r,navigate:i,children:[(0,U.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,U.jsxs)(`span`,{className:`launcher-copy`,children:[(0,U.jsx)(`strong`,{children:t}),(0,U.jsx)(`span`,{children:n})]}),(0,U.jsx)(z,{size:16})]})}function Ht({channelID:e,msgID:t,navigate:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,U.jsx)(lt,{children:o});if(!i)return(0,U.jsx)(pt,{label:r(`common.loading`)});let l=i.Message;return(0,U.jsx)(ot,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,U.jsx)(N,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:rt(l.Date)})})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,U.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,U.jsx)(J,{children:r(`common.survived`)}),l.Pinned&&(0,U.jsx)(J,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,U.jsx)(J,{children:r(`messages.channelPost`)}),(0,U.jsxs)(J,{children:[`pts `,l.PTS]})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(X,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,U.jsx)(X,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,U.jsx)(X,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,U.jsx)(X,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,U.jsx)(mt,{value:i.MessageJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,U.jsx)(mt,{value:i.ChannelJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.count`)}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.messageId`)}),(0,U.jsx)(`th`,{children:r(`common.sender`)}),(0,U.jsx)(`th`,{children:r(`common.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.PTSCount}),(0,U.jsx)(`td`,{children:e.Type}),(0,U.jsx)(`td`,{children:e.MessageID}),(0,U.jsx)(`td`,{children:e.SenderUserID}),(0,U.jsx)(`td`,{children:rt(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,U.jsx)(ft,{colSpan:6})]})]})})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.eventJson`)}),(0,U.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,U.jsx)(mt,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,U.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function Ut({label:e,value:t,onChange:n}){let{t:r}=W(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,U.jsxs)(`div`,{className:`entity-picker`,children:[(0,U.jsxs)(`div`,{className:`picker-head`,children:[(0,U.jsx)(`span`,{children:e}),t?(0,U.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,U.jsx)(Ae,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,U.jsxs)(`div`,{className:`selected-entity`,children:[(0,U.jsx)(L,{size:15}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:et(t)}),(0,U.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,U.jsx)(`span`,{children:$e(t.Username)||Qe(t.Phone)||`-`})]}):null,(0,U.jsxs)(`div`,{className:`picker-search`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,U.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,U.jsx)(`div`,{className:`picker-error`,children:u}),(0,U.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,U.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,U.jsx)(`span`,{className:`mono`,children:e.ID}),(0,U.jsx)(`strong`,{children:et(e)}),(0,U.jsx)(`span`,{children:$e(e.Username)||Qe(e.Phone)||`-`}),e.Verified?(0,U.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,U.jsx)(J,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,U.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function Wt({label:e,value:t,onChange:n}){let{t:r}=W(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,U.jsxs)(`div`,{className:`entity-picker`,children:[(0,U.jsxs)(`div`,{className:`picker-head`,children:[(0,U.jsx)(`span`,{children:e}),t?(0,U.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,U.jsx)(Ae,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,U.jsxs)(`div`,{className:`selected-entity`,children:[(0,U.jsx)(L,{size:15}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:t.Title||`-`}),(0,U.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,U.jsx)(`span`,{children:$e(t.Username)||tt(t,r)})]}):null,(0,U.jsxs)(`div`,{className:`picker-search`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,U.jsx)(A,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,U.jsx)(`div`,{className:`picker-error`,children:u}),(0,U.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,U.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,U.jsx)(`span`,{className:`mono`,children:e.ID}),(0,U.jsx)(`strong`,{children:e.Title||`-`}),(0,U.jsx)(`span`,{children:$e(e.Username)||tt(e,r)}),e.Verified?(0,U.jsx)(J,{tone:`good`,children:r(`picker.verified`)}):(0,U.jsx)(J,{children:tt(e,r)})]},e.ID)),o.length===0&&!c?(0,U.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function Gt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,U.jsxs)(ot,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,U.jsx)(lt,{children:f}),(0,U.jsxs)(st,{children:[(0,U.jsx)(`div`,{className:`message-selector-grid single`,children:(0,U.jsx)(Wt,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,U.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,U.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,U.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,U.jsx)(_e,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,U.jsx)(z,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(Y,{label:t(`messages.currentPage`),value:String(_.length)}),(0,U.jsx)(Y,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,U.jsx)(Y,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,U.jsx)(Y,{label:t(`messages.channelGroup`),value:n?`${n.Title||tt(n,t)} (${n.ID})`:`-`})]}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`common.messageId`)}),(0,U.jsx)(`th`,{children:t(`common.time`)}),(0,U.jsx)(`th`,{children:t(`common.sender`)}),(0,U.jsx)(`th`,{children:`From Peer`}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.views`)}),(0,U.jsx)(`th`,{children:t(`common.status`)}),(0,U.jsx)(`th`,{children:t(`messages.body`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[_.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.ID}),(0,U.jsx)(`td`,{children:rt(n.Date)}),(0,U.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,U.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.ViewsCount}),(0,U.jsx)(`td`,{children:n.Deleted?(0,U.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,U.jsx)(J,{tone:`warn`,children:t(`messages.pinned`)}):(0,U.jsx)(J,{children:t(`common.survived`)})}),(0,U.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,U.jsx)(z,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,U.jsx)(ft,{colSpan:9})]})]})})]})}function Kt({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,U.jsx)(lt,{children:o});if(!i)return(0,U.jsx)(pt,{label:r(`common.loading`)});let l=i.Message;return(0,U.jsx)(ot,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,U.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,U.jsx)(N,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,U.jsx)(ct,{main:(0,U.jsxs)(`div`,{className:`stacked-sections`,children:[(0,U.jsxs)(`section`,{className:`entity-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,U.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:rt(l.Date)})})]}),(0,U.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,U.jsx)(J,{tone:`danger`,children:r(`common.deleted`)}):(0,U.jsx)(J,{children:r(`common.survived`)}),(0,U.jsxs)(J,{children:[`pts `,l.PTS]}),(0,U.jsx)(J,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,U.jsxs)(`div`,{className:`summary-grid`,children:[(0,U.jsx)(X,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,U.jsx)(X,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,U.jsx)(X,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,U.jsx)(X,{label:r(`common.time`),value:rt(l.Date)})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,U.jsx)(mt,{value:i.MessageJSON})]}),(0,U.jsxs)(`div`,{className:`raw-grid`,children:[(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,U.jsx)(mt,{value:i.DialogJSON})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,U.jsx)(mt,{value:i.PrivateJSON})]})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.count`)}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.time`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.PTSCount}),(0,U.jsx)(`td`,{children:e.Type}),(0,U.jsx)(`td`,{children:rt(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,U.jsx)(ft,{colSpan:4})]})]})})]}),(0,U.jsxs)(`section`,{className:`section-block`,children:[(0,U.jsx)(q,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`ID`}),(0,U.jsx)(`th`,{children:r(`account.userID`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:r(`common.type`)}),(0,U.jsx)(`th`,{children:r(`common.status`)}),(0,U.jsx)(`th`,{children:r(`messages.attempts`)}),(0,U.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,U.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:e.ID}),(0,U.jsx)(`td`,{children:e.TargetUserID}),(0,U.jsx)(`td`,{children:e.PTS}),(0,U.jsx)(`td`,{children:e.EventType}),(0,U.jsx)(`td`,{children:e.Status}),(0,U.jsx)(`td`,{children:e.Attempts}),(0,U.jsx)(`td`,{children:nt(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,U.jsx)(ft,{colSpan:7})]})]})})]})]}),side:(0,U.jsxs)(`section`,{className:`action-dock`,children:[(0,U.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,U.jsx)(_t,{label:r(`messages.deleteThis`),icon:(0,U.jsx)(Ee,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function qt({navigate:e}){let{t}=W(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,S]=(0,g.useState)(``),[C,w]=(0,g.useState)(`1`),[T,E]=(0,g.useState)(null),[D,O]=(0,g.useState)(``);async function k(e=!1){if(O(``),!n||!i){O(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&T?.rows.length){let e=T.rows[T.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{E(await x.messages(r))}catch(e){O(b(e))}}function A(e){r(e),s(``),l(``),E(null)}function j(e){a(e),s(``),l(``),E(null)}return(0,U.jsxs)(ot,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[D&&(0,U.jsx)(lt,{children:D}),(0,U.jsxs)(st,{children:[(0,U.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,U.jsx)(Ut,{label:t(`messages.ownerUser`),value:n,onChange:A}),(0,U.jsx)(Ut,{label:t(`messages.peerUser`),value:i,onChange:j})]}),(0,U.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),k(!1)},children:[(0,U.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,U.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,U.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,U.jsx)(_e,{size:15}),` `,t(`messages.searchMessages`)]}),T?.rows.length?(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>k(!0),children:[(0,U.jsx)(z,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,U.jsxs)(`div`,{className:`metric-row`,children:[(0,U.jsx)(Y,{label:t(`messages.currentPage`),value:String(T?.rows.length??0)}),(0,U.jsx)(Y,{label:t(`messages.deleted`),value:String((T?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,U.jsx)(Y,{label:t(`messages.outgoing`),value:String((T?.rows??[]).filter(e=>e.Outgoing).length)}),(0,U.jsx)(Y,{label:t(`messages.ownerPeer`),value:n&&i?`${et(n)} / ${et(i)}`:`-`})]}),(0,U.jsxs)(`div`,{className:`operation-row`,children:[(0,U.jsxs)(`div`,{className:`operation-box`,children:[(0,U.jsxs)(`div`,{className:`operation-title`,children:[(0,U.jsx)(Ee,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,U.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,U.jsx)(_t,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:at(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,U.jsxs)(`div`,{className:`operation-box`,children:[(0,U.jsxs)(`div`,{className:`operation-title`,children:[(0,U.jsx)(se,{size:15}),` `,t(`messages.clearHistory`)]}),(0,U.jsx)(`input`,{value:y,onChange:e=>S(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,U.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,U.jsxs)(`label`,{className:`checkline`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,U.jsx)(_t,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:it(y),max_batches:it(C),just_clear:_,revoke:m})})]})]}),(0,U.jsx)(`div`,{className:`table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:t(`common.messageId`)}),(0,U.jsx)(`th`,{children:t(`common.time`)}),(0,U.jsx)(`th`,{children:t(`common.sender`)}),(0,U.jsx)(`th`,{children:t(`messages.direction`)}),(0,U.jsx)(`th`,{children:`PTS`}),(0,U.jsx)(`th`,{children:t(`common.status`)}),(0,U.jsx)(`th`,{children:t(`messages.body`)}),(0,U.jsx)(`th`,{})]})}),(0,U.jsxs)(`tbody`,{children:[T?.rows.map(n=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,U.jsx)(`td`,{children:rt(n.Date)}),(0,U.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,U.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,U.jsx)(`td`,{children:n.PTS}),(0,U.jsx)(`td`,{children:n.Deleted?(0,U.jsx)(J,{tone:`danger`,children:t(`common.deleted`)}):(0,U.jsx)(J,{children:t(`common.survived`)})}),(0,U.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,U.jsx)(z,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!T||T.rows.length===0)&&(0,U.jsx)(ft,{colSpan:8})]})]})})]})}var Jt=0,Yt=e=>`${e}-${++Jt}`,Xt=[{center:`#6f5bea`,edge:`#34278f`,pattern:`#a89df5`,text:`#ffffff`},{center:`#32a86b`,edge:`#17613e`,pattern:`#8ee0b3`,text:`#ffffff`},{center:`#df8d2f`,edge:`#8c421e`,pattern:`#ffd08a`,text:`#ffffff`},{center:`#d95878`,edge:`#7b2944`,pattern:`#f5a1b6`,text:`#ffffff`}];function Zt(e){if(!e.length)return e;let t=Math.floor(1e3/e.length),n=1e3%e.length;return e.map((e,r)=>({...e,rarity:String(t+ +(r({key:Yt(e),name:``,rarity:`1`,sortOrder:String(t),file:null,animation:null,fileError:``});function $t(e){let t=e.reduce((e,t)=>{let n=Number(t.backdropID);return Number.isInteger(n)?Math.max(e,n):e},0)+1,n=Xt[e.length%Xt.length];return{key:Yt(`backdrop`),name:``,backdropID:String(t),rarity:`1`,sortOrder:String(e.length),...n}}var en=e=>Zt([Qt(e,0),Qt(e,1)]),tn=()=>{let e=$t([]);return Zt([e,$t([e])])};function nn({data:e,compact:t=!1}){let n=(0,g.useRef)(null);return(0,g.useEffect)(()=>{if(!n.current)return;let t=Pt.default.loadAnimation({container:n.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)});return()=>t.destroy()},[e]),(0,U.jsx)(`div`,{className:`collectible-animation ${t?`compact`:``}`,ref:n})}function rn({giftID:e,attribute:t}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let n=!1;return a(!1),x.giftCollectibleAnimation(e,t.kind,t.id).then(e=>{n||r(e)}).catch(()=>{n||a(!0)}),()=>{n=!0}},[e,t.id,t.kind]),i?(0,U.jsx)(`div`,{className:`collectible-animation compact failed`,children:`!`}):n?(0,U.jsx)(nn,{data:n,compact:!0}):(0,U.jsx)(`div`,{className:`collectible-animation compact loading`,children:(0,U.jsx)(A,{className:`spin`,size:15})})}async function an(e){let t=new Uint8Array(await e.arrayBuffer()),n=t;if(t.length>=2&&t[0]===31&&t[1]===139){if(!(`DecompressionStream`in window))throw Error(`This browser cannot preview TGS files`);let e=new Blob([t]).stream().pipeThrough(new DecompressionStream(`gzip`));n=new Uint8Array(await new Response(e).arrayBuffer())}let r=JSON.parse(new TextDecoder().decode(n));if(!r||typeof r!=`object`||Array.isArray(r))throw Error(`Invalid Lottie JSON`);return r}var on=e=>Number.parseInt(e.replace(`#`,``),16),sn=e=>e.rarity_kind===`permille`?`${e.rarity_permille}‰`:e.rarity_kind;function cn({gift:e,onClose:t,onPublished:n}){let{t:r}=W(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(!0),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(`100`),[_,v]=(0,g.useState)(`1000`),[y,S]=(0,g.useState)(`gift-${e.GiftID}`),[C,w]=(0,g.useState)(``),[T,E]=(0,g.useState)(()=>en(`model`)),[D,O]=(0,g.useState)(()=>en(`pattern`)),[j,N]=(0,g.useState)(tn);(0,g.useEffect)(()=>{let t=!1;return x.giftCollectibles(e.GiftID).then(n=>{t||(a(n),n.found&&(h(String(n.upgrade_stars??100)),v(String(n.supply_total??1e3)),S(n.slug_prefix??`gift-${e.GiftID}`)))}).catch(e=>d(b(e))).finally(()=>{t||s(!1)}),()=>{t=!0}},[e.GiftID]);let P=(0,g.useMemo)(()=>({models:T.reduce((e,t)=>e+Number(t.rarity||0),0),patterns:D.reduce((e,t)=>e+Number(t.rarity||0),0),backdrops:j.reduce((e,t)=>e+Number(t.rarity||0),0)}),[T,D,j]),F=()=>p(null),I=(e,t,n)=>{(e===`models`?E:O)(e=>e.map(e=>e.key===t?{...e,...n}:e)),F()};async function L(e,t,n){if(I(e,t.key,{file:n,animation:null,fileError:``}),n)try{let r=await an(n);I(e,t.key,{animation:r,fileError:``})}catch(n){I(e,t.key,{animation:null,fileError:b(n)})}}function R(e,t=``){if(!C.trim())throw Error(r(`action.reasonRequired`));if(T.length<2||D.length<2||j.length<2)throw Error(r(`collectibles.minimumAttributes`));let n=j.map(e=>Number(e.backdropID));if(new Set(n).size!==n.length)throw Error(r(`collectibles.duplicateBackdropID`));for(let e of[...T,...D])if(!e.file)throw Error(r(`collectibles.fileRequired`));let i=new FormData,a=e=>e.map(e=>({name:e.name.trim(),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),file_key:e.key}));i.set(`metadata`,JSON.stringify({command_id:t,reason:C.trim(),confirm:e,upgrade_stars:m,supply_total:Number(_),slug_prefix:y.trim().toLowerCase(),models:a(T),patterns:a(D),backdrops:j.map(e=>({name:e.name.trim(),backdrop_id:Number(e.backdropID),rarity_permille:Number(e.rarity),sort_order:Number(e.sortOrder),center_color:on(e.center),edge_color:on(e.edge),pattern_color:on(e.pattern),text_color:on(e.text)}))}));for(let e of[...T,...D])i.set(e.key,e.file,e.file.name);return i}async function z(){l(!0),d(``),p(null);try{p(await x.publishGiftCollectibles(e.GiftID,R(!1)))}catch(e){d(b(e))}finally{l(!1)}}async function ee(){if(f){l(!0),d(``);try{await x.publishGiftCollectibles(e.GiftID,R(!0,f.command_id)),n(),t()}catch(e){d(b(e))}finally{l(!1)}}}let te=(e,t,n)=>(0,U.jsxs)(`section`,{className:`collectible-section`,children:[(0,U.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.${e}`)}),(0,U.jsx)(`span`,{children:r(`collectibles.rarityHint`)})]}),(0,U.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,U.jsxs)(J,{tone:P[e]>0?`good`:`neutral`,children:[P[e],`‰`]}),(0,U.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{n(Zt([...t,Qt(e===`models`?`model`:`pattern`,t.length)])),F()},children:[(0,U.jsx)(he,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,U.jsx)(`div`,{className:`collectible-rows`,children:t.map((i,a)=>(0,U.jsxs)(`div`,{className:`collectible-row animated`,children:[(0,U.jsx)(`div`,{className:`collectible-row-index`,children:a+1}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`common.name`)}),(0,U.jsx)(`input`,{value:i.name,maxLength:128,onChange:t=>I(e,i.key,{name:t.target.value})})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:i.rarity,onChange:t=>I(e,i.key,{rarity:t.target.value})})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:i.sortOrder,onChange:t=>I(e,i.key,{sortOrder:t.target.value})})]}),(0,U.jsxs)(`label`,{className:`collectible-file`,children:[(0,U.jsx)(`span`,{children:r(`gifts.animation`)}),(0,U.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:t=>void L(e,i,t.target.files?.[0]??null)}),(0,U.jsxs)(`em`,{children:[(0,U.jsx)(re,{size:13}),i.file?.name??r(`gifts.chooseFile`)]})]}),(0,U.jsx)(`div`,{className:`collectible-inline-preview`,children:i.animation?(0,U.jsx)(nn,{data:i.animation,compact:!0}):(0,U.jsx)(M,{size:16})}),(0,U.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:t.length<=2,onClick:()=>{n(Zt(t.filter(e=>e.key!==i.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,U.jsx)(Ee,{size:14})}),i.fileError&&(0,U.jsx)(`span`,{className:`collectible-file-error`,children:i.fileError})]},i.key))})]});return(0,gt.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal collectible-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`collectibles.title`,{id:e.GiftID}),children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:r(`collectibles.eyebrow`)}),(0,U.jsx)(`h2`,{children:r(`collectibles.title`,{id:e.GiftID})}),(0,U.jsx)(`p`,{children:e.Title||`Gift #${e.GiftID}`})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:t,disabled:c,"aria-label":r(`action.close`),children:(0,U.jsx)(Ae,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body collectible-modal-body`,children:[o?(0,U.jsxs)(`div`,{className:`collectible-loading`,children:[(0,U.jsx)(A,{className:`spin`}),r(`common.loading`)]}):i?.found?(0,U.jsxs)(`section`,{className:`collectible-active`,children:[(0,U.jsxs)(`div`,{className:`collectible-active-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(ae,{size:18}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.activeRevision`,{revision:i.revision??0})}),(0,U.jsxs)(`span`,{children:[i.slug_prefix,` · ⭐ `,i.upgrade_stars,` · `,i.issued,` / `,i.supply_total]})]})]}),(0,U.jsx)(J,{tone:`good`,children:r(`collectibles.published`)})]}),(0,U.jsxs)(`div`,{className:`collectible-active-grid`,children:[[...i.models??[],...i.patterns??[]].map(t=>(0,U.jsxs)(`article`,{children:[(0,U.jsx)(rn,{giftID:e.GiftID,attribute:t}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`strong`,{children:[t.name,t.crafted&&(0,U.jsx)(J,{children:`crafted`})]}),(0,U.jsxs)(`span`,{children:[r(`collectibles.${t.kind}`),` · `,sn(t)]})]})]},`${t.kind}-${t.id}`)),(i.backdrops??[]).map(e=>(0,U.jsxs)(`article`,{children:[(0,U.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, #${(e.center_color??0).toString(16).padStart(6,`0`)}, #${(e.edge_color??0).toString(16).padStart(6,`0`)})`,color:`#${(e.text_color??16777215).toString(16).padStart(6,`0`)}`},children:`Aa`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e.name}),(0,U.jsxs)(`span`,{children:[r(`collectibles.backdrop`),` · `,sn(e)]})]})]},`backdrop-${e.id}`))]})]}):(0,U.jsxs)(`div`,{className:`collectible-empty`,children:[(0,U.jsx)(ae,{size:22}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.noPool`)}),(0,U.jsx)(`span`,{children:r(`collectibles.noPoolHint`)})]})]}),(0,U.jsxs)(`section`,{className:`collectible-definition`,children:[(0,U.jsxs)(`div`,{className:`collectible-definition-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.publishNew`)}),(0,U.jsx)(`span`,{children:r(`collectibles.immutableHint`)})]}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,U.jsx)(`span`,{children:`TGS`}),(0,U.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,U.jsxs)(`div`,{className:`gift-fields-grid collectible-main-fields`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.upgradeStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:m,onChange:e=>{h(e.target.value),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.supply`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:_,onChange:e=>{v(e.target.value),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.slug`)}),(0,U.jsx)(`input`,{value:y,maxLength:48,onChange:e=>{S(e.target.value.toLowerCase()),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.reason`)}),(0,U.jsx)(`input`,{value:C,maxLength:1e3,placeholder:r(`gifts.reasonPlaceholder`),onChange:e=>w(e.target.value)})]})]}),te(`models`,T,E),te(`patterns`,D,O),(0,U.jsxs)(`section`,{className:`collectible-section`,children:[(0,U.jsxs)(`div`,{className:`collectible-section-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.backdrops`)}),(0,U.jsx)(`span`,{children:r(`collectibles.colorHint`)})]}),(0,U.jsxs)(`div`,{className:`collectible-section-tools`,children:[(0,U.jsxs)(J,{tone:P.backdrops>0?`good`:`neutral`,children:[P.backdrops,`‰`]}),(0,U.jsxs)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>{N(Zt([...j,$t(j)])),F()},children:[(0,U.jsx)(he,{size:13}),r(`collectibles.addAttribute`)]})]})]}),(0,U.jsx)(`div`,{className:`collectible-rows`,children:j.map((e,t)=>(0,U.jsxs)(`div`,{className:`collectible-row backdrop`,children:[(0,U.jsx)(`div`,{className:`collectible-row-index`,children:t+1}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`common.name`)}),(0,U.jsx)(`input`,{value:e.name,maxLength:128,onChange:t=>{N(j.map(n=>n.key===e.key?{...n,name:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.backdropID`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,value:e.backdropID,onChange:t=>{N(j.map(n=>n.key===e.key?{...n,backdropID:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`collectibles.rarity`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:`1000`,value:e.rarity,onChange:t=>{N(j.map(n=>n.key===e.key?{...n,rarity:t.target.value}:n)),F()}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:r(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:e.sortOrder,onChange:t=>{N(j.map(n=>n.key===e.key?{...n,sortOrder:t.target.value}:n)),F()}})]}),[`center`,`edge`,`pattern`,`text`].map(t=>(0,U.jsxs)(`label`,{className:`collectible-color`,children:[(0,U.jsx)(`span`,{children:r(`collectibles.color.${t}`)}),(0,U.jsx)(`input`,{type:`color`,value:e[t],onChange:n=>{N(j.map(r=>r.key===e.key?{...r,[t]:n.target.value}:r)),F()}})]},t)),(0,U.jsx)(`div`,{className:`collectible-backdrop-preview`,style:{background:`radial-gradient(circle, ${e.center}, ${e.edge})`,color:e.text},children:`Aa`}),(0,U.jsx)(`button`,{className:`icon-btn danger`,type:`button`,disabled:j.length<=2,onClick:()=>{N(Zt(j.filter(t=>t.key!==e.key))),F()},"aria-label":r(`collectibles.remove`),children:(0,U.jsx)(Ee,{size:14})})]},e.key))})]})]}),u&&(0,U.jsx)(lt,{children:u}),f&&(0,U.jsxs)(`div`,{className:`gift-validation`,children:[(0,U.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,U.jsx)(k,{size:17}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:r(`collectibles.validationReady`)}),(0,U.jsx)(`span`,{children:r(`collectibles.validationHint`)})]})]}),(0,U.jsx)(`pre`,{children:JSON.stringify(f.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:t,disabled:c,children:r(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:z,disabled:c,children:[c?(0,U.jsx)(A,{className:`spin`,size:15}):(0,U.jsx)(xe,{size:15}),r(`gifts.validate`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:ee,disabled:c||!f,children:[(0,U.jsx)(De,{size:15}),r(`collectibles.publish`)]})]})]})}),document.body)}function ln(e){return e.model_count+e.pattern_count+e.backdrop_count}function un(e){let t=Number(e);return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function dn({giftID:e,revision:t,compact:n=!1}){let r=(0,g.useRef)(null),i=(0,g.useRef)(null),[a,o]=(0,g.useState)(!0),[s,c]=(0,g.useState)(``);(0,g.useEffect)(()=>{let t=!1;return x.giftAnimation(e).then(e=>{t||!r.current||(i.current?.destroy(),i.current=Pt.default.loadAnimation({container:r.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(e=>c(b(e))),()=>{t=!0,i.current?.destroy(),i.current=null}},[e,t]);function l(){i.current&&(a?i.current.pause():i.current.play(),o(!a))}return(0,U.jsxs)(`div`,{className:`gift-animation-shell ${n?`compact`:``}`,children:[(0,U.jsx)(`div`,{className:`gift-animation`,ref:r,children:s&&(0,U.jsx)(`span`,{children:s})}),(0,U.jsx)(`button`,{className:`gift-play`,type:`button`,onClick:l,"aria-label":a?`Pause`:`Play`,children:a?(0,U.jsx)(pe,{size:14}):(0,U.jsx)(me,{size:14})})]})}function fn({sourceGiftID:e}){let t=(0,g.useRef)(null);return(0,g.useEffect)(()=>{let n=!1,r=null;return x.officialGiftAnimation(e).then(e=>{n||!t.current||(r=Pt.default.loadAnimation({container:t.current,renderer:`canvas`,loop:!0,autoplay:!0,animationData:structuredClone(e)}))}).catch(()=>void 0),()=>{n=!0,r?.destroy()}},[e]),(0,U.jsx)(`div`,{className:`gift-animation-shell`,children:(0,U.jsx)(`div`,{className:`gift-animation`,ref:t})})}function pn(){let{t:e}=W(),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(!1),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(`official`),[p,m]=(0,g.useState)([]),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(!0),[E,D]=(0,g.useState)(`0`),[O,j]=(0,g.useState)(`0`),[M,N]=(0,g.useState)(``),[P,F]=(0,g.useState)(`0`),[I,L]=(0,g.useState)(``),[R,z]=(0,g.useState)(`50`),[ee,te]=(0,g.useState)(`50`),[ne,ie]=(0,g.useState)(`0`),[oe,se]=(0,g.useState)(!0),[ce,le]=(0,g.useState)(``),[B,ue]=(0,g.useState)(null),[V,de]=(0,g.useState)(!1),[fe,pe]=(0,g.useState)(``),[me,ve]=(0,g.useState)(``);async function ye(){pe(``);try{n((await x.gifts()).Gifts??[])}catch(e){pe(b(e))}}(0,g.useEffect)(()=>{ye()},[]),(0,g.useEffect)(()=>{!a||d!==`official`||p.length>0||x.officialGifts().then(e=>m(e.gifts??[])).catch(e=>ve(b(e)))},[a,d,p.length]);let H=(0,g.useMemo)(()=>p.find(e=>e.source_gift_id===S)??null,[p,S]),be=(0,g.useMemo)(()=>({all:p.length,upgrade:p.filter(e=>e.can_upgrade).length,craft:p.filter(e=>e.can_craft).length,basic:p.filter(e=>!e.can_upgrade).length}),[p]),Se=(0,g.useMemo)(()=>{let e=h.trim().toLowerCase();return p.filter(t=>(v===`all`||v===`upgrade`&&t.can_upgrade||v===`craft`&&t.can_craft||v===`basic`&&!t.can_upgrade)&&(!e||t.source_gift_id.includes(e)||t.title.toLowerCase().includes(e)))},[p,h,v]),Ce=(0,g.useMemo)(()=>{let e=r.trim().toLowerCase();return e?t.filter(t=>String(t.GiftID).includes(e)||t.Title.toLowerCase().includes(e)||t.SourceFormat.toLowerCase().includes(e)):t},[t,r]);function we(t,n=``){if(!l)throw Error(e(`gifts.fileRequired`));if(!ce.trim())throw Error(e(`action.reasonRequired`));let r=new FormData;return r.set(`metadata`,JSON.stringify({command_id:n,reason:ce.trim(),confirm:t,gift_id:P,title:I.trim(),stars:R,convert_stars:ee,enabled:oe,sort_order:Number(ne)})),r.set(`file`,l,l.name),r}function Te(t,n=``){if(!S)throw Error(e(`gifts.officialRequired`));if(!ce.trim())throw Error(e(`action.reasonRequired`));return{command_id:n,reason:ce.trim(),confirm:t,source_gift_id:S,gift_id:P,title:I.trim(),stars:R,convert_stars:ee,enabled:oe,sort_order:Number(ne),include_collectible:w,upgrade_stars:E,supply_total:Number(O),slug_prefix:M.trim().toLowerCase()}}function Ee(t){C(t.source_gift_id),L(t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})),z(String(t.stars)),te(String(t.convert_stars)),T(t.can_upgrade),D(t.upgrade_stars),j(String(t.availability_total||1)),N(`official-${t.source_gift_id}`),ue(null)}async function Oe(){de(!0),ve(``),ue(null);try{ue(d===`official`?await x.importOfficialGift(Te(!1)):await x.importGift(we(!1)))}catch(e){ve(b(e))}finally{de(!1)}}async function ke(){if(B){de(!0),ve(``);try{d===`official`?await x.importOfficialGift(Te(!0,B.command_id)):await x.importGift(we(!0,B.command_id)),ue(null),u(null),F(`0`),L(``),C(``),await ye(),o(!1)}catch(e){ve(b(e))}finally{de(!1)}}}function je(){F(`0`),L(``),z(`50`),te(`50`),ie(`0`),se(!0),le(``),u(null),ue(null),ve(``),f(`official`),C(``),_(``),y(`all`),o(!0)}function Me(e){F(e.GiftID),L(e.Title),z(String(e.Stars)),te(String(e.ConvertStars)),ie(String(e.SortOrder)),se(e.Enabled),le(``),u(null),ue(null),ve(``),f(`official`),C(``),_(``),y(`all`),o(!0)}return(0,U.jsxs)(ot,{title:e(`gifts.pageTitle`),eyebrow:e(`gifts.eyebrow`),actions:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>ye(),disabled:V,children:[(0,U.jsx)(ge,{size:15}),` `,e(`common.refresh`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:je,children:[(0,U.jsx)(he,{size:15}),` `,e(`gifts.add`)]})]}),children:[fe&&(0,U.jsx)(lt,{children:fe}),(0,U.jsxs)(`div`,{className:`metric-row gift-metrics`,children:[(0,U.jsx)(Y,{label:e(`gifts.total`),value:String(t.length)}),(0,U.jsx)(Y,{label:e(`gifts.enabled`),value:String(t.filter(e=>e.Enabled).length),tone:`good`}),(0,U.jsx)(Y,{label:e(`gifts.received`),value:t.reduce((e,t)=>e+BigInt(t.ReceivedCount),0n).toString()}),(0,U.jsx)(Y,{label:e(`gifts.formats`),value:`TGS / Lottie`})]}),(0,U.jsx)(st,{children:(0,U.jsxs)(`div`,{className:`toolbar`,children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:e(`gifts.searchPlaceholder`)})]}),(0,U.jsx)(`span`,{className:`gift-list-summary`,children:e(`gifts.listSummary`,{shown:Ce.length,total:t.length})})]})}),(0,U.jsx)(`div`,{className:`table-wrap gift-table-wrap`,children:(0,U.jsxs)(`table`,{className:`data-table gift-table`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:e(`gifts.animation`)}),(0,U.jsx)(`th`,{children:e(`gifts.idRevision`)}),(0,U.jsx)(`th`,{children:e(`gifts.title`)}),(0,U.jsx)(`th`,{children:e(`gifts.price`)}),(0,U.jsx)(`th`,{children:e(`gifts.source`)}),(0,U.jsx)(`th`,{children:e(`gifts.received`)}),(0,U.jsx)(`th`,{children:e(`common.status`)}),(0,U.jsx)(`th`,{children:e(`common.updatedAt`)}),(0,U.jsx)(`th`,{children:e(`common.actions`)})]})}),(0,U.jsxs)(`tbody`,{children:[Ce.map(t=>(0,U.jsxs)(`tr`,{className:t.Enabled?``:`gift-row-disabled`,children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(dn,{giftID:t.GiftID,revision:t.Revision,compact:!0})}),(0,U.jsxs)(`td`,{className:`mono`,children:[t.GiftID,` / `,t.Revision]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`strong`,{className:`gift-table-title`,children:t.Title||`Gift #${t.GiftID}`}),(0,U.jsxs)(`span`,{className:`gift-sort-order`,children:[e(`gifts.sortOrder`),`: `,t.SortOrder]})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsxs)(`strong`,{className:`gift-table-price`,children:[`⭐ `,t.Stars]}),(0,U.jsxs)(`span`,{className:`gift-convert-price`,children:[`→ `,t.ConvertStars]})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(J,{children:t.SourceFormat}),(0,U.jsx)(`span`,{className:`gift-source-size`,children:un(t.AnimationSize)})]}),(0,U.jsx)(`td`,{children:t.ReceivedCount}),(0,U.jsx)(`td`,{children:(0,U.jsx)(J,{tone:t.Enabled?`good`:`neutral`,children:t.Enabled?e(`common.enabled`):e(`common.disabled`)})}),(0,U.jsx)(`td`,{children:nt(t.UpdatedAt)}),(0,U.jsx)(`td`,{children:(0,U.jsxs)(`div`,{className:`gift-table-actions`,children:[(0,U.jsxs)(`button`,{className:`btn compact-btn collectible-button`,type:`button`,onClick:()=>c(t),children:[(0,U.jsx)(ae,{size:13}),e(`collectibles.manage`)]}),(0,U.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:()=>Me(t),children:e(`gifts.replace`)}),(0,U.jsx)(_t,{compact:!0,tone:`neutral`,label:t.Enabled?e(`gifts.disable`):e(`gifts.enable`),path:`/api/actions/set-gift-enabled`,payload:()=>({gift_id:t.GiftID,enabled:!t.Enabled}),onDone:()=>void ye()})]})})]},t.GiftID)),Ce.length===0&&(0,U.jsx)(ft,{colSpan:9})]})]})}),a&&(0,gt.createPortal)((0,U.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,U.jsxs)(`section`,{className:`modal command-modal gift-import-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P}),children:[(0,U.jsxs)(`div`,{className:`modal-head`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`eyebrow`,children:e(`gifts.importEyebrow`)}),(0,U.jsx)(`h2`,{children:P===`0`?e(`gifts.importTitle`):e(`gifts.newRevision`,{id:P})})]}),(0,U.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>o(!1),disabled:V,"aria-label":e(`action.close`),children:(0,U.jsx)(Ae,{size:15})})]}),(0,U.jsxs)(`div`,{className:`command-body gift-import-modal-body`,children:[(0,U.jsxs)(`div`,{className:`command-steps`,children:[(0,U.jsxs)(`div`,{className:`command-step ${(d===`official`?S:l)?`done`:`active`}`,children:[(0,U.jsx)(`span`,{children:`1`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepDetails`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${B?`done`:(d===`official`?S:l)?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`2`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepValidate`)})]}),(0,U.jsxs)(`div`,{className:`command-step ${B?`active`:``}`,children:[(0,U.jsx)(`span`,{children:`3`}),(0,U.jsx)(`strong`,{children:e(`gifts.stepImport`)})]})]}),(0,U.jsxs)(`div`,{className:`gift-source-tabs`,children:[(0,U.jsx)(`button`,{className:`btn ${d===`official`?`primary`:``}`,type:`button`,onClick:()=>{f(`official`),ue(null)},children:e(`gifts.officialSource`)}),(0,U.jsx)(`button`,{className:`btn ${d===`file`?`primary`:``}`,type:`button`,onClick:()=>{f(`file`),ue(null)},children:e(`gifts.fileSource`)})]}),d===`official`?(0,U.jsxs)(`section`,{className:`official-gift-picker`,children:[(0,U.jsxs)(`div`,{className:`gift-import-note`,children:[(0,U.jsx)(`span`,{children:e(`gifts.officialHint`)}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,children:[(0,U.jsx)(`span`,{children:p.length}),(0,U.jsx)(`span`,{children:`SHA-256`})]})]}),(0,U.jsxs)(`div`,{className:`official-gift-tools`,children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:h,onChange:e=>_(e.target.value),placeholder:e(`gifts.officialSearch`)})]}),(0,U.jsx)(`span`,{children:e(`gifts.officialResults`,{shown:Se.length,total:p.length})})]}),(0,U.jsx)(`div`,{className:`official-gift-categories`,role:`group`,"aria-label":e(`gifts.officialCategoryLabel`),children:[`all`,`upgrade`,`craft`,`basic`].map(t=>(0,U.jsxs)(`button`,{className:v===t?`active`:``,type:`button`,"aria-pressed":v===t,onClick:()=>y(t),children:[e(`gifts.officialCategory.${t}`),(0,U.jsx)(`span`,{children:be[t]})]},t))}),(0,U.jsxs)(`div`,{className:`official-gift-list`,role:`listbox`,"aria-label":e(`gifts.officialSelect`),children:[Se.map(t=>{let n=t.source_gift_id===S;return(0,U.jsxs)(`button`,{className:`official-gift-option ${n?`selected`:``}`,type:`button`,role:`option`,"aria-selected":n,onClick:()=>Ee(t),children:[(0,U.jsxs)(`span`,{className:`official-gift-option-head`,children:[(0,U.jsx)(`strong`,{children:t.title||e(`gifts.officialUnnamed`,{id:t.source_gift_id})}),(0,U.jsxs)(`span`,{className:`mono`,children:[`#`,t.source_gift_id]})]}),(0,U.jsxs)(`span`,{className:`official-gift-option-meta`,children:[(0,U.jsxs)(`span`,{children:[`⭐ `,t.stars]}),(0,U.jsx)(`span`,{children:e(`gifts.officialAttributes`,{count:ln(t)})})]}),(0,U.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,U.jsx)(`span`,{className:t.can_upgrade?`yes`:`no`,children:t.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,U.jsx)(`span`,{className:t.can_craft?`craft`:`no`,children:t.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]},t.source_gift_id)}),Se.length===0&&(0,U.jsx)(`div`,{className:`official-gift-empty`,children:e(`gifts.officialEmpty`)})]}),H&&(0,U.jsxs)(`div`,{className:`official-gift-selected`,children:[(0,U.jsx)(fn,{sourceGiftID:H.source_gift_id}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:H.title||e(`gifts.officialUnnamed`,{id:H.source_gift_id})}),(0,U.jsx)(`span`,{className:`mono`,children:H.source_gift_id}),(0,U.jsxs)(`small`,{children:[H.model_count,` `,e(`collectibles.models`),` · `,H.pattern_count,` `,e(`collectibles.patterns`),` · `,H.backdrop_count,` `,e(`collectibles.backdrops`)]}),(0,U.jsxs)(`span`,{className:`official-gift-capabilities`,children:[(0,U.jsx)(`span`,{className:H.can_upgrade?`yes`:`no`,children:H.can_upgrade?e(`gifts.canUpgrade`):e(`gifts.cannotUpgrade`)}),(0,U.jsx)(`span`,{className:H.can_craft?`craft`:`no`,children:H.can_craft?e(`gifts.canCraft`):e(`gifts.cannotCraft`)})]})]})]}),H?.can_upgrade&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:w,onChange:e=>{T(e.target.checked),ue(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:e(`gifts.includeCollectible`)})]}),w&&(0,U.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.upgradeStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:E,onChange:e=>{D(e.target.value),ue(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.supply`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:O,onChange:e=>{j(e.target.value),ue(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`collectibles.slug`)}),(0,U.jsx)(`input`,{value:M,maxLength:48,onChange:e=>{N(e.target.value.toLowerCase()),ue(null)}})]})]})]})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`gift-import-note`,children:[(0,U.jsx)(`span`,{children:e(`gifts.importHint`)}),(0,U.jsxs)(`div`,{className:`gift-format-chips`,"aria-label":e(`gifts.formats`),children:[(0,U.jsx)(`span`,{children:`TGS`}),(0,U.jsx)(`span`,{children:`Lottie JSON`})]})]}),(0,U.jsxs)(`label`,{className:`gift-file-picker ${l?`has-file`:``}`,children:[(0,U.jsx)(`input`,{type:`file`,accept:`.tgs,.json,.lottie,application/json,application/x-tgsticker`,onChange:e=>{u(e.target.files?.[0]??null),ue(null)}}),(0,U.jsx)(`span`,{className:`gift-file-icon`,children:(0,U.jsx)(re,{size:22})}),(0,U.jsxs)(`span`,{className:`gift-file-copy`,children:[(0,U.jsx)(`span`,{className:`gift-field-label`,children:e(`gifts.animation`)}),(0,U.jsx)(`strong`,{children:l?l.name:e(`gifts.filePrompt`)}),(0,U.jsx)(`small`,{children:l?un(l.size):e(`gifts.fileHint`)})]}),(0,U.jsx)(`span`,{className:`gift-file-action`,children:e(l?`gifts.changeFile`:`gifts.chooseFile`)})]})]}),(0,U.jsxs)(`div`,{className:`gift-fields-grid`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.title`)}),(0,U.jsx)(`input`,{value:I,maxLength:128,placeholder:e(`gifts.titlePlaceholder`),onChange:e=>{L(e.target.value),ue(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.stars`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,value:R,onChange:e=>{z(e.target.value),ue(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.convertStars`)}),(0,U.jsx)(`input`,{type:`number`,min:`0`,value:ee,onChange:e=>{te(e.target.value),ue(null)}})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:e(`gifts.sortOrder`)}),(0,U.jsx)(`input`,{type:`number`,value:ne,onChange:e=>{ie(e.target.value),ue(null)}})]})]}),(0,U.jsxs)(`label`,{className:`gift-reason-field`,children:[(0,U.jsx)(`span`,{children:e(`gifts.reason`)}),(0,U.jsx)(`input`,{value:ce,placeholder:e(`gifts.reasonPlaceholder`),onChange:e=>le(e.target.value)})]}),(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:oe,onChange:e=>{se(e.target.checked),ue(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:e(`gifts.enableAfterImport`)})]}),me&&(0,U.jsx)(lt,{children:me}),B&&(0,U.jsxs)(`div`,{className:`gift-validation`,children:[(0,U.jsxs)(`div`,{className:`gift-validation-head`,children:[(0,U.jsx)(k,{size:17}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e(`gifts.validationReady`)}),(0,U.jsx)(`span`,{children:e(`gifts.validationHint`)})]})]}),(0,U.jsx)(`pre`,{children:JSON.stringify(B.details,null,2)})]})]}),(0,U.jsxs)(`div`,{className:`modal-actions`,children:[(0,U.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>o(!1),disabled:V,children:e(`common.close`)}),(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:Oe,disabled:V,children:[V?(0,U.jsx)(A,{className:`spin`,size:15}):(0,U.jsx)(xe,{size:15}),e(`gifts.validate`)]}),(0,U.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:ke,disabled:V||!B,children:[(0,U.jsx)(De,{size:15}),e(`gifts.confirmImport`)]})]})]})}),document.body),s&&(0,U.jsx)(cn,{gift:s,onClose:()=>c(null),onPublished:()=>void ye()})]})}var mn=`777000`;function hn(e){let t=e.rarity_permille>0?` · ${(e.rarity_permille/10).toFixed(1)}%`:``;return`${e.name||`#${e.id}`}${t}`}function gn({gift:e,onDone:t}){let{t:n}=W(),[r,i]=(0,g.useState)(`user`),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(mn),[d,f]=(0,g.useState)(``),[p,m]=(0,g.useState)(!1),[h,_]=(0,g.useState)(!1),[v,y]=(0,g.useState)(null),[S,C]=(0,g.useState)(``),[w,T]=(0,g.useState)(`0`),[E,D]=(0,g.useState)(`0`),[j,M]=(0,g.useState)(`0`),[N,P]=(0,g.useState)(``),[F,I]=(0,g.useState)(``),[L,R]=(0,g.useState)(null),[z,ee]=(0,g.useState)(``),[te,ne]=(0,g.useState)(!1),re=r===`user`?a?.ID??0:s?.ID??0,ie=r===`user`&&h;(0,g.useEffect)(()=>{_(!1),y(null),C(``),T(`0`),D(`0`),M(`0`),P(``),R(null),ee(``)},[e.GiftID]),(0,g.useEffect)(()=>{if(!ie||v)return;let t=!1;return C(``),x.giftCollectibles(e.GiftID).then(e=>{t||y(e)}).catch(e=>{t||C(b(e))}),()=>{t=!0}},[ie,v,e.GiftID]);function ae(t){let n=Number.parseInt(l.trim()||mn,10),i=Number.parseInt(N.trim(),10);return{gift_id:e.GiftID,sender_user_id:Number.isFinite(n)?n:0,user_id:r===`user`?re:0,channel_id:r===`channel`?re:0,hide_name:p,message:d.trim(),upgrade:ie,model_attribute_id:ie?w:`0`,pattern_attribute_id:ie?E:`0`,backdrop_attribute_id:ie?j:`0`,num:ie&&Number.isFinite(i)&&i>0?i:0,reason:F.trim(),confirm:t}}let se=(0,g.useMemo)(()=>ae(!1),[e.GiftID,r,re,l,d,p,h,w,E,j,N,F]),ce=L?.dry_run&&!L.error;async function le(e){if(re<=0){ee(n(`giveGift.recipientRequired`));return}if(!F.trim()){ee(n(`action.reasonRequired`));return}ne(!0),ee(``);try{let n=await x.action(`/api/actions/give-gift`,ae(e));R(n),e&&!n.error&&t?.()}catch(e){ee(b(e))}finally{ne(!1)}}return(0,U.jsxs)(`div`,{className:`give-gift-form`,children:[(0,U.jsxs)(`div`,{className:`give-gift-summary`,children:[(0,U.jsx)(oe,{size:16}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`strong`,{children:e.Title||`Gift #${e.GiftID}`}),(0,U.jsxs)(`span`,{className:`mono`,children:[`#`,e.GiftID,` · ⭐ `,e.Stars]})]})]}),(0,U.jsxs)(`div`,{className:`give-gift-tabs`,role:`group`,"aria-label":n(`giveGift.recipientKind`),children:[(0,U.jsxs)(`button`,{type:`button`,className:`btn ${r===`user`?`primary`:``}`,onClick:()=>{i(`user`),R(null)},children:[(0,U.jsx)(Oe,{size:15}),` `,n(`giveGift.recipientUser`)]}),(0,U.jsxs)(`button`,{type:`button`,className:`btn ${r===`channel`?`primary`:``}`,onClick:()=>{i(`channel`),_(!1),R(null)},children:[(0,U.jsx)(ke,{size:15}),` `,n(`giveGift.recipientChannel`)]})]}),r===`user`?(0,U.jsx)(Ut,{label:n(`giveGift.pickUser`),value:a,onChange:e=>{o(e),R(null)}}):(0,U.jsx)(Wt,{label:n(`giveGift.pickChannel`),value:s,onChange:e=>{c(e),R(null)}}),(0,U.jsxs)(`label`,{className:`form-field`,children:[(0,U.jsx)(`span`,{children:n(`giveGift.sender`)}),(0,U.jsx)(`input`,{value:l,inputMode:`numeric`,onChange:e=>{u(e.target.value.replace(/[^0-9]/g,``)),R(null)},placeholder:mn}),(0,U.jsx)(`small`,{className:`field-hint`,children:n(`giveGift.senderHint`)})]}),(0,U.jsxs)(`label`,{className:`form-field`,children:[(0,U.jsx)(`span`,{children:n(`giveGift.message`)}),(0,U.jsx)(`textarea`,{value:d,rows:2,maxLength:255,onChange:e=>{f(e.target.value),R(null)},placeholder:n(`giveGift.messagePlaceholder`)})]}),(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>{m(e.target.checked),R(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:n(`giveGift.hideName`)})]}),r===`user`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`label`,{className:`gift-switch`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>{_(e.target.checked),e.target.checked||(T(`0`),D(`0`),M(`0`),P(``)),R(null)}}),(0,U.jsx)(`span`,{className:`gift-switch-track`,"aria-hidden":`true`,children:(0,U.jsx)(`span`,{})}),(0,U.jsx)(`span`,{children:n(`giveGift.upgrade`)})]}),h&&(0,U.jsx)(`p`,{className:`give-gift-upgrade-note`,children:n(`giveGift.upgradeNote`)}),h&&S&&(0,U.jsx)(lt,{children:S}),h&&v&&(0,U.jsxs)(`div`,{className:`gift-fields-grid give-gift-attrs`,children:[(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:n(`giveGift.model`)}),(0,U.jsxs)(`select`,{value:w,onChange:e=>{T(e.target.value),R(null)},children:[(0,U.jsx)(`option`,{value:`0`,children:n(`giveGift.random`)}),(v.models??[]).map(e=>(0,U.jsx)(`option`,{value:e.id,children:hn(e)},e.id))]})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:n(`giveGift.pattern`)}),(0,U.jsxs)(`select`,{value:E,onChange:e=>{D(e.target.value),R(null)},children:[(0,U.jsx)(`option`,{value:`0`,children:n(`giveGift.random`)}),(v.patterns??[]).map(e=>(0,U.jsx)(`option`,{value:e.id,children:hn(e)},e.id))]})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:n(`giveGift.backdrop`)}),(0,U.jsxs)(`select`,{value:j,onChange:e=>{M(e.target.value),R(null)},children:[(0,U.jsx)(`option`,{value:`0`,children:n(`giveGift.random`)}),(v.backdrops??[]).map(e=>(0,U.jsx)(`option`,{value:e.id,children:hn(e)},e.id))]})]}),(0,U.jsxs)(`label`,{children:[(0,U.jsx)(`span`,{children:n(`giveGift.number`)}),(0,U.jsx)(`input`,{type:`number`,min:`1`,max:v.supply_total??void 0,value:N,placeholder:n(`giveGift.numberAuto`),onChange:e=>{P(e.target.value.replace(/[^0-9]/g,``)),R(null)}})]})]})]}),(0,U.jsxs)(`label`,{className:`form-field`,children:[(0,U.jsx)(`span`,{children:n(`action.reason`)}),(0,U.jsx)(`textarea`,{value:F,rows:2,onChange:e=>I(e.target.value),placeholder:n(`action.reasonPlaceholder`)})]}),(0,U.jsxs)(`div`,{className:`command-preview`,children:[(0,U.jsx)(`div`,{className:`preview-head`,children:n(`action.requestPreview`)}),(0,U.jsx)(mt,{value:JSON.stringify(se,null,2)})]}),z&&(0,U.jsx)(lt,{children:z}),L&&(0,U.jsxs)(`div`,{className:`result-box`,children:[(0,U.jsxs)(`div`,{className:`result-title`,children:[L.error?(0,U.jsx)(O,{size:16}):(0,U.jsx)(k,{size:16}),(0,U.jsx)(`strong`,{children:L.message||L.error||n(`action.result`)})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:n(`action.commandID`)}),(0,U.jsx)(`strong`,{children:L.command_id})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:n(`action.status`)}),(0,U.jsx)(`strong`,{children:L.status})]}),(0,U.jsxs)(`div`,{className:`result-line`,children:[(0,U.jsx)(`span`,{children:n(`action.dryRun`)}),(0,U.jsx)(`strong`,{children:L.dry_run?n(`common.yes`):n(`common.no`)})]}),L.details&&(0,U.jsx)(mt,{value:JSON.stringify(L.details,null,2)})]}),(0,U.jsxs)(`div`,{className:`give-gift-form-actions`,children:[(0,U.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>le(!1),disabled:te,children:[te?(0,U.jsx)(A,{size:15,className:`spin`}):(0,U.jsx)(me,{size:15}),n(L?`action.runAgain`:`action.runDry`)]}),(0,U.jsxs)(`button`,{className:`btn primary icon-text`,type:`button`,onClick:()=>le(!0),disabled:te||!ce,children:[(0,U.jsx)(oe,{size:15}),n(`giveGift.confirm`)]})]})]})}function _n(){let{t:e}=W(),[t,n]=(0,g.useState)([]),[r,i]=(0,g.useState)(``),[a,o]=(0,g.useState)(null),[s,c]=(0,g.useState)(``),[l,u]=(0,g.useState)(!1);async function d(){u(!0),c(``);try{let e=(await x.gifts()).Gifts??[];n(e),o(t=>t??e[0]??null)}catch(e){c(b(e))}finally{u(!1)}}(0,g.useEffect)(()=>{d()},[]);let f=(0,g.useMemo)(()=>{let e=r.trim().toLowerCase();return e?t.filter(t=>String(t.GiftID).includes(e)||t.Title.toLowerCase().includes(e)):t},[t,r]);return(0,U.jsxs)(ot,{title:e(`giveGifts.pageTitle`),eyebrow:e(`giveGifts.eyebrow`),actions:(0,U.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>d(),disabled:l,children:[(0,U.jsx)(ge,{size:15}),` `,e(`common.refresh`)]}),children:[s&&(0,U.jsx)(lt,{children:s}),(0,U.jsx)(`p`,{className:`give-gift-upgrade-note`,children:e(`giveGifts.hint`)}),(0,U.jsxs)(`div`,{className:`give-gift-layout`,children:[(0,U.jsxs)(`section`,{className:`give-gift-picker`,children:[(0,U.jsxs)(`div`,{className:`give-gift-picker-head`,children:[(0,U.jsxs)(`label`,{className:`searchbox`,children:[(0,U.jsx)(_e,{size:15}),(0,U.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:e(`giveGifts.searchPlaceholder`)})]}),(0,U.jsx)(`span`,{className:`gift-list-summary`,children:e(`gifts.listSummary`,{shown:f.length,total:t.length})})]}),(0,U.jsxs)(`div`,{className:`give-gift-picker-list`,role:`listbox`,"aria-label":e(`giveGifts.pickGift`),children:[f.map(t=>{let n=a?.GiftID===t.GiftID;return(0,U.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n,className:`give-gift-option ${n?`selected`:``} ${t.Enabled?``:`gift-row-disabled`}`,onClick:()=>o(t),children:[(0,U.jsx)(dn,{giftID:t.GiftID,revision:t.Revision,compact:!0}),(0,U.jsxs)(`span`,{className:`give-gift-option-info`,children:[(0,U.jsx)(`strong`,{children:t.Title||`Gift #${t.GiftID}`}),(0,U.jsxs)(`span`,{className:`mono`,children:[`#`,t.GiftID]}),(0,U.jsx)(`span`,{className:`give-gift-option-meta`,children:t.Enabled?(0,U.jsxs)(J,{children:[`⭐ `,t.Stars]}):(0,U.jsx)(J,{tone:`neutral`,children:e(`common.disabled`)})})]})]},t.GiftID)}),f.length===0&&!l&&(0,U.jsx)(`div`,{className:`official-gift-empty`,children:e(`common.noResults`)})]})]}),(0,U.jsx)(`section`,{className:`give-gift-panel`,children:a?(0,U.jsx)(gn,{gift:a,onDone:()=>void d()},a.GiftID):(0,U.jsxs)(`div`,{className:`give-gift-empty-panel`,children:[(0,U.jsx)(oe,{size:26}),(0,U.jsx)(`p`,{children:e(`giveGifts.selectPrompt`)})]})})]})]})}function vn({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1],i=e.path.match(/^\/bots\/(\d+)$/)?.[1];return n?(0,U.jsx)(Et,{id:Number(n),navigate:t}):r?(0,U.jsx)(Z,{id:Number(r),navigate:t}):i?(0,U.jsx)(Mt,{id:Number(i),navigate:t}):e.path===`/accounts`?(0,U.jsx)(At,{navigate:t}):e.path===`/channels`?(0,U.jsx)(jt,{navigate:t}):e.path===`/bots`?(0,U.jsx)(Nt,{navigate:t}):e.path===`/emoji`?(0,U.jsx)(zt,{}):e.path===`/gifts`?(0,U.jsx)(pn,{}):e.path===`/give-gifts`?(0,U.jsx)(_n,{}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,U.jsx)(Kt,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,U.jsx)(Ht,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,U.jsx)(Gt,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,U.jsx)(qt,{navigate:t}):(0,U.jsx)(Bt,{navigate:t})}function yn(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>G());(0,g.useEffect)(()=>{let e=()=>r(G());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(G())};return e===void 0?(0,U.jsx)(Ye,{}):e===null?(0,U.jsx)(ht,{onLogin:t}):(0,U.jsx)(Xe,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,U.jsx)(vn,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,U.jsx)(g.StrictMode,{children:(0,U.jsx)(Ge,{children:(0,U.jsx)(Fe,{children:(0,U.jsx)(yn,{})})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/assets/index-XV_IEG5m.css b/cmd/telesrv-admin/web/dist/assets/index-XV_IEG5m.css new file mode 100644 index 00000000..3e37a247 --- /dev/null +++ b/cmd/telesrv-admin/web/dist/assets/index-XV_IEG5m.css @@ -0,0 +1 @@ +:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#eef1f5;--bg-accent:#e7ecf1;--panel:#fff;--panel-subtle:#f5f8fb;--panel-strong:#eef2f6;--surface-soft:#f2f7f6;--overlay:#18222f6b;--topbar-bg:#ffffffdb;--line:#e5eaf0;--line-strong:#d3dce4;--heading:#253040;--text:#333f4d;--text-soft:#45525f;--muted:#6d7885;--muted-2:#9aa4b1;--brand:#1f7d6f;--brand-strong:#196155;--brand-2:#3a6cae;--brand-tint:#e8f4f0;--brand-tint-border:#c8e2db;--brand-tint-text:#235d53;--good:#1f8a57;--good-tint:#eaf6ef;--good-border:#c1e1cf;--warn:#a86a12;--warn-tint:#fcf4e4;--warn-border:#e7d09e;--danger:#c0392b;--danger-tint:#fcefec;--danger-border:#eecac3;--danger-text:#8f2f27;--purple:#6a4fa3;--purple-tint:#f4effb;--purple-border:#dcd0f0;--purple-text:#5a4590;--input-bg:#fff;--btn-bg:#fff;--btn-text:#29323d;--btn-hover:#f4f7fa;--switch-track:#c8d0d6;--code-bg:#1b2733;--code-text:#d6e3ef;--code-border:#2b3a49;--sidebar:#1c2530;--sidebar-soft:#26313d;--sidebar-line:#313c4a;--sidebar-row:#232d38;--sidebar-text:#dbe3ec;--sidebar-muted:#8b98a8;--sidebar-faint:#7c8a9a;--sidebar-heading:#fff;--focus:#1f7d6f29;--shadow:0 12px 34px #1827381a;--shadow-sm:0 2px 10px #1827380d;--shadow-brand:0 8px 22px #1f7d6f38;--radius-xs:8px;--radius-sm:9px;--radius:11px;--radius-lg:14px}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#0f141a;--bg-accent:#131a22;--panel:#171f28;--panel-subtle:#1c2530;--panel-strong:#212c38;--surface-soft:#1a232d;--overlay:#05080c9e;--topbar-bg:#151c24db;--line:#29333f;--line-strong:#38434f;--heading:#eef3f8;--text:#d5dde6;--text-soft:#c2ccd6;--muted:#98a4b1;--muted-2:#6d7885;--brand:#37a596;--brand-strong:#45b6a6;--brand-2:#6fa8e6;--brand-tint:#14322d;--brand-tint-border:#245349;--brand-tint-text:#7fd3c4;--good:#47c281;--good-tint:#12301f;--good-border:#245639;--warn:#e0aa4d;--warn-tint:#322810;--warn-border:#574413;--danger:#e6695c;--danger-tint:#35201d;--danger-border:#5c332d;--danger-text:#f0a49b;--purple:#ac90e2;--purple-tint:#221b31;--purple-border:#3d3357;--purple-text:#c9b6ef;--input-bg:#131a22;--btn-bg:#1e2731;--btn-text:#dbe2ea;--btn-hover:#26313d;--switch-track:#3a454f;--code-bg:#0c1218;--code-text:#cdd9e5;--code-border:#232f3b;--sidebar:#10151b;--sidebar-soft:#1c242f;--sidebar-line:#262f3a;--sidebar-row:#161d25;--sidebar-text:#cbd4de;--sidebar-muted:#7c8794;--sidebar-faint:#6f7b88;--sidebar-heading:#f0f4f8;--focus:#37a5963d;--shadow:0 16px 40px #00000075;--shadow-sm:0 2px 12px #00000061;--shadow-brand:0 8px 22px #37a59642}*{box-sizing:border-box}html,body,#root{min-height:100%}body{color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;margin:0;font:13px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;transition:background-color .2s,color .2s}button,input,textarea{font:inherit}a{color:inherit;text-decoration:none}.shell{grid-template-columns:232px minmax(0,1fr);min-height:100vh;display:grid}.sidebar{height:100vh;color:var(--sidebar-text);background:var(--sidebar);border-right:1px solid var(--sidebar-line);flex-direction:column;gap:16px;padding:18px 12px;display:flex;position:sticky;top:0;overflow-y:auto}.brand{align-items:center;gap:10px;min-height:42px;padding:0 4px;display:flex}.brand.compact{justify-content:center}.brand-elevated .brand-mark{box-shadow:var(--shadow-brand)}.brand-mark{color:#fff;background:var(--brand);border-radius:var(--radius-sm);border:1px solid #fff3;place-items:center;width:34px;height:34px;font-weight:800;display:grid}.brand strong{font-size:14px;line-height:1.1;display:block}.brand small{color:var(--sidebar-muted);margin-top:3px;font-size:11px;display:block}.sidebar-label{color:var(--sidebar-faint);text-transform:uppercase;letter-spacing:.04em;padding:0 8px;font-size:11px;font-weight:700}.nav-list,.nav-section{gap:4px;display:grid}.nav-section-toggle{width:100%;min-height:38px;color:var(--sidebar-muted);border-radius:var(--radius-sm);cursor:pointer;text-align:left;background:0 0;border:1px solid #0000;grid-template-columns:18px minmax(0,1fr) 16px;align-items:center;gap:9px;padding:0 10px;font-size:12px;font-weight:800;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-section-toggle:hover,.nav-section.active .nav-section-toggle{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-section-chevron{color:var(--sidebar-muted);justify-self:end;transition:transform .14s}.nav-section.open .nav-section-chevron{transform:rotate(180deg)}.nav-children{gap:4px;padding:2px 0 2px 18px;display:grid}.nav-item{min-height:38px;color:var(--sidebar-text);border-radius:var(--radius-sm);border:1px solid #0000;grid-template-columns:18px minmax(0,1fr);align-items:center;gap:9px;padding:0 10px;transition:color .14s,background-color .14s,border-color .14s;display:grid}.nav-dot{background:var(--sidebar-faint);border-radius:999px;justify-self:center;width:6px;height:6px}.nav-item:hover,.nav-item.active{color:var(--sidebar-heading);background:var(--sidebar-soft);border-color:var(--sidebar-line)}.nav-item.active .nav-dot{background:var(--brand)}.sidebar-status{gap:7px;margin-top:auto;display:grid}.runtime-row{min-height:32px;color:var(--sidebar-text);background:var(--sidebar-row);border:1px solid var(--sidebar-line);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;padding:0 8px;display:grid}.runtime-row strong{color:var(--sidebar-heading);font-size:11px}.workspace{min-width:0}.topbar{z-index:20;background:var(--topbar-bg);border-bottom:1px solid var(--line);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);justify-content:space-between;align-items:center;gap:18px;min-height:66px;padding:12px 24px;display:flex;position:sticky;top:0}.topbar h1{color:var(--heading);margin:2px 0 0;font-size:20px;line-height:1.2}.topbar-actions,.page-actions,.section-action,.entity-badges,.row-actions,.modal-actions{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.language-switch{background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;min-height:30px;padding:2px;display:inline-flex}.language-switch button{min-width:42px;min-height:24px;color:var(--muted);cursor:pointer;background:0 0;border:0;border-radius:999px;padding:0 9px;font-weight:800;transition:color .14s,background-color .14s}.language-switch button.active{color:#fff;background:var(--brand)}.language-switch button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.theme-toggle{width:34px;height:34px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);cursor:pointer;border-radius:999px;place-items:center;transition:color .16s,background-color .16s,border-color .16s;display:inline-grid}.theme-toggle:hover{color:var(--brand);border-color:var(--brand-tint-border);background:var(--brand-tint)}.theme-toggle:focus-visible{outline:2px solid var(--brand);outline-offset:2px}.actor-pill{min-height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:999px;align-items:center;padding:0 10px;display:inline-flex}.content{gap:16px;padding:18px 24px 30px;display:grid}.eyebrow{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:11px;font-weight:800}.dashboard-layout,.stacked-sections{gap:14px;display:grid}.overview-band,.page-frame{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm)}.overview-band{grid-template-columns:minmax(220px,1fr) minmax(420px,.9fr);align-items:center;gap:16px;padding:16px;display:grid}.overview-band h2,.page-title-row h2,.section-head h2,.modal h2{color:var(--heading);margin:0;font-size:18px;line-height:1.25}.overview-metrics,.metric-row{grid-template-columns:repeat(4,minmax(120px,1fr));gap:8px;display:grid}.overview-metrics{grid-template-columns:repeat(3,minmax(120px,1fr))}.status-item,.metric,.summary-item{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);min-width:0;padding:10px}.status-item span,.metric span,.summary-item span{color:var(--muted);margin-bottom:6px;font-size:11px;display:block}.status-item strong,.metric strong,.summary-item strong{overflow-wrap:anywhere;color:var(--text);font-weight:800;display:block}.status-item.good,.metric.good{border-color:var(--good-border)}.status-item.warn,.metric.warn{border-color:var(--warn-border)}.metric.danger{border-color:var(--danger-border)}.command-grid{grid-template-columns:repeat(3,minmax(220px,1fr));gap:12px;display:grid}.launcher{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-height:94px;box-shadow:var(--shadow-sm);grid-template-columns:38px minmax(0,1fr) 18px;align-items:center;gap:12px;padding:14px;transition:border-color .16s,box-shadow .16s,transform .16s;display:grid}.launcher:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.launcher-icon{width:38px;height:38px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);place-items:center;display:grid}.launcher-copy{gap:4px;display:grid}.launcher-copy strong{color:var(--heading);font-size:15px}.launcher-copy span{color:var(--muted)}.work-strip{grid-template-columns:repeat(4,minmax(160px,1fr));gap:8px;display:grid}.strip-item{min-height:38px;color:var(--text-soft);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.page-frame{gap:14px;padding:14px;display:grid}.page-title-row{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:14px;padding-bottom:12px;display:flex}.query-panel{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);padding:10px}.toolbar{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.message-query input{width:150px}.message-selector-grid{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;margin-bottom:10px;display:grid}.message-selector-grid.single{grid-template-columns:minmax(320px,620px)}.entity-picker{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);gap:8px;min-width:0;padding:10px;display:grid}.picker-head{min-height:24px;color:var(--text-soft);justify-content:space-between;align-items:center;gap:8px;font-weight:800;display:flex}.selected-entity{min-height:40px;color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:8px;padding:7px 9px;display:grid}.selected-entity strong,.selected-entity span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.selected-entity div{gap:2px;min-width:0;display:grid}.selected-entity div span{color:var(--brand-tint-text);opacity:.85;font-size:11px}.picker-search{background:var(--panel-subtle);border:1px solid var(--line-strong);border-radius:var(--radius-sm);grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;height:34px;padding:0 6px 0 9px;display:grid}.picker-search input{width:100%;height:30px;box-shadow:none;background:0 0;border:0;padding:0}.picker-results{border:1px solid var(--line);border-radius:var(--radius-sm);max-height:236px;display:grid;overflow:auto}.picker-row{min-height:36px;color:var(--text);background:var(--panel);border:0;border-bottom:1px solid var(--line);cursor:pointer;text-align:left;grid-template-columns:96px minmax(120px,1fr) minmax(120px,1fr) auto;align-items:center;gap:8px;padding:6px 8px;display:grid}.picker-row:last-child{border-bottom:0}.picker-row:hover,.picker-row.selected{background:var(--surface-soft)}.picker-row strong,.picker-row span{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.picker-empty,.picker-error{color:var(--muted);text-align:center;padding:9px}.picker-error{color:var(--danger);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius-sm)}input,textarea{color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);outline:none;transition:border-color .14s,box-shadow .14s}input::placeholder,textarea::placeholder{color:var(--muted-2)}input{width:190px;height:34px;padding:0 10px}textarea{resize:vertical;width:100%;padding:9px 10px}input:focus,textarea:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus)}.small-input{width:88px}.field-inline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.field-inline span{font-size:11px;font-weight:700}.searchbox{width:min(380px,100%);height:34px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:inline-flex}.searchbox input{width:100%;height:30px;box-shadow:none;border:0;padding:0}.btn{min-height:34px;color:var(--btn-text);background:var(--btn-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;justify-content:center;align-items:center;gap:6px;padding:0 12px;transition:background-color .14s,border-color .14s,color .14s,box-shadow .14s;display:inline-flex}.btn:hover:not(:disabled){background:var(--btn-hover)}.btn:disabled{color:var(--muted-2);cursor:not-allowed}.btn.primary{color:#fff;background:var(--brand);border-color:var(--brand)}.btn.primary:hover:not(:disabled){background:var(--brand-strong);border-color:var(--brand-strong)}.btn.ghost{background:var(--panel-subtle)}.btn.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.btn.danger:hover:not(:disabled){background:var(--danger-tint);border-color:var(--danger)}.btn.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.btn.warn:hover:not(:disabled){background:var(--warn-tint);border-color:var(--warn)}.btn:disabled,.btn.primary:disabled,.btn.warn:disabled,.btn.danger:disabled{color:var(--muted-2);background:var(--panel-strong);border-color:var(--line);cursor:not-allowed}.btn.full{width:100%}.icon-text{gap:7px}.compact-btn{min-height:28px;padding:0 8px;font-size:12px}.row-link,.link-button{color:var(--brand-2);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:0;display:inline-flex}.table-wrap{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);width:100%;overflow-x:auto}.data-table{border-collapse:collapse;width:100%;font-size:12.5px}.data-table th,.data-table td{border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;white-space:nowrap;height:38px;padding:7px 9px}.data-table th{z-index:0;color:var(--muted);background:var(--panel-strong);font-weight:800;position:sticky;top:0}.data-table tbody tr:hover{background:var(--panel-subtle)}.data-table tr:last-child td{border-bottom:0}.mono{font-family:SFMono-Regular,Consolas,Liberation Mono,monospace}.truncate{text-overflow:ellipsis;max-width:380px;overflow:hidden}.badge{min-height:22px;color:var(--muted);background:var(--panel-strong);border:1px solid var(--line-strong);white-space:nowrap;border-radius:999px;align-items:center;padding:1px 8px;display:inline-flex}.badge.good{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.badge.danger{color:var(--danger);background:var(--danger-tint);border-color:var(--danger-border)}.badge.warn{color:var(--warn);background:var(--warn-tint);border-color:var(--warn-border)}.empty-cell{color:var(--muted);text-align:center}.bot-create-fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.bot-create-fields .duration-field input{width:100%}.bot-create-actions{border-top:1px solid var(--line);justify-content:space-between;align-items:center;gap:14px;margin-top:14px;padding-top:14px;display:flex}.bot-create-note{color:var(--muted);font-size:12px;line-height:1.4}@media (width<=760px){.bot-create-fields{grid-template-columns:1fr}.bot-create-actions{flex-direction:column;align-items:stretch}}.split-layout{grid-template-columns:minmax(0,1fr) 330px;align-items:start;gap:14px;display:grid}.split-main,.split-side{min-width:0}.entity-head{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);justify-content:space-between;align-items:flex-start;gap:14px;padding:14px;display:flex}.entity-title{color:var(--heading);font-size:20px;font-weight:800;line-height:1.25}.entity-subtitle{color:var(--muted);margin-top:4px}.summary-grid{grid-template-columns:repeat(4,minmax(150px,1fr));gap:8px;display:grid}.about-text{color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);margin:0;padding:10px}.section-block,.action-dock,.surface{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);min-width:0;box-shadow:var(--shadow-sm);padding:12px}.section-head{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.section-head p{color:var(--muted);margin:5px 0 0}.action-dock{gap:10px;display:grid;position:sticky;top:82px}.dock-title{color:var(--text-soft);border-bottom:1px solid var(--line);padding-bottom:4px;font-weight:800}.action-dock>.btn,.action-dock .action-stack .btn{justify-content:center;width:100%}.duration-field{gap:4px;display:grid}.duration-field span{color:var(--muted);font-size:11px;font-weight:800}.duration-field input{width:100%}.action-stack{gap:10px;display:grid}.action-stack .btn,.action-dock>.btn{min-height:42px}.danger-zone{border-top:1px solid var(--line);flex-wrap:wrap;gap:8px;margin-top:10px;padding-top:10px;display:flex}.authorization-block{gap:10px;display:grid}.authorization-table{table-layout:fixed;min-width:720px}.authorization-table th,.authorization-table td{height:46px}.device-text{text-overflow:ellipsis;max-width:260px;overflow:hidden}.device-actions-head{width:190px}.device-actions-cell{width:190px;min-width:190px}.device-actions{white-space:normal;grid-template-columns:repeat(2,minmax(82px,1fr));gap:6px;min-width:178px;display:grid}.device-actions .btn{justify-content:center;width:100%}.operation-row{grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px;display:grid}.operation-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);flex-wrap:wrap;align-items:center;gap:8px;padding:10px;display:flex}.operation-title{width:100%;color:var(--heading);align-items:center;gap:6px;font-weight:800;display:flex}.checkline{color:var(--muted);align-items:center;gap:6px;display:inline-flex}.checkline input{width:auto;height:auto}.alert{color:var(--danger-text);background:var(--danger-tint);border:1px solid var(--danger-border);border-radius:var(--radius);align-items:flex-start;gap:8px;padding:9px 10px;display:flex}.json-block{max-height:520px;color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius);margin:0;padding:12px;font-size:12px;overflow:auto}.raw-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.loading-line{min-height:80px;color:var(--muted);place-items:center;display:grid}.empty-panel{min-height:92px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);place-items:center;display:grid}.gift-metrics .metric{background:var(--panel-subtle);min-height:68px;padding:12px}.gift-metrics .metric strong{font-size:17px}.gift-file-icon{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);flex:none;place-items:center;display:grid}.gift-format-chips{flex-wrap:wrap;flex:none;justify-content:flex-end;gap:6px;display:flex}.gift-format-chips span{color:var(--brand-tint-text);background:var(--brand-tint);border:1px solid var(--brand-tint-border);letter-spacing:.02em;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.gift-list-summary{color:var(--muted);margin-left:auto;font-size:11px;font-weight:700}.gift-import-modal{width:min(860px,100%)}.gift-import-modal-body{gap:14px}.gift-source-tabs{gap:8px;display:flex}.give-gift-summary{background:var(--panel-subtle);border:1px solid var(--line-strong);color:var(--text-soft);border-radius:12px;align-items:center;gap:11px;padding:11px 13px;display:flex}.give-gift-summary>svg{color:var(--brand);flex:none}.give-gift-summary strong{color:var(--text);font-size:13px;display:block}.give-gift-summary .mono{color:var(--muted);font-size:11px}.give-gift-tabs{background:var(--panel-subtle);border:1px solid var(--line-strong);border-radius:12px;gap:4px;width:100%;padding:4px;display:flex}.give-gift-tabs .btn{min-height:36px;box-shadow:none;color:var(--text-soft);background:0 0;border:1px solid #0000;border-radius:9px;flex:1 1 0;justify-content:center;transition:color .15s,background .15s,border-color .15s,box-shadow .15s}.give-gift-tabs .btn:not(.primary):hover{color:var(--brand);background:var(--brand-tint)}.give-gift-tabs .btn.primary{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:var(--shadow-brand)}.give-gift-upgrade-note{background:var(--brand-tint);border:1px solid var(--brand-tint-border);color:var(--text-soft);border-radius:10px;margin:0;padding:9px 12px;font-size:11px;font-weight:650;line-height:1.45}.give-gift-attrs{grid-template-columns:repeat(4,minmax(0,1fr));align-items:end}.give-gift-attrs select,.give-gift-attrs input{width:100%;min-width:0;height:38px;color:var(--text);background-color:var(--input-bg);border:1px solid var(--line);border-radius:var(--radius-sm);font:inherit;appearance:none;cursor:pointer;padding:0 32px 0 10px;font-size:12px;font-weight:600}.give-gift-attrs input{cursor:text;text-overflow:ellipsis;padding-right:10px}.give-gift-attrs select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa4b2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-position:right 11px center;background-repeat:no-repeat}.give-gift-attrs select:focus,.give-gift-attrs input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus);outline:none}.give-gift-layout{grid-template-columns:minmax(300px,380px) minmax(0,1fr);align-items:start;gap:16px;display:grid}.give-gift-picker{align-content:start;gap:10px;display:grid}.give-gift-picker-head{align-items:center;gap:12px;display:flex}.give-gift-picker-head .searchbox{flex:auto}.give-gift-picker-list{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-lg);scrollbar-gutter:stable;gap:8px;max-height:640px;padding:8px;display:grid;overflow:auto}.give-gift-option{text-align:left;min-width:0;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);cursor:pointer;box-shadow:var(--shadow-sm);grid-template-columns:56px minmax(0,1fr);align-items:center;gap:11px;padding:9px;transition:border-color .15s,box-shadow .15s,transform .15s;display:grid}.give-gift-option:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.give-gift-option.selected{border-color:var(--brand);box-shadow:0 0 0 2px var(--focus), var(--shadow)}.give-gift-option .gift-animation-shell.compact{pointer-events:none}.give-gift-option-info{gap:3px;min-width:0;display:grid}.give-gift-option-info strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.give-gift-option-info .mono{color:var(--muted);font-size:10px}.give-gift-option-meta{flex-wrap:wrap;gap:6px;margin-top:2px;display:flex}.give-gift-panel{background:var(--panel);border:1px solid var(--line-strong);border-radius:var(--radius-lg);gap:12px;min-width:0;padding:16px;display:grid}.give-gift-form{gap:12px;min-width:0;display:grid}.give-gift-form-actions{flex-wrap:wrap;justify-content:flex-end;gap:10px;padding-top:4px;display:flex}.give-gift-empty-panel{color:var(--muted);text-align:center;place-items:center;gap:10px;padding:48px 20px;display:grid}.give-gift-empty-panel svg{color:var(--brand);opacity:.8}.official-gift-picker{gap:12px;min-width:0;display:grid}.official-gift-tools{align-items:center;gap:12px;display:flex}.official-gift-tools .searchbox{width:100%}.official-gift-tools>span{color:var(--muted);flex:none;font-size:11px;font-weight:750}.official-gift-categories{flex-wrap:wrap;gap:7px;display:flex}.official-gift-categories button{min-height:32px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line-strong);font:inherit;cursor:pointer;border-radius:999px;align-items:center;gap:7px;padding:5px 10px;font-size:11px;font-weight:800;transition:color .15s,background .15s,border-color .15s,box-shadow .15s;display:inline-flex}.official-gift-categories button:hover{color:var(--brand);border-color:var(--brand-tint-border)}.official-gift-categories button.active{color:#fff;background:var(--brand);border-color:var(--brand);box-shadow:var(--shadow-brand)}.official-gift-categories button span{min-width:20px;height:20px;color:inherit;background:#7d8c9b38;border-radius:999px;place-items:center;padding:0 5px;font-size:10px;display:grid}.official-gift-categories button.active span{color:var(--brand);background:#ffffffd9}.official-gift-list{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--panel-subtle);scrollbar-gutter:stable;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-height:126px;max-height:314px;padding:8px;display:grid;overflow:auto}.official-gift-option{text-align:left;min-width:0;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);cursor:pointer;box-shadow:var(--shadow-sm);gap:8px;padding:11px 12px;transition:border-color .15s,box-shadow .15s,transform .15s;display:grid}.official-gift-option:hover{border-color:var(--brand-tint-border);box-shadow:var(--shadow);transform:translateY(-1px)}.official-gift-option.selected{border-color:var(--brand);box-shadow:0 0 0 2px var(--focus), var(--shadow)}.official-gift-option-head{grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:8px;display:grid}.official-gift-option-head strong{text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.official-gift-option-head .mono{color:var(--muted);font-size:9px}.official-gift-option-meta{color:var(--muted);flex-wrap:wrap;gap:10px;font-size:10px;font-weight:700;display:flex}.official-gift-capabilities{flex-wrap:wrap;gap:5px;display:flex}.official-gift-capabilities>span{letter-spacing:.01em;border:1px solid #0000;border-radius:999px;padding:3px 7px;font-size:9px;font-weight:850}.official-gift-capabilities>span.yes{color:var(--good);background:var(--good-tint);border-color:var(--good-border)}.official-gift-capabilities>span.craft{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.official-gift-capabilities>span.no{color:var(--muted);background:var(--panel-strong);border-color:var(--line-strong)}.official-gift-empty{min-height:108px;color:var(--muted);text-align:center;grid-column:1/-1;place-items:center;padding:20px;font-size:12px;display:grid}.official-gift-selected{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface-soft);grid-template-columns:108px minmax(0,1fr);align-items:center;gap:14px;padding:12px;display:grid}.official-gift-selected .gift-animation-shell{width:96px;height:96px}.official-gift-selected>div:last-child{gap:5px;min-width:0;display:grid}.official-gift-selected small{color:var(--muted)}.gift-import-note{color:var(--muted);justify-content:space-between;align-items:center;gap:12px;line-height:1.45;display:flex}.gift-file-picker{min-height:78px;color:var(--text);background:var(--panel);border:1px dashed var(--line-strong);border-radius:var(--radius);cursor:pointer;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;transition:border-color .16s,background .16s,box-shadow .16s;display:grid;position:relative}.gift-file-picker:hover,.gift-file-picker.has-file{background:var(--brand-tint);border-color:var(--brand);box-shadow:0 0 0 2px var(--focus)}.gift-file-picker input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.gift-file-icon{border-radius:var(--radius-sm);width:40px;height:40px}.gift-file-copy{gap:2px;min-width:0;display:grid}.gift-field-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:10px;font-weight:800}.gift-file-copy strong{color:var(--heading);text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.gift-file-copy small{color:var(--muted);font-size:11px;font-weight:500}.gift-file-action{color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:var(--radius-sm);padding:7px 10px;font-size:11px;font-weight:800}.gift-fields-grid{grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(120px,1fr));gap:10px;display:grid}.gift-fields-grid label,.gift-reason-field{color:var(--muted);gap:6px;font-size:11px;font-weight:700;display:grid}.gift-fields-grid input,.gift-reason-field input{width:100%;min-width:0;height:38px;color:var(--text);background:var(--input-bg);border:1px solid var(--line);border-radius:var(--radius-sm);padding:0 10px}.gift-fields-grid input:focus,.gift-reason-field input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--focus);outline:none}.gift-switch{color:var(--text-soft);cursor:pointer;align-items:center;gap:9px;font-size:12px;font-weight:700;display:inline-flex}.gift-switch input{opacity:0;width:1px;height:1px;position:absolute}.gift-switch-track{background:var(--switch-track);border-radius:999px;align-items:center;width:34px;height:19px;padding:2px;transition:background .16s;display:flex}.gift-switch-track span{background:#fff;border-radius:50%;width:15px;height:15px;transition:transform .16s;box-shadow:0 1px 3px #10182838}.gift-switch input:checked+.gift-switch-track{background:var(--brand)}.gift-switch input:checked+.gift-switch-track span{transform:translate(15px)}.gift-switch input:focus-visible+.gift-switch-track{outline:3px solid var(--focus);outline-offset:2px}.gift-validation{color:var(--code-text);background:var(--code-bg);border:1px solid var(--code-border);border-radius:var(--radius-sm);overflow:hidden}.gift-validation-head{color:var(--code-text);background:#ffffff09;border-bottom:1px solid #ffffff17;align-items:center;gap:9px;padding:10px 12px;display:flex}.gift-validation-head div{gap:2px;display:grid}.gift-validation-head span{color:var(--brand);font-size:10px}.gift-validation pre{max-height:180px;color:var(--code-text);margin:0;padding:11px 12px;font-size:11px;overflow:auto}.gift-animation-shell{background:var(--surface-soft);place-items:center;min-height:210px;display:grid;position:relative}.gift-animation{width:200px;height:200px}.gift-animation canvas{width:100%!important;height:100%!important}.gift-play{width:30px;height:30px;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:50%;place-items:center;display:grid;position:absolute;bottom:8px;right:8px}.gift-table-wrap{background:var(--panel)}.gift-table{min-width:1080px}.gift-table th:first-child{width:74px}.gift-table td{vertical-align:middle}.gift-animation-shell.compact{border:1px solid var(--line);border-radius:var(--radius-sm);width:56px;min-height:56px;overflow:hidden}.gift-animation-shell.compact .gift-animation{width:54px;height:54px}.gift-animation-shell.compact .gift-play{width:20px;height:20px;bottom:3px;right:3px}.gift-row-disabled{opacity:.68}.gift-table-title,.gift-sort-order,.gift-source-size,.gift-convert-price{display:block}.gift-table-title{text-overflow:ellipsis;white-space:nowrap;max-width:220px;overflow:hidden}.gift-sort-order,.gift-source-size,.gift-convert-price{color:var(--muted);margin-top:3px;font-size:10px}.gift-table-price{color:var(--warn)}.gift-table-actions{align-items:center;gap:6px;display:flex}.collectible-button{color:var(--purple);background:var(--purple-tint);border-color:var(--purple-border)}.collectible-button:hover{background:var(--purple-tint);border-color:var(--purple)}.collectible-modal{width:min(1180px,100%);max-height:min(92vh,980px)}.collectible-modal .modal-head p{color:var(--muted);margin:4px 0 0;font-size:11px}.collectible-modal-body{background:var(--bg);gap:16px;padding:16px 18px 22px;overflow:auto}.collectible-loading{min-height:90px;color:var(--muted);justify-content:center;align-items:center;gap:8px;display:flex}.collectible-empty{color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius);align-items:center;gap:12px;padding:16px;display:flex}.collectible-empty div,.collectible-definition-head>div:first-child,.collectible-section-head>div:first-child{gap:3px;display:grid}.collectible-empty span,.collectible-definition-head span,.collectible-section-head span{color:var(--muted);font-size:10px;font-weight:500}.collectible-active{background:var(--panel);border:1px solid var(--purple-border);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-active-head{background:var(--purple-tint);border-bottom:1px solid var(--purple-border);justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.collectible-active-head>div{color:var(--purple-text);align-items:center;gap:9px;display:flex}.collectible-active-head>div>div{gap:2px;display:grid}.collectible-active-head span{color:var(--muted);font-size:10px}.collectible-active-grid{background:var(--line);grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:1px;display:grid}.collectible-active-grid article{background:var(--panel);align-items:center;gap:9px;min-width:0;padding:9px 11px;display:flex}.collectible-active-grid article>div:last-child{gap:2px;min-width:0;display:grid}.collectible-active-grid article strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.collectible-active-grid article span{color:var(--muted);font-size:9px}.collectible-definition{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);overflow:hidden}.collectible-definition-head{background:var(--panel-subtle);border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;display:flex}.collectible-main-fields{background:var(--panel-subtle);border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section{border-bottom:1px solid var(--line);padding:14px 16px}.collectible-section:last-child{border-bottom:0}.collectible-section-head{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.collectible-section-tools{align-items:center;gap:7px;display:flex}.collectible-rows{gap:7px;display:grid}.collectible-row{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:end;gap:7px;padding:9px 9px 9px 36px;display:grid;position:relative}.collectible-row:hover{background:var(--panel);border-color:var(--line-strong);box-shadow:var(--shadow-sm)}.collectible-row.animated{grid-template-columns:minmax(120px,1.2fr) 90px 78px minmax(160px,1.4fr) 48px 30px}.collectible-row.backdrop{grid-template-columns:minmax(110px,1.2fr) 70px 80px 70px repeat(4,52px) 48px 30px}.collectible-row-index{width:27px;color:var(--purple-text);background:var(--purple-tint);border-right:1px solid var(--purple-border);border-radius:var(--radius-xs) 0 0 var(--radius-xs);place-items:center;font-size:10px;font-weight:800;display:grid;position:absolute;top:0;bottom:0;left:0}.collectible-row label{gap:4px;min-width:0;display:grid}.collectible-row label>span{color:var(--muted);text-transform:uppercase;letter-spacing:.025em;font-size:9px;font-weight:800}.collectible-row input:not([type=file]){width:100%;min-width:0;height:32px;color:var(--text);background:var(--input-bg);border:1px solid var(--line-strong);border-radius:var(--radius-sm);font:inherit;padding:0 8px;font-size:11px}.collectible-row input:focus{border-color:var(--purple);box-shadow:0 0 0 3px var(--purple-tint);outline:none}.collectible-file input{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.collectible-file em{min-width:0;height:32px;color:var(--purple-text);background:var(--purple-tint);border:1px dashed var(--purple-border);border-radius:var(--radius-sm);text-overflow:ellipsis;white-space:nowrap;cursor:pointer;align-items:center;gap:5px;padding:0 8px;font-size:10px;font-style:normal;font-weight:700;display:flex;overflow:hidden}.collectible-inline-preview{width:42px;height:42px;color:var(--purple);background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);place-items:center;display:grid;overflow:hidden}.collectible-animation{width:100%;height:100%;overflow:hidden}.collectible-animation.compact{background:var(--purple-tint);border:1px solid var(--purple-border);border-radius:var(--radius-sm);flex:0 0 42px;place-items:center;width:42px;height:42px;display:grid}.collectible-animation canvas{width:100%!important;height:100%!important}.collectible-animation.failed{color:var(--danger);background:var(--danger-tint)}.collectible-animation.loading{color:var(--purple-text)}.collectible-file-error{color:var(--danger);grid-column:1/-1;font-size:10px}.collectible-color input{cursor:pointer;height:32px!important;padding:3px!important}.collectible-backdrop-preview{border-radius:var(--radius-sm);border:1px solid #2a1f472e;flex:0 0 42px;place-items:center;width:42px;height:42px;font-size:11px;font-weight:900;display:grid;box-shadow:inset 0 0 0 1px #fff3}.collectible-row .icon-btn{align-self:center}.collectible-row .icon-btn:disabled{opacity:.28}@media (width<=900px){.gift-fields-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.give-gift-layout{grid-template-columns:1fr}.give-gift-picker-list{max-height:320px}.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:repeat(2,minmax(0,1fr))}.collectible-inline-preview,.collectible-backdrop-preview,.collectible-row .icon-btn{place-self:center start}}@media (width<=620px){.gift-import-note{flex-direction:column;align-items:flex-start}.gift-format-chips{justify-content:flex-start}.gift-file-picker{grid-template-columns:40px minmax(0,1fr)}.gift-file-action{display:none}.gift-fields-grid{grid-template-columns:1fr}.gift-list-summary{width:100%;margin-left:0}.official-gift-tools{flex-direction:column;align-items:stretch}.official-gift-list{grid-template-columns:1fr;max-height:340px}.official-gift-selected{grid-template-columns:82px minmax(0,1fr)}.official-gift-selected .gift-animation-shell{width:72px;height:72px}.collectible-modal-body{padding:10px}.collectible-definition-head,.collectible-section-head{flex-direction:column;align-items:flex-start}.collectible-row.animated,.collectible-row.backdrop{grid-template-columns:1fr}.collectible-active-grid{grid-template-columns:1fr 1fr}}.attr-block{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);gap:8px;padding:10px;display:grid}.attr-block .duration-field input{width:100%}.attr-block .btn{justify-content:center;width:100%}.emoji-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;display:grid}.emoji-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);gap:8px;padding:12px;display:grid}.emoji-preview{background:var(--surface-soft);border:1px solid var(--line);border-radius:var(--radius-sm);place-items:center;height:88px;display:grid}.emoji-anim{width:80px;height:80px}.emoji-anim canvas{width:100%!important;height:100%!important}.emoji-glyph{font-size:46px;line-height:1}.emoji-meta{gap:4px;min-width:0;display:grid}.emoji-alt{font-size:18px;line-height:1.2}.emoji-id{color:var(--text);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;justify-content:space-between;align-items:center;gap:6px;padding:4px 8px;font-size:11px;display:inline-flex}.emoji-id .mono{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.emoji-id:hover{border-color:var(--brand-tint-border);color:var(--brand)}.emoji-sub{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.modal-backdrop{z-index:10000;background:var(--overlay);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);place-items:center;padding:24px;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(760px,100%);max-height:min(820px,100vh - 48px);box-shadow:var(--shadow);padding:0;overflow:hidden}.command-modal{flex-direction:column;display:flex}.command-modal>.modal-head,.command-modal>.modal-actions{flex:none}.modal-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:flex-start;gap:12px;padding:16px 18px 12px;display:flex}.icon-btn{width:30px;height:30px;color:var(--text-soft);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);cursor:pointer;place-items:center;transition:background-color .14s,border-color .14s,color .14s;display:grid}.icon-btn:hover{background:var(--btn-hover);border-color:var(--line-strong)}.command-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;display:grid}.command-body{grid-auto-rows:max-content;gap:12px;min-height:0;padding:14px 18px;display:grid;overflow:auto}.command-step{min-height:38px;color:var(--muted);background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius-sm);align-items:center;gap:8px;padding:0 10px;display:flex}.command-step span{background:var(--panel);border:1px solid var(--line);border-radius:999px;place-items:center;width:20px;height:20px;font-size:11px;font-weight:800;display:grid}.command-step.active{color:var(--brand);border-color:var(--brand-tint-border)}.command-step.done{color:var(--good);border-color:var(--good-border)}.form-field{gap:6px;display:grid}.form-field span,.form-stack span{color:var(--text-soft);font-weight:800}.command-preview{gap:8px;display:grid}.command-preview .json-block{max-height:150px}.preview-head,.result-title{color:var(--text-soft);align-items:center;gap:7px;font-weight:800;display:flex}.result-box{background:var(--panel-subtle);border:1px solid var(--line);border-radius:var(--radius);gap:8px;padding:10px;display:grid}.result-line{grid-template-columns:92px minmax(0,1fr);gap:8px;display:grid}.result-line span{color:var(--muted)}.result-line strong{overflow-wrap:anywhere}.result-message{color:var(--text-soft)}.modal-actions{background:var(--panel);border-top:1px solid var(--line);justify-content:flex-end;padding:12px 18px}.login-page{background:var(--bg);place-items:center;min-height:100vh;padding:24px;display:grid}.login-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-lg);width:min(420px,100%);box-shadow:var(--shadow);gap:18px;padding:22px;display:grid}.login-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.login-head-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.login-chip{min-height:24px;color:var(--brand);background:var(--brand-tint);border:1px solid var(--brand-tint-border);border-radius:999px;align-items:center;padding:0 8px;font-size:12px;display:inline-flex}.login-copy h1{color:var(--heading);margin:0;font-size:22px}.login-copy p{color:var(--muted);margin:8px 0 0}.form-stack{gap:12px;display:grid}.form-stack label{gap:6px;display:grid}.form-stack input{width:100%}.boot-screen{background:var(--bg);align-content:center;place-items:center;gap:18px;min-height:100vh;display:grid}.loader-bar{background:var(--line-strong);border-radius:999px;width:180px;height:4px;overflow:hidden}.loader-bar:before{content:"";background:var(--brand);width:42%;height:100%;animation:1s ease-in-out infinite load;display:block}.spin{animation:.8s linear infinite spin}@keyframes load{0%{transform:translate(-120%)}to{transform:translate(260%)}}@keyframes spin{to{transform:rotate(360deg)}}@media (width<=1120px){.shell{grid-template-columns:1fr}.sidebar{height:auto;position:static}.nav-list{grid-template-columns:repeat(4,minmax(0,1fr))}.sidebar-status{display:none}.overview-band,.split-layout,.operation-row,.raw-grid,.message-selector-grid,.message-selector-grid.single{grid-template-columns:1fr}.action-dock{position:static}}@media (width<=760px){.content,.topbar{padding-left:14px;padding-right:14px}.command-grid,.work-strip,.overview-metrics,.metric-row,.summary-grid,.command-steps{grid-template-columns:1fr}.sidebar{gap:12px;padding:14px}.nav-list{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar,.page-title-row,.entity-head{flex-direction:column;align-items:flex-start}input,.searchbox{width:100%}.toolbar{align-items:stretch}.picker-row,.selected-entity{grid-template-columns:1fr}} diff --git a/cmd/telesrv-admin/web/dist/index.html b/cmd/telesrv-admin/web/dist/index.html index 1c5443a7..cec1bc84 100644 --- a/cmd/telesrv-admin/web/dist/index.html +++ b/cmd/telesrv-admin/web/dist/index.html @@ -21,8 +21,8 @@ } })(); - - + +
diff --git a/cmd/telesrv-admin/web/src/api.ts b/cmd/telesrv-admin/web/src/api.ts index a568db36..6cc2afdd 100644 --- a/cmd/telesrv-admin/web/src/api.ts +++ b/cmd/telesrv-admin/web/src/api.ts @@ -4,6 +4,7 @@ import type { BotDetail, BotListResponse, ChannelDetail, + EmojiListResponse, ChannelListResponse, CommandResult, GroupMessageDetail, @@ -60,6 +61,8 @@ export const api = { channel: (id: number) => request(`/api/channels/${id}`), bots: (params: URLSearchParams) => request(`/api/bots?${params.toString()}`), bot: (id: number) => request(`/api/bots/${id}`), + emoji: (params: URLSearchParams) => request(`/api/emoji?${params.toString()}`), + emojiAnimation: (documentID: string) => request>(`/api/emoji/${encodeURIComponent(documentID)}/animation`), messages: (params: URLSearchParams) => request(`/api/messages?${params.toString()}`), message: (ownerUserID: number, msgID: number) => { const params = new URLSearchParams({ owner_user_id: String(ownerUserID), msg_id: String(msgID) }); diff --git a/cmd/telesrv-admin/web/src/components/Layout.tsx b/cmd/telesrv-admin/web/src/components/Layout.tsx index 411fc0ab..06084cf5 100644 --- a/cmd/telesrv-admin/web/src/components/Layout.tsx +++ b/cmd/telesrv-admin/web/src/components/Layout.tsx @@ -8,8 +8,10 @@ import { Server, Shield, ShieldCheck, + Smile, Users, - Gift + Gift, + Send } from "lucide-react"; import { useEffect, useState, type ReactNode } from "react"; import { api } from "../api"; @@ -79,6 +81,8 @@ export function Shell({ } href="/channels" route={route} navigate={navigate}>{t("layout.channels")} } href="/bots" route={route} navigate={navigate}>{t("layout.bots")} } href="/gifts" route={route} navigate={navigate}>{t("layout.gifts")} + } href="/give-gifts" route={route} navigate={navigate}>{t("layout.giveGifts")} + } href="/emoji" route={route} navigate={navigate}>{t("layout.emoji")}
+ +
{t("attr.attributes")}
+ + + + } /> diff --git a/cmd/telesrv-admin/web/src/pages/AccountsPage.tsx b/cmd/telesrv-admin/web/src/pages/AccountsPage.tsx index cb6bf302..08d0d201 100644 --- a/cmd/telesrv-admin/web/src/pages/AccountsPage.tsx +++ b/cmd/telesrv-admin/web/src/pages/AccountsPage.tsx @@ -2,6 +2,7 @@ import { ChevronRight, Loader2, RefreshCw, Search } from "lucide-react"; import { useEffect, useState } from "react"; import { api, errorMessage } from "../api"; import { Alert, Badge, EmptyRow, Metric, PageFrame, QueryPanel } from "../components/ui"; +import { ScamFakeBadges } from "../components/flags"; import { useI18n } from "../i18n"; import { displayName, displayPhone, displayUsername, formatDate, formatUnix } from "../lib/format"; import { accountMetrics } from "../lib/metrics"; @@ -111,7 +112,7 @@ export function AccountsPage({ navigate }: { navigate: Navigate }) { {row.DeviceCount} {formatDate(row.LastActiveAt)} {row.PremiumUntil > 0 ? {t("account.premium")} {formatUnix(row.PremiumUntil)} : {t("common.none")}} - {row.Verified ? {t("common.verified")} : {t("account.notVerified")}} + {row.Verified ? {t("common.verified")} : {t("account.notVerified")}} {row.Frozen ? {t("account.frozen")} : {t("common.normal")}} {formatDate(row.UpdatedAt)} diff --git a/cmd/telesrv-admin/web/src/pages/BotDetailPage.tsx b/cmd/telesrv-admin/web/src/pages/BotDetailPage.tsx index f6bb5804..d91ce85c 100644 --- a/cmd/telesrv-admin/web/src/pages/BotDetailPage.tsx +++ b/cmd/telesrv-admin/web/src/pages/BotDetailPage.tsx @@ -3,6 +3,8 @@ import { useEffect, useState } from "react"; import { api, errorMessage } from "../api"; import { ActionButton } from "../components/ActionButton"; import { Alert, AuditTable, Badge, LoadingSurface, PageFrame, SectionHead, SplitLayout, Summary } from "../components/ui"; +import { ScamFakeActions, ScamFakeBadges } from "../components/flags"; +import { ColorAction, EmojiStatusAction, UsernameAction } from "../components/attributes"; import { useI18n } from "../i18n"; import { displayUsername, formatDate } from "../lib/format"; import type { Navigate } from "../routing"; @@ -55,6 +57,7 @@ export function BotDetailPage({ id, navigate }: { id: number; navigate: Navigate
{bot.System ? t("bots.system") : t("bots.user")} {bot.Verified ? {t("common.verified")} : {t("account.notVerified")}} +
@@ -85,6 +88,11 @@ export function BotDetailPage({ id, navigate }: { id: number; navigate: Navigate onDone={load} />
+ +
{t("attr.attributes")}
+ + + {bot.System ? (

{t("bots.systemHint")}

) : ( diff --git a/cmd/telesrv-admin/web/src/pages/BotsPage.tsx b/cmd/telesrv-admin/web/src/pages/BotsPage.tsx index a4cde501..d8890cba 100644 --- a/cmd/telesrv-admin/web/src/pages/BotsPage.tsx +++ b/cmd/telesrv-admin/web/src/pages/BotsPage.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import { api, errorMessage } from "../api"; import { ActionButton } from "../components/ActionButton"; import { Alert, Badge, EmptyRow, Metric, PageFrame, QueryPanel } from "../components/ui"; +import { ScamFakeBadges } from "../components/flags"; import { useI18n } from "../i18n"; import { displayUsername, formatDate, toInt } from "../lib/format"; import type { Navigate } from "../routing"; @@ -152,7 +153,7 @@ export function BotsPage({ navigate }: { navigate: Navigate }) { {displayUsername(row.Username) || "-"} {row.FirstName || "-"} {row.OwnerUserID > 0 ? row.OwnerUserID : "-"} - {row.Verified ? {t("common.verified")} : {t("account.notVerified")}} + {row.Verified ? {t("common.verified")} : {t("account.notVerified")}} {row.System ? {t("bots.system")} : {t("bots.user")}} {formatDate(row.CreatedAt)} diff --git a/cmd/telesrv-admin/web/src/pages/ChannelDetailPage.tsx b/cmd/telesrv-admin/web/src/pages/ChannelDetailPage.tsx index f46c5a02..351b55dd 100644 --- a/cmd/telesrv-admin/web/src/pages/ChannelDetailPage.tsx +++ b/cmd/telesrv-admin/web/src/pages/ChannelDetailPage.tsx @@ -4,6 +4,8 @@ import { api, errorMessage } from "../api"; import { ActionButton } from "../components/ActionButton"; import { Alert, AuditTable, Badge, JsonBlock, LoadingSurface, PageFrame, SectionHead, SplitLayout, Summary } from "../components/ui"; import { useI18n } from "../i18n"; +import { ScamFakeActions, ScamFakeBadges } from "../components/flags"; +import { ChannelSettingsAction, ColorAction, EmojiStatusAction, UsernameAction } from "../components/attributes"; import { channelKind, displayUsername, formatDate, formatUnix } from "../lib/format"; import type { Navigate } from "../routing"; import type { ChannelDetail } from "../types"; @@ -51,6 +53,7 @@ export function ChannelDetailPage({ id, navigate }: { id: number; navigate: Navi
{channelKind(ch, t)} {ch.Verified ? {t("common.verified")} : {t("account.notVerified")}} + {ch.Deleted ? {t("common.deleted")} : {t("common.valid")}}
@@ -86,6 +89,13 @@ export function ChannelDetailPage({ id, navigate }: { id: number; navigate: Navi payload={() => ({ channel_id: ch.ID, verified: !ch.Verified })} onDone={load} /> + +
{t("attr.settings")}
+ +
{t("attr.attributes")}
+ + + } /> diff --git a/cmd/telesrv-admin/web/src/pages/ChannelsPage.tsx b/cmd/telesrv-admin/web/src/pages/ChannelsPage.tsx index 9f45b878..f7db9567 100644 --- a/cmd/telesrv-admin/web/src/pages/ChannelsPage.tsx +++ b/cmd/telesrv-admin/web/src/pages/ChannelsPage.tsx @@ -2,6 +2,7 @@ import { ChevronRight, Loader2, RefreshCw, Search } from "lucide-react"; import { useEffect, useState } from "react"; import { api, errorMessage } from "../api"; import { Alert, Badge, EmptyRow, Metric, PageFrame, QueryPanel } from "../components/ui"; +import { ScamFakeBadges } from "../components/flags"; import { useI18n } from "../i18n"; import { channelKind, displayUsername, formatDate } from "../lib/format"; import { channelMetrics } from "../lib/metrics"; @@ -110,7 +111,7 @@ export function ChannelsPage({ navigate }: { navigate: Navigate }) { {row.ParticipantsCount} {row.AdminsCount} {row.PTS} - {row.Verified ? {t("common.verified")} : {t("account.notVerified")}} + {row.Verified ? {t("common.verified")} : {t("account.notVerified")}} {formatDate(row.UpdatedAt)} diff --git a/cmd/telesrv-admin/web/src/pages/EmojiPage.tsx b/cmd/telesrv-admin/web/src/pages/EmojiPage.tsx new file mode 100644 index 00000000..ee139725 --- /dev/null +++ b/cmd/telesrv-admin/web/src/pages/EmojiPage.tsx @@ -0,0 +1,158 @@ +import lottie from "lottie-web/build/player/lottie_light_canvas"; +import { Check, ChevronRight, Copy, Loader2, RefreshCw, Search } from "lucide-react"; +import { useEffect, useRef, useState } from "react"; +import { api, errorMessage } from "../api"; +import { Alert, Metric, PageFrame, QueryPanel } from "../components/ui"; +import { useI18n } from "../i18n"; +import type { EmojiListResponse, EmojiRow } from "../types"; + +function formatBytes(value: number): string { + if (value < 1024) return `${value} B`; + if (value < 1024 * 1024) return `${(value / 1024).toFixed(1)} KB`; + return `${(value / (1024 * 1024)).toFixed(1)} MB`; +} + +function isAnimated(mime: string): boolean { + const m = mime.toLowerCase(); + return m.includes("tgsticker") || m.includes("lottie") || m.includes("json"); +} + +function EmojiPreview({ row }: { row: EmojiRow }) { + const host = useRef(null); + const animation = useRef | null>(null); + const [failed, setFailed] = useState(!isAnimated(row.MimeType)); + + useEffect(() => { + if (!isAnimated(row.MimeType)) { + setFailed(true); + return; + } + let cancelled = false; + api.emojiAnimation(row.DocumentID).then((data) => { + if (cancelled || !host.current) return; + animation.current?.destroy(); + animation.current = lottie.loadAnimation({ + container: host.current, + renderer: "canvas", + loop: true, + autoplay: true, + animationData: structuredClone(data) + }); + }).catch(() => setFailed(true)); + return () => { + cancelled = true; + animation.current?.destroy(); + animation.current = null; + }; + }, [row.DocumentID, row.MimeType]); + + if (failed) { + return
{row.Alt || "🙂"}
; + } + return
; +} + +function EmojiCard({ row }: { row: EmojiRow }) { + const { t } = useI18n(); + const [copied, setCopied] = useState(false); + + async function copy() { + try { + await navigator.clipboard.writeText(row.DocumentID); + setCopied(true); + setTimeout(() => setCopied(false), 1200); + } catch { + // Clipboard is best-effort. + } + } + + return ( +
+
+
+ {row.Alt || "—"} + + {row.SetTitle || t("emoji.noSet")} · {formatBytes(row.Size)} +
+
+ ); +} + +export function EmojiPage() { + const { t } = useI18n(); + const [q, setQ] = useState(""); + const [data, setData] = useState(null); + const [cursor, setCursor] = useState(0); + const [busy, setBusy] = useState(false); + const [error, setError] = useState(""); + + async function load(next = false) { + setBusy(true); + setError(""); + const params = new URLSearchParams(); + if (q.trim()) { + params.set("q", q.trim()); + } else if (next) { + params.set("before_id", String(cursor)); + } + try { + const result = await api.emoji(params); + setData(result); + setCursor(result.next_before_id); + } catch (err) { + setError(errorMessage(err)); + } finally { + setBusy(false); + } + } + + useEffect(() => { + void load(false); + }, []); + + const rows = data?.rows ?? []; + + return ( + load(false)} disabled={busy}> + {t("common.refresh")} + + } + > + {error && {error}} +
+ +
+ +
{ event.preventDefault(); void load(false); }}> + + + {data?.listing && data.has_more && ( + + )} +
+
+

{t("emoji.hint")}

+ {rows.length === 0 ? ( +
{t("common.noResults")}
+ ) : ( +
+ {rows.map((row) => )} +
+ )} +
+ ); +} diff --git a/cmd/telesrv-admin/web/src/pages/GiftsPage.tsx b/cmd/telesrv-admin/web/src/pages/GiftsPage.tsx index c6441b18..5301c765 100644 --- a/cmd/telesrv-admin/web/src/pages/GiftsPage.tsx +++ b/cmd/telesrv-admin/web/src/pages/GiftsPage.tsx @@ -23,7 +23,7 @@ function formatBytes(value: number | string) { return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; } -function LottiePreview({ giftID, revision, compact = false }: { giftID: string; revision: number; compact?: boolean }) { +export function LottiePreview({ giftID, revision, compact = false }: { giftID: string; revision: number; compact?: boolean }) { const host = useRef(null); const animation = useRef | null>(null); const [playing, setPlaying] = useState(true); diff --git a/cmd/telesrv-admin/web/src/pages/GiveGiftForm.tsx b/cmd/telesrv-admin/web/src/pages/GiveGiftForm.tsx new file mode 100644 index 00000000..829a648a --- /dev/null +++ b/cmd/telesrv-admin/web/src/pages/GiveGiftForm.tsx @@ -0,0 +1,229 @@ +import { CheckCircle2, CircleAlert, Gift, Loader2, Play, User, Users } from "lucide-react"; +import { useEffect, useMemo, useState } from "react"; +import { api, errorMessage } from "../api"; +import { ChannelPicker, UserPicker } from "../components/EntityPicker"; +import { Alert, JsonBlock } from "../components/ui"; +import { useI18n } from "../i18n"; +import type { AccountRow, ChannelRow, CommandResult, StarGiftCollectibleAttributeRow, StarGiftCollectiblePreview, StarGiftRow } from "../types"; + +const SYSTEM_SENDER = "777000"; + +type RecipientKind = "user" | "channel"; + +function attrLabel(attr: StarGiftCollectibleAttributeRow): string { + const rarity = attr.rarity_permille > 0 ? ` · ${(attr.rarity_permille / 10).toFixed(1)}%` : ""; + return `${attr.name || `#${attr.id}`}${rarity}`; +} + +export function GiveGiftForm({ gift, onDone }: { gift: StarGiftRow; onDone?: () => void }) { + const { t } = useI18n(); + const [kind, setKind] = useState("user"); + const [user, setUser] = useState(null); + const [channel, setChannel] = useState(null); + const [sender, setSender] = useState(SYSTEM_SENDER); + const [message, setMessage] = useState(""); + const [hideName, setHideName] = useState(false); + const [upgrade, setUpgrade] = useState(false); + const [preview, setPreview] = useState(null); + const [previewError, setPreviewError] = useState(""); + const [modelID, setModelID] = useState("0"); + const [patternID, setPatternID] = useState("0"); + const [backdropID, setBackdropID] = useState("0"); + const [num, setNum] = useState(""); + const [reason, setReason] = useState(""); + const [result, setResult] = useState(null); + const [error, setError] = useState(""); + const [busy, setBusy] = useState(false); + + const recipientID = kind === "user" ? user?.ID ?? 0 : channel?.ID ?? 0; + const upgradable = kind === "user" && upgrade; + + // Reset the collectible selection whenever the chosen gift changes; the + // recipient/sender/message are intentionally preserved for fast re-issuing. + useEffect(() => { + setUpgrade(false); + setPreview(null); + setPreviewError(""); + setModelID("0"); + setPatternID("0"); + setBackdropID("0"); + setNum(""); + setResult(null); + setError(""); + }, [gift.GiftID]); + + useEffect(() => { + if (!upgradable || preview) return; + let cancelled = false; + setPreviewError(""); + api.giftCollectibles(gift.GiftID) + .then((data) => { if (!cancelled) setPreview(data); }) + .catch((err) => { if (!cancelled) setPreviewError(errorMessage(err)); }); + return () => { cancelled = true; }; + }, [upgradable, preview, gift.GiftID]); + + function buildPayload(confirm: boolean): Record { + const senderID = Number.parseInt(sender.trim() || SYSTEM_SENDER, 10); + const parsedNum = Number.parseInt(num.trim(), 10); + return { + gift_id: gift.GiftID, + sender_user_id: Number.isFinite(senderID) ? senderID : 0, + user_id: kind === "user" ? recipientID : 0, + channel_id: kind === "channel" ? recipientID : 0, + hide_name: hideName, + message: message.trim(), + upgrade: upgradable, + model_attribute_id: upgradable ? modelID : "0", + pattern_attribute_id: upgradable ? patternID : "0", + backdrop_attribute_id: upgradable ? backdropID : "0", + num: upgradable && Number.isFinite(parsedNum) && parsedNum > 0 ? parsedNum : 0, + reason: reason.trim(), + confirm + }; + } + + const previewPayload = useMemo(() => buildPayload(false), [gift.GiftID, kind, recipientID, sender, message, hideName, upgrade, modelID, patternID, backdropID, num, reason]); + const canConfirm = result?.dry_run && !result.error; + + async function run(confirm: boolean) { + if (recipientID <= 0) { + setError(t("giveGift.recipientRequired")); + return; + } + if (!reason.trim()) { + setError(t("action.reasonRequired")); + return; + } + setBusy(true); + setError(""); + try { + const commandResult = await api.action("/api/actions/give-gift", buildPayload(confirm)); + setResult(commandResult); + if (confirm && !commandResult.error) { + onDone?.(); + } + } catch (err) { + setError(errorMessage(err)); + } finally { + setBusy(false); + } + } + + return ( +
+
+ +
+ {gift.Title || `Gift #${gift.GiftID}`} + #{gift.GiftID} · ⭐ {gift.Stars} +
+
+ +
+ + +
+ + {kind === "user" + ? { setUser(row); setResult(null); }} /> + : { setChannel(row); setResult(null); }} />} + + + +