PageSourceSearch

https://smenarnabitcoin.cz/assets/AdmissionLocations-D6vOXBLb.js

js smenarnabitcoin.cz collected 2026-10-06 19:42:45 UTC 21,951 bytes, 1 lines download raw bytes

1import{Z as We,r as B,f as ze,j as e,P as Le,a9 as re,n as _,aa as pe,ab as ye,ac as Ne,ad as xe,ae as Me,af as Ve,ag as Re,ah as Ue}from"./index-BiR4tHPa.js";import{F as k,R as be,C as q,T as Oe,a as Ke,M as ge}from"./index-BXGd6uBa.js";import{C as E}from"./index-1AQ0BBpp.js";import{I as L}from"./index-D0a2oRRq.js";import{S as Z}from"./index-B20H1fdf.js";import{B as He}from"./Breadcrumb-CpfJQNre.js";import{s as j}from"./index-91xJNY7Q.js";import"./Skeleton-DfThc6Vk.js";import"./fade-WpTyRwrX.js";const{Title:J,Text:se}=Ke,{TextArea:Ye}=L,C="admission-locations-root",Ge=["Normal","General","Semi-Private","Private","Deluxe","Suite","ICU","PICU","NICU","CCU","HDU","Emergency","Observation","Isolation","COVID","Maternity","Labour Room","Post-Op","Day Care","Dialysis","Burn Unit","Psychiatry"],qe=i=>{if(!i)return[];const l=[],t=[i];for(;t.length;){const s=t.pop();if(s&&(s.nodeType==="bed"&&s.backendId&&l.push(s.backendId),Array.isArray(s.children)&&s.children.length>0))for(const b of s.children)t.push(b)}return l},je=(i,l)=>Array.isArray(i)?i.filter(Boolean).map(t=>{if(t.nodeType==="bed")return t;const s=(t.children||[]).filter(b=>b?b.nodeType!=="bed"?!0:!l.has(b.backendId):!1).map(b=>b.nodeType==="bed"?b:{...b,children:je(b.children||[],l)});return{...t,children:s}}):[],Ze=i=>{if(!i)return[];const l=[],t=[i];for(;t.length;){const s=t.pop();if(s&&(s.nodeType!=="bed"&&s.backendId&&l.push(s.backendId),Array.isArray(s.children)&&s.children.length>0))for(const b of s.children)t.push(b)}return l},le=(i,l)=>Array.isArray(i)?i.filter(t=>t&&t.key!==l).map(t=>!t||!Array.isArray(t.children)||t.children.length===0?t:{...t,children:le(t.children||[],l)}):[],Je=(i,l)=>{const t=(i==null?void 0:i.document)||[],s=(l==null?void 0:l.document)||[],b=[],S=new Map;return t.forEach(g=>{const D=g.parent==="true",z={title:ee(g.name),key:`loc-${g._id}`,backendId:g._id,description:g.description||"",nodeType:D?"ward":"location",parent:D,children:[]};S.set(g._id,z)}),s.forEach(g=>{var I;const D={title:we(g.name)||`R${g.row}C${g.column}`,key:`bed-${g._id}`,backendId:g._id,nodeType:"bed",row:g.row,column:g.column,bedType:g.bed_type||"Normal"},z=(I=g.ward_location)==null?void 0:I.id;if(z&&S.has(z)){const P=S.get(z);P.children=P.children||[],P.children.push(D)}}),t.forEach(g=>{var I;const D=S.get(g._id);if(!D)return;const z=(I=g.parent_location)==null?void 0:I.id;if(z){const P=S.get(z);P&&(P.children=P.children||[],P.children.push(D))}else b.push(D)}),b},Qe=async()=>{try{const[i,l]=await Promise.all([Re(),Ue()]),t=(i==null?void 0:i.data)||{},s=(l==null?void 0:l.data)||{};return Je(t,s)}catch(i){return console.error("Failed to load data:",i),[]}},ie=i=>{const l=i.toLocaleString("en-GB",{day:"2-digit"}),t=i.toLocaleString("en-GB",{month:"long"}),s=i.toLocaleString("en-GB",{year:"numeric"});return`${l}, ${t} ${s}`},we=i=>{if(typeof i!="string")return i;const l=i.trim();if(!l)return i;const t=l.match(/^bed(.*)$/i);return t?`Bed${t[1]||""}`:i},ee=i=>{if(typeof i!="string")return i;const l=i.trimStart();return l?l.charAt(0).toUpperCase()+l.slice(1):i},te=(i,l)=>{for(const t of i){if(t.key===l)return t;if(t.children&&t.children.length>0){const s=te(t.children,l);if(s)return s}}return null},Be=(i,l,t)=>l?i.map(s=>s.key===l?{...s,children:[...s.children||[],t]}:s.children&&s.children.length>0?{...s,children:Be(s.children,l,t)}:s):[...i,t],oe=(i,l,t)=>i.map(s=>s.key===l?t(s):s.children&&s.children.length>0?{...s,children:oe(s.children,l,t)}:s),ke=(i,l,t)=>i.map(s=>s.key===l?{...s,children:t}:s.children&&s.children.length>0?{...s,children:ke(s.children,l,t)}:s),ve=(i,l,t=[])=>{for(const s of i){const b=[...t,s];if(s.key===l)return b;if(s.children&&s.children.length>0){const S=ve(s.children,l,b);if(S)return S}}return null},dt=()=>{We();const[i,l]=B.useState([]),[t,s]=B.useState(C),[b,S]=B.useState(!1),[g,D]=B.useState(!0),[z,I]=B.useState(!1),[P,V]=B.useState(!1),[de,R]=B.useState(!1),[U,Q]=B.useState({rows:0,columns:0}),[F,N]=B.useState(!1),[O]=k.useForm(),[M]=k.useForm(),[X]=k.useForm(),[Y]=k.useForm(),{t:r}=ze(["bed","common"]);B.useEffect(()=>{(async()=>{D(!0);const o=await Qe();l(o),D(!1)})()},[]);const Te=n=>{n&&n.length>0&&(s(n[0]),I(!1),R(!1),V(!1))},h=B.useMemo(()=>te(i,t),[i,t]),ne=B.useMemo(()=>!t||t===C?null:ve(i,t)||null,[i,t]),G=B.useMemo(()=>h?h.nodeType==="bed":!1,[h]),K=B.useMemo(()=>h?h.nodeType!=="bed":!1,[h]),a=B.useMemo(()=>
1{if(!h)return null;if(h.nodeType==="bed"){const n=ne;return!n||n.length===0?null:n[n.length-1]}return h},[h,ne]),ae=B.useMemo(()=>{const n=new Map;return((a==null?void 0:a.children)||[]).filter(d=>(d==null?void 0:d.nodeType)==="bed").forEach(d=>{const f=Number(d.row),u=Number(d.column);!Number.isFinite(f)||!Number.isFinite(u)||n.set(`${f}_${u}`,d)}),n},[a]);B.useEffect(()=>{!G||!h||X.setFieldsValue({row:h.row??void 0,column:h.column??void 0,bedNumber:h.title??void 0,bedType:h.bedType??"Normal"})},[X,G,h]);const ce=B.useMemo(()=>a?a.key===C?[]:a.nodeType==="bed"?[]:(a.children||[]).filter(n=>n.nodeType==="bed"):[],[a]),ue=B.useMemo(()=>{const n=new Set(Ge),o=Array.isArray(i)?[...i]:[];for(;o.length;){const d=o.pop();if(d&&(d.nodeType==="bed"&&d.bedType&&n.add(d.bedType),Array.isArray(d.children)&&d.children.length>0))for(const f of d.children)o.push(f)}return Array.from(n).sort((d,f)=>String(d).localeCompare(String(f)))},[i]),Ce=()=>{S(!0),I(!1),V(!1),O.setFieldsValue({name:"",description:""})},Ie=()=>{S(!1),O.resetFields()},Se=()=>{if(!K||t===C){j.warning(r("pleaseSelectLocationToEdit"));return}V(!0),I(!1),R(!1);const n=((h==null?void 0:h.children)||[]).filter(c=>c.nodeType==="bed");let o=0,d=0;n.forEach(c=>{typeof c.row=="number"&&(o=Math.max(o,c.row)),typeof c.column=="number"&&(d=Math.max(d,c.column))});const f=o||void 0,u=d||void 0;Q({rows:f||0,columns:u||0}),M.setFieldsValue({row:f,column:u,bedType:"Normal"})},Fe=()=>{if(!K||t===C){j.warning(r("pleaseSelectLocationToAdd"));return}V(!0),I(!0),R(!1),Q({rows:0,columns:0}),M.setFieldsValue({row:void 0,column:void 0,bedType:"Normal"})},Ae=async()=>{try{const n=await M.validateFields(["row","column"]),o=Number.parseInt(n.row,10),d=Number.parseInt(n.column,10);if(!Number.isFinite(o)||o<=0||!Number.isFinite(d)||d<=0){j.error(r("rowColumnPositive"));return}Q({rows:o,columns:d}),R(!0);const f={};for(let u=1;u<=o;u++)for(let c=1;c<=d;c++){const y=ae.get(`${u}_${c}`);y!=null&&y.title&&(f[`bed_${u}_${c}`]=y.title)}Y.setFieldsValue(f)}catch{j.error(r("pleaseEnterRowColumn"))}},me=()=>{I(!1),V(!1),R(!1),Q({rows:0,columns:0}),M.resetFields()},_e=async()=>{if(!K||t===C){j.warning(r("pleaseSelectLocationToEdit"));return}const n=h,o=qe(n),d=Ze(n);if(o.length===0&&d.length===0){j.info(r("noBedsToDelete")||"Nothing to delete");return}ge.confirm({title:r("deleteBedLayout")||"Delete Bed Layout",content:`This will delete ${o.length} bed${o.length!==1?"s":""} and ${d.length} location${d.length!==1?"s":""}. Continue?`,okText:r("delete")||"Delete",okButtonProps:{style:{backgroundColor:"rgb(1, 57, 94)",borderColor:"rgb(1, 57, 94)"}},cancelText:r("cancel")||"Cancel",onOk:async()=>{var f,u;N(!0);try{o.length>0&&await Promise.all(o.map(y=>ye(y))),d.length>0&&await Promise.all(d.map(y=>Ne(y)));const c=new Set(o);l(y=>{const $=c.size>0?je(y,c):y;return le($,t)}),s(C),j.success(r("bedLayoutDeleted")||"Bed layout deleted")}catch(c){((u=(f=c==null?void 0:c.response)==null?void 0:f.data)==null?void 0:u.detail)==="You do not have permission to perform this action."?j.error(r("noPermissionToDeleteBedLayout")||"You don't have permission to delete bed layouts"):j.error(r("You don't have permission to delete bed!")||"Failed to delete bed layout")}finally{N(!1)}}})},De=async n=>{ge.confirm({title:"Delete Bed",content:`Are you sure you want to delete "${n.title}"?`,okText:"Delete",okButtonProps:{style:{backgroundColor:"rgb(1, 57, 94)",borderColor:"rgb(1, 57, 94)"}},cancelText:"Cancel",onOk:async()=>{try{n.backendId&&await ye(n.backendId),l(o=>le(o,n.key)),s((a==null?void 0:a.key)||C),j.success("Bed deleted successfully")}catch(o){console.error("Error deleting bed:",o),j.error("You do not have permission to perform this action")}}})},he=async()=>{N(!0);try{if(!de){await Ae();return}const n=await M.validateFields(),o=await Y.validateFields(),d=U.rows,f=U.columns,u=n.bedType,c=a==null?void 0:a.key;if(!c){j.error(r("pleaseSelectLocation"));return}const y=[];let $=1;for(let w=1;w<=d;w++)for(let m=1;m<=f;m++){if(ae.has(`${w}_${m}`))continue;const T=`bed_${w}_${m}`,v=o[T]||`R${w}C${m}`,p=we(v)||v;y.push({title:p,key:`bed-${Date.now()}-${$}`,nodeType:"bed",row:w,column:m,bedType:u}),$+=1}let W=[];
1try{if(y.length===0){j.info(r("noNewBedsToAdd")||"No new beds to add"),I(!1),V(!1),M.resetFields(),Y.resetFields();return}const w=a!=null&&a.backendId?{id:a.backendId,name:(a==null?void 0:a.title)||""}:null,m=ie(new Date);W=(await Promise.all(y.map(v=>xe({name:v.title,description:"",ward_location:w||void 0,date:m,created_by:"",status:"AVAILABLE",patient_id:"",patient_name:"",bed_type:v.bedType,row:v.row,column:v.column})))).map(v=>{var x,A,H,fe;const p=v==null?void 0:v.data;return(p==null?void 0:p._id)||(p==null?void 0:p.id)||((x=p==null?void 0:p.data)==null?void 0:x._id)||((A=p==null?void 0:p.data)==null?void 0:A.id)||((H=p==null?void 0:p.result)==null?void 0:H._id)||((fe=p==null?void 0:p.result)==null?void 0:fe.id)||null})}catch{j.error(r("failedToPostBeds"))}l(w=>{const m=te(w,c),T=(m==null?void 0:m.children)||[],v=T.filter(A=>A.nodeType!=="bed"),p=T.filter(A=>A.nodeType==="bed"),x=y.map((A,H)=>({...A,backendId:W[H]||A.backendId}));return ke(w,c,[...v,...p,...x])}),j.success(r("bedsAdded",{count:y.length})),I(!1),V(!1),M.resetFields(),Y.resetFields()}catch{j.error(r("failedToPostBeds"))}finally{N(!1)}},$e=()=>{const n=(o,d,f=null)=>{for(const u of o){if(u.key===d)return f;if(u.children&&u.children.length>0){const c=n(u.children,d,u.key);if(c)return c}}return null};if(a!=null&&a.key){const o=n(i,a.key);s(o||a.key)}},Ee=async()=>{var n,o,d,f;N(!0);try{const u=await X.validateFields(),c=Number.parseInt(u.row,10),y=Number.parseInt(u.column,10);if(!Number.isFinite(c)||c<=0||!Number.isFinite(y)||y<=0){j.error(r("rowColumnPositive"));return}const $=(u.bedNumber||"").toString().trim(),W=u.bedType;try{if(h!=null&&h.backendId)await Me(h.backendId,{name:$,bed_type:W,ward_location:a!=null&&a.backendId?{id:a.backendId,name:(a==null?void 0:a.title)||""}:void 0,row:c,column:y});else{const w=await xe({name:$,description:"",ward_location:a!=null&&a.backendId?{id:a.backendId,name:(a==null?void 0:a.title)||""}:void 0,date:ie(new Date),created_by:"",status:"AVAILABLE",patient_id:"",patient_name:"",row:c,column:y,bed_type:W}),m=w==null?void 0:w.data,T=(m==null?void 0:m._id)||(m==null?void 0:m.id)||((n=m==null?void 0:m.data)==null?void 0:n._id)||((o=m==null?void 0:m.data)==null?void 0:o.id)||((d=m==null?void 0:m.result)==null?void 0:d._id)||((f=m==null?void 0:m.result)==null?void 0:f.id)||null;T&&l(v=>oe(v,t,p=>({...p,backendId:T})))}l(w=>oe(w,t,m=>({...m,title:$,row:c,column:y,bedType:W,nodeType:"bed"}))),j.success(r("bedUpdated"))}catch{j.error(r("failedToUpdateBed"))}}catch{j.error(r("failedToUpdateBed"))}finally{N(!1)}},Pe=async()=>{var n,o,d,f;N(!0);try{const u=await O.validateFields(),c=ee(u.name),y=t===C?"":t||"",$=`loc-${Date.now()}`,W={title:c,key:$,children:[],description:u.description,parent:!0,nodeType:"location"},m=ie(new Date),T=y?te(i,y):null,v={name:c,description:u.description||"",date:m,parent:"true",created_by:""};T!=null&&T.backendId&&(v.parent_location={id:T.backendId,name:T.title||""});const p=await Ve(v),x=p==null?void 0:p.data,A=(x==null?void 0:x._id)||(x==null?void 0:x.id)||((n=x==null?void 0:x.data)==null?void 0:n._id)||((o=x==null?void 0:x.data)==null?void 0:o.id)||((d=x==null?void 0:x.result)==null?void 0:d._id)||((f=x==null?void 0:x.result)==null?void 0:f.id)||null;A&&(W.backendId=A),W.nodeType="ward",l(H=>Be(H,y,W)),s($),S(!1),O.resetFields()}catch{j.error(r("failedToCreateWard"))}finally{N(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Le,{activeMenu:r("title"),motherMenu:r("title")}),e.jsx("div",{style:{width:"100%"},children:e.jsxs(be,{gutter:16,children:[e.jsx(q,{xs:24,md:8,lg:7,children:e.jsxs(E,{style:{height:"calc(100vh - 140px)",overflow:"auto"},children:[e.jsxs("div",{style:{position:"sticky",top:0,zIndex:10,background:"#fff",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8,paddingBottom:4},children:[e.jsx(re,{type:"text",onClick:()=>s(C),style:{padding:0,height:"auto"},children:e.jsx(se,{strong:!0,style:{color:t===C?"#1677ff":void 0},children:r("addloc")})}),e.jsx(re,{size:"small",type:"link",onClick:Ce,disabled:G,style:G?{opacity:.5,cursor:"not-allowed"}:{},children:r("add")})]}),g?e.jsx("div",{style:{padding:20,textAlign:"center"},children:e.jsx(se,{children:r("loadingLocations")})}):e.jsx(Oe,{defaultExpandAll:!0,showLine:!0,selectedKeys:t&&t!==C?[t]:[],treeData:i,onSelect:Te})]})}),e.jsx(q,{xs:24,md:16,lg:17,children:e.jsx(E,{style:{minHeight:"calc(100vh - 140px)"},children:b?e.jsxs(E,{style:{marginBottom:16},children:[e.jsx(J,{level:4,style:{marginTop:0},children:r("addlocation")}),e.jsxs(k,{layout:"vertical",form:O,children:[e.jsx(k.Item,{label:r("parentLocation"),children:e.jsx(L,{style:{backgroundColor:"#f5f5f5"},value:t===C?r("admissionLocations"):(h==null?void 0:h.title)||r("admissionLocations"),disabled:!0})}),e.jsx(k.Item,{label:e.jsxs("strong",{children:[r("name"),e.jsx("span",{className:"text-danger",style:{fontWeight:"bold"},children:"*"})]}),name:"name",normalize:n=>ee(n),children:e.jsx(L,{style:{backgroundColor:"#f5f5f5"},onBlur:n=>{const o=ee(n.target.value);O.setFieldsValue({name:o})}})}),e.jsx(k.Item,{label:e.jsx("strong",{children:r("description")}),name:"description",children:e.jsx(Ye,{rows:6,style:{backgroundColor:"#f5f5f5"}})}),e.jsxs(Z,{style:{justifyContent:"flex-end",width:"100%",display:"flex"},children:[e.jsx(_,{variant:"primary",onClick:Ie,children:r("cancel")}),e.jsxs(_,{variant:"primary",onClick:Pe,disabled:F,children:[F&&e.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status","aria-hidden":"true"}),r(F?"loading":"save")]})]})]})]}):e.jsx(e.Fragment,{children:t===C?e.jsxs(e.Fragment,{children:[e.jsx(J,{level:4,style:{marginTop:0},children:r("dashboardTitle")}),e.jsxs(be,{gutter:[16,16],children:[e.jsx(q,{xs:24,sm:12,md:8,children:e.jsxs(E,{size:"small",style:{textAlign:"center",backgroundColor:"#f0f8ff",border:"1px solid #d4e6fc"},children:[e.jsx("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#1677ff"},children:i.filter(n=>n.nodeType!=="bed"&&n.title&&n.title.trim()!=="").length}),e.jsx("div",{style:{color:"#666"},children:r("totalLocations")})]})}),e.jsx(q,{xs:24,sm:12,md:8,children:e.jsxs(E,{size:"small",style:{textAlign:"center",backgroundColor:"#f6ffed",border:"1px solid #d9f7be"},children:[e.jsx("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#52c41a"},children:i.reduce((n,o)=>{const d=f=>f.children?f.children.reduce((u,c)=>u+(c.nodeType==="bed"?1:d(c)),0):0;return n+d(o)},0)}),e.jsx("div",{style:{color:"#666"},children:r("totalBeds")})]})}),e.jsx(q,{xs:24,sm:12,md:8,children:e.jsxs(E,{size:"small",style:{textAlign:"center",backgroundColor:"#fff2e8",border:"1px solid #ffd591"},children:[e.jsx("div",{style:{fontSize:"24px",fontWeight:"bold",color:"#fa8c16"},children:i.reduce((n,o)=>{const d=f=>f.children?f.children.reduce((u,c)=>u+(c.nodeType==="bed"&&c.status==="AVAILABLE"?1:d(c)),0):0;return n+d(o)},0)}),e.jsx("div",{style:{color:"#666"},children:r("availableBeds")})]})})]}),e.jsx("div",{style:{marginTop:"24px"},children:e.jsx(Z,{direction:"vertical",size:"middle",style:{width:"100%"},children:e.jsx("div",{style:{color:"#666",fontSize:"14px"},children:r("selectHint")})})})]}):e.jsxs(e.Fragment,{children:[e.jsx(He,{items:[{title:r("admissionLocations")},...(ne||[]).map(n=>({title:n.title}))||[]]}),G?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{marginTop:12},children:e.jsx(J,{level:4,style:{marginTop:0},children:r("editBed")})}),e.jsx(E,{style:{maxWidth:520,marginTop:12},children:e.jsxs(k,{form:X,layout:"vertical",children:[e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx(k.Item,{label:e.jsxs("strong",{children:[r("row"),e.jsx("span",{className:"text-danger",style:{fontWeight:"bold"},children:"*"})]}),name:"row",style:{flex:1},children:e.jsx(L,{style:{backgroundColor:"#f5f5f5"}})}),e.jsx(k.Item,{label:e.jsxs("strong",{children:[r("column"),e.jsx("span",{className:"text-danger",style:{fontWeight:"bold"},children:"*"})]}),name:"column",style:{flex:1},children:e.jsx(L,{style:{backgroundColor:"#f5f5f5"}})})]}),e.jsx(k.Item,{label:e.jsxs("strong",{children:[r("bedNumber"),e.jsx("span",{className:"text-danger",style:{fontWeight:"bold"},children:"*"})]}),name:"bedNumber",children:e.jsx(L,{style:{backgroundColor:"#f5f5f5"}})}),e.jsx(k.Item,{label:e.jsx("strong",{children:r("bedType")}),name:"bedType",children:e.jsx(pe,{options:ue.map(n=>({value:n,label:n})),placeholder:r("bedType")})}),e.jsxs(Z,{style:{justifyContent:"flex-end",width:"100%",display:"flex"},children:[e.jsx(_,{variant:"primary",onClick:$e,children:r("cancel")}),e.jsxs(_,{variant:"primary",onClick:Ee,disabled:F,children:[F&&e.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status","aria-hidden":"true"}),r("save")]})]})]})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{marginTop:12,display:"flex",gap:8,flexWrap:"wrap",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",flex:1,minWidth:0},children:[e.jsx(_,{variant:"primary",disabled:!K,onClick:Se,style:{fontSize:12,padding:"6px 12px",whiteSpace:"nowrap"},children:r("editBedLayout")}),e.jsx(_,{variant:"primary",disabled:!K,danger:!0,onClick:_e,style:{fontSize:12,padding:"6px 12px",whiteSpace:"nowrap"},children:r("deleteBedLayout")})]}),e.jsx(_,{variant:"primary",disabled:!K,onClick:Fe,style:{fontSize:12,padding:"6px 12px",whiteSpace:"nowrap",flexShrink:0},children:r("addBed")})]}),e.jsxs("div",{style:{marginTop:16},children:[e.jsx(J,{level:5,style:{margin:0},children:(h==null?void 0:h.title)||""}),h!=null&&h.description?e.jsx("div",{style:{marginTop:6},children:e.jsx(se,{type:"secondary",children:h.description})}):null]}),e.jsx("div",{style:{marginTop:16},children:P?de?e.jsxs(E,{style:{marginBottom:16},children:[e.jsxs(J,{level:5,style:{marginTop:0,marginBottom:16},children:[r("enterBedNumbers")," (",U.rows," × ",U.columns,")"]}),e.jsxs(k,{form:Y,layout:"vertical",children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, minmax(0, 1fr))",gap:8,marginBottom:16},children:Array.from({length:U.rows},(n,o)=>Array.from({length:U.columns},(d,f)=>e.jsx(E,{size:"small",style:{textAlign:"center",border:"1px solid #d9d9d9",borderRadius:"6px",backgroundColor:"#fafafa",minHeight:"60px",display:"flex",alignItems:"center",justifyContent:"center",width:"100%"},children:e.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center"},children:[e.jsx("div",{style:{fontSize:22,lineHeight:1,marginBottom:6},children:"🛏️"}),e.jsx(k.Item,{name:`bed_${o+1}_${f+1}`,style:{marginBottom:0,width:"100%"},rules:[{required:!0,message:r("pleaseEnterBedNumber")||"Please enter bed number"}],validateTrigger:"onBlur",children:e.jsx(L,{style:{backgroundColor:"transparent",border:"none",textAlign:"center",fontWeight:"bold",fontSize:"12px",color:"#222"},placeholder:r("enterBedNumbers")||"Enter bed number"})})]})},`bed_${o+1}_${f+1}`)))}),e.jsxs(Z,{style:{justifyContent:"flex-end",width:"100%",display:"flex"},children:[e.jsx(_,{onClick:me,children:r("cancel")}),e.jsx(_,{onClick:()=>R(!1),children:r("back")}),e.jsxs(_,{variant:"primary",onClick:he,disabled:F,children:[F&&e.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status","aria-hidden":"true"}),r("save")]})]})]})]}):e.jsx(E,{style:{marginBottom:16,width:"100%",maxWidth:"100%"},children:e.jsxs(k,{form:M,layout:"vertical",children:[e.jsxs("div",{className:"d-flex gap-2",children:[e.jsx(k.Item,{label:e.jsxs("strong",{children:[r("row"),e.jsx("span",{className:"text-danger",style:{fontWeight:"bold"},children:"*"})]}),name:"row",children:e.jsx(L,{style:{backgroundColor:"#f5f5f5"}})}),e.jsx(k.Item,{label:e.jsxs("strong",{children:[r("column"),e.jsx("span",{className:"text-danger",style:{fontWeight:"bold"},children:"*"})]}),name:"column",children:e.jsx(L,{style:{backgroundColor:"#f5f5f5"}})})]}),e.jsx(k.Item,{label:e.jsx("strong",{children:r("bedType")}),name:"bedType",style:{maxWidth:370},children:e.jsx(pe,{options:ue.map(n=>({value:n,label:n})),placeholder:r("bedType")})}),e.jsxs(Z,{style:{justifyContent:"flex-end",width:"100%",display:"flex"},children:[e.jsx(_,{onClick:me,children:r("cancel")}),e.jsxs(_,{variant:"primary",onClick:he,disabled:F,children:[F&&e.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status","aria-hidden":"true"}),r("next")]})]})]})}):null}),ce.length>0?e.jsx("div",{style:{marginTop:24},children:e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:16,marginTop:16},children:ce.map(n=>e.jsxs("div",{style:{position:"relative"},children:[e.jsxs(E,{size:"small",style:{textAlign:"center",cursor:"pointer",border:"1px solid #d9d9d9",borderRadius:"8px",transition:"all 0.3s ease",boxShadow:"0 2px 6px rgba(0,0,0,0.08)",backgroundColor:t===n.key?"#f0f8ff":"white"},hoverable:!0,onClick:()=>s(n.key),children:[e.jsx("div",{style:{fontSize:26,lineHeight:1,marginBottom:10},children:"🛏️"}),e.jsx("div",{style:{fontWeight:"bold",fontSize:"14px",marginBottom:"8px"},children:n.title}),e.jsx("div",{style:{fontSize:"12px",color:"#666",textAlign:"center"},children:n.bedType})]}),e.jsx(re,{type:"text",size:"small",danger:!0,style:{position:"absolute",top:"4px",right:"4px",padding:"2px 4px",height:"20px",minWidth:"20px"},onClick:o=>{o.stopPropagation(),De(n)},title:"Delete Bed",children:"×"})]},n.key))})}):null]})]})})})})]})})]})};export{dt as default};

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