106 lines
33 KiB
JavaScript
106 lines
33 KiB
JavaScript
import{$ as e,A as t,Bt as n,D as r,E as i,Ht as a,I as o,M as s,N as c,O as l,Q as u,R as d,St as f,T as p,Vt as m,X as h,Z as g,ct as _,ft as v,j as y,m as b,r as x,w as S,wt as C,xt as w,y as T,yt as E}from"./client-BPUTdqiR.js";import{G as D,H as O,K as k,M as A,N as j,V as M,W as N,i as P,n as ee,o as F,r as I,t as te}from"./light-CAboqKml.js";import{t as ne}from"./Card-BpETOx86.js";import{i as re}from"./Suffix--XbmyHm6.js";import{t as ie}from"./Modal-B3J1v4fq.js";import{t as L}from"./use-merged-state-Cf_5Bk0w.js";import{r as ae,t as R}from"./Button-C2tJ4IpD.js";import{r as z,t as oe}from"./use-form-item-CmxopeL6.js";import{n as se,r as B,t as ce}from"./Upload-BlwcEy3T.js";import{i as le,r as ue}from"./resolve-slot-CvI9c3sm.js";import{t as de}from"./Add-ByzGdZm-.js";import{t as V}from"./Input-n3uxaVJs.js";import{n as fe,t as pe}from"./Switch-B2z00YHT.js";import{t as me}from"./Tag-DwgSvhLr.js";import{t as H}from"./es-BEZ2Umea.js";import{t as U}from"./Space-e4uMmw8l.js";import{S as he,U as W,Z as ge,f as _e,rt as G,w as ve}from"./index-DyRlptq3.js";import{t as ye}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as K,r as q,t as be}from"./application-1kkupXkH.js";import{t as xe}from"./MessagePaper-DBUWHrDL.js";var Se=c({name:`ArrowDown`,render(){return o(`svg`,{viewBox:`0 0 28 28`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},o(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},o(`g`,{"fill-rule":`nonzero`},o(`path`,{d:`M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z`}))))}}),Ce=c({name:`ArrowUp`,render(){return o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},o(`g`,{fill:`none`},o(`path`,{d:`M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z`,fill:`currentColor`})))}}),we=O(`input-group`,`
|
|
display: inline-flex;
|
|
width: 100%;
|
|
flex-wrap: nowrap;
|
|
vertical-align: bottom;
|
|
`,[M(`>`,[O(`input`,[M(`&:not(:last-child)`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),M(`&:not(:first-child)`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
margin-left: -1px!important;
|
|
`)]),O(`button`,[M(`&:not(:last-child)`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`,[N(`state-border, border`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`)]),M(`&:not(:first-child)`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`,[N(`state-border, border`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`)])]),M(`*`,[M(`&:not(:last-child)`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`,[M(`>`,[O(`input`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),O(`base-selection`,[O(`base-selection-label`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),O(`base-selection-tags`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`),N(`box-shadow, border, state-border`,`
|
|
border-top-right-radius: 0!important;
|
|
border-bottom-right-radius: 0!important;
|
|
`)])])]),M(`&:not(:first-child)`,`
|
|
margin-left: -1px!important;
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`,[M(`>`,[O(`input`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`),O(`base-selection`,[O(`base-selection-label`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`),O(`base-selection-tags`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`),N(`box-shadow, border, state-border`,`
|
|
border-top-left-radius: 0!important;
|
|
border-bottom-left-radius: 0!important;
|
|
`)])])])])])]),J=c({name:`InputGroup`,props:{},setup(e){let{mergedClsPrefixRef:t}=j(e);return P(`-input-group`,we,t),{mergedClsPrefix:t}},render(){let{mergedClsPrefix:e}=this;return o(`div`,{class:`${e}-input-group`},this.$slots)}}),Y=`0!important`,Te=`-1px!important`;function X(e){return D(`${e}-type`,[M(`& +`,[O(`button`,{},[D(`${e}-type`,[N(`border`,{borderLeftWidth:Y}),N(`state-border`,{left:Te})])])])])}function Z(e){return D(`${e}-type`,[M(`& +`,[O(`button`,[D(`${e}-type`,[N(`border`,{borderTopWidth:Y}),N(`state-border`,{top:Te})])])])])}var Ee=O(`button-group`,`
|
|
flex-wrap: nowrap;
|
|
display: inline-flex;
|
|
position: relative;
|
|
`,[k(`vertical`,{flexDirection:`row`},[k(`rtl`,[O(`button`,[M(`&:first-child:not(:last-child)`,`
|
|
margin-right: ${Y};
|
|
border-top-right-radius: ${Y};
|
|
border-bottom-right-radius: ${Y};
|
|
`),M(`&:last-child:not(:first-child)`,`
|
|
margin-left: ${Y};
|
|
border-top-left-radius: ${Y};
|
|
border-bottom-left-radius: ${Y};
|
|
`),M(`&:not(:first-child):not(:last-child)`,`
|
|
margin-left: ${Y};
|
|
margin-right: ${Y};
|
|
border-radius: ${Y};
|
|
`),X(`default`),D(`ghost`,[X(`primary`),X(`info`),X(`success`),X(`warning`),X(`error`)])])])]),D(`vertical`,{flexDirection:`column`},[O(`button`,[M(`&:first-child:not(:last-child)`,`
|
|
margin-bottom: ${Y};
|
|
margin-left: ${Y};
|
|
margin-right: ${Y};
|
|
border-bottom-left-radius: ${Y};
|
|
border-bottom-right-radius: ${Y};
|
|
`),M(`&:last-child:not(:first-child)`,`
|
|
margin-top: ${Y};
|
|
margin-left: ${Y};
|
|
margin-right: ${Y};
|
|
border-top-left-radius: ${Y};
|
|
border-top-right-radius: ${Y};
|
|
`),M(`&:not(:first-child):not(:last-child)`,`
|
|
margin: ${Y};
|
|
border-radius: ${Y};
|
|
`),Z(`default`),D(`ghost`,[Z(`primary`),Z(`info`),Z(`success`),Z(`warning`),Z(`error`)])])])]),De=c({name:`ButtonGroup`,props:{size:String,vertical:Boolean},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n}=j(e);return P(`-button-group`,Ee,t),g(ae,e),{rtlEnabled:F(`ButtonGroup`,n,t),mergedClsPrefix:t}},render(){let{mergedClsPrefix:e}=this;return o(`div`,{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:`group`},this.$slots)}});function Oe(){return _e}var ke=ee({name:`DynamicInput`,common:te,peers:{Input:ve,Button:he},self:Oe}),Ae=b(`n-dynamic-input`),je=c({name:`DynamicInputInputPreset`,props:{clsPrefix:{type:String,required:!0},value:{type:String,default:``},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){let{mergedThemeRef:e,placeholderRef:t}=d(Ae);return{mergedTheme:e,placeholder:t}},render(){let{mergedTheme:e,placeholder:t,value:n,clsPrefix:r,onUpdateValue:i,disabled:a}=this;return o(`div`,{class:`${r}-dynamic-input-preset-input`},o(V,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:n,placeholder:t,onUpdateValue:i,disabled:a}))}}),Me=c({name:`DynamicInputPairPreset`,props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:``,value:``})},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(e){let{mergedThemeRef:t,keyPlaceholderRef:n,valuePlaceholderRef:r}=d(Ae);return{mergedTheme:t,keyPlaceholder:n,valuePlaceholder:r,handleKeyInput(t){e.onUpdateValue({key:t,value:e.value.value})},handleValueInput(t){e.onUpdateValue({key:e.value.key,value:t})}}},render(){let{mergedTheme:e,keyPlaceholder:t,valuePlaceholder:n,value:r,clsPrefix:i,disabled:a}=this;return o(`div`,{class:`${i}-dynamic-input-preset-pair`},o(V,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.key,class:`${i}-dynamic-input-pair-input`,placeholder:t,onUpdateValue:this.handleKeyInput,disabled:a}),o(V,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.value,class:`${i}-dynamic-input-pair-input`,placeholder:n,onUpdateValue:this.handleValueInput,disabled:a}))}}),Ne=O(`dynamic-input`,{width:`100%`},[O(`dynamic-input-item`,`
|
|
margin-bottom: 10px;
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
`,[O(`dynamic-input-preset-input`,{flex:1,alignItems:`center`}),O(`dynamic-input-preset-pair`,`
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
`,[O(`dynamic-input-pair-input`,[M(`&:first-child`,{"margin-right":`12px`})])]),N(`action`,`
|
|
align-self: flex-start;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
flex-shrink: 0;
|
|
flex-grow: 0;
|
|
margin: var(--action-margin);
|
|
`,[D(`icon`,{cursor:`pointer`})]),M(`&:last-child`,{marginBottom:0})]),O(`form-item`,`
|
|
padding-top: 0 !important;
|
|
margin-right: 0 !important;
|
|
`,[O(`form-item-blank`,{paddingTop:`0 !important`})])]),Q=new WeakMap,$=c({name:`DynamicInput`,props:Object.assign(Object.assign({},I.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:`input`},keyField:String,itemClass:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:``},valuePlaceholder:{type:String,default:``},placeholder:{type:String,default:``},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]}),setup(e,{slots:t}){let{mergedComponentPropsRef:n,mergedClsPrefixRef:r,mergedRtlRef:i,inlineThemeDisabled:a}=j(),o=d(oe,null),s=E(e.defaultValue),c=L(f(e,`value`),s),l=I(`DynamicInput`,`-dynamic-input`,Ne,ke,e,r),u=S(()=>{let{value:t}=c;if(Array.isArray(t)){let{max:n}=e;return n!==void 0&&t.length>=n}return!1}),p=S(()=>{let{value:t}=c;return Array.isArray(t)?t.length<=e.min:!0}),m=S(()=>n?.value?.DynamicInput?.buttonSize);function h(t){let{onInput:n,"onUpdate:value":r,onUpdateValue:i}=e;n&&z(n,t),r&&z(r,t),i&&z(i,t),s.value=t}function _(e,t){if(typeof e!=`object`||!e)return t;let n=v(e)?w(e):e,r=Q.get(n);return r===void 0&&Q.set(n,r=ge()),r}function y(e,t){let{value:n}=c,r=Array.from(n??[]),i=r[e];if(r[e]=t,i&&t&&typeof i==`object`&&typeof t==`object`){let e=v(i)?w(i):i,n=v(t)?w(t):t,r=Q.get(e);r!==void 0&&Q.set(n,r)}h(r)}function b(){x(-1)}function x(n){let{value:r}=c,{onCreate:i}=e,a=Array.from(r??[]);if(i)a.splice(n+1,0,i(n+1)),h(a);else if(t.default)a.splice(n+1,0,null),h(a);else switch(e.preset){case`input`:a.splice(n+1,0,``),h(a);break;case`pair`:a.splice(n+1,0,{key:``,value:``}),h(a);break}}function C(t){let{value:n}=c;if(!Array.isArray(n))return;let{min:r}=e;if(n.length<=r)return;let{onRemove:i}=e;i&&i(t);let a=Array.from(n);a.splice(t,1),h(a)}function T(e,t,n){if(t<0||n<0||t>=e.length||n>=e.length||t===n)return;let r=e[t];e[t]=e[n],e[n]=r}function D(e,t){let{value:n}=c;if(!Array.isArray(n))return;let r=Array.from(n);e===`up`&&T(r,t,t-1),e===`down`&&T(r,t,t+1),h(r)}g(Ae,{mergedThemeRef:l,keyPlaceholderRef:f(e,`keyPlaceholder`),valuePlaceholderRef:f(e,`valuePlaceholder`),placeholderRef:f(e,`placeholder`)});let O=F(`DynamicInput`,i,r),k=S(()=>{let{self:{actionMargin:e,actionMarginRtl:t}}=l.value;return{"--action-margin":e,"--action-margin-rtl":t}}),M=a?A(`dynamic-input`,void 0,k,e):void 0;return{locale:re(`DynamicInput`).localeRef,rtlEnabled:O,buttonSize:m,mergedClsPrefix:r,NFormItem:o,uncontrolledValue:s,mergedValue:c,insertionDisabled:u,removeDisabled:p,handleCreateClick:b,ensureKey:_,handleValueChange:y,remove:C,move:D,createItem:x,mergedTheme:l,cssVars:a?void 0:k,themeClass:M?.themeClass,onRender:M?.onRender}},render(){let{$slots:e,itemClass:t,buttonSize:n,mergedClsPrefix:r,mergedValue:i,locale:a,mergedTheme:s,keyField:c,itemStyle:l,preset:u,showSortButton:d,NFormItem:f,ensureKey:p,handleValueChange:m,remove:h,createItem:g,move:_,onRender:v,disabled:y}=this;return v?.(),o(`div`,{class:[`${r}-dynamic-input`,this.rtlEnabled&&`${r}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(i)||i.length===0?o(R,Object.assign({block:!0,ghost:!0,dashed:!0,size:n},this.createButtonProps,{disabled:this.insertionDisabled||y,theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>ue(e[`create-button-default`],()=>[a.create]),icon:()=>ue(e[`create-button-icon`],()=>[o(W,{clsPrefix:r},{default:()=>o(de,null)})])}):i.map((a,v)=>o(`div`,{key:c?a[c]:p(a,v),"data-key":c?a[c]:p(a,v),class:[`${r}-dynamic-input-item`,t],style:l},le(e.default,{value:i[v],index:v},()=>[u===`input`?o(je,{disabled:y,clsPrefix:r,value:i[v],parentPath:f?f.path.value:void 0,path:f?.path.value?`${f.path.value}[${v}]`:void 0,onUpdateValue:e=>{m(v,e)}}):u===`pair`?o(Me,{disabled:y,clsPrefix:r,value:i[v],parentPath:f?f.path.value:void 0,path:f?.path.value?`${f.path.value}[${v}]`:void 0,onUpdateValue:e=>{m(v,e)}}):null]),le(e.action,{value:i[v],index:v,create:g,remove:h,move:_},()=>[o(`div`,{class:`${r}-dynamic-input-item__action`},o(De,{size:n},{default:()=>[o(R,{disabled:this.removeDisabled||y,theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,circle:!0,onClick:()=>{h(v)}},{icon:()=>o(W,{clsPrefix:r},{default:()=>o(fe,null)})}),o(R,{disabled:this.insertionDisabled||y,circle:!0,theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,onClick:()=>{g(v)}},{icon:()=>o(W,{clsPrefix:r},{default:()=>o(de,null)})}),d?o(R,{disabled:v===0||y,circle:!0,theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,onClick:()=>{_(`up`,v)}},{icon:()=>o(W,{clsPrefix:r},{default:()=>o(Ce,null)})}):null,d?o(R,{disabled:v===i.length-1||y,circle:!0,theme:s.peers.Button,themeOverrides:s.peerOverrides.Button,onClick:()=>{_(`down`,v)}},{icon:()=>o(W,{clsPrefix:r},{default:()=>o(Se,null)})}):null]}))]))))}}),Pe={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 24 24`},Fe=c({name:`CloseOutlined`,render:function(e,t){return h(),l(`svg`,Pe,t[0]||=[p(`path`,{d:`M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z`,fill:`currentColor`},null,-1)])}}),Ie={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 24 24`},Le=c({name:`LockOutlined`,render:function(e,t){return h(),l(`svg`,Ie,t[0]||=[p(`path`,{d:`M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2z`,fill:`currentColor`},null,-1)])}}),Re={key:0},ze={class:`intro-text font`},Be={key:0,class:`intro-audio-block`},Ve=[`src`],He={class:`message-content`},Ue={key:0},We={key:1,class:`intro-empty`},Ge={key:2,class:`intro-audio-block`},Ke=[`src`],qe={key:2,class:`place-block`},Je={class:`intro-edit-audio`},Ye=[`src`],Xe={class:`slot-block`},Ze=ye(c({__name:`IntroBlock`,props:{introduction:{},mode:{}},emits:[`update:mode`],setup(t,{emit:n}){let o=t,c=n,u=e=>{c(`update:mode`,e)},d=S(()=>!!o.introduction?.text),f=S(()=>!!o.introduction?.audio),m=S(()=>{let e=o.introduction?.audio;if(e)return/^https?:\/\//i.test(e)?e:`${x()}/api/files/${encodeURIComponent(e)}`}),g=()=>{o.introduction&&(o.introduction.audio=``,o.introduction.fileList=void 0)};return(n,c)=>(h(),l(T,null,[t.mode==`show`?(h(),l(`div`,Re,[s(xe,null,{default:_(()=>[c[4]||=p(`div`,{class:`font`},`Вступление`,-1),c[5]||=p(`hr`,{class:`intro-hr`},null,-1),p(`div`,ze,a(t.introduction.text),1),f.value?(h(),l(`div`,Be,[p(`audio`,{src:m.value,controls:``,preload:`none`,class:`intro-audio`},null,8,Ve)])):r(``,!0)]),_:1})])):r(``,!0),t.mode==`show-editor`?(h(),l(`div`,{key:1,class:`place-block-hover show-editor-block`,onClick:c[0]||=e=>u(`edit`)},[c[6]||=p(`div`,{class:`message-header`},`Вступление`,-1),c[7]||=p(`hr`,{class:`hr`},null,-1),p(`div`,He,[d.value?(h(),l(`span`,Ue,a(t.introduction.text),1)):(h(),l(`span`,We,`Введение не задано — нажмите, чтобы добавить`)),f.value?(h(),l(`div`,Ge,[p(`audio`,{src:m.value,controls:``,preload:`none`,class:`intro-audio`},null,8,Ke)])):r(``,!0)])])):r(``,!0),t.mode==`edit`?(h(),l(`div`,qe,[s(C(U),{vertical:``},{default:_(()=>[c[11]||=p(`p`,{class:`settings-header`},`Текст вступления`,-1),s(C(V),{value:o.introduction.text,"onUpdate:value":c[1]||=e=>o.introduction.text=e,type:`textarea`,autosize:{minRows:4,maxRows:12},placeholder:`Дорогие сыщики! В этом деле вам предстоит...`},null,8,[`value`]),c[12]||=p(`p`,{class:`settings-header`},`Аудио вступления`,-1),p(`div`,Je,[s(C(U),{vertical:``},{default:_(()=>[f.value?(h(),l(`audio`,{key:0,src:m.value,controls:``,preload:`none`,class:`intro-audio`},null,8,Ye)):(h(),i(C(B),{key:1,depth:`3`},{default:_(()=>[...c[8]||=[y(`Аудио не задано`,-1)]]),_:1})),s(C(R),{onClick:c[2]||=e=>g(),disabled:!f.value},{default:_(()=>[...c[9]||=[y(`Убрать аудио`,-1)]]),_:1},8,[`disabled`])]),_:1}),s(C(ce),{"directory-dnd":``,max:1,"file-list":o.introduction.fileList,"onUpdate:fileList":c[3]||=e=>o.introduction.fileList=e},{default:_(()=>[s(C(se),null,{default:_(()=>[s(C(B),{style:{"font-size":`16px`}},{default:_(()=>[...c[10]||=[y(` Щелкните или перетащите аудиофайл в эту область для загрузки `,-1)]]),_:1})]),_:1})]),_:1},8,[`file-list`])]),p(`div`,Xe,[e(n.$slots,`default`,{},void 0,!0)])]),_:3})])):r(``,!0)],64))}}),[[`__scopeId`,`data-v-11f63e45`]]),Qe={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 24 24`},$e=c({name:`Key24Regular`,render:function(e,t){return h(),l(`svg`,Qe,t[0]||=[p(`g`,{fill:`none`},[p(`path`,{d:`M18.25 7a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0zM15.5 2.05A6.554 6.554 0 0 0 8.95 8.6c0 .387.05.76.11 1.104a.275.275 0 0 1-.07.244l-6.235 6.236a2.75 2.75 0 0 0-.806 1.944V20.3c0 .966.784 1.75 1.75 1.75h2.5a1.75 1.75 0 0 0 1.75-1.75v-1.25H9.7c.69 0 1.25-.56 1.25-1.25v-1.75h1.75a1.25 1.25 0 0 0 1.25-1.204c.496.128 1.02.204 1.55.204a6.554 6.554 0 0 0 6.55-6.55c0-3.631-2.953-6.45-6.55-6.45zM10.45 8.6a5.054 5.054 0 0 1 5.05-5.05c2.802 0 5.05 2.181 5.05 4.95a5.054 5.054 0 0 1-5.05 5.05c-.68 0-1.38-.171-2.005-.44a.75.75 0 0 0-1.046.69v.75H10.7c-.69 0-1.25.56-1.25 1.25v1.75H7.7c-.69 0-1.25.56-1.25 1.25v1.5a.25.25 0 0 1-.25.25H3.7a.25.25 0 0 1-.25-.25v-2.172c0-.331.132-.65.366-.884l6.236-6.235a1.774 1.774 0 0 0 .486-1.564a4.917 4.917 0 0 1-.088-.845z`,fill:`currentColor`})],-1)])}}),et={key:1,class:`place-block`},tt={class:`message-header`},nt={class:`message-content`},rt={key:0},it=[`src`,`alt`],at={class:`door-button-label`},ot={key:0,class:`hr`},st={class:`application-name`},ct=[`onClick`],lt=[`src`,`alt`],ut=[`src`],dt=[`href`],ft={class:`gray-block`},pt={key:0},mt={key:3},ht={class:`message-show-header font`},gt={key:0,class:`mcp-label`,title:`Ход сделан через MCP`},_t={class:`message-show-content font`},vt={key:0},yt=[`src`,`alt`],bt=[`src`,`alt`],xt={key:2,class:`show-applications-block`},St=[`onClick`],Ct=[`src`,`alt`],wt={key:0,class:`show-hr`},Tt=[`onClick`],Et={class:`button-dialog-text`},Dt={key:1,class:`show-hr`},Ot=[`href`],kt={class:`application-label`},At=[`src`],jt={key:4},Mt={class:`message-header font`},Nt={key:0,class:`mcp-label`,title:`Ход сделан через MCP`},Pt={key:5,class:`place-block`},Ft=[`src`,`alt`],It={style:{display:`flex`,"flex-direction":`column`,width:`100%`}},Lt={key:0,class:`application-edit-file`},Rt=[`src`,`alt`],zt=[`src`],Bt=[`href`],Vt={style:{display:`flex`,"flex-direction":`column`}},Ht={style:{display:`flex`,"flex-direction":`column`,width:`100%`}},Ut={class:`door-add-block`},Wt={class:`door-field`},Gt={style:{"align-items":`center`,display:`flex`,width:`100%`}},Kt={style:{"align-items":`center`,display:`flex`,width:`100%`}},qt={class:`slot-block`},Jt={key:0,class:`view-application-image-block`},Yt=[`src`,`alt`],Xt=[`src`],Zt=[`src`],Qt={key:3,class:`view-application-image-block`},$t=[`src`,`alt`],en=ye(c({__name:`PlaceBlock`,props:{newPlaceCode:{},newPlaceName:{},newPlaceText:{},place:{},mode:{},mcp:{type:Boolean,default:!1},addAction:{}},emits:[`update:newPlaceCode`,`update:newPlaceName`,`update:newPlaceText`,`update:mode`,`navigate`],setup(i,{emit:o}){let c=i,d=o,f=e=>{d(`update:newPlaceCode`,e)},g=e=>{d(`update:newPlaceName`,e)},v=e=>{d(`update:newPlaceText`,e)},b=e=>{d(`update:mode`,e)};function x(){return{name:void 0,image:void 0,file_type:void 0}}function w(){return{code:void 0,name:void 0,keys:void 0}}function D(){return{name:void 0}}function O(e){return e}function k(e){e.image=void 0,e.file_type=void 0,e.fileList=void 0}let A=E(null),j=E(null),M=E(!1),N=S(()=>j.value?j.value.url:K(A.value||void 0)==`image`?q(A.value?.image):``);function P(e){A.value=e,j.value=null,M.value=!0}function ee(e,t){j.value={title:e,url:t},A.value=null,M.value=!0}function F(){M.value=!1,A.value=null,j.value=null}function I(e){let t=e||``;if(t.length==0)return{before:``,after:``};let n=Math.min(t.length,Math.max(120,Math.floor(t.length*.45))),r=-1,i=1/0;for(let e=0;e<t.length;e++){let a=t[e];if(a!=`
|
|
`&&a!=` `)continue;let o=Math.abs(t.length-e-n);o<i&&(i=o,r=e)}return r<0?{before:t,after:``}:{before:t.slice(0,r),after:t.slice(r)}}let te=S(()=>I(c.place?.text).before),re=S(()=>I(c.place?.text).after),L=S(()=>c.place?.image?null:(c.place?.applications||[]).find(e=>K(e)==`image`&&e.image)||null),ae=S(()=>(c.place?.applications||[]).filter(e=>e===L.value?!1:K(e)==`image`&&e.image)),z=S(()=>(c.place?.applications||[]).filter(e=>e===L.value?!1:!(K(e)==`image`&&e.image)));return(o,S)=>(h(),l(T,null,[i.mode==`mini-add`?(h(),l(`div`,{key:0,class:`place-block-hover show-editor-block`,onClick:S[0]||=e=>b(`add`)},[...S[21]||=[p(`p`,{class:`place-image-plus`},`+`,-1)]])):r(``,!0),i.mode==`add`?(h(),l(`div`,et,[s(C(U),{vertical:``},{default:_(()=>[s(C(J),null,{default:_(()=>[s(C(V),{style:{width:`20%`},value:i.newPlaceCode,"onUpdate:value":f,type:`text`,placeholder:`Ы-1`},null,8,[`value`]),s(C(V),{style:{width:`80%`},value:i.newPlaceName,"onUpdate:value":g,type:`text`,placeholder:`Дом №Ы`},null,8,[`value`])]),_:1}),s(C(V),{value:i.newPlaceText,"onUpdate:value":v,type:`textarea`,autosize:{minRows:3},placeholder:`В начале было слово...`},null,8,[`value`]),e(o.$slots,`default`,{},void 0,!0)]),_:3})])):r(``,!0),i.mode==`show-editor`?(h(),l(`div`,{key:2,class:`place-block-hover show-editor-block`,onClick:S[4]||=e=>b(`edit`)},[p(`div`,tt,a(c.place?.code)+`: `+a(c.place?.name),1),S[22]||=p(`hr`,{class:`hr`},null,-1),p(`div`,nt,[c.place?.image?(h(),l(`div`,rt,[p(`div`,{class:`message-image-border`,onClick:S[1]||=G(e=>ee(c.place?.name||``,c.place?.image||``),[`stop`])},[p(`img`,{src:c.place?.image,alt:c.place?.name||`Изображение точки`,class:`message-image`},null,8,it)])])):r(``,!0),p(`span`,null,a(c.place?.text),1)]),(h(!0),l(T,null,u(c.place?.doors,e=>(h(),l(`div`,{key:e.code,class:`door-block`},[s(C(R),{class:`door-button`,onClick:G(t=>d(`navigate`,e.code),[`stop`])},{default:_(()=>[p(`span`,at,a(e.name||e.code||`Перейти к точке`),1)]),_:2},1032,[`onClick`]),(h(!0),l(T,null,u(e.keys,e=>(h(),l(`span`,{key:e.name,class:`key-block`},[s(C(H),{class:`lock-icon`},{default:_(()=>[s(C(Le))]),_:1}),y(` `+a(e.name),1)]))),128))]))),128)),c.place?.applications?.length?(h(),l(`hr`,ot)):r(``,!0),(h(!0),l(T,null,u(c.place?.applications,e=>(h(),l(`div`,{class:`message-footer application-block`,key:e.name},[p(`div`,st,`Приложение: `+a(e.name),1),C(K)(e)==`image`&&e.image?(h(),l(`div`,{key:0,class:`application-image-border`,onClick:G(t=>P(e),[`stop`])},[p(`img`,{src:C(q)(e.image),alt:e.name||`Изображение улики`,class:`application-image`},null,8,lt)],8,ct)):C(K)(e)==`audio`&&e.image?(h(),l(`audio`,{key:1,src:C(q)(e.image),controls:``,preload:`none`,class:`application-audio`,onClick:S[2]||=G(()=>{},[`stop`])},null,8,ut)):C(K)(e)==`pdf`&&e.image?(h(),l(`a`,{key:2,href:C(q)(e.image),target:`_blank`,rel:`noopener`,class:`application-pdf-link`,onClick:S[3]||=G(()=>{},[`stop`])},` PDF `,8,dt)):r(``,!0)]))),128)),p(`p`,ft,[c.place?.hidden?(h(),l(`span`,pt,` Скрытая точка `)):r(``,!0),(h(!0),l(T,null,u(c.place?.keys,e=>(h(),l(`span`,{key:e.name,class:`key-block`},[s(C(H),{class:`lock-icon`},{default:_(()=>[s(C($e))]),_:1}),y(` `+a(e.name),1)]))),128))])])):r(``,!0),i.mode==`show`?(h(),l(`div`,mt,[s(xe,null,{default:_(()=>[p(`div`,ht,[i.mcp?(h(),l(`span`,gt,`MCP`)):r(``,!0),y(` `+a(i.place?.code)+`: `+a(i.place?.name)+` `,1),p(`span`,{class:`collapse-icon collapse-icon-up`,onClick:S[5]||=e=>b(`show-collapse`)})]),S[23]||=p(`hr`,{class:`show-hr`},null,-1),p(`div`,_t,[i.place?.image?.length?(h(),l(`div`,vt,[p(`div`,{class:`message-image-border`,onClick:S[6]||=e=>ee(i.place?.name||``,i.place?.image||``)},[p(`img`,{src:i.place?.image,alt:i.place?.name||`Изображение точки`,class:`message-image`},null,8,yt)])])):L.value?(h(),l(`div`,{key:1,class:`message-image-border`,onClick:S[7]||=e=>P(L.value)},[p(`img`,{src:C(q)(L.value.image),alt:L.value.name||`Изображение улики`,class:`message-image`},null,8,bt)])):r(``,!0),p(`span`,null,a(te.value),1),ae.value.length?(h(),l(`div`,xt,[(h(!0),l(T,null,u(ae.value,e=>(h(),l(`div`,{class:`show-application`,key:e.name},[p(`div`,{class:`application-image-block`,onClick:t=>P(e)},[p(`img`,{src:C(q)(e.image),alt:e.name||`Изображение улики`,class:`application-image`},null,8,Ct)],8,St)]))),128))])):r(``,!0),p(`span`,null,a(re.value),1)]),c.place?.doors?.length?(h(),l(`hr`,wt)):r(``,!0),(h(!0),l(T,null,u(c.place?.doors,e=>(h(),l(`div`,{key:e.code,class:`button-dialog font`,onClick:t=>i.addAction(e.code)},[p(`div`,Et,a(e.code)+` `+a(e.name),1)],8,Tt))),128)),z.value.length?(h(),l(`hr`,Dt)):r(``,!0),(h(!0),l(T,null,u(z.value,e=>(h(),l(`div`,{class:`message-show-footer font`,key:e.name},[C(K)(e)==`pdf`&&e.image?(h(),l(`a`,{key:0,href:C(q)(e.image),target:`_blank`,rel:`noopener`,class:`pdf-application-name`},` Приложение: `+a(e.name),9,Ot)):(h(),l(T,{key:1},[p(`div`,kt,`Приложение: `+a(e.name),1),C(K)(e)==`audio`&&e.image?(h(),l(`audio`,{key:0,src:C(q)(e.image),controls:``,preload:`none`,class:`application-audio`},null,8,At)):r(``,!0)],64))]))),128))]),_:1})])):r(``,!0),i.mode==`show-collapse`?(h(),l(`div`,jt,[s(xe,null,{default:_(()=>[p(`div`,Mt,[i.mcp?(h(),l(`span`,Nt,`MCP`)):r(``,!0),y(` `+a(i.place?.code)+`: `+a(i.place?.name)+` `,1),p(`span`,{class:`collapse-icon`,onClick:S[8]||=e=>b(`show`)})])]),_:1})])):r(``,!0),i.mode==`edit`?(h(),l(`div`,Pt,[s(C(U),{vertical:``},{default:_(()=>[s(C(J),null,{default:_(()=>[s(C(V),{style:{width:`20%`},value:c.place.code,"onUpdate:value":S[9]||=e=>c.place.code=e,type:`text`,placeholder:`Ы-1`},null,8,[`value`]),s(C(V),{style:{width:`80%`},value:c.place.name,"onUpdate:value":S[10]||=e=>c.place.name=e,type:`text`,placeholder:`Дом №Ы`},null,8,[`value`])]),_:1}),s(C(V),{value:c.place.text,"onUpdate:value":S[11]||=e=>c.place.text=e,type:`textarea`,autosize:{minRows:3},placeholder:`В начале было слово...`},null,8,[`value`]),S[37]||=p(`p`,{class:`settings-header`},`Картинка`,-1),p(`div`,null,[s(C(U),null,{default:_(()=>[s(C(U),{vertical:``},{default:_(()=>[p(`img`,{src:c.place.image,alt:c.place?.name||`Изображение точки`,class:`message-edit-image`},null,8,Ft),s(C(R),{onClick:S[12]||=e=>(c.place.image=``,c.place.fileList=void 0)},{default:_(()=>[...S[24]||=[y(`Убрать картинку`,-1)]]),_:1})]),_:1}),s(C(U),{vertical:``},{default:_(()=>[s(C(V),{value:c.place.image,"onUpdate:value":S[13]||=e=>c.place.image=e,type:`text`,placeholder:`Не задано`,disabled:``},null,8,[`value`]),s(C(ce),{"directory-dnd":``,max:1,"file-list":c.place.fileList,"onUpdate:fileList":S[14]||=e=>c.place.fileList=e},{default:_(()=>[s(C(se),null,{default:_(()=>[s(C(B),{style:{"font-size":`16px`}},{default:_(()=>[...S[25]||=[y(` Щелкните или перетащите файл в эту область для загрузки `,-1)]]),_:1})]),_:1})]),_:1},8,[`file-list`])]),_:1})]),_:1})]),S[38]||=p(`p`,{class:`settings-header`},`Видимость точки`,-1),s(C(pe),{value:c.place.hidden,"onUpdate:value":S[15]||=e=>c.place.hidden=e},{checked:_(()=>[...S[26]||=[y(` Скрытая точка `,-1)]]),unchecked:_(()=>[...S[27]||=[y(` Обычная точка `,-1)]]),_:1},8,[`value`]),S[39]||=y(` Улики `,-1),s(C($),{value:c.place.applications,"onUpdate:value":S[16]||=e=>c.place.applications=e,"on-create":x},{"create-button-default":_(()=>[...S[28]||=[y(` Добавить улику `,-1)]]),default:_(({value:e})=>[p(`div`,It,[s(C(V),{value:e.name,"onUpdate:value":t=>e.name=t,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`]),e.image?(h(),l(`div`,Lt,[s(C(U),{align:`center`,justify:`space-between`},{default:_(()=>[s(C(B),{depth:`3`},{default:_(()=>[y(a(C(be)(e.image))+` `,1),s(C(me),{size:`small`,bordered:!1},{default:_(()=>[y(a(C(K)(e)||`файл`),1)]),_:2},1024)]),_:2},1024),s(C(R),{size:`small`,quaternary:``,onClick:t=>k(O(e))},{default:_(()=>[...S[29]||=[y(` Убрать файл `,-1)]]),_:1},8,[`onClick`])]),_:2},1024),C(K)(e)==`image`?(h(),l(`img`,{key:0,src:C(q)(e.image),alt:e.name||`Изображение улики`,class:`application-edit-image`},null,8,Rt)):C(K)(e)==`audio`?(h(),l(`audio`,{key:1,src:C(q)(e.image),controls:``,preload:`none`,class:`application-edit-audio`},null,8,zt)):C(K)(e)==`pdf`?(h(),l(`a`,{key:2,href:C(q)(e.image),target:`_blank`,rel:`noopener`,class:`application-pdf-link`},` PDF `,8,Bt)):r(``,!0)])):r(``,!0),s(C(ce),{max:1,"file-list":O(e).fileList,"onUpdate:fileList":t=>O(e).fileList=t,accept:`image/*,application/pdf,audio/*`},{default:_(()=>[s(C(R),{size:`small`},{default:_(()=>[...S[30]||=[y(`Загрузить файл улики`,-1)]]),_:1})]),_:1},8,[`file-list`,`onUpdate:fileList`])])]),_:1},8,[`value`]),S[40]||=y(` Действия `,-1),s(C($),{value:c.place.doors,"onUpdate:value":S[17]||=e=>c.place.doors=e,"on-create":w},{"create-button-default":_(()=>[...S[31]||=[y(` Добавить действие `,-1)]]),action:_(({index:e,create:t,remove:n})=>[p(`div`,Vt,[s(C(R),{onClick:()=>t(e),class:`plus-minus-buttons`},{default:_(()=>[...S[32]||=[y(`+`,-1)]]),_:1},8,[`onClick`]),s(C(R),{onClick:()=>n(e),class:`plus-minus-buttons`},{default:_(()=>[...S[33]||=[y(`-`,-1)]]),_:1},8,[`onClick`])])]),default:_(({value:e})=>[p(`div`,Ht,[p(`div`,Ut,[s(C(J),null,{default:_(()=>[s(C(V),{style:{width:`30%`},value:e.code,"onUpdate:value":t=>e.code=t,type:`text`,placeholder:`Код`},null,8,[`value`,`onUpdate:value`]),s(C(V),{style:{width:`70%`},value:e.name,"onUpdate:value":t=>e.name=t,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`])]),_:2},1024),S[35]||=p(`p`,{class:`need-keys-text`},`Требуемые ключи`,-1),p(`div`,Wt,[s(C($),{value:e.keys,"onUpdate:value":t=>e.keys=t,"on-create":D},{"create-button-default":_(()=>[...S[34]||=[y(` Добавить ключ `,-1)]]),default:_(({value:e})=>[p(`div`,Gt,[s(C(V),{value:e.name,"onUpdate:value":t=>e.name=t,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`])])]),_:1},8,[`value`,`onUpdate:value`])])])])]),_:1},8,[`value`]),S[41]||=y(` Получаемые ключи `,-1),s(C($),{value:c.place.keys,"onUpdate:value":S[18]||=e=>c.place.keys=e,"on-create":D},{"create-button-default":_(()=>[...S[36]||=[y(` Добавить ключ `,-1)]]),default:_(({value:e})=>[p(`div`,Kt,[s(C(V),{value:e.name,"onUpdate:value":t=>e.name=t,type:`text`,placeholder:`Название`},null,8,[`value`,`onUpdate:value`])])]),_:1},8,[`value`]),p(`div`,qt,[e(o.$slots,`default`,{},void 0,!0)])]),_:3})])):r(``,!0),s(C(ie),{show:M.value,"onUpdate:show":S[20]||=e=>M.value=e,"mask-closable":!0},{default:_(()=>[s(C(ne),{class:n({"photo-paper":N.value}),"theme-overrides":N.value?{titleTextColor:`black`,actionColor:`transparent`,paddingMedium:`14px`,borderRadius:`10px`}:void 0,style:m({maxWidth:`min(94vw, 1200px)`,width:N.value?`max-content`:`min(94vw, 1200px)`}),bordered:!1,role:`dialog`,"aria-modal":`true`,"header-style":N.value?{paddingBottom:`10px`}:void 0,"content-style":{padding:N.value?`0 14px`:`14px`}},t({header:_(()=>[p(`span`,{class:n({"photo-paper-title":N.value})},a(A.value?.name||j.value?.title),3)]),"header-extra":_(()=>[s(C(R),{quaternary:``,circle:``,"theme-overrides":N.value?{textColor:`black`,textColorHover:`#63e2b7`}:void 0,"aria-label":`Закрыть`,onClick:S[19]||=e=>F()},{default:_(()=>[s(C(H),{size:`20`},{default:_(()=>[s(C(Fe))]),_:1})]),_:1},8,[`theme-overrides`])]),default:_(()=>[A.value&&C(K)(A.value)==`image`?(h(),l(`div`,Jt,[p(`img`,{src:C(q)(A.value.image),alt:A.value.name||`Фото улики`,class:`view-application-image`},null,8,Yt)])):A.value&&C(K)(A.value)==`pdf`?(h(),l(`iframe`,{key:1,src:C(q)(A.value.image),class:`view-application-pdf`},null,8,Xt)):A.value&&C(K)(A.value)==`audio`?(h(),l(`audio`,{key:2,src:C(q)(A.value.image),controls:``,autoplay:``,class:`view-application-audio`},null,8,Zt)):j.value?(h(),l(`div`,Qt,[p(`img`,{src:j.value.url,alt:j.value.title||`Фото точки`,class:`view-application-image`},null,8,$t)])):r(``,!0)]),_:2},[N.value?{name:`action`,fn:_(()=>[s(C(R),{class:`photo-paper-action`,tag:`a`,href:N.value,target:`_blank`,rel:`noopener noreferrer`,bordered:!1,"theme-overrides":{textColor:`#bfa07d`,textColorHover:`#63e2b7`}},{default:_(()=>[...S[42]||=[y(` Открыть в новой вкладке `,-1)]]),_:1},8,[`href`])]),key:`0`}:void 0]),1032,[`class`,`theme-overrides`,`style`,`header-style`,`content-style`])]),_:1},8,[`show`])],64))}}),[[`__scopeId`,`data-v-c907363d`]]);export{Ze as n,J as r,en as t}; |