@gisce/react-ooui 1.5.4 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(G,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react"),require("antd"),require("@gisce/ooui"),require("@ant-design/icons"),require("interweave"),require("react/jsx-runtime"),require("@tabler/icons-react"),require("antd/lib/input/TextArea"),require("styled-components"),require("react-measure"),require("antd/lib/typography/Title"),require("@ant-design/plots"),require("use-deep-compare-effect"),require("@gisce/react-formiga-table"),require("file-type-buffer-browser"),require("antd/lib/_util/colors"),require("antd/es/typography/Link"),require("@gisce/fiber-diagram"),require("@gisce/react-formiga-components"),require("validator/lib/isURL"),require("validator/lib/isEmail"),require("react-hotkeys-hook"),require("react-markdown"),require("@monaco-editor/react"),require("md5"),require("react-grid-layout"),require("react-grid-layout/css/styles.css"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","react","antd","@gisce/ooui","@ant-design/icons","interweave","react/jsx-runtime","@tabler/icons-react","antd/lib/input/TextArea","styled-components","react-measure","antd/lib/typography/Title","@ant-design/plots","use-deep-compare-effect","@gisce/react-formiga-table","file-type-buffer-browser","antd/lib/_util/colors","antd/es/typography/Link","@gisce/fiber-diagram","@gisce/react-formiga-components","validator/lib/isURL","validator/lib/isEmail","react-hotkeys-hook","react-markdown","@monaco-editor/react","md5","react-grid-layout","react-grid-layout/css/styles.css","uuid"],l):(G=typeof globalThis<"u"?globalThis:G||self,l(G["react-ooui"]={},G.React,G.antd,G.ooui,G.AntIcons,G.interweave,G.jsxRuntime,G.TablerIcons,G.TextArea$1,G.styled,G.Measure,G.Title$3,G.plots,G.useDeepCompareEffect,G.reactFormigaTable,G.fileTypeBufferBrowser,G.colors,G.Link,G.fiberDiagram,G.reactFormigaComponents,G.isURL,G.isEmail,G.reactHotkeysHook,G.ReactMarkdown,G.Editor,G.md5,G.reactGridLayout,null,G.uuid))})(this,function(G,l,p,se,H,Kt,e,fo,ho,po,go,mo,Wt,yo,vo,wo,mr,So,Co,yr,bo,xo,To,Fo,Oo,_o,vr,Jc,wr){"use strict";const qe=t=>t&&typeof t=="object"&&"default"in t?t:{default:t};function Sr(t){if(t&&t.__esModule)return t;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const Ke=qe(l),Cr=Sr(H),br=qe(H),xr=Sr(fo),Do=qe(ho),ot=qe(po),Yt=qe(go),qt=qe(mo),tt=qe(yo),ko=qe(So),Mo=qe(bo),Vo=qe(xo),Eo=qe(Fo),Io=qe(Oo),Ao=qe(_o),{Text:$o,Title:Lo}=p.Typography,{useToken:No}=p.theme,Po={left:"justify-start",center:"justify-center",right:"justify-end"},vt=t=>{const{ooui:r,align:n,responsiveBehaviour:s}=t,{label:o,tooltip:i,fieldForLabel:a,labelSize:c,labelType:h}=r,u=a!==null&&o.length>1?o+" :":o,g=n||(a?s?"left":"right":"left"),{token:w}=No(),y=c===void 0?$o:Lo;return e.jsxs("div",{className:`flex flex-row items-center pb-1 pt-1 ${Po[g]}`,children:[i&&e.jsx(p.Tooltip,{title:i,children:e.jsx(H.QuestionCircleOutlined,{className:"pr-1 text-xs",style:{color:w.colorPrimary}})}),e.jsx("span",{className:"pr-2",children:e.jsx(y,{level:c,type:h,children:e.jsx(Kt.Interweave,{content:u})})})]})},Bo={ca_ES:{true:"S\xED",false:"No",simple_search:"B\xFAsqueda simple",advanced_search:"B\xFAsqueda avan\xE7ada",search:"Buscar",parameters:"Par\xE0metres",limit:"Limit",first:"Primer",no_results:"No hi ha resultats",summary:"Mostrant resultats des de {from} fins {to} d'un total de {total} registres",welcome:"Benvingut",attachments:"Adjunts",addNewAttachment:"Afegir nou adjunt",listAllAttachments:"Veure tots els adjunts",viewAs:"Veure com",confirmRemoveItem:"Est\xE0s segur de volguer eliminar aquest item?",save:"Desar",delete:"Eliminar",refresh:"Refrescar",previous:"Anterior",next:"Seg\xFCent",actions:"Accions",reports:"Informes",related:"Relacionat",new:"Nou",fillRequiredField:"Siusplau, omple aquest camp obligatori",fillRequiredFields:"Siusplau, omple tots els camps obligatoris",generatingReport:"Generant informe...",confirmation:"Confirmaci\xF3",ok:"D'acord",cancel:"Cancel\xB7lar",formHasErrors:"El formulari t\xE9 errors",unsavedChanges:"Hi ha canvis sense guardar",confirmRefreshWithoutSave:"Est\xE0s segur de volguer refrescar la p\xE0gina sense guardar els canvis?",discardAndRefresh:"Descarta els canvis i refresca",removeItems:"Elimina el registre/s",confirmRemove:"Est\xE0s segur de volguer eliminar els registre/s seleccionats?",yesConfirmRemove:"S\xED, elimina",unlinkItems:"Desenlla\xE7a registre/s",confirmUnlink:"Est\xE0s segur de volguer desenlla\xE7ar els registre/s seleccionats?",yesConfirmUnlink:"S\xED, desenlla\xE7a",confirmCloseWithoutSave:"Est\xE0s segur de volguer tancar aquesta finestra sense guardar?",closeWithoutSaving:"Tancar sense guardar",action:"Acci\xF3",report:"Informe",selectAction:"Selecciona una acci\xF3",download:"Descarrega",clear:"Neteja",open:"Obre",uploadNewImage:"Puja una nova imatge",noCurrentEntries:"No hi ha registres",duplicate:"Duplicar",downloadingAttachment:"Descarregant adjunt...",tree:"llista",form:"formulari",favorites:"Els meus favorits",edit_favorites:"Edita els favorits",no_favorites:"No tens favorits guardats",register:"Registre",of:"de",editingDocument:"Editant document",showLogs:"Veure logs",createdBy:"Creat per l'usuari",creationDate:"Data creaci\xF3",lastUpdatedBy:"\xDAltima modificaci\xF3 per",lastUpdatedDate:"Data \xFAltima modificaci\xF3",goToResourceId:"V\xE9s al recurs amb ID",searchId:"ID de cerca:",idNotFound:"No es troba aquesta id de recurs per l'objecte",selectedRegisters:"registres seleccionats",translate:"Tradu\xEFr",enterTextBeforeTranslate:"Introdueix algun text al camp abans d'afegir traduccions",saveBeforeTranslate:"Heu de desar el registre abans d'afegir les traduccions",configDashboard:"Configurar panell",moveDashboard:"Moure items del panell",openAttachment:"Veure detall de l'adjunt",openAttachmentLink:"Obrir enlla\xE7 de l'adjunt",uninformed:"Sense informar",totalRegisters:"Registres totals:",export:"Exportar",selectAtLeastOneField:"Selecciona almenys un camp per a l'exportaci\xF3",printScreen:"Imprimir pantalla",advancedExport:"Exportaci\xF3 avan\xE7ada",savedRegisters:"Registre guardat correctament",errorWhileSavingForm:"Error en guardar el formulari",autor:"Autor",recordsSelected:"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta p\xE0gina.",selectAllRecords:"Seleccionar tots els {totalRecords} registres.",allRecordsSelected:"Hi ha {totalRecords} registres seleccionats."},en_US:{true:"Yes",false:"No",simple_search:"Simple search",advanced_search:"Advanced search",search:"Search",parameters:"Parameters",limit:"Limit",first:"First",no_results:"No results",summary:"Showing registers from {from} to {to} of {total} registers",welcome:"Welcome",attachments:"Attachments",addNewAttachment:"Add new attachment",listAllAttachments:"View all the attachments",viewAs:"View as",confirmRemoveItem:"Are you sure to remove this item?",save:"Save",delete:"Delete",refresh:"Refresh",previous:"Previous",next:"Next",actions:"Actions",reports:"Reports",related:"Related",new:"New",fillRequiredField:"Please fill this required field",fillRequiredFields:"Please fill all the required fields",generatingReport:"Generating report...",confirmation:"Confirmation",ok:"OK",cancel:"Cancel",formHasErrors:"Form has errors",unsavedChanges:"There are unsaved changes",confirmRefreshWithoutSave:"Do you really want to refresh this window without saving?",discardAndRefresh:"Discard changes and refresh",removeItems:"Remove item/s",confirmRemove:"Are you sure you want to remove the selected item/s?",yesConfirmRemove:"Yes, remove",unlinkItems:"Unlink item/s",confirmUnlink:"Are you sure you want to unlink the selected item/s?",yesConfirmUnlink:"Yes, unlink",confirmCloseWithoutSave:"Do you really want to close this window without saving?",closeWithoutSaving:"Close without saving",action:"Action",report:"Report",selectAction:"Select an action",download:"Download",clear:"Clear",open:"Open",uploadNewImage:"Upload new image",noCurrentEntries:"No current entries",duplicate:"Duplicate",downloadingAttachment:"Downloading attachment...",tree:"list",form:"form",favorites:"My shortcuts",edit_favorites:"Edit shortcuts",no_favorites:"You don't have any shortcuts saved yet",register:"Register",of:"of",editingDocument:"Editing document",showLogs:"Show logs",createdBy:"Created by user",creationDate:"Creation date",lastUpdatedBy:"Last modified by",lastUpdatedDate:"Date of last modification",goToResourceId:"Go to resource ID",searchId:"Search ID:",idNotFound:"Resource ID does not exist for this object!",selectedRegisters:"selected registers",translate:"Translate",enterTextBeforeTranslate:"Enter some text to the related field before adding translations",saveBeforeTranslate:"You must save the record before adding translations",configDashboard:"Setup dashboard",moveDashboard:"Move dashboard items",openAttachment:"Open attachment detail",openAttachmentLink:"Open attachment link",uninformed:"Uninformed",totalRegisters:"Total registers:",export:"Export",selectAtLeastOneField:"Select at least one field for the export",printScreen:"Print screen",advancedExport:"Advanced export",savedRegisters:"Record successfully saved",errorWhileSavingForm:"Error while saving form",author:"Author",recordsSelected:"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta p\xE0gina.",selectAllRecords:"Seleccionar tots els {totalRecords} registres.",allRecordsSelected:"Hi ha {totalRecords} registres seleccionats."},es_ES:{true:"S\xED",false:"No",simple_search:"B\xFAsqueda simple",advanced_search:"B\xFAsqueda avanzada",search:"Buscar",parameters:"Parametros",limit:"L\xEDmite",first:"Primero",no_results:"No hay resultados",summary:"Mostrando resultado desde {from} hasta {to} de un total de {total} registros",welcome:"Bienvenido",attachments:"Adjuntos",addNewAttachment:"A\xF1adir nuevo adjunto",listAllAttachments:"Ver todos los adjuntos",viewAs:"Ver c\xF3mo",confirmRemoveItem:"Est\xE1s seguro de querer eliminar \xE9ste registro?",save:"Guardar",delete:"Eliminar",refresh:"Refrescar",previous:"Anterior",next:"Siguiente",actions:"Acciones",reports:"Informes",related:"Relacionado",new:"Nuevo",fillRequiredField:"Por favor, rellena \xE9ste campo obligatorio",fillRequiredFields:"Por favor, rellena todos los campos obligatorios",generatingReport:"Generando informe...",confirmation:"Confirmaci\xF3m",ok:"De acuerdo",cancel:"Cancelar",formHasErrors:"El formulario tiene errores",unsavedChanges:"Hay cambios sin guardar",confirmRefreshWithoutSave:"Est\xE1s seguro de querer refrescar la p\xE1gina sin guardar los cambios?",discardAndRefresh:"Descarta los cambios y refresca",removeItems:"Eliminar el registro/s",confirmRemove:"Est\xE1s seguro de querer eliminar los registro/s seleccionados?",yesConfirmRemove:"S\xED, elimina",unlinkItems:"Desenlaza registro/s",confirmUnlink:"Est\xE1s seguro de querer desenlazar los registro/s seleccionados?",yesConfirmUnlink:"S\xED, desenlaza",confirmCloseWithoutSave:"Est\xE1s seguro de querer cerrar \xE9sta ventana sin cerrar?",closeWithoutSaving:"Cerrar sin guardar",action:"Acci\xF3n",report:"Informe",selectAction:"Selecciona una acci\xF3n",download:"Descarga",clear:"Limpiar",open:"Abrir",uploadNewImage:"Subir una nueva im\xE1gen",noCurrentEntries:"No hay registros",duplicate:"Duplicar",downloadingAttachment:"Descargando adjunto...",tree:"lista",form:"formulario",favorites:"Mis favoritos",edit_favorites:"Edita los favoritos",no_favorites:"No tienes favoritos guardados",register:"Registro",of:"de",editingDocument:"Editando documento",showLogs:"Ver logs",createdBy:"Creado por el usuario",creationDate:"Fecha creaci\xF3n",lastUpdatedBy:"\xDAltima modificaci\xF3n por",lastUpdatedDate:"Fecha \xFAltima modificaci\xF3n",goToResourceId:"Ir al recurso con ID",searchId:"ID de b\xFAsqueda:",idNotFound:"No se encuentra \xE9sta ID de recursos para el objeto",selectedRegisters:"registros seleccionados",translate:"Traducir",enterTextBeforeTranslate:"Introduce algun texto en el campo antes de a\xF1adir traducciones",saveBeforeTranslate:"Tienes que guardar el registro antes de a\xF1adir las traducciones",configDashboard:"Configurar panel",moveDashboard:"Mover items del panel",openAttachment:"Ver detalle del adjunto",openAttachmentLink:"Abrir enlace del adjunto",uninformed:"Sin informar",totalRegisters:"Registros totales:",export:"Exportar",selectAtLeastOneField:"Selecciona al menos un campo para la exportaci\xF3n",printScreen:"Imprimir pantalla",advancedExport:"Exportaci\xF3n avanzada",savedRegisters:"Registro guardado correctamente",errorWhileSavingForm:"Error al guardar el formulario",author:"Autor",recordsSelected:"Hay {numberOfSelectedRows} registros seleccionados en \xE9sta p\xE1gina.",selectAllRecords:"Seleccionar todos los {totalRecords} registros.",allRecordsSelected:"Hay {totalRecords} registros seleccionados."}},he=Ke.default.createContext(null),Ho=t=>{const{children:r,lang:n}=t;function s(o){return xe(o,n)}return e.jsx(he.Provider,{value:{lang:n,t:s},children:r})},xe=(t,r)=>{var s;return((s=Bo[r])==null?void 0:s[t])||t};function me({ooui:t,children:r,layout:n="horizontal",valuePropName:s,showLabel:o=!1,alignLabel:i="left",required:a=!1,type:c,validator:h}){const{id:d,label:u,tooltip:f}=t,{t:g}=l.useContext(he),w=a?[{required:!0,message:g("fillRequiredField"),type:c,validator:h}]:void 0,y=()=>e.jsx(p.Form.Item,{className:"mb-0",name:d,valuePropName:s,rules:w,children:r});if(!o)return y();const m=e.jsx(vt,{ooui:new se.Label({name:d+"_label",string:u,help:f,fieldForLabel:d}),align:i});return n==="horizontal"?(()=>e.jsxs(p.Row,{align:"middle",className:"pb-1 pt-1",children:[e.jsx(p.Col,{className:"ml-2",flex:"7rem",children:e.jsx("div",{className:"flex flex-col items-end",children:m})}),e.jsx(p.Col,{flex:"auto",children:y()})]}))():(()=>e.jsxs(e.Fragment,{children:[m,y()]}))()}const{confirm:Ko}=p.Modal,st=({onOk:t,confirmMessage:r,lang:n})=>{Ko({title:xe("confirmation",n),icon:e.jsx(H.ExclamationCircleOutlined,{}),centered:!0,content:r,okText:xe("ok",n),cancelText:xe("cancel",n),onOk:t})},De=Ke.default.createContext(null),Wo=t=>{const{children:r,activeId:n,activeModel:s,setFieldValue:o,getFieldValue:i,executeButtonAction:a,getContext:c,getValues:h,getPlainValues:d,domain:u,submitForm:f,fetchValues:g,formHasChanges:w,elementHasLostFocus:y,getFields:m}=t;return e.jsx(De.Provider,{value:{domain:u,getValues:h,getPlainValues:d,getFields:m,activeId:n,activeModel:s,setFieldValue:o,getFieldValue:i,executeButtonAction:a,getContext:c,submitForm:f,fetchValues:g,formHasChanges:w,elementHasLostFocus:y},children:r})},Tr={"terp-purchase":"ShoppingCart","terp-graph":"PieChart","terp-crm":"Contacts","terp-hr":"Friends","terp-account":"BuildingBank","terp-project":"Checklist","terp-administration":"Adjustments","terp-partner":"Team","terp-mrp":"Build","terp-product":"Shopping",STOCK_JUSTIFY_FILL:"UnorderedList",STOCK_INDENT:"IndentIncrease",STOCK_HELP:"Question",STOCK_GO_UP:"ArrowUp",STOCK_SORT_DESCENDING:"SortDescending",STOCK_ADD:"Plus",STOCK_GOTO_LAST:"FastForward",STOCK_FIND:"Search",STOCK_PROPERTIES:"Control",STOCK_DIALOG_INFO:"Info",STOCK_FLOPPY:"Usb",STOCK_JUSTIFY_CENTER:"AlignCenter",STOCK_GO_BACK:"ArrowLeft",STOCK_UNDERLINE:"Underline",STOCK_BOLD:"Bold",STOCK_APPLY:"Check",STOCK_ZOOM_OUT:"ZoomOut",STOCK_STRIKETHROUGH:"Strikethrough",STOCK_MEDIA_REWIND:"Backward",STOCK_PRINT:"Printer",STOCK_NO:"Close",STOCK_GOTO_FIRST:"FastBackward",STOCK_CLOSE:"Close",STOCK_REMOVE:"Minus",STOCK_CUT:"Scissor",STOCK_DIALOG_AUTHENTICATION:"Safety",STOCK_ZOOM_FIT:"Expand",STOCK_JUMP_TO:"Select",STOCK_HARDDISK:"Hdd",STOCK_SAVE_AS:"Save",STOCK_UNDO:"Undo",STOCK_JUSTIFY_RIGHT:"AlignRight",STOCK_DIALOG_ERROR:"CloseCircle",STOCK_INDEX:"Profile",STOCK_GOTO_BOTTOM:"VerticalAlignBottom",STOCK_MEDIA_NEXT:"StepForward",STOCK_REDO:"Redo",STOCK_COPY:"Copy",STOCK_MEDIA_PAUSE:"Pause",STOCK_GO_FORWARD:"ArrowRight",STOCK_UNDELETE:"Undo",STOCK_EXECUTE:"Setting",STOCK_SAVE:"Save",STOCK_DIALOG_QUESTION:"QuestionCircle",STOCK_SORT_ASCENDING:"SortAscending",STOCK_REFRESH:"Reload",STOCK_MEDIA_FORWARD:"Forward",STOCK_STOP:"Border",STOCK_PRINT_PREVIEW:"Printer",STOCK_HOME:"Home",STOCK_PASTE:"CarryOut",STOCK_ZOOM_100:"ZoomIn",STOCK_FIND_AND_REPLACE:"FileSearch",STOCK_DIALOG_WARNING:"Warning",STOCK_ZOOM_IN:"ZoomIn",STOCK_CONVERT:"Export",STOCK_ITALIC:"Italic",STOCK_YES:"Check",STOCK_MEDIA_PLAY:"PlayCircle",STOCK_MEDIA_RECORD:"VideoCamera",STOCK_MEDIA_PREVIOUS:"StepBackward",STOCK_NEW:"FileAdd",STOCK_CANCEL:"Close",STOCK_DISCONNECT:"Api",STOCK_JUSTIFY_LEFT:"AlignLeft",STOCK_FILE:"File",STOCK_QUIT:"Logout",STOCK_EDIT:"Edit",STOCK_CONNECT:"Api",STOCK_GO_DOWN:"CaretDown",STOCK_NETWORK:"Apartment",STOCK_OK:"Check",STOCK_GOTO_TOP:"VerticalAlignTop",STOCK_ABOUT:"Star",STOCK_COLOR_PICKER:"Aim",STOCK_SELECT_FONT:"FontSize",STOCK_DELETE:"Delete",STOCK_DND:"FileText",STOCK_CLEAR:"CloseSquare",STOCK_UNINDENT:"AlignLeft",STOCK_PREFERENCES:"Setting"},Je=(t,r)=>(t.indexOf("gtk-")!==-1&&(t=`STOCK_${t.replace("gtk-","").replace(/\-/g,"_").toUpperCase()}`),Tr.hasOwnProperty(t)?Fr(Tr[t],r):Fr(t,r));function Yo(t){return`${t.split("-").map(r=>r.replace(/\w\S*/g,n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase())).join("")}`}function Fr(t,r){let n=t.charAt(0).toUpperCase()+t.slice(1);n.indexOf("-")!==-1&&(n=Yo(n));const s=`${n}Outlined`;if(Cr[s])return()=>Ke.default.createElement(Cr[s],{...r});const o=`Icon${n}`;if(xr[o]){const i=()=>{var c;return Ke.default.createElement(xr[o],{fill:"transparent",size:((c=r==null?void 0:r.style)==null?void 0:c.fontSize)||17})};return()=>Ke.default.createElement(br.default,{component:i,...r})}}const Ut=t=>{const{ooui:r}=t,{id:n,label:s,activated:o,buttonType:i,confirmMessage:a,icon:c,context:h,readOnly:d}=r,u=l.useContext(De),{executeButtonAction:f}=u||{},[g,w]=l.useState(!1),{lang:y}=l.useContext(he);async function m(){w(!0),await f({type:i,action:n,context:h}),w(!1)}function v(){if(a){st({confirmMessage:a,lang:y,onOk:()=>{m()}});return}m()}function S(){if(g)return e.jsx(H.LoadingOutlined,{});if(c){const T=Je(c);return T&&e.jsx(T,{})}}return e.jsx(me,{ooui:r,children:e.jsx(p.Button,{block:!0,disabled:!o||d,onClick:v,icon:S(),type:r.primary?"primary":"default",danger:r.danger,style:{whiteSpace:"normal",height:"auto"},children:s})})},Or=t=>{const{ooui:r}=t,{defaultButton:n,secondaryButtons:s}=r,{id:o,caption:i,activated:a,buttonType:c,confirmMessage:h,icon:d,primary:u,danger:f,context:g,readOnly:w}=n||{},y=l.useContext(De),{executeButtonAction:m}=y||{},[v,S]=l.useState(!1),{lang:T}=l.useContext(he);function E(){if(v)return e.jsx(H.LoadingOutlined,{});if(d){const F=Je(d);return F&&e.jsx(F,{})}}async function b(){c&&o&&(S(!0),await m({type:c,action:o,context:g}),S(!1))}function V(){if(h){st({confirmMessage:h,lang:T,onOk:()=>{b()}});return}b()}if(r.buttons.length===0)return null;if(r.buttons.length>1)return e.jsx(me,{ooui:new se.Field({ooui:r}),children:e.jsxs(p.Dropdown.Button,{disabled:!a||w,onClick:V,icon:e.jsx(H.DownOutlined,{}),type:u?"primary":void 0,overlay:e.jsx(qo,{ooui:s,executeButtonAction:m,lang:T}),children:[E(),i]})});if(n)return e.jsx(Ut,{ooui:n})},qo=t=>{const{ooui:r,executeButtonAction:n,lang:s}=t;if(!r)return null;const o=r.map(i=>{const{id:a,caption:c,activated:h,buttonType:d,confirmMessage:u,icon:f,context:g,readOnly:w,danger:y}=i,[m,v]=l.useState(!1);async function S(){v(!0),await n({type:d,action:a,context:g}),v(!1)}function T(){if(u){st({confirmMessage:u,lang:s,onOk:()=>{S()}});return}S()}function E(){if(m)return e.jsx(H.LoadingOutlined,{});if(f){const b=Je(f);return b&&e.jsx(b,{})}}return e.jsx(p.Menu.Item,{disabled:!h||w,onClick:T,icon:E(),danger:y,children:c})});return e.jsx(p.Menu,{children:o})},Uo=.7;function _r(){const{innerWidth:t,innerHeight:r}=window;return{width:t,height:r}}function Dt(){const[t,r]=l.useState(_r());return l.useEffect(()=>{function n(){r(_r())}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),{modalWidth:t.width*Uo,modalHeight:t.height,width:t.width,height:t.height}}class K{static init(r){K.handler=r}static getHandler(){if(!K.handler)throw"Must call init() first with a valid ConnectionProvider instance";return K.handler}}const Dr=t=>{let r,n,s;if(typeof t=="string"&&t.indexOf(" -- ")!==-1&&t.indexOf(`
1
+ (function(G,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react"),require("antd"),require("@gisce/ooui"),require("@ant-design/icons"),require("interweave"),require("react/jsx-runtime"),require("@tabler/icons-react"),require("antd/lib/input/TextArea"),require("styled-components"),require("react-measure"),require("antd/lib/typography/Title"),require("@ant-design/plots"),require("use-deep-compare-effect"),require("@gisce/react-formiga-table"),require("file-type-buffer-browser"),require("antd/lib/_util/colors"),require("antd/es/typography/Link"),require("@gisce/fiber-diagram"),require("@gisce/react-formiga-components"),require("validator/lib/isURL"),require("validator/lib/isEmail"),require("react-hotkeys-hook"),require("react-markdown"),require("@monaco-editor/react"),require("md5"),require("react-grid-layout"),require("react-grid-layout/css/styles.css"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","react","antd","@gisce/ooui","@ant-design/icons","interweave","react/jsx-runtime","@tabler/icons-react","antd/lib/input/TextArea","styled-components","react-measure","antd/lib/typography/Title","@ant-design/plots","use-deep-compare-effect","@gisce/react-formiga-table","file-type-buffer-browser","antd/lib/_util/colors","antd/es/typography/Link","@gisce/fiber-diagram","@gisce/react-formiga-components","validator/lib/isURL","validator/lib/isEmail","react-hotkeys-hook","react-markdown","@monaco-editor/react","md5","react-grid-layout","react-grid-layout/css/styles.css","uuid"],l):(G=typeof globalThis<"u"?globalThis:G||self,l(G["react-ooui"]={},G.React,G.antd,G.ooui,G.AntIcons,G.interweave,G.jsxRuntime,G.TablerIcons,G.TextArea$1,G.styled,G.Measure,G.Title$3,G.plots,G.useDeepCompareEffect,G.reactFormigaTable,G.fileTypeBufferBrowser,G.colors,G.Link,G.fiberDiagram,G.reactFormigaComponents,G.isURL,G.isEmail,G.reactHotkeysHook,G.ReactMarkdown,G.Editor,G.md5,G.reactGridLayout,null,G.uuid))})(this,function(G,l,p,se,H,Kt,e,fo,ho,po,go,mo,Wt,yo,vo,wo,mr,So,Co,yr,bo,xo,To,Fo,Oo,_o,vr,Jc,wr){"use strict";const qe=t=>t&&typeof t=="object"&&"default"in t?t:{default:t};function Sr(t){if(t&&t.__esModule)return t;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const Ke=qe(l),Cr=Sr(H),br=qe(H),xr=Sr(fo),Do=qe(ho),ot=qe(po),Yt=qe(go),qt=qe(mo),tt=qe(yo),ko=qe(So),Mo=qe(bo),Vo=qe(xo),Eo=qe(Fo),Io=qe(Oo),Ao=qe(_o),{Text:$o,Title:Lo}=p.Typography,{useToken:No}=p.theme,Po={left:"justify-start",center:"justify-center",right:"justify-end"},vt=t=>{const{ooui:r,align:n,responsiveBehaviour:s}=t,{label:o,tooltip:i,fieldForLabel:a,labelSize:c,labelType:h}=r,u=a!==null&&o.length>1?o+" :":o,g=n||(a?s?"left":"right":"left"),{token:w}=No(),y=c===void 0?$o:Lo;return e.jsxs("div",{className:`flex flex-row items-center pb-1 pt-1 ${Po[g]}`,children:[i&&e.jsx(p.Tooltip,{title:i,children:e.jsx(H.QuestionCircleOutlined,{className:"pr-1 text-xs",style:{color:w.colorPrimary}})}),e.jsx("span",{className:"pr-2",children:e.jsx(y,{level:c,type:h,children:e.jsx(Kt.Interweave,{content:u})})})]})},Bo={ca_ES:{true:"S\xED",false:"No",simple_search:"B\xFAsqueda simple",advanced_search:"B\xFAsqueda avan\xE7ada",search:"Buscar",parameters:"Par\xE0metres",limit:"Limit",first:"Primer",no_results:"No hi ha resultats",summary:"Mostrant resultats des de {from} fins {to} d'un total de {total} registres",welcome:"Benvingut",attachments:"Adjunts",addNewAttachment:"Afegir nou adjunt",listAllAttachments:"Veure tots els adjunts",viewAs:"Veure com",confirmRemoveItem:"Est\xE0s segur de volguer eliminar aquest item?",save:"Desar",delete:"Eliminar",refresh:"Refrescar",previous:"Anterior",next:"Seg\xFCent",actions:"Accions",reports:"Informes",related:"Relacionat",new:"Nou",fillRequiredField:"Siusplau, omple aquest camp obligatori",fillRequiredFields:"Siusplau, omple tots els camps obligatoris",generatingReport:"Generant informe...",confirmation:"Confirmaci\xF3",ok:"D'acord",cancel:"Cancel\xB7lar",formHasErrors:"El formulari t\xE9 errors",unsavedChanges:"Hi ha canvis sense guardar",confirmRefreshWithoutSave:"Est\xE0s segur de volguer refrescar la p\xE0gina sense guardar els canvis?",discardAndRefresh:"Descarta els canvis i refresca",removeItems:"Elimina el registre/s",confirmRemove:"Est\xE0s segur de volguer eliminar els registre/s seleccionats?",yesConfirmRemove:"S\xED, elimina",unlinkItems:"Desenlla\xE7a registre/s",confirmUnlink:"Est\xE0s segur de volguer desenlla\xE7ar els registre/s seleccionats?",yesConfirmUnlink:"S\xED, desenlla\xE7a",confirmCloseWithoutSave:"Est\xE0s segur de volguer tancar aquesta finestra sense guardar?",closeWithoutSaving:"Tancar sense guardar",action:"Acci\xF3",report:"Informe",selectAction:"Selecciona una acci\xF3",download:"Descarrega",clear:"Neteja",open:"Obre",uploadNewImage:"Puja una nova imatge",noCurrentEntries:"No hi ha registres",duplicate:"Duplicar",downloadingAttachment:"Descarregant adjunt...",tree:"llista",form:"formulari",favorites:"Els meus favorits",edit_favorites:"Edita els favorits",no_favorites:"No tens favorits guardats",register:"Registre",of:"de",editingDocument:"Editant document",showLogs:"Veure logs",createdBy:"Creat per l'usuari",creationDate:"Data creaci\xF3",lastUpdatedBy:"\xDAltima modificaci\xF3 per",lastUpdatedDate:"Data \xFAltima modificaci\xF3",goToResourceId:"V\xE9s al recurs amb ID",searchId:"ID de cerca:",idNotFound:"No es troba aquesta id de recurs per l'objecte",selectedRegisters:"registres seleccionats",translate:"Tradu\xEFr",enterTextBeforeTranslate:"Introdueix algun text al camp abans d'afegir traduccions",saveBeforeTranslate:"Heu de desar el registre abans d'afegir les traduccions",configDashboard:"Configurar panell",moveDashboard:"Moure items del panell",openAttachment:"Veure detall de l'adjunt",openAttachmentLink:"Obrir enlla\xE7 de l'adjunt",uninformed:"Sense informar",totalRegisters:"Registres totals:",export:"Exportar",selectAtLeastOneField:"Selecciona almenys un camp per a l'exportaci\xF3",printScreen:"Imprimir pantalla",advancedExport:"Exportaci\xF3 avan\xE7ada",savedRegisters:"Registre guardat correctament",errorWhileSavingForm:"Error en guardar el formulari",autor:"Autor",recordsSelected:"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta p\xE0gina.",selectAllRecords:"Seleccionar tots els {totalRecords} registres.",allRecordsSelected:"Hi ha {totalRecords} registres seleccionats."},en_US:{true:"Yes",false:"No",simple_search:"Simple search",advanced_search:"Advanced search",search:"Search",parameters:"Parameters",limit:"Limit",first:"First",no_results:"No results",summary:"Showing registers from {from} to {to} of {total} registers",welcome:"Welcome",attachments:"Attachments",addNewAttachment:"Add new attachment",listAllAttachments:"View all the attachments",viewAs:"View as",confirmRemoveItem:"Are you sure to remove this item?",save:"Save",delete:"Delete",refresh:"Refresh",previous:"Previous",next:"Next",actions:"Actions",reports:"Reports",related:"Related",new:"New",fillRequiredField:"Please fill this required field",fillRequiredFields:"Please fill all the required fields",generatingReport:"Generating report...",confirmation:"Confirmation",ok:"OK",cancel:"Cancel",formHasErrors:"Form has errors",unsavedChanges:"There are unsaved changes",confirmRefreshWithoutSave:"Do you really want to refresh this window without saving?",discardAndRefresh:"Discard changes and refresh",removeItems:"Remove item/s",confirmRemove:"Are you sure you want to remove the selected item/s?",yesConfirmRemove:"Yes, remove",unlinkItems:"Unlink item/s",confirmUnlink:"Are you sure you want to unlink the selected item/s?",yesConfirmUnlink:"Yes, unlink",confirmCloseWithoutSave:"Do you really want to close this window without saving?",closeWithoutSaving:"Close without saving",action:"Action",report:"Report",selectAction:"Select an action",download:"Download",clear:"Clear",open:"Open",uploadNewImage:"Upload new image",noCurrentEntries:"No current entries",duplicate:"Duplicate",downloadingAttachment:"Downloading attachment...",tree:"list",form:"form",favorites:"My shortcuts",edit_favorites:"Edit shortcuts",no_favorites:"You don't have any shortcuts saved yet",register:"Register",of:"of",editingDocument:"Editing document",showLogs:"Show logs",createdBy:"Created by user",creationDate:"Creation date",lastUpdatedBy:"Last modified by",lastUpdatedDate:"Date of last modification",goToResourceId:"Go to resource ID",searchId:"Search ID:",idNotFound:"Resource ID does not exist for this object!",selectedRegisters:"selected registers",translate:"Translate",enterTextBeforeTranslate:"Enter some text to the related field before adding translations",saveBeforeTranslate:"You must save the record before adding translations",configDashboard:"Setup dashboard",moveDashboard:"Move dashboard items",openAttachment:"Open attachment detail",openAttachmentLink:"Open attachment link",uninformed:"Uninformed",totalRegisters:"Total registers:",export:"Export",selectAtLeastOneField:"Select at least one field for the export",printScreen:"Print screen",advancedExport:"Advanced export",savedRegisters:"Record successfully saved",errorWhileSavingForm:"Error while saving form",author:"Author",recordsSelected:"Hi ha {numberOfSelectedRows} registres seleccionats en aquesta p\xE0gina.",selectAllRecords:"Seleccionar tots els {totalRecords} registres.",allRecordsSelected:"Hi ha {totalRecords} registres seleccionats."},es_ES:{true:"S\xED",false:"No",simple_search:"B\xFAsqueda simple",advanced_search:"B\xFAsqueda avanzada",search:"Buscar",parameters:"Parametros",limit:"L\xEDmite",first:"Primero",no_results:"No hay resultados",summary:"Mostrando resultado desde {from} hasta {to} de un total de {total} registros",welcome:"Bienvenido",attachments:"Adjuntos",addNewAttachment:"A\xF1adir nuevo adjunto",listAllAttachments:"Ver todos los adjuntos",viewAs:"Ver c\xF3mo",confirmRemoveItem:"Est\xE1s seguro de querer eliminar \xE9ste registro?",save:"Guardar",delete:"Eliminar",refresh:"Refrescar",previous:"Anterior",next:"Siguiente",actions:"Acciones",reports:"Informes",related:"Relacionado",new:"Nuevo",fillRequiredField:"Por favor, rellena \xE9ste campo obligatorio",fillRequiredFields:"Por favor, rellena todos los campos obligatorios",generatingReport:"Generando informe...",confirmation:"Confirmaci\xF3m",ok:"De acuerdo",cancel:"Cancelar",formHasErrors:"El formulario tiene errores",unsavedChanges:"Hay cambios sin guardar",confirmRefreshWithoutSave:"Est\xE1s seguro de querer refrescar la p\xE1gina sin guardar los cambios?",discardAndRefresh:"Descarta los cambios y refresca",removeItems:"Eliminar el registro/s",confirmRemove:"Est\xE1s seguro de querer eliminar los registro/s seleccionados?",yesConfirmRemove:"S\xED, elimina",unlinkItems:"Desenlaza registro/s",confirmUnlink:"Est\xE1s seguro de querer desenlazar los registro/s seleccionados?",yesConfirmUnlink:"S\xED, desenlaza",confirmCloseWithoutSave:"Est\xE1s seguro de querer cerrar \xE9sta ventana sin cerrar?",closeWithoutSaving:"Cerrar sin guardar",action:"Acci\xF3n",report:"Informe",selectAction:"Selecciona una acci\xF3n",download:"Descarga",clear:"Limpiar",open:"Abrir",uploadNewImage:"Subir una nueva im\xE1gen",noCurrentEntries:"No hay registros",duplicate:"Duplicar",downloadingAttachment:"Descargando adjunto...",tree:"lista",form:"formulario",favorites:"Mis favoritos",edit_favorites:"Edita los favoritos",no_favorites:"No tienes favoritos guardados",register:"Registro",of:"de",editingDocument:"Editando documento",showLogs:"Ver logs",createdBy:"Creado por el usuario",creationDate:"Fecha creaci\xF3n",lastUpdatedBy:"\xDAltima modificaci\xF3n por",lastUpdatedDate:"Fecha \xFAltima modificaci\xF3n",goToResourceId:"Ir al recurso con ID",searchId:"ID de b\xFAsqueda:",idNotFound:"No se encuentra \xE9sta ID de recursos para el objeto",selectedRegisters:"registros seleccionados",translate:"Traducir",enterTextBeforeTranslate:"Introduce algun texto en el campo antes de a\xF1adir traducciones",saveBeforeTranslate:"Tienes que guardar el registro antes de a\xF1adir las traducciones",configDashboard:"Configurar panel",moveDashboard:"Mover items del panel",openAttachment:"Ver detalle del adjunto",openAttachmentLink:"Abrir enlace del adjunto",uninformed:"Sin informar",totalRegisters:"Registros totales:",export:"Exportar",selectAtLeastOneField:"Selecciona al menos un campo para la exportaci\xF3n",printScreen:"Imprimir pantalla",advancedExport:"Exportaci\xF3n avanzada",savedRegisters:"Registro guardado correctamente",errorWhileSavingForm:"Error al guardar el formulario",author:"Autor",recordsSelected:"Hay {numberOfSelectedRows} registros seleccionados en \xE9sta p\xE1gina.",selectAllRecords:"Seleccionar todos los {totalRecords} registros.",allRecordsSelected:"Hay {totalRecords} registros seleccionados."}},he=Ke.default.createContext(null),Ho=t=>{const{children:r,lang:n}=t;function s(o){return xe(o,n)}return e.jsx(he.Provider,{value:{lang:n,t:s},children:r})},xe=(t,r)=>{var s;return((s=Bo[r])==null?void 0:s[t])||t};function me({ooui:t,children:r,layout:n="horizontal",valuePropName:s,showLabel:o=!1,alignLabel:i="left",required:a=!1,type:c,validator:h}){const{id:d,label:u,tooltip:f}=t,{t:g}=l.useContext(he),w=a?[{required:!0,message:g("fillRequiredField"),type:c,validator:h}]:void 0,y=()=>e.jsx(p.Form.Item,{className:"mb-0",name:d,valuePropName:s,rules:w,children:r});if(!o)return y();const m=e.jsx(vt,{ooui:new se.Label({name:d+"_label",string:u,help:f,fieldForLabel:d}),align:i});return n==="horizontal"?(()=>e.jsxs(p.Row,{align:"middle",className:"pb-1 pt-1",children:[e.jsx(p.Col,{className:"ml-2",flex:"7rem",children:e.jsx("div",{className:"flex flex-col items-end",children:m})}),e.jsx(p.Col,{flex:"auto",children:y()})]}))():(()=>e.jsxs(e.Fragment,{children:[m,y()]}))()}const{confirm:Ko}=p.Modal,st=({onOk:t,confirmMessage:r,lang:n})=>{Ko({title:xe("confirmation",n),icon:e.jsx(H.ExclamationCircleOutlined,{}),centered:!0,content:r,okText:xe("ok",n),cancelText:xe("cancel",n),onOk:t})},De=Ke.default.createContext(null),Wo=t=>{const{children:r,activeId:n,activeModel:s,setFieldValue:o,getFieldValue:i,executeButtonAction:a,getContext:c,getValues:h,getPlainValues:d,domain:u,submitForm:f,fetchValues:g,formHasChanges:w,elementHasLostFocus:y,getFields:m}=t;return e.jsx(De.Provider,{value:{domain:u,getValues:h,getPlainValues:d,getFields:m,activeId:n,activeModel:s,setFieldValue:o,getFieldValue:i,executeButtonAction:a,getContext:c,submitForm:f,fetchValues:g,formHasChanges:w,elementHasLostFocus:y},children:r})},Tr={"terp-purchase":"ShoppingCart","terp-graph":"PieChart","terp-crm":"Contacts","terp-hr":"Friends","terp-account":"BuildingBank","terp-project":"Checklist","terp-administration":"Adjustments","terp-partner":"Team","terp-mrp":"Build","terp-product":"Shopping",STOCK_JUSTIFY_FILL:"UnorderedList",STOCK_INDENT:"IndentIncrease",STOCK_HELP:"Question",STOCK_GO_UP:"ArrowUp",STOCK_SORT_DESCENDING:"SortDescending",STOCK_ADD:"Plus",STOCK_GOTO_LAST:"FastForward",STOCK_FIND:"Search",STOCK_PROPERTIES:"Control",STOCK_DIALOG_INFO:"Info",STOCK_FLOPPY:"Usb",STOCK_JUSTIFY_CENTER:"AlignCenter",STOCK_GO_BACK:"ArrowLeft",STOCK_UNDERLINE:"Underline",STOCK_BOLD:"Bold",STOCK_APPLY:"Check",STOCK_ZOOM_OUT:"ZoomOut",STOCK_STRIKETHROUGH:"Strikethrough",STOCK_MEDIA_REWIND:"Backward",STOCK_PRINT:"Printer",STOCK_NO:"Close",STOCK_GOTO_FIRST:"FastBackward",STOCK_CLOSE:"Close",STOCK_REMOVE:"Minus",STOCK_CUT:"Scissor",STOCK_DIALOG_AUTHENTICATION:"Safety",STOCK_ZOOM_FIT:"Expand",STOCK_JUMP_TO:"Select",STOCK_HARDDISK:"Hdd",STOCK_SAVE_AS:"Save",STOCK_UNDO:"Undo",STOCK_JUSTIFY_RIGHT:"AlignRight",STOCK_DIALOG_ERROR:"CloseCircle",STOCK_INDEX:"Profile",STOCK_GOTO_BOTTOM:"VerticalAlignBottom",STOCK_MEDIA_NEXT:"StepForward",STOCK_REDO:"Redo",STOCK_COPY:"Copy",STOCK_MEDIA_PAUSE:"Pause",STOCK_GO_FORWARD:"ArrowRight",STOCK_UNDELETE:"Undo",STOCK_EXECUTE:"Setting",STOCK_SAVE:"Save",STOCK_DIALOG_QUESTION:"QuestionCircle",STOCK_SORT_ASCENDING:"SortAscending",STOCK_REFRESH:"Reload",STOCK_MEDIA_FORWARD:"Forward",STOCK_STOP:"Border",STOCK_PRINT_PREVIEW:"Printer",STOCK_HOME:"Home",STOCK_PASTE:"CarryOut",STOCK_ZOOM_100:"ZoomIn",STOCK_FIND_AND_REPLACE:"FileSearch",STOCK_DIALOG_WARNING:"Warning",STOCK_ZOOM_IN:"ZoomIn",STOCK_CONVERT:"Export",STOCK_ITALIC:"Italic",STOCK_YES:"Check",STOCK_MEDIA_PLAY:"PlayCircle",STOCK_MEDIA_RECORD:"VideoCamera",STOCK_MEDIA_PREVIOUS:"StepBackward",STOCK_NEW:"FileAdd",STOCK_CANCEL:"Close",STOCK_DISCONNECT:"Api",STOCK_JUSTIFY_LEFT:"AlignLeft",STOCK_FILE:"File",STOCK_QUIT:"Logout",STOCK_EDIT:"Edit",STOCK_CONNECT:"Api",STOCK_GO_DOWN:"CaretDown",STOCK_NETWORK:"Apartment",STOCK_OK:"Check",STOCK_GOTO_TOP:"VerticalAlignTop",STOCK_ABOUT:"Star",STOCK_COLOR_PICKER:"Aim",STOCK_SELECT_FONT:"FontSize",STOCK_DELETE:"Delete",STOCK_DND:"FileText",STOCK_CLEAR:"CloseSquare",STOCK_UNINDENT:"AlignLeft",STOCK_PREFERENCES:"Setting"},Je=(t,r)=>(t.indexOf("gtk-")!==-1&&(t=`STOCK_${t.replace("gtk-","").replace(/\-/g,"_").toUpperCase()}`),Tr.hasOwnProperty(t)?Fr(Tr[t],r):Fr(t,r));function Yo(t){return`${t.split("-").map(r=>r.replace(/\w\S*/g,n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase())).join("")}`}function Fr(t,r){let n=t.charAt(0).toUpperCase()+t.slice(1);n.indexOf("-")!==-1&&(n=Yo(n));const s=`${n}Outlined`;if(Cr[s])return()=>Ke.default.createElement(Cr[s],{...r});const o=`Icon${n}`;if(xr[o]){const i=()=>{var c;return Ke.default.createElement(xr[o],{fill:"transparent",size:((c=r==null?void 0:r.style)==null?void 0:c.fontSize)||17})};return()=>Ke.default.createElement(br.default,{component:i,...r})}}const Ut=t=>{const{ooui:r}=t,{id:n,label:s,activated:o,buttonType:i,confirmMessage:a,icon:c,context:h,readOnly:d}=r,u=l.useContext(De),{executeButtonAction:f}=u||{},[g,w]=l.useState(!1),{lang:y}=l.useContext(he);async function m(){w(!0),await f({type:i,action:n,context:h}),w(!1)}function v(){if(a){st({confirmMessage:a,lang:y,onOk:()=>{m()}});return}m()}function S(){if(g)return e.jsx(H.LoadingOutlined,{});if(c){const T=Je(c);return T&&e.jsx(T,{})}}return e.jsx(me,{ooui:r,children:e.jsx(p.Button,{block:!0,disabled:!o||d||g,onClick:v,icon:S(),type:r.primary?"primary":"default",danger:r.danger,style:{whiteSpace:"normal",height:"auto"},children:s})})},Or=t=>{const{ooui:r}=t,{defaultButton:n,secondaryButtons:s}=r,{id:o,caption:i,activated:a,buttonType:c,confirmMessage:h,icon:d,primary:u,danger:f,context:g,readOnly:w}=n||{},y=l.useContext(De),{executeButtonAction:m}=y||{},[v,S]=l.useState(!1),{lang:T}=l.useContext(he);function E(){if(v)return e.jsx(H.LoadingOutlined,{});if(d){const F=Je(d);return F&&e.jsx(F,{})}}async function b(){c&&o&&(S(!0),await m({type:c,action:o,context:g}),S(!1))}function V(){if(h){st({confirmMessage:h,lang:T,onOk:()=>{b()}});return}b()}if(r.buttons.length===0)return null;if(r.buttons.length>1)return e.jsx(me,{ooui:new se.Field({ooui:r}),children:e.jsxs(p.Dropdown.Button,{disabled:!a||w,onClick:V,icon:e.jsx(H.DownOutlined,{}),type:u?"primary":void 0,overlay:e.jsx(qo,{ooui:s,executeButtonAction:m,lang:T}),children:[E(),i]})});if(n)return e.jsx(Ut,{ooui:n})},qo=t=>{const{ooui:r,executeButtonAction:n,lang:s}=t;if(!r)return null;const o=r.map(i=>{const{id:a,caption:c,activated:h,buttonType:d,confirmMessage:u,icon:f,context:g,readOnly:w,danger:y}=i,[m,v]=l.useState(!1);async function S(){v(!0),await n({type:d,action:a,context:g}),v(!1)}function T(){if(u){st({confirmMessage:u,lang:s,onOk:()=>{S()}});return}S()}function E(){if(m)return e.jsx(H.LoadingOutlined,{});if(f){const b=Je(f);return b&&e.jsx(b,{})}}return e.jsx(p.Menu.Item,{disabled:!h||w,onClick:T,icon:E(),danger:y,children:c})});return e.jsx(p.Menu,{children:o})},Uo=.7;function _r(){const{innerWidth:t,innerHeight:r}=window;return{width:t,height:r}}function Dt(){const[t,r]=l.useState(_r());return l.useEffect(()=>{function n(){r(_r())}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),{modalWidth:t.width*Uo,modalHeight:t.height,width:t.width,height:t.height}}class K{static init(r){K.handler=r}static getHandler(){if(!K.handler)throw"Must call init() first with a valid ConnectionProvider instance";return K.handler}}const Dr=t=>{let r,n,s;if(typeof t=="string"&&t.indexOf(" -- ")!==-1&&t.indexOf(`
2
2
 
3
3
  `)!==-1){const o=t.split(`
4
4