@bwg-ui/core 1.3.6 → 1.3.7

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.
Files changed (49) hide show
  1. package/dist/chunks/{CMSearchIntfGwP01-Cs78BtE7.cjs → CMSearchIntfGwP01-0t3umcc_.cjs} +1 -1
  2. package/dist/chunks/{CMSearchIntfGwP01-BBdPmalj.js → CMSearchIntfGwP01-DCHZJn2H.js} +1 -1
  3. package/dist/chunks/{MenuReport-BCO-gXwk.cjs → MenuReport-C70mGz2g.cjs} +1 -1
  4. package/dist/chunks/{MenuReport-CYK_Eaqa.js → MenuReport-IBdoU2S3.js} +2 -2
  5. package/dist/chunks/{common-components-mXgJEMpT.cjs → common-components-DNgQR-Ge.cjs} +7 -7
  6. package/dist/chunks/{common-components-C61ER0qC.js → common-components-DeYL3J6X.js} +6448 -6443
  7. package/dist/chunks/layout-components-Bf9IsLUS.cjs +38 -0
  8. package/dist/chunks/{layout-components-gqu1pmfr.js → layout-components-DnuV2Psp.js} +626 -602
  9. package/dist/chunks/provider-Bi5OYngn.cjs +1 -0
  10. package/dist/chunks/{provider-Kxea5IoZ.js → provider-Bx4VpaFf.js} +90 -74
  11. package/dist/components/common/BwgGrid.d.ts.map +1 -1
  12. package/dist/components/common/BwgView.d.ts.map +1 -1
  13. package/dist/components/common/index.cjs +1 -1
  14. package/dist/components/common/index.js +1 -1
  15. package/dist/components/core/index.cjs +1 -1
  16. package/dist/components/core/index.js +1 -1
  17. package/dist/components/guide/index.cjs +1 -1
  18. package/dist/components/guide/index.js +2 -2
  19. package/dist/components/layout/AppWrapper.d.ts +5 -1
  20. package/dist/components/layout/AppWrapper.d.ts.map +1 -1
  21. package/dist/components/layout/extension/ContentWrapper.d.ts.map +1 -1
  22. package/dist/components/layout/index.cjs +1 -1
  23. package/dist/components/layout/index.js +1 -1
  24. package/dist/components/pages/rsrc/CMPopuMstrM01.d.ts.map +1 -1
  25. package/dist/components/popup/index.cjs +1 -1
  26. package/dist/components/popup/index.js +1 -1
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.js +273 -271
  29. package/dist/provider/contexts/PageContentContext.d.ts +23 -0
  30. package/dist/provider/contexts/PageContentContext.d.ts.map +1 -0
  31. package/dist/provider/contexts/index.d.ts +1 -0
  32. package/dist/provider/contexts/index.d.ts.map +1 -1
  33. package/dist/provider/index.cjs +1 -1
  34. package/dist/provider/index.js +21 -19
  35. package/dist/stores/index.cjs +1 -1
  36. package/dist/stores/index.js +1 -1
  37. package/dist/utils/index.cjs +1 -1
  38. package/dist/utils/index.d.ts +16 -22
  39. package/dist/utils/index.d.ts.map +1 -1
  40. package/dist/utils/index.js +1260 -1230
  41. package/dist/utils/messageUtils.d.ts +36 -48
  42. package/dist/utils/messageUtils.d.ts.map +1 -1
  43. package/dist/utils/modalUtils.d.ts +68 -0
  44. package/dist/utils/modalUtils.d.ts.map +1 -0
  45. package/dist/utils/notificationUtils.d.ts +50 -41
  46. package/dist/utils/notificationUtils.d.ts.map +1 -1
  47. package/package.json +1 -1
  48. package/dist/chunks/layout-components-D7I6VhXN.cjs +0 -38
  49. package/dist/chunks/provider-r4mkv5Zs.cjs +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";const ae=require("../utils/index.cjs"),tt=require("../stores/index.cjs"),o=require("react/jsx-runtime"),Y=require("@ant-design/icons"),p=require("antd"),m=require("react"),_=require("../components/core/index.cjs"),at=require("./provider-r4mkv5Zs.cjs"),rO=require("dompurify"),K1=require("quill"),nO=require("react-quill"),Ym=require("quill-image-resize-module-react"),Ct=require("realgrid"),Gm=require("realgrid-react"),iO=require("react-rnd"),Oa=require("react-dom"),oO=require("./layout-components-D7I6VhXN.cjs"),Xm=require("react-router-dom"),xl=require("dayjs");function q1(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ti=q1(Y),S=q1(m),qf=({checkAuth:e=!1,buttons:t,gap:r=8})=>{const{user:n,getButtonAuth:i,setButtonAuth:a}=tt.useUserStore(),s=at.useServiceCodeValue("AUTH_BTNS"),[l,c]=m.useState({});m.useEffect(()=>{const u=e?e.menuId:void 0,f=e?e.grpId:void 0;if(!u||!f){c({});return}const h=i(u,f);if(h){c(h);return}ae.callService(s,{crprCd:n?.crprCd,userId:n?.userId,grpId:f.toUpperCase(),menuId:u}).then(g=>{const v=Array.isArray(g?.data)?g.data:Array.isArray(g)?g:[],x={};(v||[]).forEach(y=>{const w=String(y?.btnId||"").trim();if(!w)return;const b=y?.enblYn==null?!0:String(y.enblYn).toUpperCase()==="Y";x[w]=b}),a(u,f,x),c(x)}).catch(g=>{console.error(g),c({})})},[s,n?.crprCd,n?.userId,e?e.menuId:void 0,e?e.grpId:void 0,i,a]);const d=m.useMemo(()=>!t||t.length===0?null:t.filter(u=>u?.visible!==!1).map(u=>{const f=!!u.disabled;if(!e)return o.jsx(_.BwgButton,{type:u.type,disabled:f,loading:u.loading,className:u.className||"bwg-btn",style:u.style,icon:u.icon,onClick:u.onClick,children:u.label},u.id);const v=!(Object.prototype.hasOwnProperty.call(l,u.id)?!!l[u.id]:!1),x=f||v,y=o.jsx(_.BwgButton,{type:u.type,disabled:x,loading:u.loading,className:u.className||"bwg-btn",style:u.style,icon:u.icon,onClick:u.onClick,children:u.label},u.id);if(v){const w=o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx(Y.ExclamationCircleFilled,{style:{color:"#faad14",fontSize:16}}),o.jsx("span",{style:{fontWeight:600},children:`'${u.label}' 버튼에 대한 사용 권한이 없습니다.`})]}),b=o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,paddingLeft:24},children:o.jsx("span",{style:{fontSize:12},children:"관리자에게 문의하세요."})});return o.jsx(p.Popover,{title:w,content:b,placement:"bottom",styles:{body:{backgroundColor:"#fffbe6"}},children:o.jsx("span",{children:y})},u.id)}return y}),[t,l,e]);return o.jsx(p.Flex,{gap:r,children:d})};var aO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sO(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}const Yf=({grpId:e,menuId:t,btnEvent:r,layout:n="horizontal",size:i="middle",style:a,className:s,onButtonClick:l})=>{const c=at.useServiceCodeValue("AUTH_BTNS"),{user:d}=tt.useUserStore(),[u,f]=m.useState([]),[h,g]=m.useState(!0),[v,x]=m.useState(null),[y,w]=m.useState({}),b=async()=>{try{g(!0),x(null),console.log("@@ 커스텀버튼그룹 영역 조회시작",e,t);const E=await ae.callService(c,{userId:d?.userId,crprCd:d?.crprCd,grpId:e.toUpperCase(),menuId:t});if(console.log("@@ 커스텀버튼그룹 영역 조회결과",E),E?.data&&Array.isArray(E.data)){const C=E.data.sort((O,k)=>O.btnSq-k.btnSq);f(C)}else f([])}catch(E){console.error("버튼 권한 조회 실패:",E),x("버튼 권한을 조회하는 중 오류가 발생했습니다."),f([])}finally{g(!1)}};m.useEffect(()=>{b()},[e,t]);const j=async(E,C)=>{w(O=>({...O,[E]:{loading:!0}}));try{const O=r?.[E];O?await O():console.warn(`버튼 이벤트 핸들러를 찾을 수 없습니다: ${E}`),l&&l(E,C,e)}catch(O){console.error("버튼 이벤트 실행 실패:",O),p.message.error("작업 중 오류가 발생했습니다.")}finally{w(O=>({...O,[E]:{loading:!1}}))}},P=E=>{const C=y[E.btnId]||{loading:!1};return o.jsxs(p.Button,{size:i,loading:C.loading,onClick:()=>j(E.btnId,E.btnNm),className:"bwg-btn",style:{...E.iconVal&&{display:"flex",alignItems:"center",gap:"4px"}},children:[E.iconVal&&o.jsxs(o.Fragment,{children:[E.iconType==="ANTD"&&Ti[E.iconVal]&&m.createElement(Ti[E.iconVal],{style:{fontSize:"14px"}}),E.iconType!=="ANTD"&&o.jsx("span",{className:E.iconVal,style:{fontSize:"14px"}})]}),E.btnNm]},E.btnId)};return h?o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Space,{direction:n==="vertical"?"vertical":"horizontal",size:i,children:o.jsx(p.Button,{loading:!0,size:i,children:"권한 조회 중..."})})}):v?o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Alert,{message:"권한 오류",description:v,type:"error",showIcon:!0,style:{minHeight:"40px"}})}):u.length===0?o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Alert,{message:"부여된 권한이 없습니다",type:"warning",showIcon:!0,style:{height:"20px",display:"flex",alignItems:"center",margin:0,padding:"10px 10px"}})}):o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Flex,{gap:3,children:u.map(P)})})},lO=({content:e,layout:t="flex",gap:r=16,minWidth:n=120,maxWidth:i=300,style:a,className:s})=>{if(!(Array.isArray(e)&&e.length>0&&Array.isArray(e[0])))return o.jsx("div",{style:a,className:s,children:e});const c=e.filter(g=>g&&g.length>0),d=m.useMemo(()=>{const g=c[0];if(!g||g.length===0)return{totalCols:0,baseWidth:0};let v=0;const x=[];g.forEach(w=>{const b=w,j=b?.props?.["data-colspan"]?parseInt(String(b.props["data-colspan"])):1;v+=j,x.push(j)});const y=v>0?100/v:0;return{totalCols:v,baseWidth:y,componentWidths:x}},[c]),u=(g,v,x)=>{const y=g,w=y?.props?.["data-colspan"]?parseInt(String(y.props["data-colspan"])):1;switch(t){case"equal":return 100/x;case"auto":return 100/x;case"grid":return 100/d.totalCols*w;case"flex":default:const b=d.baseWidth*w;return Math.max(n,Math.min(i,b))}},f=g=>{if(!g||typeof g!="object")return g;const v=g;if(!v.props)return g;const y={...v.props.style||{},width:"100%"};return m.cloneElement(v,{...v.props,style:y})},h=(g,v)=>{if(!g||g.length===0)return null;const x=g.length;return t==="grid"?o.jsx("div",{className:"erp-cmm-form",style:{display:"grid",gridTemplateColumns:`repeat(${d.totalCols}, 1fr)`,gap:`${r}px`,width:"100%"},children:g.map((y,w)=>{const b=y?.props?.["data-colspan"]?parseInt(String(y.props["data-colspan"])):1,j=f(y);return o.jsx("div",{style:{gridColumn:`span ${b}`,minWidth:`${n}px`},className:"form-component-wrapper",children:j},`row-${v}-col-${w}`)})},`row-${v}`):o.jsx(p.Flex,{gap:r,className:"erp-cmm-form",wrap:t==="auto"?"wrap":"nowrap",style:{width:"100%"},children:g.map((y,w)=>{const b=u(y,w,x),j=f(y),P=t==="flex"?{width:`${b}px`,minWidth:`${n}px`,maxWidth:`${i}px`,flexShrink:0}:{width:`${b}%`,minWidth:`${n}px`};return o.jsx("div",{style:P,className:"form-component-wrapper",children:j},`row-${v}-col-${w}`)})},`row-${v}`)};return o.jsx(p.Flex,{gap:"small",vertical:!0,style:a,className:s,children:c.map((g,v)=>h(g,v+1))})},$e=({children:e,className:t,style:r,...n})=>o.jsx(p.Col,{...n,className:`bwg-col ${t}`,style:r,children:e});var Qo={},Au={exports:{}},Zm;function Pc(){return Zm||(Zm=1,(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Au)),Au.exports}var Jo={},Qm;function cO(){if(Qm)return Jo;Qm=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e={items_per_page:"/ 페이지",jump_to:"이동하기",jump_to_confirm:"확인하다",page:"페이지",prev_page:"이전 페이지",next_page:"다음 페이지",prev_5:"이전 5 페이지",next_5:"다음 5 페이지",prev_3:"이전 3 페이지",next_3:"다음 3 페이지",page_size:"페이지 크기"};return Jo.default=e,Jo}var ea={},ta={},ra={},Iu={exports:{}},Nu={exports:{}},Du={exports:{}},_u={exports:{}},Jm;function Y1(){return Jm||(Jm=1,(function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(_u)),_u.exports}var Bu={exports:{}},ev;function uO(){return ev||(ev=1,(function(e){var t=Y1().default;function r(n,i){if(t(n)!="object"||!n)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var s=a.call(n,i||"default");if(t(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Bu)),Bu.exports}var tv;function dO(){return tv||(tv=1,(function(e){var t=Y1().default,r=uO();function n(i){var a=r(i,"string");return t(a)=="symbol"?a:a+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Du)),Du.exports}var rv;function fO(){return rv||(rv=1,(function(e){var t=dO();function r(n,i,a){return(i=t(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Nu)),Nu.exports}var nv;function pO(){return nv||(nv=1,(function(e){var t=fO();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),s.push.apply(s,l)}return s}function n(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){t(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Iu)),Iu.exports}var na={},iv;function hO(){return iv||(iv=1,Object.defineProperty(na,"__esModule",{value:!0}),na.commonLocale=void 0,na.commonLocale={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),na}var ov;function gO(){if(ov)return ra;ov=1;var e=Pc().default;Object.defineProperty(ra,"__esModule",{value:!0}),ra.default=void 0;var t=e(pO()),r=hO(),n=(0,t.default)((0,t.default)({},r.commonLocale),{},{locale:"ko_KR",today:"오늘",now:"현재 시각",backToToday:"오늘로 돌아가기",ok:"확인",clear:"지우기",week:"주",month:"월",year:"년",timeSelect:"시간 선택",dateSelect:"날짜 선택",monthSelect:"달 선택",yearSelect:"연 선택",decadeSelect:"연대 선택",yearFormat:"YYYY년",dateFormat:"YYYY-MM-DD",dateTimeFormat:"YYYY-MM-DD HH:mm:ss",monthBeforeYear:!1,previousMonth:"이전 달 (PageUp)",nextMonth:"다음 달 (PageDown)",previousYear:"이전 해 (Control + left)",nextYear:"다음 해 (Control + right)",previousDecade:"이전 연대",nextDecade:"다음 연대",previousCentury:"이전 세기",nextCentury:"다음 세기"});return ra.default=n,ra}var ia={},av;function G1(){if(av)return ia;av=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.default=void 0;const e={placeholder:"시간 선택",rangePlaceholder:["시작 시간","종료 시간"]};return ia.default=e,ia}var sv;function X1(){if(sv)return ta;sv=1;var e=Pc().default;Object.defineProperty(ta,"__esModule",{value:!0}),ta.default=void 0;var t=e(gO()),r=e(G1());const n={lang:Object.assign({placeholder:"날짜 선택",yearPlaceholder:"연도 선택",quarterPlaceholder:"분기 선택",monthPlaceholder:"월 선택",weekPlaceholder:"주 선택",rangePlaceholder:["시작일","종료일"],rangeYearPlaceholder:["시작 연도","종료 연도"],rangeMonthPlaceholder:["시작 월","종료 월"],rangeQuarterPlaceholder:["시작 분기","종료 분기"],rangeWeekPlaceholder:["시작 주","종료 주"],shortWeekDays:["일","월","화","수","목","금","토"],shortMonths:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},t.default),timePickerLocale:Object.assign({},r.default)};return ta.default=n,ta}var lv;function mO(){if(lv)return ea;lv=1;var e=Pc().default;Object.defineProperty(ea,"__esModule",{value:!0}),ea.default=void 0;var t=e(X1());return ea.default=t.default,ea}var cv;function vO(){if(cv)return Qo;cv=1;var e=Pc().default;Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var t=e(cO()),r=e(mO()),n=e(X1()),i=e(G1());const a="${label} 유효하지 않은 ${type}",s={locale:"ko",Pagination:t.default,DatePicker:n.default,TimePicker:i.default,Calendar:r.default,global:{placeholder:"선택하세요",close:"닫기"},Table:{filterTitle:"필터 메뉴",filterConfirm:"확인",filterReset:"초기화",filterEmptyText:"필터 없음",filterCheckAll:"전체 선택",filterSearchPlaceholder:"필터 검색",emptyText:"데이터 없음",selectAll:"전체 선택",selectInvert:"선택 반전",selectNone:"없음",selectionAll:"전체 선택",sortTitle:"정렬",expand:"펼치기",collapse:"접기",triggerDesc:"내림차순으로 정렬하기",triggerAsc:"오름차순으로 정렬하기",cancelSort:"정렬 취소하기"},Tour:{Next:"다음",Previous:"이전",Finish:"종료"},Modal:{okText:"확인",cancelText:"취소",justOkText:"확인"},Popconfirm:{okText:"확인",cancelText:"취소"},Transfer:{titles:["",""],searchPlaceholder:"여기에 검색하세요",itemUnit:"개",itemsUnit:"개",remove:"삭제",selectCurrent:"현재 페이지 선택",removeCurrent:"현재 페이지 삭제",selectAll:"전체 선택",removeAll:"전체 삭제",selectInvert:"선택 반전"},Upload:{uploading:"업로드 중...",removeFile:"파일 삭제",uploadError:"업로드 실패",previewFile:"파일 미리보기",downloadFile:"파일 다운로드"},Empty:{description:"데이터 없음"},Icon:{icon:"아이콘"},Text:{edit:"수정",copy:"복사",copied:"복사 됨",expand:"확장"},Form:{optional:"(선택사항)",defaultValidateMessages:{default:"필드 유효성 검사 오류 ${label}",required:"${label} 값을 입력해 주세요",enum:"${label} [${enum}] 중에 하나여야 합니다",whitespace:"${label} 비워둘 수 없습니다",date:{format:"${label} 유효하지 않은 날짜 형식입니다",parse:"${label} 날짜 형식으로 변환될 수 없습니다",invalid:"${label} 유효하지 않은 날짜입니다"},types:{string:a,method:a,array:a,object:a,number:a,date:a,boolean:a,integer:a,float:a,regexp:a,email:a,url:a,hex:a},string:{len:"${label} ${len}글자여야 합니다",min:"${label} 적어도 ${min}글자 이상이어야 합니다",max:"${label} ${max}글자 이하여야 합니다",range:"${label} ${min}-${max}글자 사이어야 합니다"},number:{len:"${label} 값은 ${len}이어야 합니다",min:"${label} 최솟값은 ${min}입니다",max:"${label} 최댓값은 ${max}입니다",range:"${label} 값은 ${min}-${max} 사이어야 합니다"},array:{len:"${len}이어야 합니다 ${label}",min:"최소 ${min}이어야 합니다 ${label}",max:"최대 ${max}이어야 합니다 ${label}",range:"${label} ${min}-${max} 사이어야 합니다"},pattern:{mismatch:"${label} ${pattern} 패턴과 일치하지 않습니다"}}},Image:{preview:"미리보기"},QRCode:{expired:"만료된 QR 코드",refresh:"새로고침"},ColorPicker:{presetEmpty:"미정",transparent:"투명",singleColor:"단색",gradientColor:"그라데이션"}};return Qo.default=s,Qo}var $u,uv;function yO(){return uv||(uv=1,$u=vO()),$u}var xO=yO();const Z1=wr(xO),Oh=({children:e,customTheme:t,customComponentSize:r="middle",layout:n="comfortable",getPopupContainer:i})=>{const s=(()=>{const c={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'"Noto Sans KR", sans-serif',fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:p.theme.defaultAlgorithm};switch(n){case"compact":return{...c,token:{...c.token,padding:8,margin:8,borderRadius:4,fontSize:12,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}};case"spacious":return{...c,token:{...c.token,padding:24,margin:24,borderRadius:8,fontSize:16,fontSizeHeading1:44,fontSizeHeading2:36,fontSizeHeading3:28,fontSizeHeading4:24,fontSizeHeading5:20}};default:return{...c,token:{...c.token,padding:16,margin:16,borderRadius:6,fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}}}})(),l={...s,...t,token:{...s.token,...t?.token},components:{Checkbox:{colorPrimary:"var(--check-primary)",colorPrimaryBorder:"var(--check-primary)",colorPrimaryHover:"var(--check-primary-active)",colorText:"var(--text-primary)"},Radio:{colorPrimary:"var(--check-primary)",colorPrimaryActive:"var(--check-primary-active)",colorPrimaryHover:"var(--check-primary-active)",buttonSolidCheckedBg:"var(--button-solid)",buttonSolidCheckedHoverBg:"var(--button-solid-hover)",buttonSolidCheckedActiveBg:"var(--button-solid-hover)"},Tree:{nodeHoverBg:"var(--tree-selected-bg)",nodeHoverColor:"var(--primary-color)",nodeSelectedBg:"var(--tree-selected-bg)",nodeSelectedColor:"var(--primary-color)",colorText:"var(--text-primary)"},Switch:{colorPrimary:"var(--switch-primary)",colorPrimaryHover:"var(--switch-primary)"},Tabs:{inkBarColor:"var(--primary-color)",itemSelectedColor:"var(--primary-color)",itemHoverColor:"var(--button-solid-hover)",itemActiveColor:"var(--button-solid-hover)",itemColor:"var(--text-primary)",horizontalItemGutter:0,horizontalItemPadding:"11px 24px"},Button:{borderColorDisabled:"var(--border-color)",defaultShadow:"none",dangerShadow:"none",iconGap:4},...t?.components??{}}};return o.jsx(p.ConfigProvider,{locale:Z1,theme:l,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},getPopupContainer:i,children:e})},bO=({children:e})=>{const{activeDetailItem:t,openTabByMenuId:r}=tt.useMenuViewStore();tt.useMenuModelStore();const{componentSize:n}=tt.useUserStore(),i=m.useCallback(()=>{console.log("handleMenuClick",t);const s=t?.prntInfo?.menuId;s&&r(s,void 0,{skipRefreshModal:!0})},[t?.prntInfo?.menuId,r]),a=m.useMemo(()=>({0:"12px",1:"14px",2:"16px"})[n],[n]);return o.jsx("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column"},children:o.jsx("div",{className:"bwgview-content",children:o.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[o.jsx(p.Breadcrumb,{style:{marginBottom:10,fontSize:a},separator:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M6.66675 11.3333L10.0001 7.99996L6.66675 4.66663",stroke:"#9A9A9A","stroke-linecap":"round","stroke-linejoin":"round"})}),items:[{title:t?.prntInfo?.menuId?o.jsx("span",{onClick:i,style:{fontSize:a,cursor:"pointer",color:"#1890ff",textDecoration:"none"},onMouseEnter:s=>{s.currentTarget.style.textDecoration="underline"},onMouseLeave:s=>{s.currentTarget.style.textDecoration="none"},children:t.prntInfo.menuNm}):o.jsx("span",{style:{fontSize:a},children:t?.prntInfo?.menuNm})},{title:o.jsx("span",{style:{fontSize:a,color:"#666"},children:t?.viewLabel})}]}),e]})})})},wO=5,CO=0,Le=({title:e,icons:t,tooltip:r,iconVisible:n=!0,paddingBottom:i,marginBottom:a,children:s})=>{const l=Ti.AppstoreTwoTone,{componentSize:c}=tt.useUserStore(),d=m.useMemo(()=>({0:5,1:4,2:3})[c],[c]);m.useMemo(()=>t?.type==="antd"&&t.icon&&Ti[t.icon]||l,[t?.type,t?.icon]);const u=(g,v)=>(g??v).toString().padStart(2,"0"),f=`pb${u(i,CO)}`,h=`mb${u(a,wO)}`;return o.jsx(p.Flex,{vertical:!0,style:{width:"100%"},children:o.jsxs("div",{className:`bwg-title-box ${f} ${h}`,style:{display:"flex",justifyContent:"space-between"},children:[o.jsx("div",{className:"bwg-title-box-left",children:o.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[o.jsx(p.Typography.Title,{level:d,children:o.jsx("span",{children:e})}),r&&o.jsx(p.Tooltip,{title:r.title,placement:r.placement,children:o.jsx(Ti.QuestionCircleTwoTone,{style:{marginLeft:5}})})]})}),o.jsx("div",{className:"bwg-title-box-right",children:o.jsx(p.Flex,{gap:6,children:s})})]})})},{Panel:dv}=p.Collapse,ko=m.forwardRef(({reqRows:e,subRows:t,border:r=!1,labelDisplay:n,header:i},a)=>{const[s]=p.Form.useForm(),[l,c]=m.useState("1"),[d,u]=m.useState(void 0),{componentSize:f}=tt.useUserStore(),h=m.useMemo(()=>{const x={0:12,1:14,2:16},y={0:"small",1:"middle",2:"large"};return{fontSize:x[f],componentSize:y[f]}},[f]),g=()=>n?{flex:n.md||n.lg||n.sm||"100px"}:{flex:"100px"};m.useEffect(()=>{d&&s.setFieldsValue(d)},[d,s]),m.useImperativeHandle(a,()=>({getFormData:()=>s.getFieldsValue(),setFormData:x=>{s.setFieldsValue(x)},setDefaultValue:x=>{u(x),s.setFieldsValue(x)},resetForm:()=>{d?s.setFieldsValue(d):s.resetFields()},validateForm:async()=>{try{return{success:!0,data:await s.validateFields()}}catch(x){return{success:!1,error:x}}}}));const v=()=>{c(x=>x.includes("subRows")?x.filter(y=>y!=="subRows"):[...x,"subRows"])};return o.jsxs("div",{style:r?{border:"1px solid #ddd",padding:"10px 12px",borderRadius:"8px",marginBottom:"10px"}:{},children:[i&&o.jsx(Le,{title:i.title,children:i.buttons}),o.jsx(p.ConfigProvider,{componentSize:h.componentSize,theme:{token:{fontSize:h.fontSize},components:{Collapse:{}}},children:o.jsx(p.Form,{form:s,layout:"inline",initialValues:d,style:{width:"100%",fontSize:`${h.fontSize}px`},labelCol:g(),labelAlign:"left",children:o.jsxs("div",{style:{position:"relative",width:"100%"},children:[t&&o.jsx("div",{style:{position:"absolute",top:"15px",left:"-9px",zIndex:10},children:l.includes("subRows")?o.jsx(p.Tooltip,{title:"접기",children:o.jsx("span",{className:"search-collapsed-arrow",onClick:v,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:o.jsx("path",{d:"M5.28321 0.986589C4.88285 0.482264 4.11715 0.482265 3.71679 0.986589L1.0243 4.37824C0.50404 5.0336 0.970753 6 1.80751 6L7.19249 6C8.02925 6 8.49596 5.0336 7.9757 4.37824L5.28321 0.986589Z",fill:"#AEB9C4"})})})}):o.jsx(p.Tooltip,{title:"펼치기",children:o.jsx("span",{className:"search-collapsed-arrow",onClick:v,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:o.jsx("path",{d:"M5.28321 5.01341C4.88285 5.51774 4.11715 5.51773 3.71679 5.01341L1.0243 1.62176C0.50404 0.966397 0.970753 1.64312e-07 1.80751 2.37464e-07L7.19249 7.08234e-07C8.02925 7.81386e-07 8.49596 0.966399 7.9757 1.62176L5.28321 5.01341Z",fill:"#AEB9C4"})})})})}),o.jsxs(p.Collapse,{activeKey:["reqRows",...l.includes("subRows")?["subRows"]:[]],onChange:c,className:"searchbox-collapse",bordered:!1,ghost:!0,children:[e&&o.jsx(dv,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"disabled",children:e},"reqRows"),t&&o.jsx(dv,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"icon",children:t},"subRows")]})]})})})]})}),dn=({children:e,showSearchBox:t,showCloseButton:r=!0,showEyesButton:n=!1,shotSettingButton:i=!0,styles:a,...s})=>{const[l,c]=m.useState(!0),[d,u]=m.useState(()=>{const w=s.placement;return w==="left"||w==="right"||w==="top"||w==="bottom"?w:"bottom"}),[f,h]=m.useState(!1),v=(w=>{const b={wrapper:{...s.width&&{width:s.width},...s.height&&{height:s.height},margin:"0 auto"},content:{},header:{backgroundColor:"var(--drawer-header-bg)",color:"var(--text-primary)"}};switch(w){case"bottom":return{...b,wrapper:{...b.wrapper,borderRadius:"30px 30px 0 0"},content:{borderRadius:"30px 30px 0 0"},header:{...b.header,borderRadius:"30px 30px 0 0"}};case"top":return{...b,wrapper:{...b.wrapper,borderRadius:"0 0 30px 30px"},content:{borderRadius:"0 0 30px 30px"},header:{...b.header}};case"left":return{...b,wrapper:{...b.wrapper,borderRadius:"0 30px 0px 0"},content:{borderRadius:"0 30px 0px 0"},header:{...b.header,borderRadius:"0 30px 0 0"}};case"right":return{...b,wrapper:{...b.wrapper,borderRadius:"30px 0 0 0"},content:{borderRadius:"30px 0 0 0"},header:{...b.header,borderRadius:"30px 0 0 0"}};default:return b}})(d),x={wrapper:{...v?.wrapper,...a?.wrapper},content:{...v?.content,...a?.content},header:{...v?.header,...a?.header}},y=()=>{const w=[];if(i){const b=[{key:"top",label:"상단",icon:o.jsx(Y.CaretUpOutlined,{})},{key:"right",label:"우측",icon:o.jsx(Y.CaretRightOutlined,{})},{key:"bottom",label:"하단",icon:o.jsx(Y.CaretDownOutlined,{})},{key:"left",label:"좌측",icon:o.jsx(Y.CaretLeftOutlined,{})}],j=o.jsx(p.Space.Compact,{children:b.map(P=>o.jsx(p.Button,{type:d===P.key?"primary":"default",size:"small",onClick:()=>{u(P.key),h(!1)},icon:P.icon},P.key))});w.push(o.jsx(p.Popover,{content:j,trigger:"click",placement:"left",open:f,onOpenChange:h,children:o.jsx(p.Tooltip,{placement:"bottom",title:"위치변경",zIndex:2100,children:o.jsx(p.Button,{icon:o.jsx(Y.SettingOutlined,{}),type:"text",size:"middle"})})},"shotSetting"))}return n&&w.push(o.jsx(p.Tooltip,{placement:"bottom",title:l?"배경 보기":"배경 숨기기",zIndex:2100,children:o.jsx(p.Button,{icon:o.jsx(Y.EyeOutlined,{}),type:"text",size:"middle",onClick:()=>c(!l)})},"eyes")),s.extra&&w.push(o.jsx("div",{style:{margin:"0 8px"},children:s.extra},"extra")),r&&w.push(o.jsx(p.Tooltip,{placement:"bottom",title:"닫기",zIndex:2100,children:o.jsx(p.Button,{icon:o.jsx(Y.CloseOutlined,{}),onClick:s.onClose,type:"text",size:"middle"})},"close")),w};return o.jsx(p.Drawer,{className:"main-drawer",footer:!0,...s,placement:d,styles:x,maskClosable:!1,closable:!1,mask:l,extra:o.jsx(p.Space,{size:"small",align:"center",children:y()}),afterOpenChange:w=>{w||(c(!0),u(s.placement)),s.afterOpenChange?.(w)},destroyOnHidden:!0,children:t?o.jsxs(ze,{type:"vertical",children:[o.jsxs(p.Flex,{justify:"space-between",align:"center",style:{width:"100%"},children:[o.jsx("div",{children:t.title}),o.jsx(p.Flex,{gap:2,children:t.extra})]}),o.jsx(ko,{...t.searchBox}),o.jsx(p.Divider,{}),e]}):e})},Ie=({width:e="100%",height:t="100%",boxAlign:r,display:n="show",overflow:i,style:a,className:s,border:l=!0,children:c,ref:d})=>o.jsx("div",{style:{width:e,height:t,display:n==="show"?"":n,overflowX:i?.x,overflowY:i?.y,...a},className:`bwgview-content-box ${r?`content-box-${r}`:""} ${s||""} ${l?"":"none-box-st"}`,ref:d,children:c}),Q1=Ym?.default??Ym;try{K1.register("modules/imageResize",Q1)}catch(e){console.warn("quill-image-resize-module-react 로드 실패:",e)}const Nl=e=>rO.sanitize(e??"",{ALLOWED_TAGS:["p","br","div","span","strong","b","em","i","u","s","blockquote","pre","code","ul","ol","li","h1","h2","h3","h4","h5","h6","a","img"],ALLOWED_ATTR:["style","class","href","target","rel","src","alt","width","height","data-*","align"],ALLOWED_URI_REGEXP:/^(?:(?:https?|data|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),Dl=m.forwardRef(({border:e=!0,editorProps:t,value:r,defaultValue:n,onChange:i,onBlur:a,disabled:s,placeholder:l},c)=>{const{isEditing:d=!0,title:u,containerHeight:f="100%"}=t||{},h=m.useRef(null),g=m.useMemo(()=>{const P={toolbar:d?[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{align:[]}],["link","image"],["clean"]]:!1};return Q1?{...P,imageResize:{parchment:K1.import("parchment"),modules:["Resize","DisplaySize","Toolbar"],displayStyles:{backgroundColor:"black",border:"none",color:"white"}}}:P},[d]),v=m.useMemo(()=>["header","bold","italic","underline","strike","color","background","list","bullet","indent","align","link","image","width","height"],[]),x=r!==void 0,[y,w]=m.useState(n??""),b=x?r:y,j=m.useCallback((P,E,C,O)=>{const k=Nl(P??"");x||w(k),i?.(k,E,C,O)},[x,i]);return m.useImperativeHandle(c,()=>({getHTML:()=>b??"",getText:()=>h.current?.getEditor()?.getText()??"",insertHTML:P=>{const E=h.current?.getEditor();if(!E)return;const C=E.getSelection(!0),O=Nl(P??"");E.clipboard.dangerouslyPasteHTML(C?C.index:E.getLength(),O)},insertImage:(P,E)=>{const C=h.current?.getEditor();if(!C)return;const O=C.getSelection(!0),k=typeof P=="string"?P:"";C.insertEmbed(O?O.index:C.getLength(),"image",k,"user")},getQuill:()=>h.current?.getEditor?.()??null})),o.jsx(Ie,{border:e,style:{opacity:s?.6:1,pointerEvents:s?"none":"auto",height:typeof f=="number"?`${f}px`:f,minHeight:0},children:o.jsxs("div",{className:"bwg-editor-wrap",style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[u&&o.jsx(Le,{...u,paddingBottom:10}),o.jsx(nO,{ref:h,theme:d?"snow":"bubble",readOnly:!d,value:b,onChange:j,onBlur:a,modules:g,formats:v,style:{width:"100%",display:"flex",flexDirection:"column",minHeight:0,flex:"1"},placeholder:l},d?"snow":"bubble")]})})}),SO=(e,t,r,n)=>Nl(e??""),jO=({itemProps:e,...t})=>{const{rules:r,shouldUpdate:n,dependencies:i,noStyle:a,...s}=e;return o.jsx(p.Form.Item,{valuePropName:"value",trigger:"onChange",getValueFromEvent:SO,normalize:l=>l??"",rules:r,shouldUpdate:n,dependencies:i,noStyle:a,...s,children:o.jsx(Dl,{...t})})},EO=e=>{const{itemProps:t,onChange:r,editorProps:n,...i}=e,a=p.Form.useFormInstance();if(t?.name!=null){const s=t.name;return o.jsxs(o.Fragment,{children:[o.jsx(p.Form.Item,{hidden:!0,name:s,rules:t.rules,normalize:l=>l??"",children:o.jsx("input",{type:"hidden"})}),o.jsx(Dl,{...i,editorProps:n,value:a.getFieldValue(s)??"",onChange:(l,c,d,u)=>{const f=Nl(l??"");a.setFieldValue(s,f),r?.(f,c,d,u)},onBlur:()=>{a.validateFields([s]).catch(()=>{})}})]})}return o.jsx(Dl,{...e})},kh=Object.assign(EO,{FormItem:jO,Core:Dl}),To=m.forwardRef(({currentPage:e,totalPages:t,pageSize:r=10,totalData:n,onPageChange:i,pageSizeOptions:a=[10,20,50,100],gridRef:s,mode:l="client",onServerPageChange:c},d)=>{const[u,f]=m.useState(r),[h,g]=m.useState(1),[v,x]=m.useState(r),[y,w]=m.useState(0);m.useEffect(()=>{f(r)},[r]),m.useEffect(()=>{f(r)},[]),m.useImperativeHandle(d,()=>({currentPage:h,pageSize:v,totalData:y,totalPages:Math.ceil(y/v),setPage:A=>{g(A),c?.(A,v)},setPageSize:A=>{x(A),g(1),c?.(1,A)},setTotalData:A=>{w(A)},reset:()=>{g(1),x(r),w(0)}}),[h,v,y,c,r]);const b=l==="client",j=b?(e||0)+1:h,P=b?(t||0)>0:y>0,C=b?P?Math.ceil((n||0)/u):0:Math.ceil(y/v),O=b?P&&n||0:y,k=Math.min(j,C||1),T=`${u}-${C}-${k}`,D=A=>{b?i?.(A-1):(g(A),c?.(A,v))},L=A=>{if(b){f(A);try{s?.current?.gridView?(s.current.gridView.setPaging(!0,A),s.current.gridView.setPage(0)):i?.(0)}catch(B){console.warn("페이지 사이즈 변경 중 오류:",B),i?.(0)}}else x(A),g(1),c?.(1,A)};return o.jsxs("div",{className:"bwg-pagination-container",style:{padding:"10px",display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid #dddddd",position:"relative"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontSize:"12px",color:"#333333"},children:"페이지당"}),o.jsx("select",{value:b?u:v,onChange:A=>L(Number(A.target.value)),disabled:!P,style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"12px",color:"#333333",opacity:P?1:.5},children:a.map(A=>o.jsxs("option",{value:A,children:[A,"개"]},A))}),o.jsxs("span",{style:{fontSize:"12px",color:"#666",opacity:P?1:.5},children:["/ 총 ",O,"개"]})]}),o.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultBorderColor:"#e8e8e8",defaultHoverBorderColor:"var(--primary-color)",defaultHoverColor:"var(--text-primary)",contentFontSize:13,defaultColor:"var(--text-primary)",paddingInline:0}}},children:[o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultColor:"#999999",defaultHoverColor:"var(--text-primary)"}}},children:[o.jsx(p.Button,{onClick:()=>D(1),disabled:!P||k===1,style:{width:"26px",height:"26px",border:0,background:!P||k===1?"#f1f1f1":"white",cursor:!P||k===1?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[o.jsx("path",{d:"M12 17L7 12L12 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M17 17L12 12L17 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})}),o.jsx(p.Button,{onClick:()=>D(k-1),disabled:!P||k===1,style:{width:"26px",height:"26px",border:0,background:!P||k===1?"#f1f1f1":"white",cursor:!P||k===1?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:o.jsx("path",{d:"M14 17L9 12L14 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})})]}),o.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:(()=>{if(!P||C===0)return o.jsx(p.Button,{disabled:!0,style:{width:"26px",height:"26px"},children:"1"});const A=5;let B=1,z=Math.min(A,C);k>3&&C>A&&(B=Math.max(1,k-2),z=Math.min(C,B+A-1),z===C&&(B=Math.max(1,z-A+1)));const F=[];for(let R=B;R<=z;R++)F.push(o.jsx(p.Button,{onClick:()=>D(R),style:{width:"26px",height:"26px",background:k===R?"var(--primary-color)":"#ffffff",color:k===R?"#ffffff":"#333333",cursor:"pointer"},children:R},R));return F})()},T),o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultColor:"#999999",defaultHoverColor:"var(--text-primary)"}}},children:[o.jsx(p.Button,{onClick:()=>D(k+1),disabled:!P||k>=C,style:{width:"26px",height:"26px",border:0,background:!P||k>=C?"#f1f1f1":"white",cursor:!P||k>=C?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:o.jsx("path",{d:"M10 17L15 12L10 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),o.jsx(p.Button,{onClick:()=>D(C),disabled:!P||k>=C,style:{width:"26px",height:"26px",border:0,background:!P||k>=C?"#f1f1f1":"white",cursor:!P||k>=C?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[o.jsx("path",{d:"M12 17L17 12L12 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M7 17L12 12L7 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})})]})]})})]})});To.displayName="BwgPagination";const PO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZZDLDcJADETHUe7QQVJC6AAqACoAKkCcESh8JI60kBKgg3TA0kE6gAISzHgj0BJ8sWw/j2cXCCI7aD446g2diDp1aWyWaz9sxmHhNlJSyUCDnlQeQpEKm5UCDwgqvHBnTji4MvcEKGw3FsVFDeCmCCbMYwIpQY4wMnX5mj5pKrXfTFSxc1sp/o03yLlZaoSpRFhme53/QF4FmNl9txbH8wuC5893tEo1PZivBs6/sgVXBlv9BpvVRX62Og6eAAAAAElFTkSuQmCC",OO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZVDbDcIwDHSiqL90AzoCI5S/fvQBEwATIDYoE7BCRwjqAtmAsEE3gAlqzlFBKbXknJ2cL5cQRcF13SIf9Bd63mmHdcN5nsbbJm6UtY6bxlGaCunNZZmTUpniqhpQvIhZ8AlcI+9QXYHYIb3BgQ0ETAJ36BvUmQiDuBV19TNdFBkliUyK0lX1fbc0bkyL1WF6D7UzbBxnpKCi9YHG0UPeoz6BePt+h55UxMMA9NMrPa68BDLiAxmcQh0cAM62AAAAAElFTkSuQmCC";let Lu=null;const kO=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"},{label:"레이아웃 초기화",tag:"initLayout"}],TO=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(들여쓰기 표시)",tag:"showIndentExcel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"},{label:"레이아웃 초기화",tag:"initLayout"}],MO=({children:e})=>{const[t,r]=m.useState(!1),[n,i]=m.useState(null);return t?o.jsx("div",{style:{padding:"20px",border:"1px solid #ff4d4f",borderRadius:"6px",backgroundColor:"#fff2f0",margin:"10px"},children:o.jsx(p.Alert,{message:"리얼그리드 로드 실패",description:o.jsxs("div",{children:[o.jsx("p",{children:"리얼그리드 라이센스 또는 초기화 중 오류가 발생했습니다."}),o.jsxs("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:["오류: ",n?.message||"알 수 없는 오류"]}),o.jsx(p.Button,{type:"primary",size:"small",style:{marginTop:"8px"},onClick:()=>{r(!1),i(null),window.location.reload()},children:"다시 시도"})]}),type:"error",showIcon:!0})}):o.jsx(RO,{onError:a=>{console.error("BwgGrid 에러:",a),i(a),r(!0)},children:e})};class RO extends m.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){this.props.onError(t)}render(){return this.state.hasError?null:this.props.children}}const AO=m.forwardRef(({type:e="nrml",gridDivStyle:t,gridDivClassName:r,gridColumns:n,gridOptions:i,gridEvents:a,bindRef:s,gridContext:l,renderers:c,gridInitCallback:d,gridId:u},f)=>{const h=m.useRef(null),g=m.useRef(new Map),v=m.useRef(null),{gridSize:x}=tt.useUserStore(),y=at.useGridSizeConfig(),b=at.useBwgView()?.menuId||"",j=m.useRef(`${b||"NO_MENU"}__${u||"NO_GRID"}__${ae.generateUID(16)}`),P=(U,ne,re,G)=>{let te=[],de=[];const q="treeNode";for(let Q in U){let Z=U[Q];te[Z[re]]=U[Q];let le=te[Z[ne]];if(le==null||le=="-"){de.push(Z);continue}le[q]==null&&(le[q]=[]),le[q].push(Z)}return de},E=m.useCallback(U=>{const ne=G=>{const te=[];return G.forEach(de=>{de.children&&de.children.length>0?te.push(...ne(de.children)):te.push(de)}),te};return ne(U).map(G=>({fieldName:G.fieldName,dataType:G.dataType||"text"}))},[]),C=m.useCallback(U=>{const ne=G=>{const te=[];return G.forEach(de=>{de.children&&de.children.length>0?te.push(...ne(de.children)):te.push(de)}),te};return ne(U).map(G=>({...G,header:{...G.header,template:G.required?`<img src='${OO}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:G.editable?`<img src='${PO}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:"${headerText}",values:{headerText:G.header?.text??""},text:G.header?.text||""},styleName:G.dataType==="number"?"right":G.styleName||"center"}))},[]);m.useImperativeHandle(f,()=>({addAllData(U,ne){const re=h.current?.gridView.getCurrent().dataRow;if(h.current?.dataProvider instanceof Ct.LocalDataProvider){h.current.dataProvider.clearRows();try{h.current?.gridView.showLoading(),h.current.dataProvider.setRows(U)}catch(G){console.error("fillJsonData 오류:",G)}finally{h.current?.gridView.closeLoading()}}if(h.current?.dataProvider instanceof Ct.LocalTreeDataProvider){if(h.current.dataProvider.clearRows(),ne?.treeOption?.dataField==null||ne?.treeOption?.parentField==null)return;const G={rows:"treeNode"};try{h.current?.gridView.showLoading();let te=P(U,ne.treeOption?.parentField,ne.treeOption?.dataField);h.current.dataProvider.fillJsonData({treeNode:te},G),ne.treeOption.isExpand&&h.current.gridView?.expandAll()}catch(te){console.error("fillJsonData 오류:",te)}finally{h.current?.gridView.closeLoading()}}ne?.isCurrent?h.current?.gridView.setCurrent({dataRow:re}):h.current?.gridView.setCurrent({dataRow:0})},isUpdate:()=>{const U=h.current?.dataProvider?.getAllStateRows();if(!U)return!1;const ne=(U.created?.length??0)>0,re=(U.updated?.length??0)>0,G=(U.deleted?.length??0)>0;return ne||re||G},getGridInstance:()=>h.current,getCurrentRow:()=>h.current?.gridView.getCurrent().dataRow??-1,getCurrentIndex:()=>h.current?.gridView.getCurrent().itemIndex??-1,gridExcelDown(U){h.current?.gridView.exportGrid({type:"excel",target:"local",allItems:!1,lookupDisplay:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!U?.indenting,header:"default",footer:"default",sheetName:"",fileName:U?.fileName||"sample.xlsx",...U})},getGridSaveData:()=>{const U=h.current?.dataProvider?.getAllStateRows();if(U===void 0)return[{}];let ne=[];if(U.created!==void 0&&U.created.length>0)for(const re in U.created){let G=h.current?.dataProvider?.getJsonRow(U.created[re]);G={...G,iudFlag:"I"},ne.push(G)}if(U.updated!==void 0&&U.updated.length>0)for(const re in U.updated){let G=h.current?.dataProvider?.getJsonRow(U.updated[re]);G={...G,iudFlag:"U"},ne.push(G)}if(U.deleted!==void 0&&U.deleted.length>0)for(const re in U.deleted){let G=h.current?.dataProvider?.getJsonRow(U.deleted[re]);G={...G,iudFlag:"D"},ne.push(G)}return ne},deleteGridData:()=>{h?.current?.gridView?.getCheckedItems()?.map(ne=>{let re=h?.current?.gridView?.getDataRow(ne)??-1;const G=h?.current?.dataProvider?.getRowState(re);G==Ct.RowState.DELETED?(h?.current?.dataProvider?.setRowState(re,g.current.get(ne)??Ct.RowState.NONE),g.current.delete(ne)):G==Ct.RowState.CREATED?h?.current?.dataProvider?.setRowState(re,Ct.RowState.CREATE_AND_DELETED):G==Ct.RowState.CREATE_AND_DELETED?h?.current?.dataProvider?.setRowState(re,Ct.RowState.CREATED):(g.current.set(ne,G??Ct.RowState.NONE),h?.current?.dataProvider?.setRowState(re,Ct.RowState.DELETED)),h?.current?.gridView?.checkItem(ne,!1)})},_oriRowState:[{}],dp:e=="tree"?h.current?.dataProvider:h.current?.dataProvider??null,vw:e=="tree"?h.current?.gridView:h.current?.gridView??null}));const O=m.useCallback((U,ne,re)=>{if(s!==void 0&&re>=0){let G=U.getDataSource().getJsonRow(re);s?.current?.setFieldsValue(G)}else s!==void 0&&re<0&&s?.current?.resetFields();U.setCurrent({dataRow:0}),a?.onCurrentRowChanged&&a?.onCurrentRowChanged(U,ne,re)},[s,a]),k=m.useCallback((U,ne,re)=>{const G=ne.fieldName??"";s?.current?.getFieldInstance(G)&&s?.current.setFieldValue(G,re),a?.onEditChange&&a?.onEditChange(U,ne,re)},[s,a]),T=m.useCallback((U,ne,re)=>{const G=U.getOrgFieldName(re),te=U.getValue(ne,re);s?.current?.setFieldValue(G,te)},[s]),D=m.useCallback((U,ne,re,G)=>{const te=U.getColumn(G).name??"",de=U.getValue(ne,G);s?.current?.getFieldInstance(te)&&s?.current.setFieldValue(te,de),a?.onCellEdited&&a?.onCellEdited(U,ne,re,G)},[s,a]),L=m.useCallback((U,ne,re,G)=>{if(typeof ne.dataRow=="number"&&ne.dataRow!=-1){var te=U.getDataSource().getRowState(ne.dataRow);if(te=="deleted"||te=="createAndDeleted")return!1}return a?.onShowEditor!=null&&a?.onShowEditor(U,ne,re,G),!0},[s,a]),A=m.useCallback(U=>{if(!h.current)return;const ne=h.current.gridView,re=ne.getDataSource();if(i?.container?.page){const G=ne.getPage(),te=ne.getPageCount(),de=re.getRowCount();ye({currentPage:G,totalPages:te,totalData:de})}},[i?.container?.page]),B=m.useCallback(()=>{if(!h.current)return;const U=h.current.gridView,ne=U.getDataSource();__SYS_CD__;const re=["onKeyDown"],G=["onRowInserted"];Object.keys(a??{}).map(te=>{re.includes(te)?U[te+"Add"]=a?.[te]:U[te]=a?.[te],G.includes(te)?ne[te+"Add"]=a?.[te]:ne[te]=a?.[te]}),ne instanceof Ct.LocalDataProvider&&(ne.onRowInserted=(te,de)=>{de<0||(setTimeout(function(){U?.setCurrent({dataRow:de})},1),te.onRowInsertedAdd!==void 0&&te.onRowInsertedAdd(te,de))}),U.onKeyDown=function(te,de){if(de.code=="Space"){let q=te.getSelectedItems(!0);for(const Q in q)te.isCheckable(q[Q])&&(te.isCheckedItem(q[Q])?te.checkItem(q[Q],!1,!1):te.checkItem(q[Q],!0,!1))}return te.onKeyDownAdd!==void 0&&te.onKeyDownAdd(te,de),!0},h.current.gridView.onCurrentRowChanged=O,h.current.gridView.onEditChange=k,h.current.gridView.getDataSource().onValueChanged=T,h.current.gridView.onCellEdited=D,h.current.gridView.onShowEditor=L,h.current.gridView.onDataLoadComplated=A,h.current.gridView.onLayoutPropertyChanged=function(te,de,q,Q,Z){const le=de?.column||"알 수 없음";console.log("🔵 [BwgGrid] 레이아웃 속성 변경 감지:",{columnName:le,property:q,oldValue:Q,newValue:Z,layout:de}),q==="visible"&&console.log(`📌 컬럼 "${le}" ${Z?"표시":"숨김"}`),(q==="order"||q==="index")&&console.log(`📌 컬럼 "${le}" 위치 변경: ${Q} → ${Z}`),a?.onLayoutPropertyChanged&&a.onLayoutPropertyChanged(te,de,q,Q,Z)}},[O,k,T,D,L,A,u,b]),z=m.useCallback(U=>{if(!U)return;const ne=u,re=b,G=__SYS_CD__;try{U.gridView.setSortingOptions({enabled:!0}),U.gridView.sortMode=Ct.SortMode.EXPLICIT,U.gridView.editorOptions.viewGridInside=!0,U.gridView instanceof Ct.TreeView&&U.gridView.setTreeOptions({expandWhenSetData:Ct.ExpandWhenSetData.REMAIN_AND_EXPAND,expanderIconStyle:Ct.TreeExpanderIconStyle.SQUARE,iconVisible:!1,lineVisible:!0});const te=()=>({0:25,1:30,2:43})[x];U.gridView.setDisplayOptions({showEmptyMessage:!0,emptyMessage:"조회된 데이터가 존재하지 않습니다.",useFocusClass:!0,minRowHeight:i?.display?.minRowHeight||25,maxRowHeight:i?.display?.maxRowHeight||100,rowHeight:te(),rowChangeDelay:i?.display?.rowChangeDelay||0,selectionStyle:i?.display?.selectionStyle||Ct.SelectionStyle.ROWS,fitStyle:i?.display?.fitStyle||Ct.GridFitStyle.FILL,useAlternateRowStyle:i?.display?.useAlternateRowStyle||!1}),U.gridView.setEditOptions({commitWhenExitLast:!0,columnEditableFirst:!1,commitByCell:!0,commitWhenLeave:!0,crossWhenExitLast:!0,confirmWhenDelete:!1,deletable:!1,revertable:!1,showOnlyValidationMessage:!0,editable:i?.edit?.editable||!1,validateOnEdited:i?.edit?.validateOnEdited||!1}),U.gridView.setCopyOptions({singleMode:i?.copy?.singleMode||!1}),U.gridView.setPasteOptions({selectBlockPaste:!0,checkReadOnly:!0,throwValidationError:!1}),U.gridView.header.height=i?.header?.height||43,U.gridView.header.styleName=i?.header?.styleName||"bwgGridHeader",i?.container?.radio?U.gridView.setCheckBar({exclusive:i?.container?.radio||!1}):U.gridView.setCheckBar({visible:i?.container?.check||!1,showAll:i?.container?.checkAll||!1}),U.gridView.setStateBar({visible:i?.container?.state||!1}),U.gridView.rowIndicator.visible=i?.container?.indicator||!1,U.gridView instanceof Ct.GridView&&(U.gridView.groupPanel.visible=i?.container?.panel||!1),U.gridView.setFooters({visible:i?.container?.footer||!1}),U.gridView.setHeader({visible:i?.container?.header||!0,showTooltip:i?.container?.headerShowTooltip||!1}),U.gridView.formatOptions.numberFormat="#,##0"}catch(te){console.log("그리드 옵션 설정 중 오류:",te)}try{U.gridView instanceof Ct.TreeView?U.gridView.setContextMenu(TO):U.gridView.setContextMenu(kO),U.gridView.onContextMenuItemClicked=function(te,de,q){if(!(!q||!q.column)){if(de.tag=="excel")W(te,{isTitle:!1},l?.excel);else if(de.tag=="showIndentExcel")W(te,{isTitle:!1,treeBlank:!0},l?.excel);else if(de.tag=="withTitleExcel")W(te,{isTitle:!0,treeBlank:!1},l?.excel);else if(de.tag=="filter")$(te,de);else if(de.tag=="fixedCol"){const Z=te.getDataSource().getFieldIndex(q.column);te.setFixedOptions({colCount:Z})}else if(de.tag=="fixedRow")te.setFixedOptions({rowCount:(q.itemIndex||0)+1});else if(de.tag=="fixedCancel")te.setFixedOptions({colCount:0,rowCount:0});else if(de.tag=="hide")te.layoutByName(q.column).visible=!1,te._hideCols||(te._hideCols=[]),te._hideCols[te._hideCols.length]=q.column;else if(de.tag=="hideClear"){if(te._hideCols&&te._hideCols.length>0){for(var Q=0;Q<te._hideCols.length;Q++)te.layoutByName(te._hideCols[Q]).visible=!0;te._hideCols=[]}}else if(de.tag=="initLayout"){if(ne&&re)try{ae.removeGridLayout(G,re,ne)}catch(Z){console.warn("[BwgGrid] 레이아웃 삭제 실패:",Z)}if(n){te.setColumns(n);const Z=n.filter(le=>le.visible!==!1).map(le=>le.fieldName||le.name);Z.length>0&&te.setColumnLayout(Z)}}}}}catch(te){console.log("컨텍스트 설정 중 오류:",te)}},[i,x,u,b]),F=U=>{if(!(!c||c.length===0))try{c.forEach(ne=>{const{name:re,renderer:G}=ne;if(re&&G){const te=typeof G=="function"?new G:G;U.gridView.registerCustomRenderer(re,te)}})}catch(ne){console.error("커스텀 렌더러 초기화 중 오류:",ne)}},R=U=>{U.onPageChanged=(ne,re)=>{ye(G=>({...G,currentPage:re}))},U.onPageCountChanged=(ne,re)=>{ye(G=>({...G,totalPages:re}))}},N=U=>{h.current?.gridView&&h.current.gridView.setPage(U)},I=U=>{if(i?.layout?.colspan&&i.layout.colspan.length>0&&i?.layout?.colspan.forEach(ne=>{const re=U.gridView.layoutByColumn(ne.fieldName);if(re){const G=ne.span;re.spanCallback=function(te,de,q){return G}}}),n&&n.length>0&&n.some(re=>re.children&&re.children.length>0))try{(()=>{const G=JSON.parse(JSON.stringify(n)),te=[],de=q=>{const Q=[];return q.children.map(Z=>{if(Z.children&&Z.children.length>0){const le=de(Z),ie=Z.header?.text||Z.fieldName,pe=U.gridView.getColumnProperty(Z.fieldName,"header");delete Z.children,delete Z.header;let ve={name:Z.fieldName,header:{text:pe?.text||ie,template:pe?.template,values:pe?.values,visible:pe?.visible??!0},items:le,...Z};Q.push(ve)}else Q.push(Z.fieldName)}),Q};G.map(q=>{if(q.children&&q.children.length>0){const Q=de(q),Z=q.header?.text||q.fieldName,le=q.header?.visible??!0,ie=U.gridView.getColumnProperty(q.fieldName,"header");delete q.children,delete q.header;const pe={name:q.fieldName,header:{text:ie?.text||Z,template:ie?.template,values:ie?.values,visible:ie?.visible||le},items:Q,...q};te.push(pe)}else te.push(q.fieldName)}),console.log("Final Layout!!",te),U.gridView.setColumnLayout(te)})()}catch(re){console.error("컬럼 레이아웃 설정 오류:",re)}},M=()=>{if(h.current){if(e==="nrml"){const U=h.current;if(z(U),F(U),n&&n.length>0){const ne=E(n),re=C(n);U.gridView.getDataSource().setFields(ne),U.gridView.setColumns(re)}if(I(U),i?.container?.page){const ne=i?.pagingOption?.pageSize||10;U.gridView.setPaging(!0,ne),R(U.gridView)}}else{const U=h.current;if(z(U),F(U),n&&n.length>0){const ne=E(n),re=C(n);U.gridView.getDataSource().setFields(ne),U.gridView.setColumns(re)}I(h.current)}setTimeout(()=>{if(d){const U=typeof f=="object"&&f!==null?f.current:null;d(U)}},0)}},W=(U,ne,re)=>{const G=U.getDataSource();let te=re?.footer==null?"default":re.footer;G.getRowCount()<1&&(te="hidden");let de={type:"excel",target:"local",allItems:!1,lookupDisplay:!0,compatibility:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!ne?.treeBlank,footer:te,sheetName:"",documentTitle:{},documentSubtitle:{},documentTail:{},fileName:re?.fileName||"sample.xlsx"};G instanceof Ct.LocalTreeDataProvider&&(de.indenting=!!ne?.treeBlank),re?.isCellMerge==!0&&(de.separateRows=!1),ae.isEmpty(re?.sheetName)==!1&&(de.sheetName=re?.sheetName),ne?.isTitle&&(de.documentTitle={message:ae.isSafeEmpty(re?.mainTitle,"No Title"),visible:!0,styleName:"documentStyle",spaceTop:1,spaceBottom:0,height:43},ae.isEmpty(re?.subTitle)==!1&&(de.documentSubtitle={message:re?.subTitle,visible:!0,styleName:"center",height:20}),ae.isEmpty(re?.tailTitle)==!1&&(de.documentTail={message:re?.tailTitle,visible:!0,styleName:"documentStyle"})),U.exportGrid(de)},$=(U,ne)=>{const re=U.getDataSource(),G=re.getOrgFieldNames();if(ne.checked)for(var te=0;te<G.length;te++){let q=[],Q=re.getDistinctValues(G[te])??[];if(Q.length==0)continue;let Z=U.columnByName(G[te]);for(var de=0;de<Q.length;de++){if(Q[de]==null)continue;let le=Z.values!=null&&Z.values.indexOf(Q[de])!=-1?Z?.labels?.[Z.values.indexOf(Q[de])]:Q[de];ae.isEmpty(le)&&(ae.isEmpty(Q[de])?le=" ":le=Q[de]);let ie="";Q[de]==null?ie="value="+Q[de]:ie="value='"+Q[de]+"'",q.push({name:le,criteria:ie})}U.setColumnFilters(G[te],q)}else for(var te=0;te<G.length;te++)U.clearColumnFilters(G[te]),U.activateAllColumnFilters(G[te],!1),U.clearColumnFilters(G[te])};m.useEffect(()=>{if(!h.current?.gridView)return;const U=()=>({0:25,1:30,2:43})[x],ne=()=>({0:12,1:13,2:14})[x];h.current.gridView.setDisplayOptions({rowHeight:U()}),v.current&&v.current.style.setProperty("--bwg-grid-font-size",`${ne()}px`)},[x,i?.display?.rowHeight]),m.useEffect(()=>{if(h.current&&h.current.gridView)if(e==="nrml"){const U=h.current;z(U)}else{const U=h.current;z(U)}},[e,i,z]),m.useEffect(()=>{!h.current||!n||n.length===0||M()},[n]),m.useEffect(()=>{h.current&&B()},[a,B]),m.useLayoutEffect(()=>{if(!(!u||!b||!h.current?.gridView))try{const U=ae.getGridLayout(__SYS_CD__,b,u);if(U){const ne=Array.isArray(U)?U:U.layout||U;ne&&(h.current.gridView.setColumnLayout(ne),console.log(`[BwgGrid] 저장된 레이아웃 로드 완료: ${__SYS_CD__}/${b}/${u}`))}}catch(U){console.warn("[BwgGrid] 레이아웃 로드 실패:",U)}},[u,b]),m.useEffect(()=>{const U=ne=>{const re=ne.ctrlKey||ne.metaKey;Lu===j.current&&(re&&(ne.key==="f"||ne.key==="F")&&(ne.preventDefault(),Ee(G=>G&&!1),fe(""),X(G=>!G)),re&&(ne.key==="g"||ne.key==="G")&&(ne.preventDefault(),X(G=>G&&!1),Ee(G=>!G)))};return window.addEventListener("keydown",U,{capture:!0}),()=>{window.removeEventListener("keydown",U,!0)}},[]);const[H,X]=m.useState(!1),[ue,fe]=m.useState(""),me=m.useRef(null),[Pe,Ee]=m.useState(!1),[J,ye]=m.useState({currentPage:0,totalPages:0,totalData:0});m.useEffect(()=>{ye({currentPage:0,totalPages:0,totalData:0})},[]),m.useEffect(()=>{H&&setTimeout(()=>{me.current?.focus?.()},0)},[H]),m.useEffect(()=>()=>{if(h.current)try{const U=h.current;U.gridView&&(U.gridView.onDataLoadComplated=void 0,U.gridView.onCurrentRowChanged=void 0,U.gridView.onCellClicked=void 0,U.gridView.onCellDblClicked=void 0,U.gridView.onEditRowChanged=void 0,U.gridView.onItemChecked=void 0,U.gridView.onItemAllChecked=void 0,U.gridView.onColumnCheckedChanged=void 0,U.gridView.onCellButtonClicked=void 0,U.gridView.onEditChange=void 0,U.gridView.onCellEdited=void 0,U.gridView.onKeyUp=void 0,U.gridView.onKeyDown=void 0,U.gridView.onWheel=void 0,U.gridView.onValidateColumn=void 0,U.gridView.onValidateRow=void 0,U.gridView.onValidationFail=void 0,U.gridView.onRowInserting=void 0,U.gridView.onCellItemClicked=void 0,U.gridView.onShowEditor=void 0,U.gridView.onLayoutPropertyChanged=void 0,U.gridView.getDataSource()&&(U.gridView.getDataSource().clearRows(),U.gridView.getDataSource().setFields([])),U.gridView.getDataSource().clearRows())}catch(U){console.warn("⚠️ BwgGrid cleanup error:",U)}},[]);const ge=m.useCallback(()=>{const U=ue;console.log("@@ handleSearchEnter:",U);const ne=h.current?.gridView;if(!ne)return;if(ne.isFiltered()){console.log("EE:: [그리드 Filtering 으로 인한 오류] 그리드 내 Filter를 해제 후 진행해 주십시오.");return}if(ne.commit(),ae.isEmpty(U))return;const re=ne.getCurrent().itemIndex??-1;if(re<0)return;const G={value:U,startIndex:re+1,wrap:!0,caseSensitive:!1,partialMatch:!0},te=ne.searchCell(G);ne.setCurrent(te)},[ue]),V=m.useCallback(U=>{U.key==="Escape"&&(U.preventDefault(),X(!1))},[]),oe=m.useCallback(()=>{fe(""),X(!H)},[H]),K=m.useCallback(()=>{Ee(!Pe)},[Pe]),ce=m.useCallback(U=>{U.key==="Escape"&&(U.preventDefault(),Ee(!1))},[]),he=m.useCallback(()=>{if(!u||!b||!h.current?.gridView){console.warn("[BwgGrid] 레이아웃 저장 실패: gridId 또는 menuId가 없습니다.");return}try{const ne=h.current.gridView.saveColumnLayout();ne&&(ae.saveGridLayout(__SYS_CD__,b,u,ne),Ee(!1))}catch(U){console.warn("[BwgGrid] 레이아웃 저장 실패:",U)}},[u,b]),we=m.useCallback(()=>{if(!u||!b||!h.current?.gridView){console.warn("[BwgGrid] 레이아웃 초기화 실패: gridId 또는 menuId가 없습니다.");return}try{if(ae.removeGridLayout(__SYS_CD__,b,u),n){const U=C(n);h.current.gridView.setColumns(U);const ne=n.filter(re=>re.visible!==!1).map(re=>re.fieldName||re.name);ne.length>0&&h.current.gridView.setColumnLayout(ne)}console.log(`[BwgGrid] 레이아웃 초기화 완료: ${__SYS_CD__}/${b}/${u}`),Ee(!1)}catch(U){console.warn("[BwgGrid] 레이아웃 초기화 실패:",U)}},[u,b,n,C]),Se={searchEnter:ge,handleCloseKeyword:V,handleSearch:oe,handleLayoutManager:K,handleCloseLayoutManager:ce,handleSaveLayout:he,handleResetLayout:we},Te=m.useMemo(()=>({0:12,1:13,2:14})[x],[x]),Ne=m.useMemo(()=>({...t,position:"relative",width:t?.width||"100%",height:t?.height||"100%","--bwg-grid-font-size":`${Te}px`}),[t,Te]);return o.jsxs(MO,{children:[o.jsxs("div",{ref:v,style:Ne,className:r,onClick:()=>{Lu=j.current},onFocusCapture:()=>{Lu=j.current},children:[H&&o.jsx("div",{className:"grid-search-box",style:{"--search-button-size":`${y.buttonSize}px`,"--search-button-font-size":`${y.fontSize}px`,"--search-box-width":`${y.width}px`},children:o.jsx(p.ConfigProvider,{componentSize:y.componentSize,theme:{token:{fontSize:y.fontSize}},children:o.jsxs(p.Flex,{gap:3,children:[o.jsx(p.Input,{ref:me,value:ue,name:"srchField",autoComplete:"off",placeholder:"검색어를 입력하세요.",onKeyUp:U=>Se.handleCloseKeyword(U),onChange:U=>fe(U.target.value),onPressEnter:()=>Se.searchEnter()}),o.jsx(p.Button,{variant:"solid",icon:o.jsx(Y.CloseOutlined,{}),onClick:()=>X(!1)})]})})}),Pe&&o.jsx("div",{className:"grid-layout-manager-box",style:{"--search-button-size":`${y.buttonSize}px`,"--search-button-font-size":`${y.fontSize}px`,"--search-box-width":`${y.width}px`},onKeyUp:U=>Se.handleCloseLayoutManager(U),children:o.jsx(p.ConfigProvider,{componentSize:y.componentSize,theme:{token:{fontSize:y.fontSize}},children:o.jsxs(p.Flex,{vertical:!0,gap:10,children:[o.jsxs(p.Flex,{gap:6,style:{width:"100%",position:"relative"},children:[o.jsx(p.Button,{className:"bwg-btn",icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:o.jsx("path",{d:"M11.25 15V11.25H6.75V15M13.5 15H4.5C3.67157 15 3 14.3284 3 13.5V4.5C3 3.67157 3.67157 3 4.5 3H10.6287C11.0265 3 11.408 3.15804 11.6893 3.43934L14.5607 6.31066C14.842 6.59197 15 6.9735 15 7.37132V13.5C15 14.3284 14.3284 15 13.5 15Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),onClick:Se.handleSaveLayout,disabled:!u||!b,children:"레이아웃 저장"}),o.jsx(p.Button,{className:"bwg-btn",icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsx("g",{"clip-path":"url(#clip0_1427_1188)",children:o.jsx("path",{d:"M14.7003 11.34C14.2603 12.58 13.4403 13.64 12.3503 14.36C11.2603 15.09 9.96032 15.44 8.66032 15.36C7.35032 15.28 6.11032 14.79 5.11032 13.94C4.11032 13.09 3.41032 11.95 3.12032 10.67C2.83032 9.39 2.96032 8.06 3.50032 6.86C4.04032 5.66 4.94032 4.68 6.09032 4.04C7.24032 3.41 8.56032 3.16 9.85032 3.35C12.0403 3.66 13.4903 5.24 15.0503 6.65M15.0403 2.63V6.65H11.0103",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1427_1188",children:o.jsx("rect",{width:"18",height:"18",fill:"white"})})})]}),onClick:Se.handleResetLayout,disabled:!u||!b,children:"레이아웃 초기화"}),o.jsx("div",{style:{position:"absolute",right:0},children:o.jsx(p.Button,{type:"text",icon:o.jsx(Y.CloseOutlined,{}),style:{width:30,height:30},onClick:()=>Ee(!1)})})]}),(!u||!b)&&o.jsx(p.Alert,{message:"그리드 설정정보가 완료되지 않았습니다. 관리자에게 문의하십시오",type:"warning",showIcon:!0,style:{fontSize:y.fontSize,border:0,background:ae.colorFormat.site.yellow01,color:"var(--text-primary)",padding:"4px 10px",borderRadius:4}})]})})}),e==="nrml"?o.jsx(Gm.RealGridReact,{ref:h,autoGenerateField:!0,onInitialized:M}):o.jsx(Gm.RealTreeReact,{ref:h,autoGenerateField:!1,onInitialized:M})]}),i?.container?.page&&o.jsx(To,{currentPage:J.currentPage,totalPages:J.totalPages,pageSize:i?.pagingOption?.pageSize,totalData:J.totalData,onPageChange:N,pageSizeOptions:i?.pagingOption?.pageSizeOptions,gridRef:h})]})}),Ve=AO,fn=m.memo(({title:e,border:t,children:r,titleChildren:n})=>{const i=m.useMemo(()=>({components:{Form:{labelColor:"#9A9A9A"},Select:{colorTextDisabled:"#000"}}}),[]);return o.jsxs(ze,{type:"vertical",children:[o.jsx(Le,{title:e,icons:{type:"antd",icon:"InfoCircleTwoTone"},children:n}),o.jsx(Ie,{border:!1,children:o.jsx(p.ConfigProvider,{theme:i,children:r})})]})}),ze=({type:e="horizontal",layoutAlign:t="left",verticalAlign:r,className:n,style:i,children:a})=>o.jsx("div",{style:i,className:`bwgview-content-layout ${e=="horizontal"?"hz-layout":"vt-layout"} layout-${t} ${r&&`vertical-${r}`} ${n||""}`,children:a}),fv=(e,t)=>{const r=window.innerWidth,n=window.innerHeight,i=Math.min(Math.max(e.x,0),Math.max(0,r-t.width)),a=Math.min(Math.max(e.y,0),Math.max(0,n-t.height));return{x:Math.round(i),y:Math.round(a)}},IO=({buttons:e,onClose:t})=>{const r=(e||[]).filter(n=>n?.visible!==!1);return r.length===0?o.jsx(p.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"}):o.jsxs("div",{style:{display:"flex",gap:6},children:[r.map(n=>o.jsx(p.Button,{type:n.type,disabled:!!n.disabled,loading:n.loading,className:n.className||"bwg-btn popup-btn",style:n.style,icon:n.icon,onClick:n.onClick,children:n.label},n.id)),o.jsx(p.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"})]})},fi=({popup:e,popupEvent:t,onClose:r,children:n,buttons:i})=>{const a=m.useRef(null),s=e?.popupTitle||"팝업",l=e?.width||800,c=e?.height||600,[d,u]=m.useState(l),[f,h]=m.useState(c),g=m.useMemo(()=>{const P=Math.max(0,(window.innerWidth-l)/2),E=Math.max(0,(window.innerHeight-c)/2);return{x:Math.round(P),y:Math.round(E)}},[l,c]),[v,x]=m.useState(g),y=(P,E)=>{const C=fv({x:E.x,y:E.y},{width:d,height:f});x(C)},w=(P,E,C,O,k)=>{const T={width:Math.round(parseInt(C.style.width,10)),height:Math.round(parseInt(C.style.height,10))},D=fv(k,T);u(T.width),h(T.height),x(D)},b=()=>a.current??document.body,j=typeof e?.zIndex=="number"?e.zIndex:3e3;return o.jsxs("div",{style:{position:"fixed",inset:0,zIndex:j},children:[o.jsx("div",{onClick:r,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:0}}),o.jsxs(iO.Rnd,{className:"bwg-popup",size:{width:d,height:f},position:v,bounds:"window",minWidth:400,minHeight:300,onDragStop:y,onResizeStop:w,dragHandleClassName:"drag-handle",cancel:".rnd-cancel",enableUserSelectHack:!1,style:{backgroundColor:"white",borderRadius:20,boxShadow:"0 4px 15px rgba(0,0,0,0.25)",overflow:"visible",position:"absolute",zIndex:1},children:[o.jsx("div",{className:"bwg-popup-content",style:{overflow:"hidden",borderRadius:20,height:"100%"},children:o.jsx(Oh,{getPopupContainer:b,children:o.jsx(ze,{type:"vertical",children:o.jsx(p.Card,{className:"popup-drag-container",title:o.jsx("div",{className:"drag-handle",style:{display:"flex",alignItems:"center",gap:8},children:s}),style:{width:"100%",height:"100%"},styles:{body:{height:"calc(100% - 77px)",padding:20,overflow:"auto"}},extra:o.jsx(IO,{buttons:i,onClose:()=>e?.close?.()||r?.()}),children:o.jsx("div",{className:"rnd-cancel",style:{height:"100%"},children:o.jsx(at.SearchBoxProvider,{children:n})})})})})}),o.jsx("div",{ref:a,className:"bwg-popup-portal-root",style:{position:"relative"}})]})]})},wt=({children:e,className:t,style:r,marginBottom:n=8,gutter:i=[16,8],...a})=>o.jsx(p.Row,{...a,gutter:i,className:`bwg-row ${t}`,style:{marginBottom:`${n}px`,...r},children:e}),Oc=({children:e})=>o.jsx("div",{style:{height:"100%",padding:"20px 30px 26px"},children:o.jsx("div",{style:{width:"100%",height:"100%",border:"1px solid #ddd",borderRadius:"15px",background:"#fff"},children:e})}),NO=({rowKey:e="id",columns:t,dataSource:r,loading:n=!1,rowSelection:i,size:a="middle",pagination:s=!1,...l})=>o.jsx(p.Table,{rowKey:e,columns:t,dataSource:r,loading:n,rowSelection:i,size:a,pagination:s,bordered:!0,scroll:{x:"max-content"},locale:{emptyText:"데이터가 없습니다."},...l}),ar=e=>{const{type:t="card",animated:r=!0,...n}=e;return o.jsx(p.Tabs,{type:t,animated:r,...n})};function Gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function DO(e){if(Array.isArray(e))return Gf(e)}function J1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Th(e,t){if(e){if(typeof e=="string")return Gf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gf(e,t):void 0}}function _O(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ "use strict";const se=require("../utils/index.cjs"),tt=require("../stores/index.cjs"),o=require("react/jsx-runtime"),Y=require("@ant-design/icons"),p=require("antd"),m=require("react"),_=require("../components/core/index.cjs"),at=require("./provider-Bi5OYngn.cjs"),rO=require("dompurify"),K1=require("quill"),nO=require("react-quill"),Ym=require("quill-image-resize-module-react"),Ct=require("realgrid"),Gm=require("realgrid-react"),iO=require("react-rnd"),Oa=require("react-dom"),oO=require("./layout-components-Bf9IsLUS.cjs"),Xm=require("react-router-dom"),xl=require("dayjs");function q1(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ti=q1(Y),S=q1(m),qf=({checkAuth:e=!1,buttons:t,gap:r=8})=>{const{user:n,getButtonAuth:i,setButtonAuth:a}=tt.useUserStore(),s=at.useServiceCodeValue("AUTH_BTNS"),[l,c]=m.useState({});m.useEffect(()=>{const u=e?e.menuId:void 0,f=e?e.grpId:void 0;if(!u||!f){c({});return}const h=i(u,f);if(h){c(h);return}se.callService(s,{crprCd:n?.crprCd,userId:n?.userId,grpId:f.toUpperCase(),menuId:u}).then(g=>{const v=Array.isArray(g?.data)?g.data:Array.isArray(g)?g:[],x={};(v||[]).forEach(y=>{const w=String(y?.btnId||"").trim();if(!w)return;const b=y?.enblYn==null?!0:String(y.enblYn).toUpperCase()==="Y";x[w]=b}),a(u,f,x),c(x)}).catch(g=>{console.error(g),c({})})},[s,n?.crprCd,n?.userId,e?e.menuId:void 0,e?e.grpId:void 0,i,a]);const d=m.useMemo(()=>!t||t.length===0?null:t.filter(u=>u?.visible!==!1).map(u=>{const f=!!u.disabled;if(!e)return o.jsx(_.BwgButton,{type:u.type,disabled:f,loading:u.loading,className:u.className||"bwg-btn",style:u.style,icon:u.icon,onClick:u.onClick,children:u.label},u.id);const v=!(Object.prototype.hasOwnProperty.call(l,u.id)?!!l[u.id]:!1),x=f||v,y=o.jsx(_.BwgButton,{type:u.type,disabled:x,loading:u.loading,className:u.className||"bwg-btn",style:u.style,icon:u.icon,onClick:u.onClick,children:u.label},u.id);if(v){const w=o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx(Y.ExclamationCircleFilled,{style:{color:"#faad14",fontSize:16}}),o.jsx("span",{style:{fontWeight:600},children:`'${u.label}' 버튼에 대한 사용 권한이 없습니다.`})]}),b=o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4,paddingLeft:24},children:o.jsx("span",{style:{fontSize:12},children:"관리자에게 문의하세요."})});return o.jsx(p.Popover,{title:w,content:b,placement:"bottom",styles:{body:{backgroundColor:"#fffbe6"}},children:o.jsx("span",{children:y})},u.id)}return y}),[t,l,e]);return o.jsx(p.Flex,{gap:r,children:d})};var aO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sO(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}const Yf=({grpId:e,menuId:t,btnEvent:r,layout:n="horizontal",size:i="middle",style:a,className:s,onButtonClick:l})=>{const c=at.useServiceCodeValue("AUTH_BTNS"),{user:d}=tt.useUserStore(),[u,f]=m.useState([]),[h,g]=m.useState(!0),[v,x]=m.useState(null),[y,w]=m.useState({}),b=async()=>{try{g(!0),x(null),console.log("@@ 커스텀버튼그룹 영역 조회시작",e,t);const E=await se.callService(c,{userId:d?.userId,crprCd:d?.crprCd,grpId:e.toUpperCase(),menuId:t});if(console.log("@@ 커스텀버튼그룹 영역 조회결과",E),E?.data&&Array.isArray(E.data)){const C=E.data.sort((O,k)=>O.btnSq-k.btnSq);f(C)}else f([])}catch(E){console.error("버튼 권한 조회 실패:",E),x("버튼 권한을 조회하는 중 오류가 발생했습니다."),f([])}finally{g(!1)}};m.useEffect(()=>{b()},[e,t]);const j=async(E,C)=>{w(O=>({...O,[E]:{loading:!0}}));try{const O=r?.[E];O?await O():console.warn(`버튼 이벤트 핸들러를 찾을 수 없습니다: ${E}`),l&&l(E,C,e)}catch(O){console.error("버튼 이벤트 실행 실패:",O),p.message.error("작업 중 오류가 발생했습니다.")}finally{w(O=>({...O,[E]:{loading:!1}}))}},P=E=>{const C=y[E.btnId]||{loading:!1};return o.jsxs(p.Button,{size:i,loading:C.loading,onClick:()=>j(E.btnId,E.btnNm),className:"bwg-btn",style:{...E.iconVal&&{display:"flex",alignItems:"center",gap:"4px"}},children:[E.iconVal&&o.jsxs(o.Fragment,{children:[E.iconType==="ANTD"&&Ti[E.iconVal]&&m.createElement(Ti[E.iconVal],{style:{fontSize:"14px"}}),E.iconType!=="ANTD"&&o.jsx("span",{className:E.iconVal,style:{fontSize:"14px"}})]}),E.btnNm]},E.btnId)};return h?o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Space,{direction:n==="vertical"?"vertical":"horizontal",size:i,children:o.jsx(p.Button,{loading:!0,size:i,children:"권한 조회 중..."})})}):v?o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Alert,{message:"권한 오류",description:v,type:"error",showIcon:!0,style:{minHeight:"40px"}})}):u.length===0?o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Alert,{message:"부여된 권한이 없습니다",type:"warning",showIcon:!0,style:{height:"20px",display:"flex",alignItems:"center",margin:0,padding:"10px 10px"}})}):o.jsx("div",{className:`bwg-button-group bwg-button-group-${n} ${s||""}`,style:a,children:o.jsx(p.Flex,{gap:3,children:u.map(P)})})},lO=({content:e,layout:t="flex",gap:r=16,minWidth:n=120,maxWidth:i=300,style:a,className:s})=>{if(!(Array.isArray(e)&&e.length>0&&Array.isArray(e[0])))return o.jsx("div",{style:a,className:s,children:e});const c=e.filter(g=>g&&g.length>0),d=m.useMemo(()=>{const g=c[0];if(!g||g.length===0)return{totalCols:0,baseWidth:0};let v=0;const x=[];g.forEach(w=>{const b=w,j=b?.props?.["data-colspan"]?parseInt(String(b.props["data-colspan"])):1;v+=j,x.push(j)});const y=v>0?100/v:0;return{totalCols:v,baseWidth:y,componentWidths:x}},[c]),u=(g,v,x)=>{const y=g,w=y?.props?.["data-colspan"]?parseInt(String(y.props["data-colspan"])):1;switch(t){case"equal":return 100/x;case"auto":return 100/x;case"grid":return 100/d.totalCols*w;case"flex":default:const b=d.baseWidth*w;return Math.max(n,Math.min(i,b))}},f=g=>{if(!g||typeof g!="object")return g;const v=g;if(!v.props)return g;const y={...v.props.style||{},width:"100%"};return m.cloneElement(v,{...v.props,style:y})},h=(g,v)=>{if(!g||g.length===0)return null;const x=g.length;return t==="grid"?o.jsx("div",{className:"erp-cmm-form",style:{display:"grid",gridTemplateColumns:`repeat(${d.totalCols}, 1fr)`,gap:`${r}px`,width:"100%"},children:g.map((y,w)=>{const b=y?.props?.["data-colspan"]?parseInt(String(y.props["data-colspan"])):1,j=f(y);return o.jsx("div",{style:{gridColumn:`span ${b}`,minWidth:`${n}px`},className:"form-component-wrapper",children:j},`row-${v}-col-${w}`)})},`row-${v}`):o.jsx(p.Flex,{gap:r,className:"erp-cmm-form",wrap:t==="auto"?"wrap":"nowrap",style:{width:"100%"},children:g.map((y,w)=>{const b=u(y,w,x),j=f(y),P=t==="flex"?{width:`${b}px`,minWidth:`${n}px`,maxWidth:`${i}px`,flexShrink:0}:{width:`${b}%`,minWidth:`${n}px`};return o.jsx("div",{style:P,className:"form-component-wrapper",children:j},`row-${v}-col-${w}`)})},`row-${v}`)};return o.jsx(p.Flex,{gap:"small",vertical:!0,style:a,className:s,children:c.map((g,v)=>h(g,v+1))})},$e=({children:e,className:t,style:r,...n})=>o.jsx(p.Col,{...n,className:`bwg-col ${t}`,style:r,children:e});var Qo={},Au={exports:{}},Zm;function Pc(){return Zm||(Zm=1,(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Au)),Au.exports}var Jo={},Qm;function cO(){if(Qm)return Jo;Qm=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.default=void 0;var e={items_per_page:"/ 페이지",jump_to:"이동하기",jump_to_confirm:"확인하다",page:"페이지",prev_page:"이전 페이지",next_page:"다음 페이지",prev_5:"이전 5 페이지",next_5:"다음 5 페이지",prev_3:"이전 3 페이지",next_3:"다음 3 페이지",page_size:"페이지 크기"};return Jo.default=e,Jo}var ea={},ta={},ra={},Iu={exports:{}},Nu={exports:{}},Du={exports:{}},_u={exports:{}},Jm;function Y1(){return Jm||(Jm=1,(function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(_u)),_u.exports}var Bu={exports:{}},ev;function uO(){return ev||(ev=1,(function(e){var t=Y1().default;function r(n,i){if(t(n)!="object"||!n)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var s=a.call(n,i||"default");if(t(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Bu)),Bu.exports}var tv;function dO(){return tv||(tv=1,(function(e){var t=Y1().default,r=uO();function n(i){var a=r(i,"string");return t(a)=="symbol"?a:a+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Du)),Du.exports}var rv;function fO(){return rv||(rv=1,(function(e){var t=dO();function r(n,i,a){return(i=t(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Nu)),Nu.exports}var nv;function pO(){return nv||(nv=1,(function(e){var t=fO();function r(i,a){var s=Object.keys(i);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(i);a&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),s.push.apply(s,l)}return s}function n(i){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?r(Object(s),!0).forEach(function(l){t(i,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(s)):r(Object(s)).forEach(function(l){Object.defineProperty(i,l,Object.getOwnPropertyDescriptor(s,l))})}return i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Iu)),Iu.exports}var na={},iv;function hO(){return iv||(iv=1,Object.defineProperty(na,"__esModule",{value:!0}),na.commonLocale=void 0,na.commonLocale={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),na}var ov;function gO(){if(ov)return ra;ov=1;var e=Pc().default;Object.defineProperty(ra,"__esModule",{value:!0}),ra.default=void 0;var t=e(pO()),r=hO(),n=(0,t.default)((0,t.default)({},r.commonLocale),{},{locale:"ko_KR",today:"오늘",now:"현재 시각",backToToday:"오늘로 돌아가기",ok:"확인",clear:"지우기",week:"주",month:"월",year:"년",timeSelect:"시간 선택",dateSelect:"날짜 선택",monthSelect:"달 선택",yearSelect:"연 선택",decadeSelect:"연대 선택",yearFormat:"YYYY년",dateFormat:"YYYY-MM-DD",dateTimeFormat:"YYYY-MM-DD HH:mm:ss",monthBeforeYear:!1,previousMonth:"이전 달 (PageUp)",nextMonth:"다음 달 (PageDown)",previousYear:"이전 해 (Control + left)",nextYear:"다음 해 (Control + right)",previousDecade:"이전 연대",nextDecade:"다음 연대",previousCentury:"이전 세기",nextCentury:"다음 세기"});return ra.default=n,ra}var ia={},av;function G1(){if(av)return ia;av=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.default=void 0;const e={placeholder:"시간 선택",rangePlaceholder:["시작 시간","종료 시간"]};return ia.default=e,ia}var sv;function X1(){if(sv)return ta;sv=1;var e=Pc().default;Object.defineProperty(ta,"__esModule",{value:!0}),ta.default=void 0;var t=e(gO()),r=e(G1());const n={lang:Object.assign({placeholder:"날짜 선택",yearPlaceholder:"연도 선택",quarterPlaceholder:"분기 선택",monthPlaceholder:"월 선택",weekPlaceholder:"주 선택",rangePlaceholder:["시작일","종료일"],rangeYearPlaceholder:["시작 연도","종료 연도"],rangeMonthPlaceholder:["시작 월","종료 월"],rangeQuarterPlaceholder:["시작 분기","종료 분기"],rangeWeekPlaceholder:["시작 주","종료 주"],shortWeekDays:["일","월","화","수","목","금","토"],shortMonths:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},t.default),timePickerLocale:Object.assign({},r.default)};return ta.default=n,ta}var lv;function mO(){if(lv)return ea;lv=1;var e=Pc().default;Object.defineProperty(ea,"__esModule",{value:!0}),ea.default=void 0;var t=e(X1());return ea.default=t.default,ea}var cv;function vO(){if(cv)return Qo;cv=1;var e=Pc().default;Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.default=void 0;var t=e(cO()),r=e(mO()),n=e(X1()),i=e(G1());const a="${label} 유효하지 않은 ${type}",s={locale:"ko",Pagination:t.default,DatePicker:n.default,TimePicker:i.default,Calendar:r.default,global:{placeholder:"선택하세요",close:"닫기"},Table:{filterTitle:"필터 메뉴",filterConfirm:"확인",filterReset:"초기화",filterEmptyText:"필터 없음",filterCheckAll:"전체 선택",filterSearchPlaceholder:"필터 검색",emptyText:"데이터 없음",selectAll:"전체 선택",selectInvert:"선택 반전",selectNone:"없음",selectionAll:"전체 선택",sortTitle:"정렬",expand:"펼치기",collapse:"접기",triggerDesc:"내림차순으로 정렬하기",triggerAsc:"오름차순으로 정렬하기",cancelSort:"정렬 취소하기"},Tour:{Next:"다음",Previous:"이전",Finish:"종료"},Modal:{okText:"확인",cancelText:"취소",justOkText:"확인"},Popconfirm:{okText:"확인",cancelText:"취소"},Transfer:{titles:["",""],searchPlaceholder:"여기에 검색하세요",itemUnit:"개",itemsUnit:"개",remove:"삭제",selectCurrent:"현재 페이지 선택",removeCurrent:"현재 페이지 삭제",selectAll:"전체 선택",removeAll:"전체 삭제",selectInvert:"선택 반전"},Upload:{uploading:"업로드 중...",removeFile:"파일 삭제",uploadError:"업로드 실패",previewFile:"파일 미리보기",downloadFile:"파일 다운로드"},Empty:{description:"데이터 없음"},Icon:{icon:"아이콘"},Text:{edit:"수정",copy:"복사",copied:"복사 됨",expand:"확장"},Form:{optional:"(선택사항)",defaultValidateMessages:{default:"필드 유효성 검사 오류 ${label}",required:"${label} 값을 입력해 주세요",enum:"${label} [${enum}] 중에 하나여야 합니다",whitespace:"${label} 비워둘 수 없습니다",date:{format:"${label} 유효하지 않은 날짜 형식입니다",parse:"${label} 날짜 형식으로 변환될 수 없습니다",invalid:"${label} 유효하지 않은 날짜입니다"},types:{string:a,method:a,array:a,object:a,number:a,date:a,boolean:a,integer:a,float:a,regexp:a,email:a,url:a,hex:a},string:{len:"${label} ${len}글자여야 합니다",min:"${label} 적어도 ${min}글자 이상이어야 합니다",max:"${label} ${max}글자 이하여야 합니다",range:"${label} ${min}-${max}글자 사이어야 합니다"},number:{len:"${label} 값은 ${len}이어야 합니다",min:"${label} 최솟값은 ${min}입니다",max:"${label} 최댓값은 ${max}입니다",range:"${label} 값은 ${min}-${max} 사이어야 합니다"},array:{len:"${len}이어야 합니다 ${label}",min:"최소 ${min}이어야 합니다 ${label}",max:"최대 ${max}이어야 합니다 ${label}",range:"${label} ${min}-${max} 사이어야 합니다"},pattern:{mismatch:"${label} ${pattern} 패턴과 일치하지 않습니다"}}},Image:{preview:"미리보기"},QRCode:{expired:"만료된 QR 코드",refresh:"새로고침"},ColorPicker:{presetEmpty:"미정",transparent:"투명",singleColor:"단색",gradientColor:"그라데이션"}};return Qo.default=s,Qo}var $u,uv;function yO(){return uv||(uv=1,$u=vO()),$u}var xO=yO();const Z1=wr(xO),Oh=({children:e,customTheme:t,customComponentSize:r="middle",layout:n="comfortable",getPopupContainer:i})=>{const s=(()=>{const c={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'"Noto Sans KR", sans-serif',fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:p.theme.defaultAlgorithm};switch(n){case"compact":return{...c,token:{...c.token,padding:8,margin:8,borderRadius:4,fontSize:12,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}};case"spacious":return{...c,token:{...c.token,padding:24,margin:24,borderRadius:8,fontSize:16,fontSizeHeading1:44,fontSizeHeading2:36,fontSizeHeading3:28,fontSizeHeading4:24,fontSizeHeading5:20}};default:return{...c,token:{...c.token,padding:16,margin:16,borderRadius:6,fontSize:14,fontSizeHeading1:30,fontSizeHeading2:20,fontSizeHeading3:18,fontSizeHeading4:16,fontSizeHeading5:14}}}})(),l={...s,...t,token:{...s.token,...t?.token},components:{Checkbox:{colorPrimary:"var(--check-primary)",colorPrimaryBorder:"var(--check-primary)",colorPrimaryHover:"var(--check-primary-active)",colorText:"var(--text-primary)"},Radio:{colorPrimary:"var(--check-primary)",colorPrimaryActive:"var(--check-primary-active)",colorPrimaryHover:"var(--check-primary-active)",buttonSolidCheckedBg:"var(--button-solid)",buttonSolidCheckedHoverBg:"var(--button-solid-hover)",buttonSolidCheckedActiveBg:"var(--button-solid-hover)"},Tree:{nodeHoverBg:"var(--tree-selected-bg)",nodeHoverColor:"var(--primary-color)",nodeSelectedBg:"var(--tree-selected-bg)",nodeSelectedColor:"var(--primary-color)",colorText:"var(--text-primary)"},Switch:{colorPrimary:"var(--switch-primary)",colorPrimaryHover:"var(--switch-primary)"},Tabs:{inkBarColor:"var(--primary-color)",itemSelectedColor:"var(--primary-color)",itemHoverColor:"var(--button-solid-hover)",itemActiveColor:"var(--button-solid-hover)",itemColor:"var(--text-primary)",horizontalItemGutter:0,horizontalItemPadding:"11px 24px"},Button:{borderColorDisabled:"var(--border-color)",defaultShadow:"none",dangerShadow:"none",iconGap:4},...t?.components??{}}};return o.jsx(p.ConfigProvider,{locale:Z1,theme:l,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},getPopupContainer:i,children:e})},bO=({children:e})=>{const{activeDetailItem:t,openTabByMenuId:r}=tt.useMenuViewStore();tt.useMenuModelStore();const{componentSize:n}=tt.useUserStore(),i=m.useCallback(()=>{console.log("handleMenuClick",t);const s=t?.prntInfo?.menuId;s&&r(s,void 0,{skipRefreshModal:!0})},[t?.prntInfo?.menuId,r]),a=m.useMemo(()=>({0:"12px",1:"14px",2:"16px"})[n],[n]);return o.jsx("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column"},children:o.jsx("div",{className:"bwgview-content",children:o.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[o.jsx(p.Breadcrumb,{style:{marginBottom:10,fontSize:a},separator:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M6.66675 11.3333L10.0001 7.99996L6.66675 4.66663",stroke:"#9A9A9A","stroke-linecap":"round","stroke-linejoin":"round"})}),items:[{title:t?.prntInfo?.menuId?o.jsx("span",{onClick:i,style:{fontSize:a,cursor:"pointer",color:"#1890ff",textDecoration:"none"},onMouseEnter:s=>{s.currentTarget.style.textDecoration="underline"},onMouseLeave:s=>{s.currentTarget.style.textDecoration="none"},children:t.prntInfo.menuNm}):o.jsx("span",{style:{fontSize:a},children:t?.prntInfo?.menuNm})},{title:o.jsx("span",{style:{fontSize:a,color:"#666"},children:t?.viewLabel})}]}),e]})})})},wO=5,CO=0,Le=({title:e,icons:t,tooltip:r,iconVisible:n=!0,paddingBottom:i,marginBottom:a,children:s})=>{const l=Ti.AppstoreTwoTone,{componentSize:c}=tt.useUserStore(),d=m.useMemo(()=>({0:5,1:4,2:3})[c],[c]);m.useMemo(()=>t?.type==="antd"&&t.icon&&Ti[t.icon]||l,[t?.type,t?.icon]);const u=(g,v)=>(g??v).toString().padStart(2,"0"),f=`pb${u(i,CO)}`,h=`mb${u(a,wO)}`;return o.jsx(p.Flex,{vertical:!0,style:{width:"100%"},children:o.jsxs("div",{className:`bwg-title-box ${f} ${h}`,style:{display:"flex",justifyContent:"space-between"},children:[o.jsx("div",{className:"bwg-title-box-left",children:o.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[o.jsx(p.Typography.Title,{level:d,children:o.jsx("span",{children:e})}),r&&o.jsx(p.Tooltip,{title:r.title,placement:r.placement,children:o.jsx(Ti.QuestionCircleTwoTone,{style:{marginLeft:5}})})]})}),o.jsx("div",{className:"bwg-title-box-right",children:o.jsx(p.Flex,{gap:6,children:s})})]})})},{Panel:dv}=p.Collapse,ko=m.forwardRef(({reqRows:e,subRows:t,border:r=!1,labelDisplay:n,header:i},a)=>{const[s]=p.Form.useForm(),[l,c]=m.useState("1"),[d,u]=m.useState(void 0),{componentSize:f}=tt.useUserStore(),h=m.useMemo(()=>{const x={0:12,1:14,2:16},y={0:"small",1:"middle",2:"large"};return{fontSize:x[f],componentSize:y[f]}},[f]),g=()=>n?{flex:n.md||n.lg||n.sm||"100px"}:{flex:"100px"};m.useEffect(()=>{d&&s.setFieldsValue(d)},[d,s]),m.useImperativeHandle(a,()=>({getFormData:()=>s.getFieldsValue(),setFormData:x=>{s.setFieldsValue(x)},setDefaultValue:x=>{u(x),s.setFieldsValue(x)},resetForm:()=>{d?s.setFieldsValue(d):s.resetFields()},validateForm:async()=>{try{return{success:!0,data:await s.validateFields()}}catch(x){return{success:!1,error:x}}}}));const v=()=>{c(x=>x.includes("subRows")?x.filter(y=>y!=="subRows"):[...x,"subRows"])};return o.jsxs("div",{style:r?{border:"1px solid #ddd",padding:"10px 12px",borderRadius:"8px",marginBottom:"10px"}:{},children:[i&&o.jsx(Le,{title:i.title,children:i.buttons}),o.jsx(p.ConfigProvider,{componentSize:h.componentSize,theme:{token:{fontSize:h.fontSize},components:{Collapse:{}}},children:o.jsx(p.Form,{form:s,layout:"inline",initialValues:d,style:{width:"100%",fontSize:`${h.fontSize}px`},labelCol:g(),labelAlign:"left",children:o.jsxs("div",{style:{position:"relative",width:"100%"},children:[t&&o.jsx("div",{style:{position:"absolute",top:"15px",left:"-9px",zIndex:10},children:l.includes("subRows")?o.jsx(p.Tooltip,{title:"접기",children:o.jsx("span",{className:"search-collapsed-arrow",onClick:v,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:o.jsx("path",{d:"M5.28321 0.986589C4.88285 0.482264 4.11715 0.482265 3.71679 0.986589L1.0243 4.37824C0.50404 5.0336 0.970753 6 1.80751 6L7.19249 6C8.02925 6 8.49596 5.0336 7.9757 4.37824L5.28321 0.986589Z",fill:"#AEB9C4"})})})}):o.jsx(p.Tooltip,{title:"펼치기",children:o.jsx("span",{className:"search-collapsed-arrow",onClick:v,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"9",height:"6",viewBox:"0 0 9 6",fill:"none",children:o.jsx("path",{d:"M5.28321 5.01341C4.88285 5.51774 4.11715 5.51773 3.71679 5.01341L1.0243 1.62176C0.50404 0.966397 0.970753 1.64312e-07 1.80751 2.37464e-07L7.19249 7.08234e-07C8.02925 7.81386e-07 8.49596 0.966399 7.9757 1.62176L5.28321 5.01341Z",fill:"#AEB9C4"})})})})}),o.jsxs(p.Collapse,{activeKey:["reqRows",...l.includes("subRows")?["subRows"]:[]],onChange:c,className:"searchbox-collapse",bordered:!1,ghost:!0,children:[e&&o.jsx(dv,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"disabled",children:e},"reqRows"),t&&o.jsx(dv,{style:{padding:0,margin:0},header:void 0,showArrow:!1,collapsible:"icon",children:t},"subRows")]})]})})})]})}),dn=({children:e,showSearchBox:t,showCloseButton:r=!0,showEyesButton:n=!1,shotSettingButton:i=!0,styles:a,...s})=>{const[l,c]=m.useState(!0),[d,u]=m.useState(()=>{const w=s.placement;return w==="left"||w==="right"||w==="top"||w==="bottom"?w:"bottom"}),[f,h]=m.useState(!1),v=(w=>{const b={wrapper:{...s.width&&{width:s.width},...s.height&&{height:s.height},margin:"0 auto"},content:{},header:{backgroundColor:"var(--drawer-header-bg)",color:"var(--text-primary)"}};switch(w){case"bottom":return{...b,wrapper:{...b.wrapper,borderRadius:"30px 30px 0 0"},content:{borderRadius:"30px 30px 0 0"},header:{...b.header,borderRadius:"30px 30px 0 0"}};case"top":return{...b,wrapper:{...b.wrapper,borderRadius:"0 0 30px 30px"},content:{borderRadius:"0 0 30px 30px"},header:{...b.header}};case"left":return{...b,wrapper:{...b.wrapper,borderRadius:"0 30px 0px 0"},content:{borderRadius:"0 30px 0px 0"},header:{...b.header,borderRadius:"0 30px 0 0"}};case"right":return{...b,wrapper:{...b.wrapper,borderRadius:"30px 0 0 0"},content:{borderRadius:"30px 0 0 0"},header:{...b.header,borderRadius:"30px 0 0 0"}};default:return b}})(d),x={wrapper:{...v?.wrapper,...a?.wrapper},content:{...v?.content,...a?.content},header:{...v?.header,...a?.header}},y=()=>{const w=[];if(i){const b=[{key:"top",label:"상단",icon:o.jsx(Y.CaretUpOutlined,{})},{key:"right",label:"우측",icon:o.jsx(Y.CaretRightOutlined,{})},{key:"bottom",label:"하단",icon:o.jsx(Y.CaretDownOutlined,{})},{key:"left",label:"좌측",icon:o.jsx(Y.CaretLeftOutlined,{})}],j=o.jsx(p.Space.Compact,{children:b.map(P=>o.jsx(p.Button,{type:d===P.key?"primary":"default",size:"small",onClick:()=>{u(P.key),h(!1)},icon:P.icon},P.key))});w.push(o.jsx(p.Popover,{content:j,trigger:"click",placement:"left",open:f,onOpenChange:h,children:o.jsx(p.Tooltip,{placement:"bottom",title:"위치변경",zIndex:2100,children:o.jsx(p.Button,{icon:o.jsx(Y.SettingOutlined,{}),type:"text",size:"middle"})})},"shotSetting"))}return n&&w.push(o.jsx(p.Tooltip,{placement:"bottom",title:l?"배경 보기":"배경 숨기기",zIndex:2100,children:o.jsx(p.Button,{icon:o.jsx(Y.EyeOutlined,{}),type:"text",size:"middle",onClick:()=>c(!l)})},"eyes")),s.extra&&w.push(o.jsx("div",{style:{margin:"0 8px"},children:s.extra},"extra")),r&&w.push(o.jsx(p.Tooltip,{placement:"bottom",title:"닫기",zIndex:2100,children:o.jsx(p.Button,{icon:o.jsx(Y.CloseOutlined,{}),onClick:s.onClose,type:"text",size:"middle"})},"close")),w};return o.jsx(p.Drawer,{className:"main-drawer",footer:!0,...s,placement:d,styles:x,maskClosable:!1,closable:!1,mask:l,extra:o.jsx(p.Space,{size:"small",align:"center",children:y()}),afterOpenChange:w=>{w||(c(!0),u(s.placement)),s.afterOpenChange?.(w)},destroyOnHidden:!0,children:t?o.jsxs(ze,{type:"vertical",children:[o.jsxs(p.Flex,{justify:"space-between",align:"center",style:{width:"100%"},children:[o.jsx("div",{children:t.title}),o.jsx(p.Flex,{gap:2,children:t.extra})]}),o.jsx(ko,{...t.searchBox}),o.jsx(p.Divider,{}),e]}):e})},Ie=({width:e="100%",height:t="100%",boxAlign:r,display:n="show",overflow:i,style:a,className:s,border:l=!0,children:c,ref:d})=>o.jsx("div",{style:{width:e,height:t,display:n==="show"?"":n,overflowX:i?.x,overflowY:i?.y,...a},className:`bwgview-content-box ${r?`content-box-${r}`:""} ${s||""} ${l?"":"none-box-st"}`,ref:d,children:c}),Q1=Ym?.default??Ym;try{K1.register("modules/imageResize",Q1)}catch(e){console.warn("quill-image-resize-module-react 로드 실패:",e)}const Nl=e=>rO.sanitize(e??"",{ALLOWED_TAGS:["p","br","div","span","strong","b","em","i","u","s","blockquote","pre","code","ul","ol","li","h1","h2","h3","h4","h5","h6","a","img"],ALLOWED_ATTR:["style","class","href","target","rel","src","alt","width","height","data-*","align"],ALLOWED_URI_REGEXP:/^(?:(?:https?|data|mailto|tel):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),Dl=m.forwardRef(({border:e=!0,editorProps:t,value:r,defaultValue:n,onChange:i,onBlur:a,disabled:s,placeholder:l},c)=>{const{isEditing:d=!0,title:u,containerHeight:f="100%"}=t||{},h=m.useRef(null),g=m.useMemo(()=>{const P={toolbar:d?[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{align:[]}],["link","image"],["clean"]]:!1};return Q1?{...P,imageResize:{parchment:K1.import("parchment"),modules:["Resize","DisplaySize","Toolbar"],displayStyles:{backgroundColor:"black",border:"none",color:"white"}}}:P},[d]),v=m.useMemo(()=>["header","bold","italic","underline","strike","color","background","list","bullet","indent","align","link","image","width","height"],[]),x=r!==void 0,[y,w]=m.useState(n??""),b=x?r:y,j=m.useCallback((P,E,C,O)=>{const k=Nl(P??"");x||w(k),i?.(k,E,C,O)},[x,i]);return m.useImperativeHandle(c,()=>({getHTML:()=>b??"",getText:()=>h.current?.getEditor()?.getText()??"",insertHTML:P=>{const E=h.current?.getEditor();if(!E)return;const C=E.getSelection(!0),O=Nl(P??"");E.clipboard.dangerouslyPasteHTML(C?C.index:E.getLength(),O)},insertImage:(P,E)=>{const C=h.current?.getEditor();if(!C)return;const O=C.getSelection(!0),k=typeof P=="string"?P:"";C.insertEmbed(O?O.index:C.getLength(),"image",k,"user")},getQuill:()=>h.current?.getEditor?.()??null})),o.jsx(Ie,{border:e,style:{opacity:s?.6:1,pointerEvents:s?"none":"auto",height:typeof f=="number"?`${f}px`:f,minHeight:0},children:o.jsxs("div",{className:"bwg-editor-wrap",style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[u&&o.jsx(Le,{...u,paddingBottom:10}),o.jsx(nO,{ref:h,theme:d?"snow":"bubble",readOnly:!d,value:b,onChange:j,onBlur:a,modules:g,formats:v,style:{width:"100%",display:"flex",flexDirection:"column",minHeight:0,flex:"1"},placeholder:l},d?"snow":"bubble")]})})}),SO=(e,t,r,n)=>Nl(e??""),jO=({itemProps:e,...t})=>{const{rules:r,shouldUpdate:n,dependencies:i,noStyle:a,...s}=e;return o.jsx(p.Form.Item,{valuePropName:"value",trigger:"onChange",getValueFromEvent:SO,normalize:l=>l??"",rules:r,shouldUpdate:n,dependencies:i,noStyle:a,...s,children:o.jsx(Dl,{...t})})},EO=e=>{const{itemProps:t,onChange:r,editorProps:n,...i}=e,a=p.Form.useFormInstance();if(t?.name!=null){const s=t.name;return o.jsxs(o.Fragment,{children:[o.jsx(p.Form.Item,{hidden:!0,name:s,rules:t.rules,normalize:l=>l??"",children:o.jsx("input",{type:"hidden"})}),o.jsx(Dl,{...i,editorProps:n,value:a.getFieldValue(s)??"",onChange:(l,c,d,u)=>{const f=Nl(l??"");a.setFieldValue(s,f),r?.(f,c,d,u)},onBlur:()=>{a.validateFields([s]).catch(()=>{})}})]})}return o.jsx(Dl,{...e})},kh=Object.assign(EO,{FormItem:jO,Core:Dl}),To=m.forwardRef(({currentPage:e,totalPages:t,pageSize:r=10,totalData:n,onPageChange:i,pageSizeOptions:a=[10,20,50,100],gridRef:s,mode:l="client",onServerPageChange:c},d)=>{const[u,f]=m.useState(r),[h,g]=m.useState(1),[v,x]=m.useState(r),[y,w]=m.useState(0);m.useEffect(()=>{f(r)},[r]),m.useEffect(()=>{f(r)},[]),m.useImperativeHandle(d,()=>({currentPage:h,pageSize:v,totalData:y,totalPages:Math.ceil(y/v),setPage:A=>{g(A),c?.(A,v)},setPageSize:A=>{x(A),g(1),c?.(1,A)},setTotalData:A=>{w(A)},reset:()=>{g(1),x(r),w(0)}}),[h,v,y,c,r]);const b=l==="client",j=b?(e||0)+1:h,P=b?(t||0)>0:y>0,C=b?P?Math.ceil((n||0)/u):0:Math.ceil(y/v),O=b?P&&n||0:y,k=Math.min(j,C||1),T=`${u}-${C}-${k}`,D=A=>{b?i?.(A-1):(g(A),c?.(A,v))},L=A=>{if(b){f(A);try{s?.current?.gridView?(s.current.gridView.setPaging(!0,A),s.current.gridView.setPage(0)):i?.(0)}catch(B){console.warn("페이지 사이즈 변경 중 오류:",B),i?.(0)}}else x(A),g(1),c?.(1,A)};return o.jsxs("div",{className:"bwg-pagination-container",style:{padding:"10px",display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid #dddddd",position:"relative"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontSize:"12px",color:"#333333"},children:"페이지당"}),o.jsx("select",{value:b?u:v,onChange:A=>L(Number(A.target.value)),disabled:!P,style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"12px",color:"#333333",opacity:P?1:.5},children:a.map(A=>o.jsxs("option",{value:A,children:[A,"개"]},A))}),o.jsxs("span",{style:{fontSize:"12px",color:"#666",opacity:P?1:.5},children:["/ 총 ",O,"개"]})]}),o.jsx("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultBorderColor:"#e8e8e8",defaultHoverBorderColor:"var(--primary-color)",defaultHoverColor:"var(--text-primary)",contentFontSize:13,defaultColor:"var(--text-primary)",paddingInline:0}}},children:[o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultColor:"#999999",defaultHoverColor:"var(--text-primary)"}}},children:[o.jsx(p.Button,{onClick:()=>D(1),disabled:!P||k===1,style:{width:"26px",height:"26px",border:0,background:!P||k===1?"#f1f1f1":"white",cursor:!P||k===1?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[o.jsx("path",{d:"M12 17L7 12L12 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M17 17L12 12L17 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})}),o.jsx(p.Button,{onClick:()=>D(k-1),disabled:!P||k===1,style:{width:"26px",height:"26px",border:0,background:!P||k===1?"#f1f1f1":"white",cursor:!P||k===1?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:o.jsx("path",{d:"M14 17L9 12L14 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})})]}),o.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:(()=>{if(!P||C===0)return o.jsx(p.Button,{disabled:!0,style:{width:"26px",height:"26px"},children:"1"});const A=5;let B=1,z=Math.min(A,C);k>3&&C>A&&(B=Math.max(1,k-2),z=Math.min(C,B+A-1),z===C&&(B=Math.max(1,z-A+1)));const F=[];for(let R=B;R<=z;R++)F.push(o.jsx(p.Button,{onClick:()=>D(R),style:{width:"26px",height:"26px",background:k===R?"var(--primary-color)":"#ffffff",color:k===R?"#ffffff":"#333333",cursor:"pointer"},children:R},R));return F})()},T),o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultColor:"#999999",defaultHoverColor:"var(--text-primary)"}}},children:[o.jsx(p.Button,{onClick:()=>D(k+1),disabled:!P||k>=C,style:{width:"26px",height:"26px",border:0,background:!P||k>=C?"#f1f1f1":"white",cursor:!P||k>=C?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:o.jsx("path",{d:"M10 17L15 12L10 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})}),o.jsx(p.Button,{onClick:()=>D(C),disabled:!P||k>=C,style:{width:"26px",height:"26px",border:0,background:!P||k>=C?"#f1f1f1":"white",cursor:!P||k>=C?"not-allowed":"pointer",opacity:P?1:.5},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[o.jsx("path",{d:"M12 17L17 12L12 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M7 17L12 12L7 7",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]})})]})]})})]})});To.displayName="BwgPagination";const PO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZZDLDcJADETHUe7QQVJC6AAqACoAKkCcESh8JI60kBKgg3TA0kE6gAISzHgj0BJ8sWw/j2cXCCI7aD446g2diDp1aWyWaz9sxmHhNlJSyUCDnlQeQpEKm5UCDwgqvHBnTji4MvcEKGw3FsVFDeCmCCbMYwIpQY4wMnX5mj5pKrXfTFSxc1sp/o03yLlZaoSpRFhme53/QF4FmNl9txbH8wuC5893tEo1PZivBs6/sgVXBlv9BpvVRX62Og6eAAAAAElFTkSuQmCC",OO="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAC7SURBVHgBZVDbDcIwDHSiqL90AzoCI5S/fvQBEwATIDYoE7BCRwjqAtmAsEE3gAlqzlFBKbXknJ2cL5cQRcF13SIf9Bd63mmHdcN5nsbbJm6UtY6bxlGaCunNZZmTUpniqhpQvIhZ8AlcI+9QXYHYIb3BgQ0ETAJ36BvUmQiDuBV19TNdFBkliUyK0lX1fbc0bkyL1WF6D7UzbBxnpKCi9YHG0UPeoz6BePt+h55UxMMA9NMrPa68BDLiAxmcQh0cAM62AAAAAElFTkSuQmCC";let Lu=null;const kO=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"},{label:"레이아웃 초기화",tag:"initLayout"}],TO=[{label:"엑셀다운로드",tag:"excel"},{label:"엑셀(들여쓰기 표시)",tag:"showIndentExcel"},{label:"엑셀(제목포함)",tag:"withTitleExcel"},{label:"-"},{label:"필터",type:"check",checked:!1,tag:"filter"},{label:"열고정",tag:"fixedCol"},{label:"행고정",tag:"fixedRow"},{label:"고정해제",tag:"fixedCancel"},{label:"-"},{label:"숨기기",tag:"hide"},{label:"숨기기해제",tag:"hideClear"},{label:"레이아웃 초기화",tag:"initLayout"}],MO=({children:e})=>{const[t,r]=m.useState(!1),[n,i]=m.useState(null);return t?o.jsx("div",{style:{padding:"20px",border:"1px solid #ff4d4f",borderRadius:"6px",backgroundColor:"#fff2f0",margin:"10px"},children:o.jsx(p.Alert,{message:"리얼그리드 로드 실패",description:o.jsxs("div",{children:[o.jsx("p",{children:"리얼그리드 라이센스 또는 초기화 중 오류가 발생했습니다."}),o.jsxs("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:["오류: ",n?.message||"알 수 없는 오류"]}),o.jsx(p.Button,{type:"primary",size:"small",style:{marginTop:"8px"},onClick:()=>{r(!1),i(null),window.location.reload()},children:"다시 시도"})]}),type:"error",showIcon:!0})}):o.jsx(RO,{onError:a=>{console.error("BwgGrid 에러:",a),i(a),r(!0)},children:e})};class RO extends m.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){this.props.onError(t)}render(){return this.state.hasError?null:this.props.children}}const AO=m.forwardRef(({type:e="nrml",gridDivStyle:t,gridDivClassName:r,gridColumns:n,gridOptions:i,gridEvents:a,bindRef:s,gridContext:l,renderers:c,gridInitCallback:d,gridId:u},f)=>{const h=m.useRef(null),g=m.useRef(new Map),v=m.useRef(null),{gridSize:x}=tt.useUserStore(),y=at.useGridSizeConfig(),b=at.useBwgView()?.menuId||"",j=m.useRef(`${b||"NO_MENU"}__${u||"NO_GRID"}__${se.generateUID(16)}`),P=(U,ne,re,G)=>{let te=[],de=[];const q="treeNode";for(let Q in U){let Z=U[Q];te[Z[re]]=U[Q];let le=te[Z[ne]];if(le==null||le=="-"){de.push(Z);continue}le[q]==null&&(le[q]=[]),le[q].push(Z)}return de},E=m.useCallback(U=>{const ne=G=>{const te=[];return G.forEach(de=>{de.children&&de.children.length>0?te.push(...ne(de.children)):te.push(de)}),te};return ne(U).map(G=>({fieldName:G.fieldName,dataType:G.dataType||"text"}))},[]),C=m.useCallback(U=>{const ne=G=>{const te=[];return G.forEach(de=>{de.children&&de.children.length>0?te.push(...ne(de.children)):te.push(de)}),te};return ne(U).map(G=>({...G,header:{...G.header,template:G.required?`<img src='${OO}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:G.editable?`<img src='${PO}' style='margin-top:4px; margin-right: 2px;' alt='Required input' >\${headerText} `:"${headerText}",values:{headerText:G.header?.text??""},text:G.header?.text||""},styleName:G.dataType==="number"?"right":G.styleName||"center"}))},[]);m.useImperativeHandle(f,()=>({addAllData(U,ne){const re=h.current?.gridView.getCurrent().dataRow;if(h.current?.dataProvider instanceof Ct.LocalDataProvider){h.current.dataProvider.clearRows();try{h.current?.gridView.showLoading(),h.current.dataProvider.setRows(U)}catch(G){console.error("fillJsonData 오류:",G)}finally{h.current?.gridView.closeLoading()}}if(h.current?.dataProvider instanceof Ct.LocalTreeDataProvider){if(h.current.dataProvider.clearRows(),ne?.treeOption?.dataField==null||ne?.treeOption?.parentField==null)return;const G={rows:"treeNode"};try{h.current?.gridView.showLoading();let te=P(U,ne.treeOption?.parentField,ne.treeOption?.dataField);h.current.dataProvider.fillJsonData({treeNode:te},G),ne.treeOption.isExpand&&h.current.gridView?.expandAll()}catch(te){console.error("fillJsonData 오류:",te)}finally{h.current?.gridView.closeLoading()}}ne?.isCurrent?h.current?.gridView.setCurrent({dataRow:re}):h.current?.gridView.setCurrent({dataRow:0})},isUpdate:()=>{const U=h.current?.dataProvider?.getAllStateRows();if(!U)return!1;const ne=(U.created?.length??0)>0,re=(U.updated?.length??0)>0,G=(U.deleted?.length??0)>0;return ne||re||G},getGridInstance:()=>h.current,getCurrentRow:()=>h.current?.gridView.getCurrent().dataRow??-1,getCurrentIndex:()=>h.current?.gridView.getCurrent().itemIndex??-1,gridExcelDown(U){h.current?.gridView.exportGrid({type:"excel",target:"local",allItems:!1,lookupDisplay:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!U?.indenting,header:"default",footer:"default",sheetName:"",fileName:U?.fileName||"sample.xlsx",...U})},getGridSaveData:()=>{const U=h.current?.dataProvider?.getAllStateRows();if(U===void 0)return[{}];let ne=[];if(U.created!==void 0&&U.created.length>0)for(const re in U.created){let G=h.current?.dataProvider?.getJsonRow(U.created[re]);G={...G,iudFlag:"I"},ne.push(G)}if(U.updated!==void 0&&U.updated.length>0)for(const re in U.updated){let G=h.current?.dataProvider?.getJsonRow(U.updated[re]);G={...G,iudFlag:"U"},ne.push(G)}if(U.deleted!==void 0&&U.deleted.length>0)for(const re in U.deleted){let G=h.current?.dataProvider?.getJsonRow(U.deleted[re]);G={...G,iudFlag:"D"},ne.push(G)}return ne},deleteGridData:()=>{h?.current?.gridView?.getCheckedItems()?.map(ne=>{let re=h?.current?.gridView?.getDataRow(ne)??-1;const G=h?.current?.dataProvider?.getRowState(re);G==Ct.RowState.DELETED?(h?.current?.dataProvider?.setRowState(re,g.current.get(ne)??Ct.RowState.NONE),g.current.delete(ne)):G==Ct.RowState.CREATED?h?.current?.dataProvider?.setRowState(re,Ct.RowState.CREATE_AND_DELETED):G==Ct.RowState.CREATE_AND_DELETED?h?.current?.dataProvider?.setRowState(re,Ct.RowState.CREATED):(g.current.set(ne,G??Ct.RowState.NONE),h?.current?.dataProvider?.setRowState(re,Ct.RowState.DELETED)),h?.current?.gridView?.checkItem(ne,!1)})},_oriRowState:[{}],dp:e=="tree"?h.current?.dataProvider:h.current?.dataProvider??null,vw:e=="tree"?h.current?.gridView:h.current?.gridView??null}));const O=m.useCallback((U,ne,re)=>{if(s!==void 0&&re>=0){let G=U.getDataSource().getJsonRow(re);s?.current?.setFieldsValue(G)}else s!==void 0&&re<0&&s?.current?.resetFields();U.setCurrent({dataRow:0}),a?.onCurrentRowChanged&&a?.onCurrentRowChanged(U,ne,re)},[s,a]),k=m.useCallback((U,ne,re)=>{const G=ne.fieldName??"";s?.current?.getFieldInstance(G)&&s?.current.setFieldValue(G,re),a?.onEditChange&&a?.onEditChange(U,ne,re)},[s,a]),T=m.useCallback((U,ne,re)=>{const G=U.getOrgFieldName(re),te=U.getValue(ne,re);s?.current?.setFieldValue(G,te)},[s]),D=m.useCallback((U,ne,re,G)=>{const te=U.getColumn(G).name??"",de=U.getValue(ne,G);s?.current?.getFieldInstance(te)&&s?.current.setFieldValue(te,de),a?.onCellEdited&&a?.onCellEdited(U,ne,re,G)},[s,a]),L=m.useCallback((U,ne,re,G)=>{if(typeof ne.dataRow=="number"&&ne.dataRow!=-1){var te=U.getDataSource().getRowState(ne.dataRow);if(te=="deleted"||te=="createAndDeleted")return!1}return a?.onShowEditor!=null&&a?.onShowEditor(U,ne,re,G),!0},[s,a]),A=m.useCallback(U=>{if(!h.current)return;const ne=h.current.gridView,re=ne.getDataSource();if(i?.container?.page){const G=ne.getPage(),te=ne.getPageCount(),de=re.getRowCount();ye({currentPage:G,totalPages:te,totalData:de})}},[i?.container?.page]),B=m.useCallback(()=>{if(!h.current)return;const U=h.current.gridView,ne=U.getDataSource();__SYS_CD__;const re=["onKeyDown"],G=["onRowInserted"];Object.keys(a??{}).map(te=>{re.includes(te)?U[te+"Add"]=a?.[te]:U[te]=a?.[te],G.includes(te)?ne[te+"Add"]=a?.[te]:ne[te]=a?.[te]}),ne instanceof Ct.LocalDataProvider&&(ne.onRowInserted=(te,de)=>{de<0||(setTimeout(function(){U?.setCurrent({dataRow:de})},1),te.onRowInsertedAdd!==void 0&&te.onRowInsertedAdd(te,de))}),U.onKeyDown=function(te,de){if(de.code=="Space"){let q=te.getSelectedItems(!0);for(const Q in q)te.isCheckable(q[Q])&&(te.isCheckedItem(q[Q])?te.checkItem(q[Q],!1,!1):te.checkItem(q[Q],!0,!1))}return te.onKeyDownAdd!==void 0&&te.onKeyDownAdd(te,de),!0},h.current.gridView.onCurrentRowChanged=O,h.current.gridView.onEditChange=k,h.current.gridView.getDataSource().onValueChanged=T,h.current.gridView.onCellEdited=D,h.current.gridView.onShowEditor=L,h.current.gridView.onDataLoadComplated=A,h.current.gridView.onLayoutPropertyChanged=function(te,de,q,Q,Z){const le=de?.column||"알 수 없음";console.log("🔵 [BwgGrid] 레이아웃 속성 변경 감지:",{columnName:le,property:q,oldValue:Q,newValue:Z,layout:de}),q==="visible"&&console.log(`📌 컬럼 "${le}" ${Z?"표시":"숨김"}`),(q==="order"||q==="index")&&console.log(`📌 컬럼 "${le}" 위치 변경: ${Q} → ${Z}`),a?.onLayoutPropertyChanged&&a.onLayoutPropertyChanged(te,de,q,Q,Z)}},[O,k,T,D,L,A,u,b]),z=m.useCallback(U=>{if(!U)return;const ne=u,re=b,G=__SYS_CD__;try{U.gridView.setSortingOptions({enabled:!0}),U.gridView.sortMode=Ct.SortMode.EXPLICIT,U.gridView.editorOptions.viewGridInside=!0,U.gridView instanceof Ct.TreeView&&U.gridView.setTreeOptions({expandWhenSetData:Ct.ExpandWhenSetData.REMAIN_AND_EXPAND,expanderIconStyle:Ct.TreeExpanderIconStyle.SQUARE,iconVisible:!1,lineVisible:!0});const te=()=>({0:25,1:30,2:43})[x];U.gridView.setDisplayOptions({showEmptyMessage:!0,emptyMessage:"조회된 데이터가 존재하지 않습니다.",useFocusClass:!0,minRowHeight:i?.display?.minRowHeight||25,maxRowHeight:i?.display?.maxRowHeight||100,rowHeight:te(),rowChangeDelay:i?.display?.rowChangeDelay||0,selectionStyle:i?.display?.selectionStyle||Ct.SelectionStyle.ROWS,fitStyle:i?.display?.fitStyle||Ct.GridFitStyle.FILL,useAlternateRowStyle:i?.display?.useAlternateRowStyle||!1}),U.gridView.setEditOptions({commitWhenExitLast:!0,columnEditableFirst:!1,commitByCell:!0,commitWhenLeave:!0,crossWhenExitLast:!0,confirmWhenDelete:!1,deletable:!1,revertable:!1,showOnlyValidationMessage:!0,editable:i?.edit?.editable||!1,validateOnEdited:i?.edit?.validateOnEdited||!1}),U.gridView.setCopyOptions({singleMode:i?.copy?.singleMode||!1}),U.gridView.setPasteOptions({selectBlockPaste:!0,checkReadOnly:!0,throwValidationError:!1}),U.gridView.header.height=i?.header?.height||43,U.gridView.header.styleName=i?.header?.styleName||"bwgGridHeader",i?.container?.radio?U.gridView.setCheckBar({exclusive:i?.container?.radio||!1}):U.gridView.setCheckBar({visible:i?.container?.check||!1,showAll:i?.container?.checkAll||!1}),U.gridView.setStateBar({visible:i?.container?.state||!1}),U.gridView.rowIndicator.visible=i?.container?.indicator||!1,U.gridView instanceof Ct.GridView&&(U.gridView.groupPanel.visible=i?.container?.panel||!1),U.gridView.setFooters({visible:i?.container?.footer||!1}),U.gridView.setHeader({visible:i?.container?.header||!0,showTooltip:i?.container?.headerShowTooltip||!1}),U.gridView.formatOptions.numberFormat="#,##0"}catch(te){console.log("그리드 옵션 설정 중 오류:",te)}try{U.gridView instanceof Ct.TreeView?U.gridView.setContextMenu(TO):U.gridView.setContextMenu(kO),U.gridView.onContextMenuItemClicked=function(te,de,q){if(!(!q||!q.column)){if(de.tag=="excel")W(te,{isTitle:!1},l?.excel);else if(de.tag=="showIndentExcel")W(te,{isTitle:!1,treeBlank:!0},l?.excel);else if(de.tag=="withTitleExcel")W(te,{isTitle:!0,treeBlank:!1},l?.excel);else if(de.tag=="filter")$(te,de);else if(de.tag=="fixedCol"){const Z=te.getDataSource().getFieldIndex(q.column);te.setFixedOptions({colCount:Z})}else if(de.tag=="fixedRow")te.setFixedOptions({rowCount:(q.itemIndex||0)+1});else if(de.tag=="fixedCancel")te.setFixedOptions({colCount:0,rowCount:0});else if(de.tag=="hide")te.layoutByName(q.column).visible=!1,te._hideCols||(te._hideCols=[]),te._hideCols[te._hideCols.length]=q.column;else if(de.tag=="hideClear"){if(te._hideCols&&te._hideCols.length>0){for(var Q=0;Q<te._hideCols.length;Q++)te.layoutByName(te._hideCols[Q]).visible=!0;te._hideCols=[]}}else if(de.tag=="initLayout"){if(ne&&re)try{se.removeGridLayout(G,re,ne)}catch(Z){console.warn("[BwgGrid] 레이아웃 삭제 실패:",Z)}if(n){te.setColumns(n);const Z=n.filter(le=>le.visible!==!1).map(le=>le.fieldName||le.name);Z.length>0&&te.setColumnLayout(Z)}}}}}catch(te){console.log("컨텍스트 설정 중 오류:",te)}},[i,x,u,b]),F=U=>{if(!(!c||c.length===0))try{c.forEach(ne=>{const{name:re,renderer:G}=ne;if(re&&G){const te=typeof G=="function"?new G:G;U.gridView.registerCustomRenderer(re,te)}})}catch(ne){console.error("커스텀 렌더러 초기화 중 오류:",ne)}},R=U=>{U.onPageChanged=(ne,re)=>{ye(G=>({...G,currentPage:re}))},U.onPageCountChanged=(ne,re)=>{ye(G=>({...G,totalPages:re}))}},N=U=>{h.current?.gridView&&h.current.gridView.setPage(U)},I=U=>{if(i?.layout?.colspan&&i.layout.colspan.length>0&&i?.layout?.colspan.forEach(ne=>{const re=U.gridView.layoutByColumn(ne.fieldName);if(re){const G=ne.span;re.spanCallback=function(te,de,q){return G}}}),n&&n.length>0&&n.some(re=>re.children&&re.children.length>0))try{(()=>{const G=JSON.parse(JSON.stringify(n)),te=[],de=q=>{const Q=[];return q.children.map(Z=>{if(Z.children&&Z.children.length>0){const le=de(Z),ie=Z.header?.text||Z.fieldName,pe=U.gridView.getColumnProperty(Z.fieldName,"header");delete Z.children,delete Z.header;let ve={name:Z.fieldName,header:{text:pe?.text||ie,template:pe?.template,values:pe?.values,visible:pe?.visible??!0},items:le,...Z};Q.push(ve)}else Q.push(Z.fieldName)}),Q};G.map(q=>{if(q.children&&q.children.length>0){const Q=de(q),Z=q.header?.text||q.fieldName,le=q.header?.visible??!0,ie=U.gridView.getColumnProperty(q.fieldName,"header");delete q.children,delete q.header;const pe={name:q.fieldName,header:{text:ie?.text||Z,template:ie?.template,values:ie?.values,visible:ie?.visible||le},items:Q,...q};te.push(pe)}else te.push(q.fieldName)}),console.log("Final Layout!!",te),U.gridView.setColumnLayout(te)})()}catch(re){console.error("컬럼 레이아웃 설정 오류:",re)}},M=()=>{if(h.current){if(e==="nrml"){const U=h.current;if(z(U),F(U),n&&n.length>0){const ne=E(n),re=C(n);U.gridView.getDataSource().setFields(ne),U.gridView.setColumns(re)}if(I(U),i?.container?.page){const ne=i?.pagingOption?.pageSize||10;U.gridView.setPaging(!0,ne),R(U.gridView)}}else{const U=h.current;if(z(U),F(U),n&&n.length>0){const ne=E(n),re=C(n);U.gridView.getDataSource().setFields(ne),U.gridView.setColumns(re)}I(h.current)}setTimeout(()=>{if(d){const U=typeof f=="object"&&f!==null?f.current:null;d(U)}},0)}},W=(U,ne,re)=>{const G=U.getDataSource();let te=re?.footer==null?"default":re.footer;G.getRowCount()<1&&(te="hidden");let de={type:"excel",target:"local",allItems:!1,lookupDisplay:!0,compatibility:!0,showProgress:!0,progressMessage:"엑셀 Export 중 입니다.",applyDynamicStyles:!1,separateRows:!0,indenting:!!ne?.treeBlank,footer:te,sheetName:"",documentTitle:{},documentSubtitle:{},documentTail:{},fileName:re?.fileName||"sample.xlsx"};G instanceof Ct.LocalTreeDataProvider&&(de.indenting=!!ne?.treeBlank),re?.isCellMerge==!0&&(de.separateRows=!1),se.isEmpty(re?.sheetName)==!1&&(de.sheetName=re?.sheetName),ne?.isTitle&&(de.documentTitle={message:se.isSafeEmpty(re?.mainTitle,"No Title"),visible:!0,styleName:"documentStyle",spaceTop:1,spaceBottom:0,height:43},se.isEmpty(re?.subTitle)==!1&&(de.documentSubtitle={message:re?.subTitle,visible:!0,styleName:"center",height:20}),se.isEmpty(re?.tailTitle)==!1&&(de.documentTail={message:re?.tailTitle,visible:!0,styleName:"documentStyle"})),U.exportGrid(de)},$=(U,ne)=>{const re=U.getDataSource(),G=re.getOrgFieldNames();if(ne.checked)for(var te=0;te<G.length;te++){let q=[],Q=re.getDistinctValues(G[te])??[];if(Q.length==0)continue;let Z=U.columnByName(G[te]);for(var de=0;de<Q.length;de++){if(Q[de]==null)continue;let le=Z.values!=null&&Z.values.indexOf(Q[de])!=-1?Z?.labels?.[Z.values.indexOf(Q[de])]:Q[de];se.isEmpty(le)&&(se.isEmpty(Q[de])?le=" ":le=Q[de]);let ie="";Q[de]==null?ie="value="+Q[de]:ie="value='"+Q[de]+"'",q.push({name:le,criteria:ie})}U.setColumnFilters(G[te],q)}else for(var te=0;te<G.length;te++)U.clearColumnFilters(G[te]),U.activateAllColumnFilters(G[te],!1),U.clearColumnFilters(G[te])};m.useEffect(()=>{if(!h.current?.gridView)return;const U=()=>({0:25,1:30,2:43})[x],ne=()=>({0:12,1:13,2:14})[x];h.current.gridView.setDisplayOptions({rowHeight:U()}),v.current&&v.current.style.setProperty("--bwg-grid-font-size",`${ne()}px`)},[x,i?.display?.rowHeight]),m.useEffect(()=>{if(h.current&&h.current.gridView)if(e==="nrml"){const U=h.current;z(U)}else{const U=h.current;z(U)}},[e,i,z]),m.useEffect(()=>{!h.current||!n||n.length===0||M()},[n]),m.useEffect(()=>{h.current&&B()},[a,B]),m.useEffect(()=>{if(!(!u||!b||!h.current?.gridView||!n||n.length===0))try{const U=se.getGridLayout(__SYS_CD__,b,u);if(U){const ne=Array.isArray(U)?U:U.layout||U;ne&&(h.current.gridView.setColumnLayout(ne),console.log(`[BwgGrid] 저장된 레이아웃 로드 완료: ${__SYS_CD__}/${b}/${u}`))}}catch(U){console.warn("[BwgGrid] 레이아웃 로드 실패:",U)}},[u,b]),m.useEffect(()=>{const U=ne=>{const re=ne.ctrlKey||ne.metaKey;Lu===j.current&&(re&&(ne.key==="f"||ne.key==="F")&&(ne.preventDefault(),Ee(G=>G&&!1),fe(""),X(G=>!G)),re&&(ne.key==="g"||ne.key==="G")&&(ne.preventDefault(),X(G=>G&&!1),Ee(G=>!G)))};return window.addEventListener("keydown",U,{capture:!0}),()=>{window.removeEventListener("keydown",U,!0)}},[]);const[H,X]=m.useState(!1),[ue,fe]=m.useState(""),me=m.useRef(null),[Pe,Ee]=m.useState(!1),[J,ye]=m.useState({currentPage:0,totalPages:0,totalData:0});m.useEffect(()=>{ye({currentPage:0,totalPages:0,totalData:0})},[]),m.useEffect(()=>{H&&setTimeout(()=>{me.current?.focus?.()},0)},[H]),m.useEffect(()=>()=>{if(h.current)try{const U=h.current;U.gridView&&(U.gridView.onDataLoadComplated=void 0,U.gridView.onCurrentRowChanged=void 0,U.gridView.onCellClicked=void 0,U.gridView.onCellDblClicked=void 0,U.gridView.onEditRowChanged=void 0,U.gridView.onItemChecked=void 0,U.gridView.onItemAllChecked=void 0,U.gridView.onColumnCheckedChanged=void 0,U.gridView.onCellButtonClicked=void 0,U.gridView.onEditChange=void 0,U.gridView.onCellEdited=void 0,U.gridView.onKeyUp=void 0,U.gridView.onKeyDown=void 0,U.gridView.onWheel=void 0,U.gridView.onValidateColumn=void 0,U.gridView.onValidateRow=void 0,U.gridView.onValidationFail=void 0,U.gridView.onRowInserting=void 0,U.gridView.onCellItemClicked=void 0,U.gridView.onShowEditor=void 0,U.gridView.onLayoutPropertyChanged=void 0,U.gridView.getDataSource()&&(U.gridView.getDataSource().clearRows(),U.gridView.getDataSource().setFields([])),U.gridView.getDataSource().clearRows())}catch(U){console.warn("⚠️ BwgGrid cleanup error:",U)}},[]);const ge=m.useCallback(()=>{const U=ue;console.log("@@ handleSearchEnter:",U);const ne=h.current?.gridView;if(!ne)return;if(ne.isFiltered()){console.log("EE:: [그리드 Filtering 으로 인한 오류] 그리드 내 Filter를 해제 후 진행해 주십시오.");return}if(ne.commit(),se.isEmpty(U))return;const re=ne.getCurrent().itemIndex??-1;if(re<0)return;const G={value:U,startIndex:re+1,wrap:!0,caseSensitive:!1,partialMatch:!0},te=ne.searchCell(G);ne.setCurrent(te)},[ue]),V=m.useCallback(U=>{U.key==="Escape"&&(U.preventDefault(),X(!1))},[]),oe=m.useCallback(()=>{fe(""),X(!H)},[H]),K=m.useCallback(()=>{Ee(!Pe)},[Pe]),ce=m.useCallback(U=>{U.key==="Escape"&&(U.preventDefault(),Ee(!1))},[]),he=m.useCallback(()=>{if(!u||!b||!h.current?.gridView){console.warn("[BwgGrid] 레이아웃 저장 실패: gridId 또는 menuId가 없습니다.");return}try{const ne=h.current.gridView.saveColumnLayout();ne&&(se.saveGridLayout(__SYS_CD__,b,u,ne),Ee(!1))}catch(U){console.warn("[BwgGrid] 레이아웃 저장 실패:",U)}},[u,b]),we=m.useCallback(()=>{if(!u||!b||!h.current?.gridView){console.warn("[BwgGrid] 레이아웃 초기화 실패: gridId 또는 menuId가 없습니다.");return}try{if(se.removeGridLayout(__SYS_CD__,b,u),n){const U=C(n);h.current.gridView.setColumns(U);const ne=n.filter(re=>re.visible!==!1).map(re=>re.fieldName||re.name);ne.length>0&&h.current.gridView.setColumnLayout(ne)}console.log(`[BwgGrid] 레이아웃 초기화 완료: ${__SYS_CD__}/${b}/${u}`),Ee(!1)}catch(U){console.warn("[BwgGrid] 레이아웃 초기화 실패:",U)}},[u,b,n,C]),Se={searchEnter:ge,handleCloseKeyword:V,handleSearch:oe,handleLayoutManager:K,handleCloseLayoutManager:ce,handleSaveLayout:he,handleResetLayout:we},Te=m.useMemo(()=>({0:12,1:13,2:14})[x],[x]),Ne=m.useMemo(()=>({...t,position:"relative",width:t?.width||"100%",height:t?.height||"100%","--bwg-grid-font-size":`${Te}px`}),[t,Te]);return o.jsxs(MO,{children:[o.jsxs("div",{ref:v,style:Ne,className:r,onClick:()=>{Lu=j.current},onFocusCapture:()=>{Lu=j.current},children:[H&&o.jsx("div",{className:"grid-search-box",style:{"--search-button-size":`${y.buttonSize}px`,"--search-button-font-size":`${y.fontSize}px`,"--search-box-width":`${y.width}px`},children:o.jsx(p.ConfigProvider,{componentSize:y.componentSize,theme:{token:{fontSize:y.fontSize}},children:o.jsxs(p.Flex,{gap:3,children:[o.jsx(p.Input,{ref:me,value:ue,name:"srchField",autoComplete:"off",placeholder:"검색어를 입력하세요.",onKeyUp:U=>Se.handleCloseKeyword(U),onChange:U=>fe(U.target.value),onPressEnter:()=>Se.searchEnter()}),o.jsx(p.Button,{variant:"solid",icon:o.jsx(Y.CloseOutlined,{}),onClick:()=>X(!1)})]})})}),Pe&&o.jsx("div",{className:"grid-layout-manager-box",style:{"--search-button-size":`${y.buttonSize}px`,"--search-button-font-size":`${y.fontSize}px`,"--search-box-width":`${y.width}px`},onKeyUp:U=>Se.handleCloseLayoutManager(U),children:o.jsx(p.ConfigProvider,{componentSize:y.componentSize,theme:{token:{fontSize:y.fontSize}},children:o.jsxs(p.Flex,{vertical:!0,gap:10,children:[o.jsxs(p.Flex,{gap:6,style:{width:"100%",position:"relative"},children:[o.jsx(p.Button,{className:"bwg-btn",icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:o.jsx("path",{d:"M11.25 15V11.25H6.75V15M13.5 15H4.5C3.67157 15 3 14.3284 3 13.5V4.5C3 3.67157 3.67157 3 4.5 3H10.6287C11.0265 3 11.408 3.15804 11.6893 3.43934L14.5607 6.31066C14.842 6.59197 15 6.9735 15 7.37132V13.5C15 14.3284 14.3284 15 13.5 15Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),onClick:Se.handleSaveLayout,disabled:!u||!b,children:"레이아웃 저장"}),o.jsx(p.Button,{className:"bwg-btn",icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsx("g",{"clip-path":"url(#clip0_1427_1188)",children:o.jsx("path",{d:"M14.7003 11.34C14.2603 12.58 13.4403 13.64 12.3503 14.36C11.2603 15.09 9.96032 15.44 8.66032 15.36C7.35032 15.28 6.11032 14.79 5.11032 13.94C4.11032 13.09 3.41032 11.95 3.12032 10.67C2.83032 9.39 2.96032 8.06 3.50032 6.86C4.04032 5.66 4.94032 4.68 6.09032 4.04C7.24032 3.41 8.56032 3.16 9.85032 3.35C12.0403 3.66 13.4903 5.24 15.0503 6.65M15.0403 2.63V6.65H11.0103",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1427_1188",children:o.jsx("rect",{width:"18",height:"18",fill:"white"})})})]}),onClick:Se.handleResetLayout,disabled:!u||!b,children:"레이아웃 초기화"}),o.jsx("div",{style:{position:"absolute",right:0},children:o.jsx(p.Button,{type:"text",icon:o.jsx(Y.CloseOutlined,{}),style:{width:30,height:30},onClick:()=>Ee(!1)})})]}),(!u||!b)&&o.jsx(p.Alert,{message:"그리드 설정정보가 완료되지 않았습니다. 관리자에게 문의하십시오",type:"warning",showIcon:!0,style:{fontSize:y.fontSize,border:0,background:se.colorFormat.site.yellow01,color:"var(--text-primary)",padding:"4px 10px",borderRadius:4}})]})})}),e==="nrml"?o.jsx(Gm.RealGridReact,{ref:h,autoGenerateField:!0,onInitialized:M}):o.jsx(Gm.RealTreeReact,{ref:h,autoGenerateField:!1,onInitialized:M})]}),i?.container?.page&&o.jsx(To,{currentPage:J.currentPage,totalPages:J.totalPages,pageSize:i?.pagingOption?.pageSize,totalData:J.totalData,onPageChange:N,pageSizeOptions:i?.pagingOption?.pageSizeOptions,gridRef:h})]})}),Ve=AO,fn=m.memo(({title:e,border:t,children:r,titleChildren:n})=>{const i=m.useMemo(()=>({components:{Form:{labelColor:"#9A9A9A"},Select:{colorTextDisabled:"#000"}}}),[]);return o.jsxs(ze,{type:"vertical",children:[o.jsx(Le,{title:e,icons:{type:"antd",icon:"InfoCircleTwoTone"},children:n}),o.jsx(Ie,{border:!1,children:o.jsx(p.ConfigProvider,{theme:i,children:r})})]})}),ze=({type:e="horizontal",layoutAlign:t="left",verticalAlign:r,className:n,style:i,children:a})=>o.jsx("div",{style:i,className:`bwgview-content-layout ${e=="horizontal"?"hz-layout":"vt-layout"} layout-${t} ${r&&`vertical-${r}`} ${n||""}`,children:a}),fv=(e,t)=>{const r=window.innerWidth,n=window.innerHeight,i=Math.min(Math.max(e.x,0),Math.max(0,r-t.width)),a=Math.min(Math.max(e.y,0),Math.max(0,n-t.height));return{x:Math.round(i),y:Math.round(a)}},IO=({buttons:e,onClose:t})=>{const r=(e||[]).filter(n=>n?.visible!==!1);return r.length===0?o.jsx(p.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"}):o.jsxs("div",{style:{display:"flex",gap:6},children:[r.map(n=>o.jsx(p.Button,{type:n.type,disabled:!!n.disabled,loading:n.loading,className:n.className||"bwg-btn popup-btn",style:n.style,icon:n.icon,onClick:n.onClick,children:n.label},n.id)),o.jsx(p.Button,{type:"default",className:"bwg-btn popup-btn",onClick:t,children:"닫기"})]})},fi=({popup:e,popupEvent:t,onClose:r,children:n,buttons:i})=>{const a=m.useRef(null),s=e?.popupTitle||"팝업",l=e?.width||800,c=e?.height||600,[d,u]=m.useState(l),[f,h]=m.useState(c),g=m.useMemo(()=>{const P=Math.max(0,(window.innerWidth-l)/2),E=Math.max(0,(window.innerHeight-c)/2);return{x:Math.round(P),y:Math.round(E)}},[l,c]),[v,x]=m.useState(g),y=(P,E)=>{const C=fv({x:E.x,y:E.y},{width:d,height:f});x(C)},w=(P,E,C,O,k)=>{const T={width:Math.round(parseInt(C.style.width,10)),height:Math.round(parseInt(C.style.height,10))},D=fv(k,T);u(T.width),h(T.height),x(D)},b=()=>a.current??document.body,j=typeof e?.zIndex=="number"?e.zIndex:3e3;return o.jsxs("div",{style:{position:"fixed",inset:0,zIndex:j},children:[o.jsx("div",{onClick:r,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:0}}),o.jsxs(iO.Rnd,{className:"bwg-popup",size:{width:d,height:f},position:v,bounds:"window",minWidth:400,minHeight:300,onDragStop:y,onResizeStop:w,dragHandleClassName:"drag-handle",cancel:".rnd-cancel",enableUserSelectHack:!1,style:{backgroundColor:"white",borderRadius:20,boxShadow:"0 4px 15px rgba(0,0,0,0.25)",overflow:"visible",position:"absolute",zIndex:1},children:[o.jsx("div",{className:"bwg-popup-content",style:{overflow:"hidden",borderRadius:20,height:"100%"},children:o.jsx(Oh,{getPopupContainer:b,children:o.jsx(ze,{type:"vertical",children:o.jsx(p.Card,{className:"popup-drag-container",title:o.jsx("div",{className:"drag-handle",style:{display:"flex",alignItems:"center",gap:8},children:s}),style:{width:"100%",height:"100%"},styles:{body:{height:"calc(100% - 77px)",padding:20,overflow:"auto"}},extra:o.jsx(IO,{buttons:i,onClose:()=>e?.close?.()||r?.()}),children:o.jsx("div",{className:"rnd-cancel",style:{height:"100%"},children:o.jsx(at.SearchBoxProvider,{children:n})})})})})}),o.jsx("div",{ref:a,className:"bwg-popup-portal-root",style:{position:"relative"}})]})]})},wt=({children:e,className:t,style:r,marginBottom:n=8,gutter:i=[16,8],...a})=>o.jsx(p.Row,{...a,gutter:i,className:`bwg-row ${t}`,style:{marginBottom:`${n}px`,...r},children:e}),Oc=({children:e})=>o.jsx("div",{style:{height:"100%",padding:"20px 30px 26px"},children:o.jsx("div",{style:{width:"100%",height:"100%",border:"1px solid #ddd",borderRadius:"15px",background:"#fff"},children:e})}),NO=({rowKey:e="id",columns:t,dataSource:r,loading:n=!1,rowSelection:i,size:a="middle",pagination:s=!1,...l})=>o.jsx(p.Table,{rowKey:e,columns:t,dataSource:r,loading:n,rowSelection:i,size:a,pagination:s,bordered:!0,scroll:{x:"max-content"},locale:{emptyText:"데이터가 없습니다."},...l}),ar=e=>{const{type:t="card",animated:r=!0,...n}=e;return o.jsx(p.Tabs,{type:t,animated:r,...n})};function Gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function DO(e){if(Array.isArray(e))return Gf(e)}function J1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Th(e,t){if(e){if(typeof e=="string")return Gf(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gf(e,t):void 0}}function _O(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zt(e){return DO(e)||J1(e)||Th(e)||_O()}function Mt(){return Mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mt.apply(null,arguments)}var BO={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};function ew(e){if(Array.isArray(e))return e}function $O(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,l=[],c=!0,d=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(u){d=!0,i=u}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw i}}return l}}function tw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function je(e,t){return ew(e)||$O(e,t)||Th(e,t)||tw()}function He(e){"@babel/helpers - typeof";return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},He(e)}function LO(e,t){if(He(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(He(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rw(e){var t=LO(e,"string");return He(t)=="symbol"?t:t+""}function Ce(e,t,r){return(t=rw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zO(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Jr(e,t){if(e==null)return{};var r,n,i=zO(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var zu={exports:{}};/*!
4
4
  Copyright (c) 2018 Jed Watson.
@@ -118,7 +118,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
118
118
  0 -6px 16px 0 rgba(0, 0, 0, 0.08),
119
119
  0 -3px 6px -4px rgba(0, 0, 0, 0.12),
120
120
  0 -9px 28px 8px rgba(0, 0, 0, 0.05)
121
- `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}var Yv=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const rC={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},VM={motionBase:!0,motionUnit:!0},HM={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},nC=(e,t,r)=>{const n=r.getDerivativeToken(e),{override:i}=t,a=Yv(t,["override"]);let s=Object.assign(Object.assign({},n),{override:i});return s=tC(s),a&&Object.entries(a).forEach(([l,c])=>{const{theme:d}=c,u=Yv(c,["theme"]);let f=u;d&&(f=nC(Object.assign(Object.assign({},s),u),{override:u},d)),s[l]=f}),s};function Io(){const{token:e,hashed:t,theme:r,override:n,cssVar:i}=m.useContext(Zw),a=`${zM}-${t||""}`,s=r||Xw,[l,c,d]=CT(s,[_a,e],{salt:a,override:n,getComputedToken:nC,formatToken:tC,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:rC,ignore:VM,preserve:HM}});return[s,d,t?c:"",l,i]}const Hh=(e,t=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}),UM=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),WM=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),KM=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),qM=(e,t,r,n)=>{const i=`[class^="${t}"], [class*=" ${t}"]`,a=r?`.${r}`:i,s={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let l={};return n!==!1&&(l={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},l),s),{[i]:s})}},YM=(e,t)=>({outline:`${Qe(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:t??1,transition:"outline-offset 0s, outline 0s"}),GM=(e,t)=>({"&:focus-visible":YM(e,t)}),iC=e=>({[`.${e}`]:Object.assign(Object.assign({},UM()),{[`.${e} .${e}-icon`]:{display:"block"}})}),oC=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none"},GM(e)),{"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}}),{genStyleHooks:os}=LM({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=m.useContext(Mn);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,r,n,i]=Io();return{theme:e,realToken:t,hashId:r,token:n,cssVar:i}},useCSP:()=>{const{csp:e}=m.useContext(Mn);return e??{}},getResetStyles:(e,t)=>{var r;const n=KM(e);return[n,{"&":n},iC((r=t?.prefix.iconPrefixCls)!==null&&r!==void 0?r:Vh)]},getCommonStyle:qM,getCompUnitless:()=>rC});function XM(e,t){return Vl.reduce((r,n)=>{const i=e[`${n}1`],a=e[`${n}3`],s=e[`${n}6`],l=e[`${n}7`];return Object.assign(Object.assign({},r),t(n,{lightColor:i,lightBorderColor:a,darkColor:s,textColor:l}))},{})}const ZM=(e,t)=>{const[r,n]=Io();return xp({token:n,hashId:"",path:["ant-design-icons",e],nonce:()=>t?.nonce,layer:{name:"antd"}},()=>iC(e))},QM=Object.assign({},S),{useId:Gv}=QM,JM=()=>"",eR=typeof Gv>"u"?JM:Gv;function tR(e,t,r){var n,i;const a=pn("ConfigProvider"),s=e||{},l=s.inherit===!1||!t?Object.assign(Object.assign({},wp),{hashed:(n=t?.hashed)!==null&&n!==void 0?n:wp.hashed,cssVar:t?.cssVar}):t,c=eR();if(process.env.NODE_ENV!=="production"){const d=s.cssVar||l.cssVar,u=!!(typeof s.cssVar=="object"&&(!((i=s.cssVar)===null||i===void 0)&&i.key)||c);process.env.NODE_ENV!=="production"&&a(!d||u,"breaking","Missing key in `cssVar` config. Please upgrade to React 18 or set `cssVar.key` manually in each ConfigProvider inside `cssVar` enabled ConfigProvider.")}return Ih(()=>{var d,u;if(!e)return t;const f=Object.assign({},l.components);Object.keys(e.components||{}).forEach(v=>{f[v]=Object.assign(Object.assign({},f[v]),e.components[v])});const h=`css-var-${c.replace(/:/g,"")}`,g=((d=s.cssVar)!==null&&d!==void 0?d:l.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:r?.prefixCls},typeof l.cssVar=="object"?l.cssVar:{}),typeof s.cssVar=="object"?s.cssVar:{}),{key:typeof s.cssVar=="object"&&((u=s.cssVar)===null||u===void 0?void 0:u.key)||h});return Object.assign(Object.assign(Object.assign({},l),s),{token:Object.assign(Object.assign({},l.token),s.token),components:f,cssVar:g})},[s,l],(d,u)=>d.some((f,h)=>{const g=u[h];return!qk(f,g,!0)}))}var rR=["children"],aC=S.createContext({});function nR(e){var t=e.children,r=Jr(e,rR);return S.createElement(aC.Provider,{value:r},t)}var iR=(function(e){ts(r,e);var t=rs(r);function r(){return Lr(this,r),t.apply(this,arguments)}return zr(r,[{key:"render",value:function(){return this.props.children}}]),r})(S.Component);function oR(e){var t=S.useReducer(function(l){return l+1},0),r=je(t,2),n=r[1],i=S.useRef(e),a=yr(function(){return i.current}),s=yr(function(l){i.current=typeof l=="function"?l(i.current):l,n()});return[a,s]}var Jn="none",Hs="appear",Us="enter",Ws="leave",Xv="none",Gr="prepare",io="start",oo="active",Uh="end",sC="prepared";function Zv(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit".concat(e)]="webkit".concat(t),r["Moz".concat(e)]="moz".concat(t),r["ms".concat(e)]="MS".concat(t),r["O".concat(e)]="o".concat(t.toLowerCase()),r}function aR(e,t){var r={animationend:Zv("Animation","AnimationEnd"),transitionend:Zv("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete r.animationend.animation,"TransitionEvent"in t||delete r.transitionend.transition),r}var sR=aR(nr(),typeof window<"u"?window:{}),lC={};if(nr()){var lR=document.createElement("div");lC=lR.style}var Ks={};function cC(e){if(Ks[e])return Ks[e];var t=sR[e];if(t)for(var r=Object.keys(t),n=r.length,i=0;i<n;i+=1){var a=r[i];if(Object.prototype.hasOwnProperty.call(t,a)&&a in lC)return Ks[e]=t[a],Ks[e]}return""}var uC=cC("animationend"),dC=cC("transitionend"),cR=!!(uC&&dC),Qv=uC||"animationend",Jv=dC||"transitionend";function e0(e,t){if(!e)return null;if(He(e)==="object"){var r=t.replace(/-\w/g,function(n){return n[1].toUpperCase()});return e[r]}return"".concat(e,"-").concat(t)}const uR=(function(e){var t=m.useRef();function r(i){i&&(i.removeEventListener(Jv,e),i.removeEventListener(Qv,e))}function n(i){t.current&&t.current!==i&&r(t.current),i&&i!==t.current&&(i.addEventListener(Jv,e),i.addEventListener(Qv,e),t.current=i)}return S.useEffect(function(){return function(){r(t.current)}},[]),[n,r]});var fC=nr()?m.useLayoutEffect:m.useEffect,pC=function(t){return+setTimeout(t,16)},hC=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(pC=function(t){return window.requestAnimationFrame(t)},hC=function(t){return window.cancelAnimationFrame(t)});var t0=0,Nc=new Map;function gC(e){Nc.delete(e)}var bo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;t0+=1;var n=t0;function i(a){if(a===0)gC(n),t();else{var s=pC(function(){i(a-1)});Nc.set(n,s)}}return i(r),n};bo.cancel=function(e){var t=Nc.get(e);return gC(e),hC(t)};process.env.NODE_ENV!=="production"&&(bo.ids=function(){return Nc});const dR=(function(){var e=S.useRef(null);function t(){bo.cancel(e.current)}function r(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=bo(function(){i<=1?n({isCanceled:function(){return a!==e.current}}):r(n,i-1)});e.current=a}return S.useEffect(function(){return function(){t()}},[]),[r,t]});var fR=[Gr,io,oo,Uh],pR=[Gr,sC],mC=!1,hR=!0;function vC(e){return e===oo||e===Uh}const gR=(function(e,t,r){var n=Aa(Xv),i=je(n,2),a=i[0],s=i[1],l=dR(),c=je(l,2),d=c[0],u=c[1];function f(){s(Gr,!0)}var h=t?pR:fR;return fC(function(){if(a!==Xv&&a!==Uh){var g=h.indexOf(a),v=h[g+1],x=r(a);x===mC?s(v,!0):v&&d(function(y){function w(){y.isCanceled()||s(v,!0)}x===!0?w():Promise.resolve(x).then(w)})}},[e,a]),S.useEffect(function(){return function(){u()}},[]),[f,a]});function mR(e,t,r,n){var i=n.motionEnter,a=i===void 0?!0:i,s=n.motionAppear,l=s===void 0?!0:s,c=n.motionLeave,d=c===void 0?!0:c,u=n.motionDeadline,f=n.motionLeaveImmediately,h=n.onAppearPrepare,g=n.onEnterPrepare,v=n.onLeavePrepare,x=n.onAppearStart,y=n.onEnterStart,w=n.onLeaveStart,b=n.onAppearActive,j=n.onEnterActive,P=n.onLeaveActive,E=n.onAppearEnd,C=n.onEnterEnd,O=n.onLeaveEnd,k=n.onVisibleChanged,T=Aa(),D=je(T,2),L=D[0],A=D[1],B=oR(Jn),z=je(B,2),F=z[0],R=z[1],N=Aa(null),I=je(N,2),M=I[0],W=I[1],$=F(),H=m.useRef(!1),X=m.useRef(null);function ue(){return r()}var fe=m.useRef(!1);function me(){R(Jn),W(null,!0)}var Pe=yr(function(U){var ne=F();if(ne!==Jn){var re=ue();if(!(U&&!U.deadline&&U.target!==re)){var G=fe.current,te;ne===Hs&&G?te=E?.(re,U):ne===Us&&G?te=C?.(re,U):ne===Ws&&G&&(te=O?.(re,U)),G&&te!==!1&&me()}}}),Ee=uR(Pe),J=je(Ee,1),ye=J[0],ge=function(ne){switch(ne){case Hs:return Ce(Ce(Ce({},Gr,h),io,x),oo,b);case Us:return Ce(Ce(Ce({},Gr,g),io,y),oo,j);case Ws:return Ce(Ce(Ce({},Gr,v),io,w),oo,P);default:return{}}},V=S.useMemo(function(){return ge($)},[$]),oe=gR($,!e,function(U){if(U===Gr){var ne=V[Gr];return ne?ne(ue()):mC}if(he in V){var re;W(((re=V[he])===null||re===void 0?void 0:re.call(V,ue(),null))||null)}return he===oo&&$!==Jn&&(ye(ue()),u>0&&(clearTimeout(X.current),X.current=setTimeout(function(){Pe({deadline:!0})},u))),he===sC&&me(),hR}),K=je(oe,2),ce=K[0],he=K[1],we=vC(he);fe.current=we;var Se=m.useRef(null);fC(function(){if(!(H.current&&Se.current===t)){A(t);var U=H.current;H.current=!0;var ne;!U&&t&&l&&(ne=Hs),U&&t&&a&&(ne=Us),(U&&!t&&d||!U&&f&&!t&&d)&&(ne=Ws);var re=ge(ne);ne&&(e||re[Gr])?(R(ne),ce()):R(Jn),Se.current=t}},[t]),m.useEffect(function(){($===Hs&&!l||$===Us&&!a||$===Ws&&!d)&&R(Jn)},[l,a,d]),m.useEffect(function(){return function(){H.current=!1,clearTimeout(X.current)}},[]);var Te=S.useRef(!1);m.useEffect(function(){L&&(Te.current=!0),L!==void 0&&$===Jn&&((Te.current||L)&&k?.(L),Te.current=!0)},[L,$]);var Ne=M;return V[Gr]&&he===io&&(Ne=xe({transition:"none"},Ne)),[$,he,Ne,L??t]}function vR(e){var t=e;He(e)==="object"&&(t=e.transitionSupport);function r(i,a){return!!(i.motionName&&t&&a!==!1)}var n=S.forwardRef(function(i,a){var s=i.visible,l=s===void 0?!0:s,c=i.removeOnLeave,d=c===void 0?!0:c,u=i.forceRender,f=i.children,h=i.motionName,g=i.leavedClassName,v=i.eventProps,x=S.useContext(aC),y=x.motion,w=r(i,y),b=m.useRef(),j=m.useRef();function P(){try{return b.current instanceof HTMLElement?b.current:bl(j.current)}catch{return null}}var E=mR(w,l,P,i),C=je(E,4),O=C[0],k=C[1],T=C[2],D=C[3],L=S.useRef(D);D&&(L.current=!0);var A=S.useCallback(function(I){b.current=I,Nh(a,I)},[a]),B,z=xe(xe({},v),{},{visible:l});if(!f)B=null;else if(O===Jn)D?B=f(xe({},z),A):!d&&L.current&&g?B=f(xe(xe({},z),{},{className:g}),A):u||!d&&!g?B=f(xe(xe({},z),{},{style:{display:"none"}}),A):B=null;else{var F;k===Gr?F="prepare":vC(k)?F="active":k===io&&(F="start");var R=e0(h,"".concat(O,"-").concat(F));B=f(xe(xe({},z),{},{className:_e(e0(h,O),Ce(Ce({},R,R&&F),h,typeof h=="string")),style:T}),A)}if(S.isValidElement(B)&&Tc(B)){var N=_h(B);N||(B=S.cloneElement(B,{ref:A}))}return S.createElement(iR,{ref:j},B)});return n.displayName="CSSMotion",n}const yC=vR(cR),jp=S.createContext(!0);process.env.NODE_ENV!=="production"&&(jp.displayName="MotionCacheContext");function yR(e){const t=S.useContext(jp),{children:r}=e,[,n]=Io(),{motion:i}=n,a=S.useRef(!1);return a.current||(a.current=t!==i),a.current?S.createElement(jp.Provider,{value:i},S.createElement(nR,{motion:i},r)):r}const xC=S.memo(({dropdownMatchSelectWidth:e})=>(pn("ConfigProvider").deprecated(e===void 0,"dropdownMatchSelectWidth","popupMatchSelectWidth"),null));process.env.NODE_ENV!=="production"&&(xC.displayName="PropWarning");const xR=process.env.NODE_ENV!=="production"?xC:()=>null;var bR=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let Ep=!1;process.env.NODE_ENV;const wR=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let bC;function CR(){return bC||Cp}function SR(e){return Object.keys(e).some(t=>t.endsWith("Color"))}const jR=e=>{const{prefixCls:t,theme:r}=e;t!==void 0&&(bC=t),r&&SR(r)&&(process.env.NODE_ENV!=="production"&&is(!1,"ConfigProvider","`config` of css variable theme is not work in v5. Please use new `theme` config instead."),jM(CR(),r))},ER=e=>{const{children:t,csp:r,autoInsertSpaceInButton:n,alert:i,anchor:a,form:s,locale:l,componentSize:c,direction:d,space:u,splitter:f,virtual:h,dropdownMatchSelectWidth:g,popupMatchSelectWidth:v,popupOverflow:x,legacyLocale:y,parentContext:w,iconPrefixCls:b,theme:j,componentDisabled:P,segmented:E,statistic:C,spin:O,calendar:k,carousel:T,cascader:D,collapse:L,typography:A,checkbox:B,descriptions:z,divider:F,drawer:R,skeleton:N,steps:I,image:M,layout:W,list:$,mentions:H,modal:X,progress:ue,result:fe,slider:me,breadcrumb:Pe,menu:Ee,pagination:J,input:ye,textArea:ge,empty:V,badge:oe,radio:K,rate:ce,switch:he,transfer:we,avatar:Se,message:Te,tag:Ne,table:U,card:ne,tabs:re,timeline:G,timePicker:te,upload:de,notification:q,tree:Q,colorPicker:Z,datePicker:le,rangePicker:ie,flex:pe,wave:ve,dropdown:be,warning:Be,tour:se,tooltip:Me,popover:Fe,popconfirm:Hr,floatButton:tn,floatButtonGroup:Yi,variant:Wo,inputNumber:Gi,treeSelect:Ur}=e,Ht=S.useCallback((et,xt)=>{const{prefixCls:Jt}=e;if(xt)return xt;const Wt=Jt||w.getPrefixCls("");return et?`${Wt}-${et}`:Wt},[w.getPrefixCls,e.prefixCls]),yt=b||w.iconPrefixCls||Vh,mn=r||w.csp;ZM(yt,mn);const Ut=tR(j,w.theme,{prefixCls:Ht("")});process.env.NODE_ENV!=="production"&&(Ep=Ep||!!Ut);const Xe={csp:mn,autoInsertSpaceInButton:n,alert:i,anchor:a,locale:l||y,direction:d,space:u,splitter:f,virtual:h,popupMatchSelectWidth:v??g,popupOverflow:x,getPrefixCls:Ht,iconPrefixCls:yt,theme:Ut,segmented:E,statistic:C,spin:O,calendar:k,carousel:T,cascader:D,collapse:L,typography:A,checkbox:B,descriptions:z,divider:F,drawer:R,skeleton:N,steps:I,image:M,input:ye,textArea:ge,layout:W,list:$,mentions:H,modal:X,progress:ue,result:fe,slider:me,breadcrumb:Pe,menu:Ee,pagination:J,empty:V,badge:oe,radio:K,rate:ce,switch:he,transfer:we,avatar:Se,message:Te,tag:Ne,table:U,card:ne,tabs:re,timeline:G,timePicker:te,upload:de,notification:q,tree:Q,colorPicker:Z,datePicker:le,rangePicker:ie,flex:pe,wave:ve,dropdown:be,warning:Be,tour:se,tooltip:Me,popover:Fe,popconfirm:Hr,floatButton:tn,floatButtonGroup:Yi,variant:Wo,inputNumber:Gi,treeSelect:Ur};process.env.NODE_ENV!=="production"&&pn("ConfigProvider")(!("autoInsertSpaceInButton"in e),"deprecated","`autoInsertSpaceInButton` is deprecated. Please use `{ button: { autoInsertSpace: boolean }}` instead.");const qe=Object.assign({},w);Object.keys(Xe).forEach(et=>{Xe[et]!==void 0&&(qe[et]=Xe[et])}),wR.forEach(et=>{const xt=e[et];xt&&(qe[et]=xt)}),typeof n<"u"&&(qe.button=Object.assign({autoInsertSpace:n},qe.button));const Dt=Ih(()=>qe,qe,(et,xt)=>{const Jt=Object.keys(et),Wt=Object.keys(xt);return Jt.length!==Wt.length||Jt.some(nn=>et[nn]!==xt[nn])}),{layer:rn}=S.useContext(ns),or=S.useMemo(()=>({prefixCls:yt,csp:mn,layer:rn?"antd":void 0}),[yt,mn,rn]);let mt=S.createElement(S.Fragment,null,S.createElement(xR,{dropdownMatchSelectWidth:g}),t);const Hn=S.useMemo(()=>{var et,xt,Jt,Wt;return tM(((et=yo.Form)===null||et===void 0?void 0:et.defaultValidateMessages)||{},((Jt=(xt=Dt.locale)===null||xt===void 0?void 0:xt.Form)===null||Jt===void 0?void 0:Jt.defaultValidateMessages)||{},((Wt=Dt.form)===null||Wt===void 0?void 0:Wt.validateMessages)||{},s?.validateMessages||{})},[Dt,s?.validateMessages]);Object.keys(Hn).length>0&&(mt=S.createElement(nM.Provider,{value:Hn},mt)),l&&(mt=S.createElement(Yw,{locale:l,_ANT_MARK__:qw},mt)),mt=S.createElement(Mh.Provider,{value:or},mt),c&&(mt=S.createElement(PM,{size:c},mt)),mt=S.createElement(yR,null,mt);const vn=S.useMemo(()=>{const et=Ut||{},{algorithm:xt,token:Jt,components:Wt,cssVar:nn}=et,Xi=bR(et,["algorithm","token","components","cssVar"]),Wr=xt&&(!Array.isArray(xt)||xt.length>0)?hp(xt):Xw,jr={};Object.entries(Wt||{}).forEach(([Kr,Zi])=>{const st=Object.assign({},Zi);"algorithm"in st&&(st.algorithm===!0?st.theme=Wr:(Array.isArray(st.algorithm)||typeof st.algorithm=="function")&&(st.theme=hp(st.algorithm)),delete st.algorithm),jr[Kr]=st});const on=Object.assign(Object.assign({},_a),Jt);return Object.assign(Object.assign({},Xi),{theme:Wr,token:on,components:jr,override:Object.assign({override:on},jr),cssVar:nn})},[Ut]);return j&&(mt=S.createElement(Zw.Provider,{value:vn},mt)),Dt.warning&&(mt=S.createElement(Ww.Provider,{value:Dt.warning},mt)),P!==void 0&&(mt=S.createElement(EM,{disabled:P},mt)),S.createElement(Mn.Provider,{value:Dt},mt)},No=e=>{const t=S.useContext(Mn),r=S.useContext(Fh);return S.createElement(ER,Object.assign({parentContext:t,legacyLocale:r},e))};No.ConfigContext=Mn;No.SizeContext=xo;No.config=jR;No.useConfig=OM;Object.defineProperty(No,"SizeContext",{get:()=>(process.env.NODE_ENV!=="production"&&is(!1,"ConfigProvider","ConfigProvider.SizeContext is deprecated. Please use `ConfigProvider.useConfig().componentSize` instead."),xo)});process.env.NODE_ENV!=="production"&&(No.displayName="ConfigProvider");function wC(e){var t=e.children,r=e.prefixCls,n=e.id,i=e.overlayInnerStyle,a=e.bodyClassName,s=e.className,l=e.style;return S.createElement("div",{className:_e("".concat(r,"-content"),s),style:l},S.createElement("div",{className:_e("".concat(r,"-inner"),a),id:n,role:"tooltip",style:i},typeof t=="function"?t():t))}var CC=S.createContext(null),r0=[];function PR(e,t){var r=S.useState(function(){if(!nr())return null;var v=document.createElement("div");return process.env.NODE_ENV!=="production"&&t&&v.setAttribute("data-debug",t),v}),n=je(r,1),i=n[0],a=S.useRef(!1),s=S.useContext(CC),l=S.useState(r0),c=je(l,2),d=c[0],u=c[1],f=s||(a.current?void 0:function(v){u(function(x){var y=[v].concat(zt(x));return y})});function h(){i.parentElement||document.body.appendChild(i),a.current=!0}function g(){var v;(v=i.parentElement)===null||v===void 0||v.removeChild(i),a.current=!1}return pt(function(){return e?s?s(h):h():g(),g},[e]),pt(function(){d.length&&(d.forEach(function(v){return v()}),u(r0))},[d]),[i,f]}function OR(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),r=document.createElement("div");r.id=t;var n=r.style;n.position="absolute",n.left="0",n.top="0",n.width="100px",n.height="100px",n.overflow="scroll";var i,a;if(e){var s=getComputedStyle(e);n.scrollbarColor=s.scrollbarColor,n.scrollbarWidth=s.scrollbarWidth;var l=getComputedStyle(e,"::-webkit-scrollbar"),c=parseInt(l.width,10),d=parseInt(l.height,10);try{var u=c?"width: ".concat(l.width,";"):"",f=d?"height: ".concat(l.height,";"):"";On(`
121
+ `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),n)}var Yv=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const rC={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},VM={motionBase:!0,motionUnit:!0},HM={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},nC=(e,t,r)=>{const n=r.getDerivativeToken(e),{override:i}=t,a=Yv(t,["override"]);let s=Object.assign(Object.assign({},n),{override:i});return s=tC(s),a&&Object.entries(a).forEach(([l,c])=>{const{theme:d}=c,u=Yv(c,["theme"]);let f=u;d&&(f=nC(Object.assign(Object.assign({},s),u),{override:u},d)),s[l]=f}),s};function Io(){const{token:e,hashed:t,theme:r,override:n,cssVar:i}=m.useContext(Zw),a=`${zM}-${t||""}`,s=r||Xw,[l,c,d]=CT(s,[_a,e],{salt:a,override:n,getComputedToken:nC,formatToken:tC,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:rC,ignore:VM,preserve:HM}});return[s,d,t?c:"",l,i]}const Hh=(e,t=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}),UM=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),WM=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),KM=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),qM=(e,t,r,n)=>{const i=`[class^="${t}"], [class*=" ${t}"]`,a=r?`.${r}`:i,s={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let l={};return n!==!1&&(l={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},l),s),{[i]:s})}},YM=(e,t)=>({outline:`${Qe(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:t??1,transition:"outline-offset 0s, outline 0s"}),GM=(e,t)=>({"&:focus-visible":YM(e,t)}),iC=e=>({[`.${e}`]:Object.assign(Object.assign({},UM()),{[`.${e} .${e}-icon`]:{display:"block"}})}),oC=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none"},GM(e)),{"&:focus, &:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive}}),{genStyleHooks:os}=LM({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=m.useContext(Mn);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,r,n,i]=Io();return{theme:e,realToken:t,hashId:r,token:n,cssVar:i}},useCSP:()=>{const{csp:e}=m.useContext(Mn);return e??{}},getResetStyles:(e,t)=>{var r;const n=KM(e);return[n,{"&":n},iC((r=t?.prefix.iconPrefixCls)!==null&&r!==void 0?r:Vh)]},getCommonStyle:qM,getCompUnitless:()=>rC});function XM(e,t){return Vl.reduce((r,n)=>{const i=e[`${n}1`],a=e[`${n}3`],s=e[`${n}6`],l=e[`${n}7`];return Object.assign(Object.assign({},r),t(n,{lightColor:i,lightBorderColor:a,darkColor:s,textColor:l}))},{})}const ZM=(e,t)=>{const[r,n]=Io();return xp({token:n,hashId:"",path:["ant-design-icons",e],nonce:()=>t?.nonce,layer:{name:"antd"}},()=>iC(e))},QM=Object.assign({},S),{useId:Gv}=QM,JM=()=>"",eR=typeof Gv>"u"?JM:Gv;function tR(e,t,r){var n,i;const a=pn("ConfigProvider"),s=e||{},l=s.inherit===!1||!t?Object.assign(Object.assign({},wp),{hashed:(n=t?.hashed)!==null&&n!==void 0?n:wp.hashed,cssVar:t?.cssVar}):t,c=eR();if(process.env.NODE_ENV!=="production"){const d=s.cssVar||l.cssVar,u=!!(typeof s.cssVar=="object"&&(!((i=s.cssVar)===null||i===void 0)&&i.key)||c);process.env.NODE_ENV!=="production"&&a(!d||u,"breaking","Missing key in `cssVar` config. Please upgrade to React 18 or set `cssVar.key` manually in each ConfigProvider inside `cssVar` enabled ConfigProvider.")}return Ih(()=>{var d,u;if(!e)return t;const f=Object.assign({},l.components);Object.keys(e.components||{}).forEach(v=>{f[v]=Object.assign(Object.assign({},f[v]),e.components[v])});const h=`css-var-${c.replace(/:/g,"")}`,g=((d=s.cssVar)!==null&&d!==void 0?d:l.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:r?.prefixCls},typeof l.cssVar=="object"?l.cssVar:{}),typeof s.cssVar=="object"?s.cssVar:{}),{key:typeof s.cssVar=="object"&&((u=s.cssVar)===null||u===void 0?void 0:u.key)||h});return Object.assign(Object.assign(Object.assign({},l),s),{token:Object.assign(Object.assign({},l.token),s.token),components:f,cssVar:g})},[s,l],(d,u)=>d.some((f,h)=>{const g=u[h];return!qk(f,g,!0)}))}var rR=["children"],aC=S.createContext({});function nR(e){var t=e.children,r=Jr(e,rR);return S.createElement(aC.Provider,{value:r},t)}var iR=(function(e){ts(r,e);var t=rs(r);function r(){return Lr(this,r),t.apply(this,arguments)}return zr(r,[{key:"render",value:function(){return this.props.children}}]),r})(S.Component);function oR(e){var t=S.useReducer(function(l){return l+1},0),r=je(t,2),n=r[1],i=S.useRef(e),a=yr(function(){return i.current}),s=yr(function(l){i.current=typeof l=="function"?l(i.current):l,n()});return[a,s]}var Jn="none",Hs="appear",Us="enter",Ws="leave",Xv="none",Gr="prepare",io="start",oo="active",Uh="end",sC="prepared";function Zv(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit".concat(e)]="webkit".concat(t),r["Moz".concat(e)]="moz".concat(t),r["ms".concat(e)]="MS".concat(t),r["O".concat(e)]="o".concat(t.toLowerCase()),r}function aR(e,t){var r={animationend:Zv("Animation","AnimationEnd"),transitionend:Zv("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete r.animationend.animation,"TransitionEvent"in t||delete r.transitionend.transition),r}var sR=aR(nr(),typeof window<"u"?window:{}),lC={};if(nr()){var lR=document.createElement("div");lC=lR.style}var Ks={};function cC(e){if(Ks[e])return Ks[e];var t=sR[e];if(t)for(var r=Object.keys(t),n=r.length,i=0;i<n;i+=1){var a=r[i];if(Object.prototype.hasOwnProperty.call(t,a)&&a in lC)return Ks[e]=t[a],Ks[e]}return""}var uC=cC("animationend"),dC=cC("transitionend"),cR=!!(uC&&dC),Qv=uC||"animationend",Jv=dC||"transitionend";function e0(e,t){if(!e)return null;if(He(e)==="object"){var r=t.replace(/-\w/g,function(n){return n[1].toUpperCase()});return e[r]}return"".concat(e,"-").concat(t)}const uR=(function(e){var t=m.useRef();function r(i){i&&(i.removeEventListener(Jv,e),i.removeEventListener(Qv,e))}function n(i){t.current&&t.current!==i&&r(t.current),i&&i!==t.current&&(i.addEventListener(Jv,e),i.addEventListener(Qv,e),t.current=i)}return S.useEffect(function(){return function(){r(t.current)}},[]),[n,r]});var fC=nr()?m.useLayoutEffect:m.useEffect,pC=function(t){return+setTimeout(t,16)},hC=function(t){return clearTimeout(t)};typeof window<"u"&&"requestAnimationFrame"in window&&(pC=function(t){return window.requestAnimationFrame(t)},hC=function(t){return window.cancelAnimationFrame(t)});var t0=0,Nc=new Map;function gC(e){Nc.delete(e)}var bo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;t0+=1;var n=t0;function i(a){if(a===0)gC(n),t();else{var s=pC(function(){i(a-1)});Nc.set(n,s)}}return i(r),n};bo.cancel=function(e){var t=Nc.get(e);return gC(e),hC(t)};process.env.NODE_ENV!=="production"&&(bo.ids=function(){return Nc});const dR=(function(){var e=S.useRef(null);function t(){bo.cancel(e.current)}function r(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var a=bo(function(){i<=1?n({isCanceled:function(){return a!==e.current}}):r(n,i-1)});e.current=a}return S.useEffect(function(){return function(){t()}},[]),[r,t]});var fR=[Gr,io,oo,Uh],pR=[Gr,sC],mC=!1,hR=!0;function vC(e){return e===oo||e===Uh}const gR=(function(e,t,r){var n=Aa(Xv),i=je(n,2),a=i[0],s=i[1],l=dR(),c=je(l,2),d=c[0],u=c[1];function f(){s(Gr,!0)}var h=t?pR:fR;return fC(function(){if(a!==Xv&&a!==Uh){var g=h.indexOf(a),v=h[g+1],x=r(a);x===mC?s(v,!0):v&&d(function(y){function w(){y.isCanceled()||s(v,!0)}x===!0?w():Promise.resolve(x).then(w)})}},[e,a]),S.useEffect(function(){return function(){u()}},[]),[f,a]});function mR(e,t,r,n){var i=n.motionEnter,a=i===void 0?!0:i,s=n.motionAppear,l=s===void 0?!0:s,c=n.motionLeave,d=c===void 0?!0:c,u=n.motionDeadline,f=n.motionLeaveImmediately,h=n.onAppearPrepare,g=n.onEnterPrepare,v=n.onLeavePrepare,x=n.onAppearStart,y=n.onEnterStart,w=n.onLeaveStart,b=n.onAppearActive,j=n.onEnterActive,P=n.onLeaveActive,E=n.onAppearEnd,C=n.onEnterEnd,O=n.onLeaveEnd,k=n.onVisibleChanged,T=Aa(),D=je(T,2),L=D[0],A=D[1],B=oR(Jn),z=je(B,2),F=z[0],R=z[1],N=Aa(null),I=je(N,2),M=I[0],W=I[1],$=F(),H=m.useRef(!1),X=m.useRef(null);function ue(){return r()}var fe=m.useRef(!1);function me(){R(Jn),W(null,!0)}var Pe=yr(function(U){var ne=F();if(ne!==Jn){var re=ue();if(!(U&&!U.deadline&&U.target!==re)){var G=fe.current,te;ne===Hs&&G?te=E?.(re,U):ne===Us&&G?te=C?.(re,U):ne===Ws&&G&&(te=O?.(re,U)),G&&te!==!1&&me()}}}),Ee=uR(Pe),J=je(Ee,1),ye=J[0],ge=function(ne){switch(ne){case Hs:return Ce(Ce(Ce({},Gr,h),io,x),oo,b);case Us:return Ce(Ce(Ce({},Gr,g),io,y),oo,j);case Ws:return Ce(Ce(Ce({},Gr,v),io,w),oo,P);default:return{}}},V=S.useMemo(function(){return ge($)},[$]),oe=gR($,!e,function(U){if(U===Gr){var ne=V[Gr];return ne?ne(ue()):mC}if(he in V){var re;W(((re=V[he])===null||re===void 0?void 0:re.call(V,ue(),null))||null)}return he===oo&&$!==Jn&&(ye(ue()),u>0&&(clearTimeout(X.current),X.current=setTimeout(function(){Pe({deadline:!0})},u))),he===sC&&me(),hR}),K=je(oe,2),ce=K[0],he=K[1],we=vC(he);fe.current=we;var Se=m.useRef(null);fC(function(){if(!(H.current&&Se.current===t)){A(t);var U=H.current;H.current=!0;var ne;!U&&t&&l&&(ne=Hs),U&&t&&a&&(ne=Us),(U&&!t&&d||!U&&f&&!t&&d)&&(ne=Ws);var re=ge(ne);ne&&(e||re[Gr])?(R(ne),ce()):R(Jn),Se.current=t}},[t]),m.useEffect(function(){($===Hs&&!l||$===Us&&!a||$===Ws&&!d)&&R(Jn)},[l,a,d]),m.useEffect(function(){return function(){H.current=!1,clearTimeout(X.current)}},[]);var Te=S.useRef(!1);m.useEffect(function(){L&&(Te.current=!0),L!==void 0&&$===Jn&&((Te.current||L)&&k?.(L),Te.current=!0)},[L,$]);var Ne=M;return V[Gr]&&he===io&&(Ne=xe({transition:"none"},Ne)),[$,he,Ne,L??t]}function vR(e){var t=e;He(e)==="object"&&(t=e.transitionSupport);function r(i,a){return!!(i.motionName&&t&&a!==!1)}var n=S.forwardRef(function(i,a){var s=i.visible,l=s===void 0?!0:s,c=i.removeOnLeave,d=c===void 0?!0:c,u=i.forceRender,f=i.children,h=i.motionName,g=i.leavedClassName,v=i.eventProps,x=S.useContext(aC),y=x.motion,w=r(i,y),b=m.useRef(),j=m.useRef();function P(){try{return b.current instanceof HTMLElement?b.current:bl(j.current)}catch{return null}}var E=mR(w,l,P,i),C=je(E,4),O=C[0],k=C[1],T=C[2],D=C[3],L=S.useRef(D);D&&(L.current=!0);var A=S.useCallback(function(I){b.current=I,Nh(a,I)},[a]),B,z=xe(xe({},v),{},{visible:l});if(!f)B=null;else if(O===Jn)D?B=f(xe({},z),A):!d&&L.current&&g?B=f(xe(xe({},z),{},{className:g}),A):u||!d&&!g?B=f(xe(xe({},z),{},{style:{display:"none"}}),A):B=null;else{var F;k===Gr?F="prepare":vC(k)?F="active":k===io&&(F="start");var R=e0(h,"".concat(O,"-").concat(F));B=f(xe(xe({},z),{},{className:_e(e0(h,O),Ce(Ce({},R,R&&F),h,typeof h=="string")),style:T}),A)}if(S.isValidElement(B)&&Tc(B)){var N=_h(B);N||(B=S.cloneElement(B,{ref:A}))}return S.createElement(iR,{ref:j},B)});return n.displayName="CSSMotion",n}const yC=vR(cR),jp=S.createContext(!0);process.env.NODE_ENV!=="production"&&(jp.displayName="MotionCacheContext");function yR(e){const t=S.useContext(jp),{children:r}=e,[,n]=Io(),{motion:i}=n,a=S.useRef(!1);return a.current||(a.current=t!==i),a.current?S.createElement(jp.Provider,{value:i},S.createElement(nR,{motion:i},r)):r}const xC=S.memo(({dropdownMatchSelectWidth:e})=>(pn("ConfigProvider").deprecated(e===void 0,"dropdownMatchSelectWidth","popupMatchSelectWidth"),null));process.env.NODE_ENV!=="production"&&(xC.displayName="PropWarning");const xR=process.env.NODE_ENV!=="production"?xC:()=>null;var bR=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let Ep=!1;process.env.NODE_ENV;const wR=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let bC;function CR(){return bC||Cp}function SR(e){return Object.keys(e).some(t=>t.endsWith("Color"))}const jR=e=>{const{prefixCls:t,theme:r}=e;t!==void 0&&(bC=t),r&&SR(r)&&(process.env.NODE_ENV!=="production"&&is(!1,"ConfigProvider","`config` of css variable theme is not work in v5. Please use new `theme` config instead."),jM(CR(),r))},ER=e=>{const{children:t,csp:r,autoInsertSpaceInButton:n,alert:i,anchor:a,form:s,locale:l,componentSize:c,direction:d,space:u,splitter:f,virtual:h,dropdownMatchSelectWidth:g,popupMatchSelectWidth:v,popupOverflow:x,legacyLocale:y,parentContext:w,iconPrefixCls:b,theme:j,componentDisabled:P,segmented:E,statistic:C,spin:O,calendar:k,carousel:T,cascader:D,collapse:L,typography:A,checkbox:B,descriptions:z,divider:F,drawer:R,skeleton:N,steps:I,image:M,layout:W,list:$,mentions:H,modal:X,progress:ue,result:fe,slider:me,breadcrumb:Pe,menu:Ee,pagination:J,input:ye,textArea:ge,empty:V,badge:oe,radio:K,rate:ce,switch:he,transfer:we,avatar:Se,message:Te,tag:Ne,table:U,card:ne,tabs:re,timeline:G,timePicker:te,upload:de,notification:q,tree:Q,colorPicker:Z,datePicker:le,rangePicker:ie,flex:pe,wave:ve,dropdown:be,warning:Be,tour:ae,tooltip:Me,popover:Fe,popconfirm:Hr,floatButton:tn,floatButtonGroup:Yi,variant:Wo,inputNumber:Gi,treeSelect:Ur}=e,Ht=S.useCallback((et,xt)=>{const{prefixCls:Jt}=e;if(xt)return xt;const Wt=Jt||w.getPrefixCls("");return et?`${Wt}-${et}`:Wt},[w.getPrefixCls,e.prefixCls]),yt=b||w.iconPrefixCls||Vh,mn=r||w.csp;ZM(yt,mn);const Ut=tR(j,w.theme,{prefixCls:Ht("")});process.env.NODE_ENV!=="production"&&(Ep=Ep||!!Ut);const Xe={csp:mn,autoInsertSpaceInButton:n,alert:i,anchor:a,locale:l||y,direction:d,space:u,splitter:f,virtual:h,popupMatchSelectWidth:v??g,popupOverflow:x,getPrefixCls:Ht,iconPrefixCls:yt,theme:Ut,segmented:E,statistic:C,spin:O,calendar:k,carousel:T,cascader:D,collapse:L,typography:A,checkbox:B,descriptions:z,divider:F,drawer:R,skeleton:N,steps:I,image:M,input:ye,textArea:ge,layout:W,list:$,mentions:H,modal:X,progress:ue,result:fe,slider:me,breadcrumb:Pe,menu:Ee,pagination:J,empty:V,badge:oe,radio:K,rate:ce,switch:he,transfer:we,avatar:Se,message:Te,tag:Ne,table:U,card:ne,tabs:re,timeline:G,timePicker:te,upload:de,notification:q,tree:Q,colorPicker:Z,datePicker:le,rangePicker:ie,flex:pe,wave:ve,dropdown:be,warning:Be,tour:ae,tooltip:Me,popover:Fe,popconfirm:Hr,floatButton:tn,floatButtonGroup:Yi,variant:Wo,inputNumber:Gi,treeSelect:Ur};process.env.NODE_ENV!=="production"&&pn("ConfigProvider")(!("autoInsertSpaceInButton"in e),"deprecated","`autoInsertSpaceInButton` is deprecated. Please use `{ button: { autoInsertSpace: boolean }}` instead.");const qe=Object.assign({},w);Object.keys(Xe).forEach(et=>{Xe[et]!==void 0&&(qe[et]=Xe[et])}),wR.forEach(et=>{const xt=e[et];xt&&(qe[et]=xt)}),typeof n<"u"&&(qe.button=Object.assign({autoInsertSpace:n},qe.button));const Dt=Ih(()=>qe,qe,(et,xt)=>{const Jt=Object.keys(et),Wt=Object.keys(xt);return Jt.length!==Wt.length||Jt.some(nn=>et[nn]!==xt[nn])}),{layer:rn}=S.useContext(ns),or=S.useMemo(()=>({prefixCls:yt,csp:mn,layer:rn?"antd":void 0}),[yt,mn,rn]);let mt=S.createElement(S.Fragment,null,S.createElement(xR,{dropdownMatchSelectWidth:g}),t);const Hn=S.useMemo(()=>{var et,xt,Jt,Wt;return tM(((et=yo.Form)===null||et===void 0?void 0:et.defaultValidateMessages)||{},((Jt=(xt=Dt.locale)===null||xt===void 0?void 0:xt.Form)===null||Jt===void 0?void 0:Jt.defaultValidateMessages)||{},((Wt=Dt.form)===null||Wt===void 0?void 0:Wt.validateMessages)||{},s?.validateMessages||{})},[Dt,s?.validateMessages]);Object.keys(Hn).length>0&&(mt=S.createElement(nM.Provider,{value:Hn},mt)),l&&(mt=S.createElement(Yw,{locale:l,_ANT_MARK__:qw},mt)),mt=S.createElement(Mh.Provider,{value:or},mt),c&&(mt=S.createElement(PM,{size:c},mt)),mt=S.createElement(yR,null,mt);const vn=S.useMemo(()=>{const et=Ut||{},{algorithm:xt,token:Jt,components:Wt,cssVar:nn}=et,Xi=bR(et,["algorithm","token","components","cssVar"]),Wr=xt&&(!Array.isArray(xt)||xt.length>0)?hp(xt):Xw,jr={};Object.entries(Wt||{}).forEach(([Kr,Zi])=>{const st=Object.assign({},Zi);"algorithm"in st&&(st.algorithm===!0?st.theme=Wr:(Array.isArray(st.algorithm)||typeof st.algorithm=="function")&&(st.theme=hp(st.algorithm)),delete st.algorithm),jr[Kr]=st});const on=Object.assign(Object.assign({},_a),Jt);return Object.assign(Object.assign({},Xi),{theme:Wr,token:on,components:jr,override:Object.assign({override:on},jr),cssVar:nn})},[Ut]);return j&&(mt=S.createElement(Zw.Provider,{value:vn},mt)),Dt.warning&&(mt=S.createElement(Ww.Provider,{value:Dt.warning},mt)),P!==void 0&&(mt=S.createElement(EM,{disabled:P},mt)),S.createElement(Mn.Provider,{value:Dt},mt)},No=e=>{const t=S.useContext(Mn),r=S.useContext(Fh);return S.createElement(ER,Object.assign({parentContext:t,legacyLocale:r},e))};No.ConfigContext=Mn;No.SizeContext=xo;No.config=jR;No.useConfig=OM;Object.defineProperty(No,"SizeContext",{get:()=>(process.env.NODE_ENV!=="production"&&is(!1,"ConfigProvider","ConfigProvider.SizeContext is deprecated. Please use `ConfigProvider.useConfig().componentSize` instead."),xo)});process.env.NODE_ENV!=="production"&&(No.displayName="ConfigProvider");function wC(e){var t=e.children,r=e.prefixCls,n=e.id,i=e.overlayInnerStyle,a=e.bodyClassName,s=e.className,l=e.style;return S.createElement("div",{className:_e("".concat(r,"-content"),s),style:l},S.createElement("div",{className:_e("".concat(r,"-inner"),a),id:n,role:"tooltip",style:i},typeof t=="function"?t():t))}var CC=S.createContext(null),r0=[];function PR(e,t){var r=S.useState(function(){if(!nr())return null;var v=document.createElement("div");return process.env.NODE_ENV!=="production"&&t&&v.setAttribute("data-debug",t),v}),n=je(r,1),i=n[0],a=S.useRef(!1),s=S.useContext(CC),l=S.useState(r0),c=je(l,2),d=c[0],u=c[1],f=s||(a.current?void 0:function(v){u(function(x){var y=[v].concat(zt(x));return y})});function h(){i.parentElement||document.body.appendChild(i),a.current=!0}function g(){var v;(v=i.parentElement)===null||v===void 0||v.removeChild(i),a.current=!1}return pt(function(){return e?s?s(h):h():g(),g},[e]),pt(function(){d.length&&(d.forEach(function(v){return v()}),u(r0))},[d]),[i,f]}function OR(e){var t="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),r=document.createElement("div");r.id=t;var n=r.style;n.position="absolute",n.left="0",n.top="0",n.width="100px",n.height="100px",n.overflow="scroll";var i,a;if(e){var s=getComputedStyle(e);n.scrollbarColor=s.scrollbarColor,n.scrollbarWidth=s.scrollbarWidth;var l=getComputedStyle(e,"::-webkit-scrollbar"),c=parseInt(l.width,10),d=parseInt(l.height,10);try{var u=c?"width: ".concat(l.width,";"):"",f=d?"height: ".concat(l.height,";"):"";On(`
122
122
  #`.concat(t,`::-webkit-scrollbar {
123
123
  `).concat(u,`
124
124
  `).concat(f,`
@@ -126,7 +126,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
126
126
  html body {
127
127
  overflow-y: hidden;
128
128
  `.concat(s?"width: calc(100% - ".concat(a,"px);"):"",`
129
- }`),i)}else Ta(i);return function(){Ta(i)}},[t,i])}var AR=!1;function IR(e){return AR}var i0=function(t){return t===!1?!1:!nr()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},Wh=S.forwardRef(function(e,t){var r=e.open,n=e.autoLock,i=e.getContainer,a=e.debug,s=e.autoDestroy,l=s===void 0?!0:s,c=e.children,d=S.useState(r),u=je(d,2),f=u[0],h=u[1],g=f||r;process.env.NODE_ENV!=="production"&&Nn(nr()||!r,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),S.useEffect(function(){(l||r)&&h(r)},[r,l]);var v=S.useState(function(){return i0(i)}),x=je(v,2),y=x[0],w=x[1];S.useEffect(function(){var A=i0(i);w(A??null)});var b=PR(g&&!y,a),j=je(b,2),P=j[0],E=j[1],C=y??P;RR(n&&r&&nr()&&(C===P||C===document.body));var O=null;if(c&&Tc(c)&&t){var k=c;O=k.ref}var T=Dh(O,t);if(!g||!nr()||y===void 0)return null;var D=C===!1||IR(),L=c;return t&&(L=S.cloneElement(c,{ref:T})),S.createElement(CC.Provider,{value:E},D?L:Oa.createPortal(L,C))});process.env.NODE_ENV!=="production"&&(Wh.displayName="Portal");function NR(){var e=xe({},S);return e.useId}var o0=0,a0=NR();const SC=a0?function(t){var r=a0();return t||(process.env.NODE_ENV==="test"?"test-id":r)}:function(t){var r=S.useState("ssr-id"),n=je(r,2),i=n[0],a=n[1];return S.useEffect(function(){var s=o0;o0+=1,a("rc_unique_".concat(s))},[]),t||(process.env.NODE_ENV==="test"?"test-id":i)},DR=(function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e?.substr(0,4))});function _R(e){var t=e.prefixCls,r=e.align,n=e.arrow,i=e.arrowPos,a=n||{},s=a.className,l=a.content,c=i.x,d=c===void 0?0:c,u=i.y,f=u===void 0?0:u,h=S.useRef();if(!r||!r.points)return null;var g={position:"absolute"};if(r.autoArrow!==!1){var v=r.points[0],x=r.points[1],y=v[0],w=v[1],b=x[0],j=x[1];y===b||!["t","b"].includes(y)?g.top=f:y==="t"?g.top=0:g.bottom=0,w===j||!["l","r"].includes(w)?g.left=d:w==="l"?g.left=0:g.right=0}return S.createElement("div",{ref:h,className:_e("".concat(t,"-arrow"),s),style:g},l)}function BR(e){var t=e.prefixCls,r=e.open,n=e.zIndex,i=e.mask,a=e.motion;return i?S.createElement(yC,Mt({},a,{motionAppear:!0,visible:r,removeOnLeave:!0}),function(s){var l=s.className;return S.createElement("div",{style:{zIndex:n},className:_e("".concat(t,"-mask"),l)})}):null}var jC=S.memo(function(e){var t=e.children;return t},function(e,t){return t.cache});process.env.NODE_ENV!=="production"&&(jC.displayName="PopupContent");var EC=S.forwardRef(function(e,t){var r=e.popup,n=e.className,i=e.prefixCls,a=e.style,s=e.target,l=e.onVisibleChanged,c=e.open,d=e.keepDom,u=e.fresh,f=e.onClick,h=e.mask,g=e.arrow,v=e.arrowPos,x=e.align,y=e.motion,w=e.maskMotion,b=e.forceRender,j=e.getPopupContainer,P=e.autoDestroy,E=e.portal,C=e.zIndex,O=e.onMouseEnter,k=e.onMouseLeave,T=e.onPointerEnter,D=e.onPointerDownCapture,L=e.ready,A=e.offsetX,B=e.offsetY,z=e.offsetR,F=e.offsetB,R=e.onAlign,N=e.onPrepare,I=e.stretch,M=e.targetWidth,W=e.targetHeight,$=typeof r=="function"?r():r,H=c||d,X=j?.length>0,ue=S.useState(!j||!X),fe=je(ue,2),me=fe[0],Pe=fe[1];if(pt(function(){!me&&X&&s&&Pe(!0)},[me,X,s]),!me)return null;var Ee="auto",J={left:"-1000vw",top:"-1000vh",right:Ee,bottom:Ee};if(L||!c){var ye,ge=x.points,V=x.dynamicInset||((ye=x._experimental)===null||ye===void 0?void 0:ye.dynamicInset),oe=V&&ge[0][1]==="r",K=V&&ge[0][0]==="b";oe?(J.right=z,J.left=Ee):(J.left=A,J.right=Ee),K?(J.bottom=F,J.top=Ee):(J.top=B,J.bottom=Ee)}var ce={};return I&&(I.includes("height")&&W?ce.height=W:I.includes("minHeight")&&W&&(ce.minHeight=W),I.includes("width")&&M?ce.width=M:I.includes("minWidth")&&M&&(ce.minWidth=M)),c||(ce.pointerEvents="none"),S.createElement(E,{open:b||H,getContainer:j&&function(){return j(s)},autoDestroy:P},S.createElement(BR,{prefixCls:i,open:c,zIndex:C,mask:h,motion:w}),S.createElement(Ro,{onResize:R,disabled:!c},function(he){return S.createElement(yC,Mt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(i,"-hidden")},y,{onAppearPrepare:N,onEnterPrepare:N,visible:c,onVisibleChanged:function(Se){var Te;y==null||(Te=y.onVisibleChanged)===null||Te===void 0||Te.call(y,Se),l(Se)}}),function(we,Se){var Te=we.className,Ne=we.style,U=_e(i,Te,n);return S.createElement("div",{ref:es(he,t,Se),className:U,style:xe(xe(xe(xe({"--arrow-x":"".concat(v.x||0,"px"),"--arrow-y":"".concat(v.y||0,"px")},J),ce),Ne),{},{boxSizing:"border-box",zIndex:C},a),onMouseEnter:O,onMouseLeave:k,onPointerEnter:T,onClick:f,onPointerDownCapture:D},g&&S.createElement(_R,{prefixCls:i,arrow:g,arrowPos:v,align:x}),S.createElement(jC,{cache:!c&&!u},$))})}))});process.env.NODE_ENV!=="production"&&(EC.displayName="Popup");var PC=S.forwardRef(function(e,t){var r=e.children,n=e.getTriggerDOMNode,i=Tc(r),a=S.useCallback(function(l){Nh(t,n?n(l):l)},[n]),s=Dh(a,_h(r));return i?S.cloneElement(r,{ref:s}):r});process.env.NODE_ENV!=="production"&&(PC.displayName="TriggerWrapper");var s0=S.createContext(null);function l0(e){return e?Array.isArray(e)?e:[e]:[]}function $R(e,t,r,n){return S.useMemo(function(){var i=l0(r??t),a=l0(n??t),s=new Set(i),l=new Set(a);return e&&(s.has("hover")&&(s.delete("hover"),s.add("click")),l.has("hover")&&(l.delete("hover"),l.add("click"))),[s,l]},[e,t,r,n])}const LR=(function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),r=t.width,n=t.height;if(r||n)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),a=i.width,s=i.height;if(a||s)return!0}}return!1});function zR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return r?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function FR(e,t,r,n){for(var i=r.points,a=Object.keys(e),s=0;s<a.length;s+=1){var l,c=a[s];if(zR((l=e[c])===null||l===void 0?void 0:l.points,i,n))return"".concat(t,"-placement-").concat(c)}return""}function c0(e,t,r,n){return t||(r?{motionName:"".concat(e,"-").concat(r)}:n?{motionName:n}:null)}function as(e){return e.ownerDocument.defaultView}function Pp(e){for(var t=[],r=e?.parentElement,n=["hidden","scroll","clip","auto"];r;){var i=as(r).getComputedStyle(r),a=i.overflowX,s=i.overflowY,l=i.overflow;[a,s,l].some(function(c){return n.includes(c)})&&t.push(r),r=r.parentElement}return t}function $a(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function sa(e){return $a(parseFloat(e),0)}function u0(e,t){var r=xe({},e);return(t||[]).forEach(function(n){if(!(n instanceof HTMLBodyElement||n instanceof HTMLHtmlElement)){var i=as(n).getComputedStyle(n),a=i.overflow,s=i.overflowClipMargin,l=i.borderTopWidth,c=i.borderBottomWidth,d=i.borderLeftWidth,u=i.borderRightWidth,f=n.getBoundingClientRect(),h=n.offsetHeight,g=n.clientHeight,v=n.offsetWidth,x=n.clientWidth,y=sa(l),w=sa(c),b=sa(d),j=sa(u),P=$a(Math.round(f.width/v*1e3)/1e3),E=$a(Math.round(f.height/h*1e3)/1e3),C=(v-x-b-j)*P,O=(h-g-y-w)*E,k=y*E,T=w*E,D=b*P,L=j*P,A=0,B=0;if(a==="clip"){var z=sa(s);A=z*P,B=z*E}var F=f.x+D-A,R=f.y+k-B,N=F+f.width+2*A-D-L-C,I=R+f.height+2*B-k-T-O;r.left=Math.max(r.left,F),r.top=Math.max(r.top,R),r.right=Math.min(r.right,N),r.bottom=Math.min(r.bottom,I)}}),r}function d0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r="".concat(t),n=r.match(/^(.*)\%$/);return n?e*(parseFloat(n[1])/100):parseFloat(r)}function f0(e,t){var r=t||[],n=je(r,2),i=n[0],a=n[1];return[d0(e.width,i),d0(e.height,a)]}function p0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function eo(e,t){var r=t[0],n=t[1],i,a;return r==="t"?a=e.y:r==="b"?a=e.y+e.height:a=e.y+e.height/2,n==="l"?i=e.x:n==="r"?i=e.x+e.width:i=e.x+e.width/2,{x:i,y:a}}function Yn(e,t){var r={t:"b",b:"t",l:"r",r:"l"};return e.map(function(n,i){return i===t?r[n]||"c":n}).join("")}function VR(e,t,r,n,i,a,s){var l=S.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[n]||{}}),c=je(l,2),d=c[0],u=c[1],f=S.useRef(0),h=S.useMemo(function(){return t?Pp(t):[]},[t]),g=S.useRef({}),v=function(){g.current={}};e||v();var x=yr(function(){if(t&&r&&e){let Er=function(Xo,yn){var qn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te,Zo=H.x+Xo,Ds=H.y+yn,ku=Zo+K,Tu=Ds+oe,Mu=Math.max(Zo,qn.left),ke=Math.max(Ds,qn.top),De=Math.min(ku,qn.right),lt=Math.min(Tu,qn.bottom);return Math.max(0,(De-Mu)*(lt-ke))},Ji=function(){Wr=H.y+qe,jr=Wr+oe,on=H.x+Xe,Kr=on+K};var b,j,P,E,C=t,O=C.ownerDocument,k=as(C),T=k.getComputedStyle(C),D=T.position,L=C.style.left,A=C.style.top,B=C.style.right,z=C.style.bottom,F=C.style.overflow,R=xe(xe({},i[n]),a),N=O.createElement("div");(b=C.parentElement)===null||b===void 0||b.appendChild(N),N.style.left="".concat(C.offsetLeft,"px"),N.style.top="".concat(C.offsetTop,"px"),N.style.position=D,N.style.height="".concat(C.offsetHeight,"px"),N.style.width="".concat(C.offsetWidth,"px"),C.style.left="0",C.style.top="0",C.style.right="auto",C.style.bottom="auto",C.style.overflow="hidden";var I;if(Array.isArray(r))I={x:r[0],y:r[1],width:0,height:0};else{var M,W,$=r.getBoundingClientRect();$.x=(M=$.x)!==null&&M!==void 0?M:$.left,$.y=(W=$.y)!==null&&W!==void 0?W:$.top,I={x:$.x,y:$.y,width:$.width,height:$.height}}var H=C.getBoundingClientRect(),X=k.getComputedStyle(C),ue=X.height,fe=X.width;H.x=(j=H.x)!==null&&j!==void 0?j:H.left,H.y=(P=H.y)!==null&&P!==void 0?P:H.top;var me=O.documentElement,Pe=me.clientWidth,Ee=me.clientHeight,J=me.scrollWidth,ye=me.scrollHeight,ge=me.scrollTop,V=me.scrollLeft,oe=H.height,K=H.width,ce=I.height,he=I.width,we={left:0,top:0,right:Pe,bottom:Ee},Se={left:-V,top:-ge,right:J-V,bottom:ye-ge},Te=R.htmlRegion,Ne="visible",U="visibleFirst";Te!=="scroll"&&Te!==U&&(Te=Ne);var ne=Te===U,re=u0(Se,h),G=u0(we,h),te=Te===Ne?G:re,de=ne?G:te;C.style.left="auto",C.style.top="auto",C.style.right="0",C.style.bottom="0";var q=C.getBoundingClientRect();C.style.left=L,C.style.top=A,C.style.right=B,C.style.bottom=z,C.style.overflow=F,(E=C.parentElement)===null||E===void 0||E.removeChild(N);var Q=$a(Math.round(K/parseFloat(fe)*1e3)/1e3),Z=$a(Math.round(oe/parseFloat(ue)*1e3)/1e3);if(Q===0||Z===0||Ra(r)&&!LR(r))return;var le=R.offset,ie=R.targetOffset,pe=f0(H,le),ve=je(pe,2),be=ve[0],Be=ve[1],se=f0(I,ie),Me=je(se,2),Fe=Me[0],Hr=Me[1];I.x-=Fe,I.y-=Hr;var tn=R.points||[],Yi=je(tn,2),Wo=Yi[0],Gi=Yi[1],Ur=p0(Gi),Ht=p0(Wo),yt=eo(I,Ur),mn=eo(H,Ht),Ut=xe({},R),Xe=yt.x-mn.x+be,qe=yt.y-mn.y+Be,Dt=Er(Xe,qe),rn=Er(Xe,qe,G),or=eo(I,["t","l"]),mt=eo(H,["t","l"]),Hn=eo(I,["b","r"]),vn=eo(H,["b","r"]),et=R.overflow||{},xt=et.adjustX,Jt=et.adjustY,Wt=et.shiftX,nn=et.shiftY,Xi=function(yn){return typeof yn=="boolean"?yn:yn>=0},Wr,jr,on,Kr;Ji();var Zi=Xi(Jt),st=Ht[0]===Ur[0];if(Zi&&Ht[0]==="t"&&(jr>de.bottom||g.current.bt)){var mi=qe;st?mi-=oe-ce:mi=or.y-vn.y-Be;var Ps=Er(Xe,mi),vu=Er(Xe,mi,G);Ps>Dt||Ps===Dt&&(!ne||vu>=rn)?(g.current.bt=!0,qe=mi,Be=-Be,Ut.points=[Yn(Ht,0),Yn(Ur,0)]):g.current.bt=!1}if(Zi&&Ht[0]==="b"&&(Wr<de.top||g.current.tb)){var vi=qe;st?vi+=oe-ce:vi=Hn.y-mt.y-Be;var Os=Er(Xe,vi),yu=Er(Xe,vi,G);Os>Dt||Os===Dt&&(!ne||yu>=rn)?(g.current.tb=!0,qe=vi,Be=-Be,Ut.points=[Yn(Ht,0),Yn(Ur,0)]):g.current.tb=!1}var ks=Xi(xt),Ts=Ht[1]===Ur[1];if(ks&&Ht[1]==="l"&&(Kr>de.right||g.current.rl)){var yi=Xe;Ts?yi-=K-he:yi=or.x-vn.x-be;var xi=Er(yi,qe),Ko=Er(yi,qe,G);xi>Dt||xi===Dt&&(!ne||Ko>=rn)?(g.current.rl=!0,Xe=yi,be=-be,Ut.points=[Yn(Ht,1),Yn(Ur,1)]):g.current.rl=!1}if(ks&&Ht[1]==="r"&&(on<de.left||g.current.lr)){var bi=Xe;Ts?bi+=K-he:bi=Hn.x-mt.x-be;var qo=Er(bi,qe),Qi=Er(bi,qe,G);qo>Dt||qo===Dt&&(!ne||Qi>=rn)?(g.current.lr=!0,Xe=bi,be=-be,Ut.points=[Yn(Ht,1),Yn(Ur,1)]):g.current.lr=!1}Ji();var qr=Wt===!0?0:Wt;typeof qr=="number"&&(on<G.left&&(Xe-=on-G.left-be,I.x+he<G.left+qr&&(Xe+=I.x-G.left+he-qr)),Kr>G.right&&(Xe-=Kr-G.right-be,I.x>G.right-qr&&(Xe+=I.x-G.right+qr)));var Un=nn===!0?0:nn;typeof Un=="number"&&(Wr<G.top&&(qe-=Wr-G.top-Be,I.y+ce<G.top+Un&&(qe+=I.y-G.top+ce-Un)),jr>G.bottom&&(qe-=jr-G.bottom-Be,I.y>G.bottom-Un&&(qe+=I.y-G.bottom+Un)));var Wn=H.x+Xe,Kn=Wn+K,Yo=H.y+qe,xu=Yo+oe,Ms=I.x,Rs=Ms+he,As=I.y,bu=As+ce,wu=Math.max(Wn,Ms),Is=Math.min(Kn,Rs),Cu=(wu+Is)/2,Su=Cu-Wn,Ns=Math.max(Yo,As),ju=Math.min(xu,bu),Eu=(Ns+ju)/2,Pu=Eu-Yo;s?.(t,Ut);var an=q.right-H.x-(Xe+H.width),Go=q.bottom-H.y-(qe+H.height);Q===1&&(Xe=Math.round(Xe),an=Math.round(an)),Z===1&&(qe=Math.round(qe),Go=Math.round(Go));var Ou={ready:!0,offsetX:Xe/Q,offsetY:qe/Z,offsetR:an/Q,offsetB:Go/Z,arrowX:Su/Q,arrowY:Pu/Z,scaleX:Q,scaleY:Z,align:Ut};u(Ou)}}),y=function(){f.current+=1;var j=f.current;Promise.resolve().then(function(){f.current===j&&x()})},w=function(){u(function(j){return xe(xe({},j),{},{ready:!1})})};return pt(w,[n]),pt(function(){e||w()},[e]),[d.ready,d.offsetX,d.offsetY,d.offsetR,d.offsetB,d.arrowX,d.arrowY,d.scaleX,d.scaleY,d.align,y]}function HR(e,t,r,n,i){pt(function(){if(e&&t&&r){let f=function(){n(),i()};var a=t,s=r,l=Pp(a),c=Pp(s),d=as(s),u=new Set([d].concat(zt(l),zt(c)));return u.forEach(function(h){h.addEventListener("scroll",f,{passive:!0})}),d.addEventListener("resize",f,{passive:!0}),n(),function(){u.forEach(function(h){h.removeEventListener("scroll",f),d.removeEventListener("resize",f)})}}},[e,t,r])}function UR(e,t,r,n,i,a,s,l){var c=S.useRef(e);c.current=e;var d=S.useRef(!1);S.useEffect(function(){if(t&&n&&(!i||a)){var f=function(){d.current=!1},h=function(P){var E;c.current&&!s(((E=P.composedPath)===null||E===void 0||(E=E.call(P))===null||E===void 0?void 0:E[0])||P.target)&&!d.current&&l(!1)},g=as(n);g.addEventListener("pointerdown",f,!0),g.addEventListener("mousedown",h,!0),g.addEventListener("contextmenu",h,!0);var v=$l(r);if(v&&(v.addEventListener("mousedown",h,!0),v.addEventListener("contextmenu",h,!0)),process.env.NODE_ENV!=="production"){var x,y,w=r==null||(x=r.getRootNode)===null||x===void 0?void 0:x.call(r),b=(y=n.getRootNode)===null||y===void 0?void 0:y.call(n);po(w===b,"trigger element and popup element should in same shadow root.")}return function(){g.removeEventListener("pointerdown",f,!0),g.removeEventListener("mousedown",h,!0),g.removeEventListener("contextmenu",h,!0),v&&(v.removeEventListener("mousedown",h,!0),v.removeEventListener("contextmenu",h,!0))}}},[t,r,n,i,a]);function u(){d.current=!0}return u}var WR=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function KR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wh,t=S.forwardRef(function(r,n){var i=r.prefixCls,a=i===void 0?"rc-trigger-popup":i,s=r.children,l=r.action,c=l===void 0?"hover":l,d=r.showAction,u=r.hideAction,f=r.popupVisible,h=r.defaultPopupVisible,g=r.onPopupVisibleChange,v=r.afterPopupVisibleChange,x=r.mouseEnterDelay,y=r.mouseLeaveDelay,w=y===void 0?.1:y,b=r.focusDelay,j=r.blurDelay,P=r.mask,E=r.maskClosable,C=E===void 0?!0:E,O=r.getPopupContainer,k=r.forceRender,T=r.autoDestroy,D=r.destroyPopupOnHide,L=r.popup,A=r.popupClassName,B=r.popupStyle,z=r.popupPlacement,F=r.builtinPlacements,R=F===void 0?{}:F,N=r.popupAlign,I=r.zIndex,M=r.stretch,W=r.getPopupClassNameFromAlign,$=r.fresh,H=r.alignPoint,X=r.onPopupClick,ue=r.onPopupAlign,fe=r.arrow,me=r.popupMotion,Pe=r.maskMotion,Ee=r.popupTransitionName,J=r.popupAnimation,ye=r.maskTransitionName,ge=r.maskAnimation,V=r.className,oe=r.getTriggerDOMNode,K=Jr(r,WR),ce=T||D||!1,he=S.useState(!1),we=je(he,2),Se=we[0],Te=we[1];pt(function(){Te(DR())},[]);var Ne=S.useRef({}),U=S.useContext(s0),ne=S.useMemo(function(){return{registerSubPopup:function(De,lt){Ne.current[De]=lt,U?.registerSubPopup(De,lt)}}},[U]),re=SC(),G=S.useState(null),te=je(G,2),de=te[0],q=te[1],Q=S.useRef(null),Z=yr(function(ke){Q.current=ke,Ra(ke)&&de!==ke&&q(ke),U?.registerSubPopup(re,ke)}),le=S.useState(null),ie=je(le,2),pe=ie[0],ve=ie[1],be=S.useRef(null),Be=yr(function(ke){Ra(ke)&&pe!==ke&&(ve(ke),be.current=ke)}),se=S.Children.only(s),Me=se?.props||{},Fe={},Hr=yr(function(ke){var De,lt,Pt=pe;return Pt?.contains(ke)||((De=$l(Pt))===null||De===void 0?void 0:De.host)===ke||ke===Pt||de?.contains(ke)||((lt=$l(de))===null||lt===void 0?void 0:lt.host)===ke||ke===de||Object.values(Ne.current).some(function(vt){return vt?.contains(ke)||ke===vt})}),tn=c0(a,me,J,Ee),Yi=c0(a,Pe,ge,ye),Wo=S.useState(h||!1),Gi=je(Wo,2),Ur=Gi[0],Ht=Gi[1],yt=f??Ur,mn=yr(function(ke){f===void 0&&Ht(ke)});pt(function(){Ht(f||!1)},[f]);var Ut=S.useRef(yt);Ut.current=yt;var Xe=S.useRef([]);Xe.current=[];var qe=yr(function(ke){var De;mn(ke),((De=Xe.current[Xe.current.length-1])!==null&&De!==void 0?De:yt)!==ke&&(Xe.current.push(ke),g?.(ke))}),Dt=S.useRef(),rn=function(){clearTimeout(Dt.current)},or=function(De){var lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;rn(),lt===0?qe(De):Dt.current=setTimeout(function(){qe(De)},lt*1e3)};S.useEffect(function(){return rn},[]);var mt=S.useState(!1),Hn=je(mt,2),vn=Hn[0],et=Hn[1];pt(function(ke){(!ke||yt)&&et(!0)},[yt]);var xt=S.useState(null),Jt=je(xt,2),Wt=Jt[0],nn=Jt[1],Xi=S.useState(null),Wr=je(Xi,2),jr=Wr[0],on=Wr[1],Kr=function(De){on([De.clientX,De.clientY])},Zi=VR(yt,de,H&&jr!==null?jr:pe,z,R,N,ue),st=je(Zi,11),mi=st[0],Ps=st[1],vu=st[2],vi=st[3],Os=st[4],yu=st[5],ks=st[6],Ts=st[7],yi=st[8],xi=st[9],Ko=st[10],bi=$R(Se,c,d,u),qo=je(bi,2),Qi=qo[0],qr=qo[1],Un=Qi.has("click"),Wn=qr.has("click")||qr.has("contextMenu"),Kn=yr(function(){vn||Ko()}),Yo=function(){Ut.current&&H&&Wn&&or(!1)};HR(yt,pe,de,Kn,Yo),pt(function(){Kn()},[jr,z]),pt(function(){yt&&!(R!=null&&R[z])&&Kn()},[JSON.stringify(N)]);var xu=S.useMemo(function(){var ke=FR(R,a,xi,H);return _e(ke,W?.(xi))},[xi,W,R,a,H]);S.useImperativeHandle(n,function(){return{nativeElement:be.current,popupElement:Q.current,forceAlign:Kn}});var Ms=S.useState(0),Rs=je(Ms,2),As=Rs[0],bu=Rs[1],wu=S.useState(0),Is=je(wu,2),Cu=Is[0],Su=Is[1],Ns=function(){if(M&&pe){var De=pe.getBoundingClientRect();bu(De.width),Su(De.height)}},ju=function(){Ns(),Kn()},Eu=function(De){et(!1),Ko(),v?.(De)},Pu=function(){return new Promise(function(De){Ns(),nn(function(){return De})})};pt(function(){Wt&&(Ko(),Wt(),nn(null))},[Wt]);function an(ke,De,lt,Pt){Fe[ke]=function(vt){var _s;Pt?.(vt),or(De,lt);for(var Ru=arguments.length,qm=new Array(Ru>1?Ru-1:0),Bs=1;Bs<Ru;Bs++)qm[Bs-1]=arguments[Bs];(_s=Me[ke])===null||_s===void 0||_s.call.apply(_s,[Me,vt].concat(qm))}}(Un||Wn)&&(Fe.onClick=function(ke){var De;Ut.current&&Wn?or(!1):!Ut.current&&Un&&(Kr(ke),or(!0));for(var lt=arguments.length,Pt=new Array(lt>1?lt-1:0),vt=1;vt<lt;vt++)Pt[vt-1]=arguments[vt];(De=Me.onClick)===null||De===void 0||De.call.apply(De,[Me,ke].concat(Pt))});var Go=UR(yt,Wn,pe,de,P,C,Hr,or),Ou=Qi.has("hover"),Er=qr.has("hover"),Ji,Xo;Ou&&(an("onMouseEnter",!0,x,function(ke){Kr(ke)}),an("onPointerEnter",!0,x,function(ke){Kr(ke)}),Ji=function(De){(yt||vn)&&de!==null&&de!==void 0&&de.contains(De.target)&&or(!0,x)},H&&(Fe.onMouseMove=function(ke){var De;(De=Me.onMouseMove)===null||De===void 0||De.call(Me,ke)})),Er&&(an("onMouseLeave",!1,w),an("onPointerLeave",!1,w),Xo=function(){or(!1,w)}),Qi.has("focus")&&an("onFocus",!0,b),qr.has("focus")&&an("onBlur",!1,j),Qi.has("contextMenu")&&(Fe.onContextMenu=function(ke){var De;Ut.current&&qr.has("contextMenu")?or(!1):(Kr(ke),or(!0)),ke.preventDefault();for(var lt=arguments.length,Pt=new Array(lt>1?lt-1:0),vt=1;vt<lt;vt++)Pt[vt-1]=arguments[vt];(De=Me.onContextMenu)===null||De===void 0||De.call.apply(De,[Me,ke].concat(Pt))}),V&&(Fe.className=_e(Me.className,V));var yn=S.useRef(!1);yn.current||(yn.current=k||yt||vn);var qn=xe(xe({},Me),Fe),Zo={},Ds=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ds.forEach(function(ke){K[ke]&&(Zo[ke]=function(){for(var De,lt=arguments.length,Pt=new Array(lt),vt=0;vt<lt;vt++)Pt[vt]=arguments[vt];(De=qn[ke])===null||De===void 0||De.call.apply(De,[qn].concat(Pt)),K[ke].apply(K,Pt)})});var ku=S.cloneElement(se,xe(xe({},qn),Zo)),Tu={x:yu,y:ks},Mu=fe?xe({},fe!==!0?fe:{}):null;return S.createElement(S.Fragment,null,S.createElement(Ro,{disabled:!yt,ref:Be,onResize:ju},S.createElement(PC,{getTriggerDOMNode:oe},ku)),yn.current&&S.createElement(s0.Provider,{value:ne},S.createElement(EC,{portal:e,ref:Z,prefixCls:a,popup:L,className:_e(A,xu),style:B,target:pe,onMouseEnter:Ji,onMouseLeave:Xo,onPointerEnter:Ji,zIndex:I,open:yt,keepDom:vn,fresh:$,onClick:X,onPointerDownCapture:Go,mask:P,motion:tn,maskMotion:Yi,onVisibleChanged:Eu,onPrepare:Pu,forceRender:k,autoDestroy:ce,getPopupContainer:O,align:xi,arrow:Mu,arrowPos:Tu,ready:mi,offsetX:Ps,offsetY:vu,offsetR:vi,offsetB:Os,onAlign:Kn,stretch:M,targetWidth:As/Ts,targetHeight:Cu/yi})))});return process.env.NODE_ENV!=="production"&&(t.displayName="Trigger"),t}const qR=KR(Wh);var to={shiftX:64,adjustY:1},ro={adjustX:1,shiftY:!0},Or=[0,0],YR={left:{points:["cr","cl"],overflow:ro,offset:[-4,0],targetOffset:Or},right:{points:["cl","cr"],overflow:ro,offset:[4,0],targetOffset:Or},top:{points:["bc","tc"],overflow:to,offset:[0,-4],targetOffset:Or},bottom:{points:["tc","bc"],overflow:to,offset:[0,4],targetOffset:Or},topLeft:{points:["bl","tl"],overflow:to,offset:[0,-4],targetOffset:Or},leftTop:{points:["tr","tl"],overflow:ro,offset:[-4,0],targetOffset:Or},topRight:{points:["br","tr"],overflow:to,offset:[0,-4],targetOffset:Or},rightTop:{points:["tl","tr"],overflow:ro,offset:[4,0],targetOffset:Or},bottomRight:{points:["tr","br"],overflow:to,offset:[0,4],targetOffset:Or},rightBottom:{points:["bl","br"],overflow:ro,offset:[4,0],targetOffset:Or},bottomLeft:{points:["tl","bl"],overflow:to,offset:[0,4],targetOffset:Or},leftBottom:{points:["br","bl"],overflow:ro,offset:[-4,0],targetOffset:Or}},GR=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],XR=function(t,r){var n=t.overlayClassName,i=t.trigger,a=i===void 0?["hover"]:i,s=t.mouseEnterDelay,l=s===void 0?0:s,c=t.mouseLeaveDelay,d=c===void 0?.1:c,u=t.overlayStyle,f=t.prefixCls,h=f===void 0?"rc-tooltip":f,g=t.children,v=t.onVisibleChange,x=t.afterVisibleChange,y=t.transitionName,w=t.animation,b=t.motion,j=t.placement,P=j===void 0?"right":j,E=t.align,C=E===void 0?{}:E,O=t.destroyTooltipOnHide,k=O===void 0?!1:O,T=t.defaultVisible,D=t.getTooltipContainer,L=t.overlayInnerStyle,A=t.overlay,B=t.id,z=t.showArrow,F=z===void 0?!0:z,R=t.classNames,N=t.styles,I=Jr(t,GR),M=SC(B),W=m.useRef(null);m.useImperativeHandle(r,function(){return W.current});var $=xe({},I);"visible"in t&&($.popupVisible=t.visible);var H=function(){return S.createElement(wC,{key:"content",prefixCls:h,id:M,bodyClassName:R?.body,overlayInnerStyle:xe(xe({},L),N?.body)},A)},X=function(){var fe=S.Children.only(g),me=fe?.props||{},Pe=xe(xe({},me),{},{"aria-describedby":A?M:null});return S.cloneElement(g,Pe)};return S.createElement(qR,Mt({popupClassName:_e(n,R?.root),prefixCls:h,popup:H,action:a,builtinPlacements:YR,popupPlacement:P,ref:W,popupAlign:C,getPopupContainer:D,onPopupVisibleChange:v,afterPopupVisibleChange:x,popupTransitionName:y,popupAnimation:w,popupMotion:b,defaultPopupVisible:T,autoDestroy:k,mouseLeaveDelay:d,popupStyle:xe(xe({},u),N?.root),mouseEnterDelay:l,arrow:F},$),X())};const ZR=m.forwardRef(XR),La=S.createContext({});process.env.NODE_ENV!=="production"&&(La.displayName="FormItemInputContext");const QR=({children:e,status:t,override:r})=>{const n=S.useContext(La),i=S.useMemo(()=>{const a=Object.assign({},n);return r&&delete a.isFormItemInput,t&&(delete a.status,delete a.hasFeedback,delete a.feedbackIcon),a},[t,r,n]);return S.createElement(La.Provider,{value:i},e)},JR=S.createContext(void 0),OC=e=>{const t=m.useContext(xo);return m.useMemo(()=>e?typeof e=="string"?e??t:typeof e=="function"?e(t):t:t,[e,t])},kC=S.createContext(null),TC=(e,t)=>{const r=S.useContext(kC),n=S.useMemo(()=>{if(!r)return"";const{compactDirection:i,isFirstItem:a,isLastItem:s}=r,l=i==="vertical"?"-vertical-":"-";return _e(`${e}-compact${l}item`,{[`${e}-compact${l}first-item`]:a,[`${e}-compact${l}last-item`]:s,[`${e}-compact${l}item-rtl`]:t==="rtl"})},[e,t,r]);return{compactSize:r?.compactSize,compactDirection:r?.compactDirection,compactItemClassnames:n}},eA=e=>{const{children:t}=e;return S.createElement(kC.Provider,{value:null},t)},Op=e=>{const{space:t,form:r,children:n}=e;if(n==null)return null;let i=n;return r&&(i=m.createElement(QR,{override:!0,status:!0},i)),t&&(i=m.createElement(eA,null,i)),i},Kh=m.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kh.displayName="zIndexContext");const wn=100,tA=10,rA=wn*tA,nA=rA+wn,MC={Modal:wn,Drawer:wn,Popover:wn,Popconfirm:wn,Tooltip:wn,Tour:wn,FloatButton:wn},iA={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function oA(e){return e in MC}const aA=(e,t)=>{const[,r]=Io(),n=m.useContext(Kh),i=oA(e);let a;if(t!==void 0)a=[t,t];else{let s=n??0;i?s+=(n?0:r.zIndexPopupBase)+MC[e]:s+=iA[e],a=[n===void 0?t:s,s]}if(process.env.NODE_ENV!=="production"){const s=pn(e),l=r.zIndexPopupBase+nA,c=a[0]||0;process.env.NODE_ENV!=="production"&&s(t!==void 0||c<=l,"usage","`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.")}return a},sA=(e,t,r)=>r!==void 0?r:`${e}-${t}`;function lA(e){const{sizePopupArrow:t,borderRadiusXS:r,borderRadiusOuter:n}=e,i=t/2,a=0,s=i,l=n*1/Math.sqrt(2),c=i-n*(1-1/Math.sqrt(2)),d=i-r*(1/Math.sqrt(2)),u=n*(Math.sqrt(2)-1)+r*(1/Math.sqrt(2)),f=2*i-d,h=u,g=2*i-l,v=c,x=2*i-a,y=s,w=i*Math.sqrt(2)+n*(Math.sqrt(2)-2),b=n*(Math.sqrt(2)-1),j=`polygon(${b}px 100%, 50% ${b}px, ${2*i-b}px 100%, ${b}px 100%)`,P=`path('M ${a} ${s} A ${n} ${n} 0 0 0 ${l} ${c} L ${d} ${u} A ${r} ${r} 0 0 1 ${f} ${h} L ${g} ${v} A ${n} ${n} 0 0 0 ${x} ${y} Z')`;return{arrowShadowWidth:w,arrowPath:P,arrowPolygon:j}}const cA=(e,t,r)=>{const{sizePopupArrow:n,arrowPolygon:i,arrowPath:a,arrowShadowWidth:s,borderRadiusXS:l,calc:c}=e;return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:c(n).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Qe(l)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},RC=8;function AC(e){const{contentRadius:t,limitVerticalRadius:r}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:r?RC:n}}function qs(e,t){return e?t:{}}function uA(e,t,r){const{componentCls:n,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:s}=e,{arrowDistance:l=0,arrowPlacement:c={left:!0,right:!0,top:!0,bottom:!0}}={};return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({[`${n}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},cA(e,t,i)),{"&:before":{background:t}})]},qs(!!c.top,{[[`&-placement-top > ${n}-arrow`,`&-placement-topLeft > ${n}-arrow`,`&-placement-topRight > ${n}-arrow`].join(",")]:{bottom:l,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":s,[`> ${n}-arrow`]:{left:{_skip_check_:!0,value:s}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Qe(s)})`,[`> ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}}})),qs(!!c.bottom,{[[`&-placement-bottom > ${n}-arrow`,`&-placement-bottomLeft > ${n}-arrow`,`&-placement-bottomRight > ${n}-arrow`].join(",")]:{top:l,transform:"translateY(-100%)"},[`&-placement-bottom > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":s,[`> ${n}-arrow`]:{left:{_skip_check_:!0,value:s}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Qe(s)})`,[`> ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}}})),qs(!!c.left,{[[`&-placement-left > ${n}-arrow`,`&-placement-leftTop > ${n}-arrow`,`&-placement-leftBottom > ${n}-arrow`].join(",")]:{right:{_skip_check_:!0,value:l},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${n}-arrow`]:{top:a},[`&-placement-leftBottom > ${n}-arrow`]:{bottom:a}})),qs(!!c.right,{[[`&-placement-right > ${n}-arrow`,`&-placement-rightTop > ${n}-arrow`,`&-placement-rightBottom > ${n}-arrow`].join(",")]:{left:{_skip_check_:!0,value:l},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${n}-arrow`]:{top:a},[`&-placement-rightBottom > ${n}-arrow`]:{bottom:a}}))}}function dA(e,t,r,n){if(n===!1)return{adjustX:!1,adjustY:!1};const i=n&&typeof n=="object"?n:{},a={};switch(e){case"top":case"bottom":a.shiftX=t.arrowOffsetHorizontal*2+r,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=t.arrowOffsetVertical*2+r,a.shiftX=!0,a.adjustX=!0;break}const s=Object.assign(Object.assign({},a),i);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const h0={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},fA={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},pA=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function hA(e){const{arrowWidth:t,autoAdjustOverflow:r,arrowPointAtCenter:n,offset:i,borderRadius:a}=e,s=t/2,l={},c=AC({contentRadius:a,limitVerticalRadius:!0});return Object.keys(h0).forEach(d=>{const u=n&&fA[d]||h0[d],f=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(l[d]=f,pA.has(d)&&(f.autoArrow=!1),d){case"top":case"topLeft":case"topRight":f.offset[1]=-s-i;break;case"bottom":case"bottomLeft":case"bottomRight":f.offset[1]=s+i;break;case"left":case"leftTop":case"leftBottom":f.offset[0]=-s-i;break;case"right":case"rightTop":case"rightBottom":f.offset[0]=s+i;break}if(n)switch(d){case"topLeft":case"bottomLeft":f.offset[0]=-c.arrowOffsetHorizontal-s;break;case"topRight":case"bottomRight":f.offset[0]=c.arrowOffsetHorizontal+s;break;case"leftTop":case"rightTop":f.offset[1]=-c.arrowOffsetHorizontal*2+s;break;case"leftBottom":case"rightBottom":f.offset[1]=c.arrowOffsetHorizontal*2-s;break}f.overflow=dA(d,c,t,r),f.htmlRegion="visibleFirst"}),l}function gA(e){return e&&m.isValidElement(e)&&e.type===m.Fragment}const mA=(e,t,r)=>m.isValidElement(e)?m.cloneElement(e,typeof r=="function"?r(e.props||{}):r):t;function IC(e,t){return mA(e,e,t)}const vA=e=>({animationDuration:e,animationFillMode:"both"}),yA=e=>({animationDuration:e,animationFillMode:"both"}),xA=(e,t,r,n,i=!1)=>{const a=i?"&":"";return{[`
129
+ }`),i)}else Ta(i);return function(){Ta(i)}},[t,i])}var AR=!1;function IR(e){return AR}var i0=function(t){return t===!1?!1:!nr()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},Wh=S.forwardRef(function(e,t){var r=e.open,n=e.autoLock,i=e.getContainer,a=e.debug,s=e.autoDestroy,l=s===void 0?!0:s,c=e.children,d=S.useState(r),u=je(d,2),f=u[0],h=u[1],g=f||r;process.env.NODE_ENV!=="production"&&Nn(nr()||!r,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),S.useEffect(function(){(l||r)&&h(r)},[r,l]);var v=S.useState(function(){return i0(i)}),x=je(v,2),y=x[0],w=x[1];S.useEffect(function(){var A=i0(i);w(A??null)});var b=PR(g&&!y,a),j=je(b,2),P=j[0],E=j[1],C=y??P;RR(n&&r&&nr()&&(C===P||C===document.body));var O=null;if(c&&Tc(c)&&t){var k=c;O=k.ref}var T=Dh(O,t);if(!g||!nr()||y===void 0)return null;var D=C===!1||IR(),L=c;return t&&(L=S.cloneElement(c,{ref:T})),S.createElement(CC.Provider,{value:E},D?L:Oa.createPortal(L,C))});process.env.NODE_ENV!=="production"&&(Wh.displayName="Portal");function NR(){var e=xe({},S);return e.useId}var o0=0,a0=NR();const SC=a0?function(t){var r=a0();return t||(process.env.NODE_ENV==="test"?"test-id":r)}:function(t){var r=S.useState("ssr-id"),n=je(r,2),i=n[0],a=n[1];return S.useEffect(function(){var s=o0;o0+=1,a("rc_unique_".concat(s))},[]),t||(process.env.NODE_ENV==="test"?"test-id":i)},DR=(function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e?.substr(0,4))});function _R(e){var t=e.prefixCls,r=e.align,n=e.arrow,i=e.arrowPos,a=n||{},s=a.className,l=a.content,c=i.x,d=c===void 0?0:c,u=i.y,f=u===void 0?0:u,h=S.useRef();if(!r||!r.points)return null;var g={position:"absolute"};if(r.autoArrow!==!1){var v=r.points[0],x=r.points[1],y=v[0],w=v[1],b=x[0],j=x[1];y===b||!["t","b"].includes(y)?g.top=f:y==="t"?g.top=0:g.bottom=0,w===j||!["l","r"].includes(w)?g.left=d:w==="l"?g.left=0:g.right=0}return S.createElement("div",{ref:h,className:_e("".concat(t,"-arrow"),s),style:g},l)}function BR(e){var t=e.prefixCls,r=e.open,n=e.zIndex,i=e.mask,a=e.motion;return i?S.createElement(yC,Mt({},a,{motionAppear:!0,visible:r,removeOnLeave:!0}),function(s){var l=s.className;return S.createElement("div",{style:{zIndex:n},className:_e("".concat(t,"-mask"),l)})}):null}var jC=S.memo(function(e){var t=e.children;return t},function(e,t){return t.cache});process.env.NODE_ENV!=="production"&&(jC.displayName="PopupContent");var EC=S.forwardRef(function(e,t){var r=e.popup,n=e.className,i=e.prefixCls,a=e.style,s=e.target,l=e.onVisibleChanged,c=e.open,d=e.keepDom,u=e.fresh,f=e.onClick,h=e.mask,g=e.arrow,v=e.arrowPos,x=e.align,y=e.motion,w=e.maskMotion,b=e.forceRender,j=e.getPopupContainer,P=e.autoDestroy,E=e.portal,C=e.zIndex,O=e.onMouseEnter,k=e.onMouseLeave,T=e.onPointerEnter,D=e.onPointerDownCapture,L=e.ready,A=e.offsetX,B=e.offsetY,z=e.offsetR,F=e.offsetB,R=e.onAlign,N=e.onPrepare,I=e.stretch,M=e.targetWidth,W=e.targetHeight,$=typeof r=="function"?r():r,H=c||d,X=j?.length>0,ue=S.useState(!j||!X),fe=je(ue,2),me=fe[0],Pe=fe[1];if(pt(function(){!me&&X&&s&&Pe(!0)},[me,X,s]),!me)return null;var Ee="auto",J={left:"-1000vw",top:"-1000vh",right:Ee,bottom:Ee};if(L||!c){var ye,ge=x.points,V=x.dynamicInset||((ye=x._experimental)===null||ye===void 0?void 0:ye.dynamicInset),oe=V&&ge[0][1]==="r",K=V&&ge[0][0]==="b";oe?(J.right=z,J.left=Ee):(J.left=A,J.right=Ee),K?(J.bottom=F,J.top=Ee):(J.top=B,J.bottom=Ee)}var ce={};return I&&(I.includes("height")&&W?ce.height=W:I.includes("minHeight")&&W&&(ce.minHeight=W),I.includes("width")&&M?ce.width=M:I.includes("minWidth")&&M&&(ce.minWidth=M)),c||(ce.pointerEvents="none"),S.createElement(E,{open:b||H,getContainer:j&&function(){return j(s)},autoDestroy:P},S.createElement(BR,{prefixCls:i,open:c,zIndex:C,mask:h,motion:w}),S.createElement(Ro,{onResize:R,disabled:!c},function(he){return S.createElement(yC,Mt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(i,"-hidden")},y,{onAppearPrepare:N,onEnterPrepare:N,visible:c,onVisibleChanged:function(Se){var Te;y==null||(Te=y.onVisibleChanged)===null||Te===void 0||Te.call(y,Se),l(Se)}}),function(we,Se){var Te=we.className,Ne=we.style,U=_e(i,Te,n);return S.createElement("div",{ref:es(he,t,Se),className:U,style:xe(xe(xe(xe({"--arrow-x":"".concat(v.x||0,"px"),"--arrow-y":"".concat(v.y||0,"px")},J),ce),Ne),{},{boxSizing:"border-box",zIndex:C},a),onMouseEnter:O,onMouseLeave:k,onPointerEnter:T,onClick:f,onPointerDownCapture:D},g&&S.createElement(_R,{prefixCls:i,arrow:g,arrowPos:v,align:x}),S.createElement(jC,{cache:!c&&!u},$))})}))});process.env.NODE_ENV!=="production"&&(EC.displayName="Popup");var PC=S.forwardRef(function(e,t){var r=e.children,n=e.getTriggerDOMNode,i=Tc(r),a=S.useCallback(function(l){Nh(t,n?n(l):l)},[n]),s=Dh(a,_h(r));return i?S.cloneElement(r,{ref:s}):r});process.env.NODE_ENV!=="production"&&(PC.displayName="TriggerWrapper");var s0=S.createContext(null);function l0(e){return e?Array.isArray(e)?e:[e]:[]}function $R(e,t,r,n){return S.useMemo(function(){var i=l0(r??t),a=l0(n??t),s=new Set(i),l=new Set(a);return e&&(s.has("hover")&&(s.delete("hover"),s.add("click")),l.has("hover")&&(l.delete("hover"),l.add("click"))),[s,l]},[e,t,r,n])}const LR=(function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),r=t.width,n=t.height;if(r||n)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),a=i.width,s=i.height;if(a||s)return!0}}return!1});function zR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return r?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function FR(e,t,r,n){for(var i=r.points,a=Object.keys(e),s=0;s<a.length;s+=1){var l,c=a[s];if(zR((l=e[c])===null||l===void 0?void 0:l.points,i,n))return"".concat(t,"-placement-").concat(c)}return""}function c0(e,t,r,n){return t||(r?{motionName:"".concat(e,"-").concat(r)}:n?{motionName:n}:null)}function as(e){return e.ownerDocument.defaultView}function Pp(e){for(var t=[],r=e?.parentElement,n=["hidden","scroll","clip","auto"];r;){var i=as(r).getComputedStyle(r),a=i.overflowX,s=i.overflowY,l=i.overflow;[a,s,l].some(function(c){return n.includes(c)})&&t.push(r),r=r.parentElement}return t}function $a(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function sa(e){return $a(parseFloat(e),0)}function u0(e,t){var r=xe({},e);return(t||[]).forEach(function(n){if(!(n instanceof HTMLBodyElement||n instanceof HTMLHtmlElement)){var i=as(n).getComputedStyle(n),a=i.overflow,s=i.overflowClipMargin,l=i.borderTopWidth,c=i.borderBottomWidth,d=i.borderLeftWidth,u=i.borderRightWidth,f=n.getBoundingClientRect(),h=n.offsetHeight,g=n.clientHeight,v=n.offsetWidth,x=n.clientWidth,y=sa(l),w=sa(c),b=sa(d),j=sa(u),P=$a(Math.round(f.width/v*1e3)/1e3),E=$a(Math.round(f.height/h*1e3)/1e3),C=(v-x-b-j)*P,O=(h-g-y-w)*E,k=y*E,T=w*E,D=b*P,L=j*P,A=0,B=0;if(a==="clip"){var z=sa(s);A=z*P,B=z*E}var F=f.x+D-A,R=f.y+k-B,N=F+f.width+2*A-D-L-C,I=R+f.height+2*B-k-T-O;r.left=Math.max(r.left,F),r.top=Math.max(r.top,R),r.right=Math.min(r.right,N),r.bottom=Math.min(r.bottom,I)}}),r}function d0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r="".concat(t),n=r.match(/^(.*)\%$/);return n?e*(parseFloat(n[1])/100):parseFloat(r)}function f0(e,t){var r=t||[],n=je(r,2),i=n[0],a=n[1];return[d0(e.width,i),d0(e.height,a)]}function p0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function eo(e,t){var r=t[0],n=t[1],i,a;return r==="t"?a=e.y:r==="b"?a=e.y+e.height:a=e.y+e.height/2,n==="l"?i=e.x:n==="r"?i=e.x+e.width:i=e.x+e.width/2,{x:i,y:a}}function Yn(e,t){var r={t:"b",b:"t",l:"r",r:"l"};return e.map(function(n,i){return i===t?r[n]||"c":n}).join("")}function VR(e,t,r,n,i,a,s){var l=S.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[n]||{}}),c=je(l,2),d=c[0],u=c[1],f=S.useRef(0),h=S.useMemo(function(){return t?Pp(t):[]},[t]),g=S.useRef({}),v=function(){g.current={}};e||v();var x=yr(function(){if(t&&r&&e){let Er=function(Xo,yn){var qn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te,Zo=H.x+Xo,Ds=H.y+yn,ku=Zo+K,Tu=Ds+oe,Mu=Math.max(Zo,qn.left),ke=Math.max(Ds,qn.top),De=Math.min(ku,qn.right),lt=Math.min(Tu,qn.bottom);return Math.max(0,(De-Mu)*(lt-ke))},Ji=function(){Wr=H.y+qe,jr=Wr+oe,on=H.x+Xe,Kr=on+K};var b,j,P,E,C=t,O=C.ownerDocument,k=as(C),T=k.getComputedStyle(C),D=T.position,L=C.style.left,A=C.style.top,B=C.style.right,z=C.style.bottom,F=C.style.overflow,R=xe(xe({},i[n]),a),N=O.createElement("div");(b=C.parentElement)===null||b===void 0||b.appendChild(N),N.style.left="".concat(C.offsetLeft,"px"),N.style.top="".concat(C.offsetTop,"px"),N.style.position=D,N.style.height="".concat(C.offsetHeight,"px"),N.style.width="".concat(C.offsetWidth,"px"),C.style.left="0",C.style.top="0",C.style.right="auto",C.style.bottom="auto",C.style.overflow="hidden";var I;if(Array.isArray(r))I={x:r[0],y:r[1],width:0,height:0};else{var M,W,$=r.getBoundingClientRect();$.x=(M=$.x)!==null&&M!==void 0?M:$.left,$.y=(W=$.y)!==null&&W!==void 0?W:$.top,I={x:$.x,y:$.y,width:$.width,height:$.height}}var H=C.getBoundingClientRect(),X=k.getComputedStyle(C),ue=X.height,fe=X.width;H.x=(j=H.x)!==null&&j!==void 0?j:H.left,H.y=(P=H.y)!==null&&P!==void 0?P:H.top;var me=O.documentElement,Pe=me.clientWidth,Ee=me.clientHeight,J=me.scrollWidth,ye=me.scrollHeight,ge=me.scrollTop,V=me.scrollLeft,oe=H.height,K=H.width,ce=I.height,he=I.width,we={left:0,top:0,right:Pe,bottom:Ee},Se={left:-V,top:-ge,right:J-V,bottom:ye-ge},Te=R.htmlRegion,Ne="visible",U="visibleFirst";Te!=="scroll"&&Te!==U&&(Te=Ne);var ne=Te===U,re=u0(Se,h),G=u0(we,h),te=Te===Ne?G:re,de=ne?G:te;C.style.left="auto",C.style.top="auto",C.style.right="0",C.style.bottom="0";var q=C.getBoundingClientRect();C.style.left=L,C.style.top=A,C.style.right=B,C.style.bottom=z,C.style.overflow=F,(E=C.parentElement)===null||E===void 0||E.removeChild(N);var Q=$a(Math.round(K/parseFloat(fe)*1e3)/1e3),Z=$a(Math.round(oe/parseFloat(ue)*1e3)/1e3);if(Q===0||Z===0||Ra(r)&&!LR(r))return;var le=R.offset,ie=R.targetOffset,pe=f0(H,le),ve=je(pe,2),be=ve[0],Be=ve[1],ae=f0(I,ie),Me=je(ae,2),Fe=Me[0],Hr=Me[1];I.x-=Fe,I.y-=Hr;var tn=R.points||[],Yi=je(tn,2),Wo=Yi[0],Gi=Yi[1],Ur=p0(Gi),Ht=p0(Wo),yt=eo(I,Ur),mn=eo(H,Ht),Ut=xe({},R),Xe=yt.x-mn.x+be,qe=yt.y-mn.y+Be,Dt=Er(Xe,qe),rn=Er(Xe,qe,G),or=eo(I,["t","l"]),mt=eo(H,["t","l"]),Hn=eo(I,["b","r"]),vn=eo(H,["b","r"]),et=R.overflow||{},xt=et.adjustX,Jt=et.adjustY,Wt=et.shiftX,nn=et.shiftY,Xi=function(yn){return typeof yn=="boolean"?yn:yn>=0},Wr,jr,on,Kr;Ji();var Zi=Xi(Jt),st=Ht[0]===Ur[0];if(Zi&&Ht[0]==="t"&&(jr>de.bottom||g.current.bt)){var mi=qe;st?mi-=oe-ce:mi=or.y-vn.y-Be;var Ps=Er(Xe,mi),vu=Er(Xe,mi,G);Ps>Dt||Ps===Dt&&(!ne||vu>=rn)?(g.current.bt=!0,qe=mi,Be=-Be,Ut.points=[Yn(Ht,0),Yn(Ur,0)]):g.current.bt=!1}if(Zi&&Ht[0]==="b"&&(Wr<de.top||g.current.tb)){var vi=qe;st?vi+=oe-ce:vi=Hn.y-mt.y-Be;var Os=Er(Xe,vi),yu=Er(Xe,vi,G);Os>Dt||Os===Dt&&(!ne||yu>=rn)?(g.current.tb=!0,qe=vi,Be=-Be,Ut.points=[Yn(Ht,0),Yn(Ur,0)]):g.current.tb=!1}var ks=Xi(xt),Ts=Ht[1]===Ur[1];if(ks&&Ht[1]==="l"&&(Kr>de.right||g.current.rl)){var yi=Xe;Ts?yi-=K-he:yi=or.x-vn.x-be;var xi=Er(yi,qe),Ko=Er(yi,qe,G);xi>Dt||xi===Dt&&(!ne||Ko>=rn)?(g.current.rl=!0,Xe=yi,be=-be,Ut.points=[Yn(Ht,1),Yn(Ur,1)]):g.current.rl=!1}if(ks&&Ht[1]==="r"&&(on<de.left||g.current.lr)){var bi=Xe;Ts?bi+=K-he:bi=Hn.x-mt.x-be;var qo=Er(bi,qe),Qi=Er(bi,qe,G);qo>Dt||qo===Dt&&(!ne||Qi>=rn)?(g.current.lr=!0,Xe=bi,be=-be,Ut.points=[Yn(Ht,1),Yn(Ur,1)]):g.current.lr=!1}Ji();var qr=Wt===!0?0:Wt;typeof qr=="number"&&(on<G.left&&(Xe-=on-G.left-be,I.x+he<G.left+qr&&(Xe+=I.x-G.left+he-qr)),Kr>G.right&&(Xe-=Kr-G.right-be,I.x>G.right-qr&&(Xe+=I.x-G.right+qr)));var Un=nn===!0?0:nn;typeof Un=="number"&&(Wr<G.top&&(qe-=Wr-G.top-Be,I.y+ce<G.top+Un&&(qe+=I.y-G.top+ce-Un)),jr>G.bottom&&(qe-=jr-G.bottom-Be,I.y>G.bottom-Un&&(qe+=I.y-G.bottom+Un)));var Wn=H.x+Xe,Kn=Wn+K,Yo=H.y+qe,xu=Yo+oe,Ms=I.x,Rs=Ms+he,As=I.y,bu=As+ce,wu=Math.max(Wn,Ms),Is=Math.min(Kn,Rs),Cu=(wu+Is)/2,Su=Cu-Wn,Ns=Math.max(Yo,As),ju=Math.min(xu,bu),Eu=(Ns+ju)/2,Pu=Eu-Yo;s?.(t,Ut);var an=q.right-H.x-(Xe+H.width),Go=q.bottom-H.y-(qe+H.height);Q===1&&(Xe=Math.round(Xe),an=Math.round(an)),Z===1&&(qe=Math.round(qe),Go=Math.round(Go));var Ou={ready:!0,offsetX:Xe/Q,offsetY:qe/Z,offsetR:an/Q,offsetB:Go/Z,arrowX:Su/Q,arrowY:Pu/Z,scaleX:Q,scaleY:Z,align:Ut};u(Ou)}}),y=function(){f.current+=1;var j=f.current;Promise.resolve().then(function(){f.current===j&&x()})},w=function(){u(function(j){return xe(xe({},j),{},{ready:!1})})};return pt(w,[n]),pt(function(){e||w()},[e]),[d.ready,d.offsetX,d.offsetY,d.offsetR,d.offsetB,d.arrowX,d.arrowY,d.scaleX,d.scaleY,d.align,y]}function HR(e,t,r,n,i){pt(function(){if(e&&t&&r){let f=function(){n(),i()};var a=t,s=r,l=Pp(a),c=Pp(s),d=as(s),u=new Set([d].concat(zt(l),zt(c)));return u.forEach(function(h){h.addEventListener("scroll",f,{passive:!0})}),d.addEventListener("resize",f,{passive:!0}),n(),function(){u.forEach(function(h){h.removeEventListener("scroll",f),d.removeEventListener("resize",f)})}}},[e,t,r])}function UR(e,t,r,n,i,a,s,l){var c=S.useRef(e);c.current=e;var d=S.useRef(!1);S.useEffect(function(){if(t&&n&&(!i||a)){var f=function(){d.current=!1},h=function(P){var E;c.current&&!s(((E=P.composedPath)===null||E===void 0||(E=E.call(P))===null||E===void 0?void 0:E[0])||P.target)&&!d.current&&l(!1)},g=as(n);g.addEventListener("pointerdown",f,!0),g.addEventListener("mousedown",h,!0),g.addEventListener("contextmenu",h,!0);var v=$l(r);if(v&&(v.addEventListener("mousedown",h,!0),v.addEventListener("contextmenu",h,!0)),process.env.NODE_ENV!=="production"){var x,y,w=r==null||(x=r.getRootNode)===null||x===void 0?void 0:x.call(r),b=(y=n.getRootNode)===null||y===void 0?void 0:y.call(n);po(w===b,"trigger element and popup element should in same shadow root.")}return function(){g.removeEventListener("pointerdown",f,!0),g.removeEventListener("mousedown",h,!0),g.removeEventListener("contextmenu",h,!0),v&&(v.removeEventListener("mousedown",h,!0),v.removeEventListener("contextmenu",h,!0))}}},[t,r,n,i,a]);function u(){d.current=!0}return u}var WR=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function KR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wh,t=S.forwardRef(function(r,n){var i=r.prefixCls,a=i===void 0?"rc-trigger-popup":i,s=r.children,l=r.action,c=l===void 0?"hover":l,d=r.showAction,u=r.hideAction,f=r.popupVisible,h=r.defaultPopupVisible,g=r.onPopupVisibleChange,v=r.afterPopupVisibleChange,x=r.mouseEnterDelay,y=r.mouseLeaveDelay,w=y===void 0?.1:y,b=r.focusDelay,j=r.blurDelay,P=r.mask,E=r.maskClosable,C=E===void 0?!0:E,O=r.getPopupContainer,k=r.forceRender,T=r.autoDestroy,D=r.destroyPopupOnHide,L=r.popup,A=r.popupClassName,B=r.popupStyle,z=r.popupPlacement,F=r.builtinPlacements,R=F===void 0?{}:F,N=r.popupAlign,I=r.zIndex,M=r.stretch,W=r.getPopupClassNameFromAlign,$=r.fresh,H=r.alignPoint,X=r.onPopupClick,ue=r.onPopupAlign,fe=r.arrow,me=r.popupMotion,Pe=r.maskMotion,Ee=r.popupTransitionName,J=r.popupAnimation,ye=r.maskTransitionName,ge=r.maskAnimation,V=r.className,oe=r.getTriggerDOMNode,K=Jr(r,WR),ce=T||D||!1,he=S.useState(!1),we=je(he,2),Se=we[0],Te=we[1];pt(function(){Te(DR())},[]);var Ne=S.useRef({}),U=S.useContext(s0),ne=S.useMemo(function(){return{registerSubPopup:function(De,lt){Ne.current[De]=lt,U?.registerSubPopup(De,lt)}}},[U]),re=SC(),G=S.useState(null),te=je(G,2),de=te[0],q=te[1],Q=S.useRef(null),Z=yr(function(ke){Q.current=ke,Ra(ke)&&de!==ke&&q(ke),U?.registerSubPopup(re,ke)}),le=S.useState(null),ie=je(le,2),pe=ie[0],ve=ie[1],be=S.useRef(null),Be=yr(function(ke){Ra(ke)&&pe!==ke&&(ve(ke),be.current=ke)}),ae=S.Children.only(s),Me=ae?.props||{},Fe={},Hr=yr(function(ke){var De,lt,Pt=pe;return Pt?.contains(ke)||((De=$l(Pt))===null||De===void 0?void 0:De.host)===ke||ke===Pt||de?.contains(ke)||((lt=$l(de))===null||lt===void 0?void 0:lt.host)===ke||ke===de||Object.values(Ne.current).some(function(vt){return vt?.contains(ke)||ke===vt})}),tn=c0(a,me,J,Ee),Yi=c0(a,Pe,ge,ye),Wo=S.useState(h||!1),Gi=je(Wo,2),Ur=Gi[0],Ht=Gi[1],yt=f??Ur,mn=yr(function(ke){f===void 0&&Ht(ke)});pt(function(){Ht(f||!1)},[f]);var Ut=S.useRef(yt);Ut.current=yt;var Xe=S.useRef([]);Xe.current=[];var qe=yr(function(ke){var De;mn(ke),((De=Xe.current[Xe.current.length-1])!==null&&De!==void 0?De:yt)!==ke&&(Xe.current.push(ke),g?.(ke))}),Dt=S.useRef(),rn=function(){clearTimeout(Dt.current)},or=function(De){var lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;rn(),lt===0?qe(De):Dt.current=setTimeout(function(){qe(De)},lt*1e3)};S.useEffect(function(){return rn},[]);var mt=S.useState(!1),Hn=je(mt,2),vn=Hn[0],et=Hn[1];pt(function(ke){(!ke||yt)&&et(!0)},[yt]);var xt=S.useState(null),Jt=je(xt,2),Wt=Jt[0],nn=Jt[1],Xi=S.useState(null),Wr=je(Xi,2),jr=Wr[0],on=Wr[1],Kr=function(De){on([De.clientX,De.clientY])},Zi=VR(yt,de,H&&jr!==null?jr:pe,z,R,N,ue),st=je(Zi,11),mi=st[0],Ps=st[1],vu=st[2],vi=st[3],Os=st[4],yu=st[5],ks=st[6],Ts=st[7],yi=st[8],xi=st[9],Ko=st[10],bi=$R(Se,c,d,u),qo=je(bi,2),Qi=qo[0],qr=qo[1],Un=Qi.has("click"),Wn=qr.has("click")||qr.has("contextMenu"),Kn=yr(function(){vn||Ko()}),Yo=function(){Ut.current&&H&&Wn&&or(!1)};HR(yt,pe,de,Kn,Yo),pt(function(){Kn()},[jr,z]),pt(function(){yt&&!(R!=null&&R[z])&&Kn()},[JSON.stringify(N)]);var xu=S.useMemo(function(){var ke=FR(R,a,xi,H);return _e(ke,W?.(xi))},[xi,W,R,a,H]);S.useImperativeHandle(n,function(){return{nativeElement:be.current,popupElement:Q.current,forceAlign:Kn}});var Ms=S.useState(0),Rs=je(Ms,2),As=Rs[0],bu=Rs[1],wu=S.useState(0),Is=je(wu,2),Cu=Is[0],Su=Is[1],Ns=function(){if(M&&pe){var De=pe.getBoundingClientRect();bu(De.width),Su(De.height)}},ju=function(){Ns(),Kn()},Eu=function(De){et(!1),Ko(),v?.(De)},Pu=function(){return new Promise(function(De){Ns(),nn(function(){return De})})};pt(function(){Wt&&(Ko(),Wt(),nn(null))},[Wt]);function an(ke,De,lt,Pt){Fe[ke]=function(vt){var _s;Pt?.(vt),or(De,lt);for(var Ru=arguments.length,qm=new Array(Ru>1?Ru-1:0),Bs=1;Bs<Ru;Bs++)qm[Bs-1]=arguments[Bs];(_s=Me[ke])===null||_s===void 0||_s.call.apply(_s,[Me,vt].concat(qm))}}(Un||Wn)&&(Fe.onClick=function(ke){var De;Ut.current&&Wn?or(!1):!Ut.current&&Un&&(Kr(ke),or(!0));for(var lt=arguments.length,Pt=new Array(lt>1?lt-1:0),vt=1;vt<lt;vt++)Pt[vt-1]=arguments[vt];(De=Me.onClick)===null||De===void 0||De.call.apply(De,[Me,ke].concat(Pt))});var Go=UR(yt,Wn,pe,de,P,C,Hr,or),Ou=Qi.has("hover"),Er=qr.has("hover"),Ji,Xo;Ou&&(an("onMouseEnter",!0,x,function(ke){Kr(ke)}),an("onPointerEnter",!0,x,function(ke){Kr(ke)}),Ji=function(De){(yt||vn)&&de!==null&&de!==void 0&&de.contains(De.target)&&or(!0,x)},H&&(Fe.onMouseMove=function(ke){var De;(De=Me.onMouseMove)===null||De===void 0||De.call(Me,ke)})),Er&&(an("onMouseLeave",!1,w),an("onPointerLeave",!1,w),Xo=function(){or(!1,w)}),Qi.has("focus")&&an("onFocus",!0,b),qr.has("focus")&&an("onBlur",!1,j),Qi.has("contextMenu")&&(Fe.onContextMenu=function(ke){var De;Ut.current&&qr.has("contextMenu")?or(!1):(Kr(ke),or(!0)),ke.preventDefault();for(var lt=arguments.length,Pt=new Array(lt>1?lt-1:0),vt=1;vt<lt;vt++)Pt[vt-1]=arguments[vt];(De=Me.onContextMenu)===null||De===void 0||De.call.apply(De,[Me,ke].concat(Pt))}),V&&(Fe.className=_e(Me.className,V));var yn=S.useRef(!1);yn.current||(yn.current=k||yt||vn);var qn=xe(xe({},Me),Fe),Zo={},Ds=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Ds.forEach(function(ke){K[ke]&&(Zo[ke]=function(){for(var De,lt=arguments.length,Pt=new Array(lt),vt=0;vt<lt;vt++)Pt[vt]=arguments[vt];(De=qn[ke])===null||De===void 0||De.call.apply(De,[qn].concat(Pt)),K[ke].apply(K,Pt)})});var ku=S.cloneElement(ae,xe(xe({},qn),Zo)),Tu={x:yu,y:ks},Mu=fe?xe({},fe!==!0?fe:{}):null;return S.createElement(S.Fragment,null,S.createElement(Ro,{disabled:!yt,ref:Be,onResize:ju},S.createElement(PC,{getTriggerDOMNode:oe},ku)),yn.current&&S.createElement(s0.Provider,{value:ne},S.createElement(EC,{portal:e,ref:Z,prefixCls:a,popup:L,className:_e(A,xu),style:B,target:pe,onMouseEnter:Ji,onMouseLeave:Xo,onPointerEnter:Ji,zIndex:I,open:yt,keepDom:vn,fresh:$,onClick:X,onPointerDownCapture:Go,mask:P,motion:tn,maskMotion:Yi,onVisibleChanged:Eu,onPrepare:Pu,forceRender:k,autoDestroy:ce,getPopupContainer:O,align:xi,arrow:Mu,arrowPos:Tu,ready:mi,offsetX:Ps,offsetY:vu,offsetR:vi,offsetB:Os,onAlign:Kn,stretch:M,targetWidth:As/Ts,targetHeight:Cu/yi})))});return process.env.NODE_ENV!=="production"&&(t.displayName="Trigger"),t}const qR=KR(Wh);var to={shiftX:64,adjustY:1},ro={adjustX:1,shiftY:!0},Or=[0,0],YR={left:{points:["cr","cl"],overflow:ro,offset:[-4,0],targetOffset:Or},right:{points:["cl","cr"],overflow:ro,offset:[4,0],targetOffset:Or},top:{points:["bc","tc"],overflow:to,offset:[0,-4],targetOffset:Or},bottom:{points:["tc","bc"],overflow:to,offset:[0,4],targetOffset:Or},topLeft:{points:["bl","tl"],overflow:to,offset:[0,-4],targetOffset:Or},leftTop:{points:["tr","tl"],overflow:ro,offset:[-4,0],targetOffset:Or},topRight:{points:["br","tr"],overflow:to,offset:[0,-4],targetOffset:Or},rightTop:{points:["tl","tr"],overflow:ro,offset:[4,0],targetOffset:Or},bottomRight:{points:["tr","br"],overflow:to,offset:[0,4],targetOffset:Or},rightBottom:{points:["bl","br"],overflow:ro,offset:[4,0],targetOffset:Or},bottomLeft:{points:["tl","bl"],overflow:to,offset:[0,4],targetOffset:Or},leftBottom:{points:["br","bl"],overflow:ro,offset:[-4,0],targetOffset:Or}},GR=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],XR=function(t,r){var n=t.overlayClassName,i=t.trigger,a=i===void 0?["hover"]:i,s=t.mouseEnterDelay,l=s===void 0?0:s,c=t.mouseLeaveDelay,d=c===void 0?.1:c,u=t.overlayStyle,f=t.prefixCls,h=f===void 0?"rc-tooltip":f,g=t.children,v=t.onVisibleChange,x=t.afterVisibleChange,y=t.transitionName,w=t.animation,b=t.motion,j=t.placement,P=j===void 0?"right":j,E=t.align,C=E===void 0?{}:E,O=t.destroyTooltipOnHide,k=O===void 0?!1:O,T=t.defaultVisible,D=t.getTooltipContainer,L=t.overlayInnerStyle,A=t.overlay,B=t.id,z=t.showArrow,F=z===void 0?!0:z,R=t.classNames,N=t.styles,I=Jr(t,GR),M=SC(B),W=m.useRef(null);m.useImperativeHandle(r,function(){return W.current});var $=xe({},I);"visible"in t&&($.popupVisible=t.visible);var H=function(){return S.createElement(wC,{key:"content",prefixCls:h,id:M,bodyClassName:R?.body,overlayInnerStyle:xe(xe({},L),N?.body)},A)},X=function(){var fe=S.Children.only(g),me=fe?.props||{},Pe=xe(xe({},me),{},{"aria-describedby":A?M:null});return S.cloneElement(g,Pe)};return S.createElement(qR,Mt({popupClassName:_e(n,R?.root),prefixCls:h,popup:H,action:a,builtinPlacements:YR,popupPlacement:P,ref:W,popupAlign:C,getPopupContainer:D,onPopupVisibleChange:v,afterPopupVisibleChange:x,popupTransitionName:y,popupAnimation:w,popupMotion:b,defaultPopupVisible:T,autoDestroy:k,mouseLeaveDelay:d,popupStyle:xe(xe({},u),N?.root),mouseEnterDelay:l,arrow:F},$),X())};const ZR=m.forwardRef(XR),La=S.createContext({});process.env.NODE_ENV!=="production"&&(La.displayName="FormItemInputContext");const QR=({children:e,status:t,override:r})=>{const n=S.useContext(La),i=S.useMemo(()=>{const a=Object.assign({},n);return r&&delete a.isFormItemInput,t&&(delete a.status,delete a.hasFeedback,delete a.feedbackIcon),a},[t,r,n]);return S.createElement(La.Provider,{value:i},e)},JR=S.createContext(void 0),OC=e=>{const t=m.useContext(xo);return m.useMemo(()=>e?typeof e=="string"?e??t:typeof e=="function"?e(t):t:t,[e,t])},kC=S.createContext(null),TC=(e,t)=>{const r=S.useContext(kC),n=S.useMemo(()=>{if(!r)return"";const{compactDirection:i,isFirstItem:a,isLastItem:s}=r,l=i==="vertical"?"-vertical-":"-";return _e(`${e}-compact${l}item`,{[`${e}-compact${l}first-item`]:a,[`${e}-compact${l}last-item`]:s,[`${e}-compact${l}item-rtl`]:t==="rtl"})},[e,t,r]);return{compactSize:r?.compactSize,compactDirection:r?.compactDirection,compactItemClassnames:n}},eA=e=>{const{children:t}=e;return S.createElement(kC.Provider,{value:null},t)},Op=e=>{const{space:t,form:r,children:n}=e;if(n==null)return null;let i=n;return r&&(i=m.createElement(QR,{override:!0,status:!0},i)),t&&(i=m.createElement(eA,null,i)),i},Kh=m.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kh.displayName="zIndexContext");const wn=100,tA=10,rA=wn*tA,nA=rA+wn,MC={Modal:wn,Drawer:wn,Popover:wn,Popconfirm:wn,Tooltip:wn,Tour:wn,FloatButton:wn},iA={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1};function oA(e){return e in MC}const aA=(e,t)=>{const[,r]=Io(),n=m.useContext(Kh),i=oA(e);let a;if(t!==void 0)a=[t,t];else{let s=n??0;i?s+=(n?0:r.zIndexPopupBase)+MC[e]:s+=iA[e],a=[n===void 0?t:s,s]}if(process.env.NODE_ENV!=="production"){const s=pn(e),l=r.zIndexPopupBase+nA,c=a[0]||0;process.env.NODE_ENV!=="production"&&s(t!==void 0||c<=l,"usage","`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.")}return a},sA=(e,t,r)=>r!==void 0?r:`${e}-${t}`;function lA(e){const{sizePopupArrow:t,borderRadiusXS:r,borderRadiusOuter:n}=e,i=t/2,a=0,s=i,l=n*1/Math.sqrt(2),c=i-n*(1-1/Math.sqrt(2)),d=i-r*(1/Math.sqrt(2)),u=n*(Math.sqrt(2)-1)+r*(1/Math.sqrt(2)),f=2*i-d,h=u,g=2*i-l,v=c,x=2*i-a,y=s,w=i*Math.sqrt(2)+n*(Math.sqrt(2)-2),b=n*(Math.sqrt(2)-1),j=`polygon(${b}px 100%, 50% ${b}px, ${2*i-b}px 100%, ${b}px 100%)`,P=`path('M ${a} ${s} A ${n} ${n} 0 0 0 ${l} ${c} L ${d} ${u} A ${r} ${r} 0 0 1 ${f} ${h} L ${g} ${v} A ${n} ${n} 0 0 0 ${x} ${y} Z')`;return{arrowShadowWidth:w,arrowPath:P,arrowPolygon:j}}const cA=(e,t,r)=>{const{sizePopupArrow:n,arrowPolygon:i,arrowPath:a,arrowShadowWidth:s,borderRadiusXS:l,calc:c}=e;return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:c(n).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Qe(l)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},RC=8;function AC(e){const{contentRadius:t,limitVerticalRadius:r}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:r?RC:n}}function qs(e,t){return e?t:{}}function uA(e,t,r){const{componentCls:n,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:s}=e,{arrowDistance:l=0,arrowPlacement:c={left:!0,right:!0,top:!0,bottom:!0}}={};return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({[`${n}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},cA(e,t,i)),{"&:before":{background:t}})]},qs(!!c.top,{[[`&-placement-top > ${n}-arrow`,`&-placement-topLeft > ${n}-arrow`,`&-placement-topRight > ${n}-arrow`].join(",")]:{bottom:l,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":s,[`> ${n}-arrow`]:{left:{_skip_check_:!0,value:s}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${Qe(s)})`,[`> ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}}})),qs(!!c.bottom,{[[`&-placement-bottom > ${n}-arrow`,`&-placement-bottomLeft > ${n}-arrow`,`&-placement-bottomRight > ${n}-arrow`].join(",")]:{top:l,transform:"translateY(-100%)"},[`&-placement-bottom > ${n}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":s,[`> ${n}-arrow`]:{left:{_skip_check_:!0,value:s}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${Qe(s)})`,[`> ${n}-arrow`]:{right:{_skip_check_:!0,value:s}}}})),qs(!!c.left,{[[`&-placement-left > ${n}-arrow`,`&-placement-leftTop > ${n}-arrow`,`&-placement-leftBottom > ${n}-arrow`].join(",")]:{right:{_skip_check_:!0,value:l},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${n}-arrow`]:{top:a},[`&-placement-leftBottom > ${n}-arrow`]:{bottom:a}})),qs(!!c.right,{[[`&-placement-right > ${n}-arrow`,`&-placement-rightTop > ${n}-arrow`,`&-placement-rightBottom > ${n}-arrow`].join(",")]:{left:{_skip_check_:!0,value:l},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${n}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${n}-arrow`]:{top:a},[`&-placement-rightBottom > ${n}-arrow`]:{bottom:a}}))}}function dA(e,t,r,n){if(n===!1)return{adjustX:!1,adjustY:!1};const i=n&&typeof n=="object"?n:{},a={};switch(e){case"top":case"bottom":a.shiftX=t.arrowOffsetHorizontal*2+r,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=t.arrowOffsetVertical*2+r,a.shiftX=!0,a.adjustX=!0;break}const s=Object.assign(Object.assign({},a),i);return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const h0={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},fA={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},pA=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function hA(e){const{arrowWidth:t,autoAdjustOverflow:r,arrowPointAtCenter:n,offset:i,borderRadius:a}=e,s=t/2,l={},c=AC({contentRadius:a,limitVerticalRadius:!0});return Object.keys(h0).forEach(d=>{const u=n&&fA[d]||h0[d],f=Object.assign(Object.assign({},u),{offset:[0,0],dynamicInset:!0});switch(l[d]=f,pA.has(d)&&(f.autoArrow=!1),d){case"top":case"topLeft":case"topRight":f.offset[1]=-s-i;break;case"bottom":case"bottomLeft":case"bottomRight":f.offset[1]=s+i;break;case"left":case"leftTop":case"leftBottom":f.offset[0]=-s-i;break;case"right":case"rightTop":case"rightBottom":f.offset[0]=s+i;break}if(n)switch(d){case"topLeft":case"bottomLeft":f.offset[0]=-c.arrowOffsetHorizontal-s;break;case"topRight":case"bottomRight":f.offset[0]=c.arrowOffsetHorizontal+s;break;case"leftTop":case"rightTop":f.offset[1]=-c.arrowOffsetHorizontal*2+s;break;case"leftBottom":case"rightBottom":f.offset[1]=c.arrowOffsetHorizontal*2-s;break}f.overflow=dA(d,c,t,r),f.htmlRegion="visibleFirst"}),l}function gA(e){return e&&m.isValidElement(e)&&e.type===m.Fragment}const mA=(e,t,r)=>m.isValidElement(e)?m.cloneElement(e,typeof r=="function"?r(e.props||{}):r):t;function IC(e,t){return mA(e,e,t)}const vA=e=>({animationDuration:e,animationFillMode:"both"}),yA=e=>({animationDuration:e,animationFillMode:"both"}),xA=(e,t,r,n,i=!1)=>{const a=i?"&":"";return{[`
130
130
  ${a}${e}-enter,
131
131
  ${a}${e}-appear
132
132
  `]:Object.assign(Object.assign({},vA(n)),{animationPlayState:"paused"}),[`${a}${e}-leave`]:Object.assign(Object.assign({},yA(n)),{animationPlayState:"paused"}),[`
@@ -146,7 +146,7 @@ html body {
146
146
  top:0 !important;
147
147
  right:0 !important;
148
148
  pointer-events: none !important;
149
- `,JA=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],ed={},fr;function eI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&ed[r])return ed[r];var n=window.getComputedStyle(e),i=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),a=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),l=JA.map(function(d){return"".concat(d,":").concat(n.getPropertyValue(d))}).join(";"),c={sizingStyle:l,paddingSize:a,borderSize:s,boxSizing:i};return t&&r&&(ed[r]=c),c}function tI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;fr||(fr=document.createElement("textarea"),fr.setAttribute("tab-index","-1"),fr.setAttribute("aria-hidden","true"),fr.setAttribute("name","hiddenTextarea"),document.body.appendChild(fr)),e.getAttribute("wrap")?fr.setAttribute("wrap",e.getAttribute("wrap")):fr.removeAttribute("wrap");var i=eI(e,t),a=i.paddingSize,s=i.borderSize,l=i.boxSizing,c=i.sizingStyle;fr.setAttribute("style","".concat(c,";").concat(QA)),fr.value=e.value||e.placeholder||"";var d=void 0,u=void 0,f,h=fr.scrollHeight;if(l==="border-box"?h+=s:l==="content-box"&&(h-=a),r!==null||n!==null){fr.value=" ";var g=fr.scrollHeight-a;r!==null&&(d=g*r,l==="border-box"&&(d=d+a+s),h=Math.max(d,h)),n!==null&&(u=g*n,l==="border-box"&&(u=u+a+s),f=h>u?"":"hidden",h=Math.min(u,h))}var v={height:h,overflowY:f,resize:"none"};return d&&(v.minHeight=d),u&&(v.maxHeight=u),v}var rI=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],td=0,rd=1,nd=2,nI=S.forwardRef(function(e,t){var r=e,n=r.prefixCls,i=r.defaultValue,a=r.value,s=r.autoSize,l=r.onResize,c=r.className,d=r.style,u=r.disabled,f=r.onChange,h=r.onInternalAutoSize,g=Jr(r,rI),v=go(i,{value:a,postState:function(ue){return ue??""}}),x=je(v,2),y=x[0],w=x[1],b=function(ue){w(ue.target.value),f?.(ue)},j=S.useRef();S.useImperativeHandle(t,function(){return{textArea:j.current}});var P=S.useMemo(function(){return s&&He(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),E=je(P,2),C=E[0],O=E[1],k=!!s,T=S.useState(nd),D=je(T,2),L=D[0],A=D[1],B=S.useState(),z=je(B,2),F=z[0],R=z[1],N=function(){A(td),process.env.NODE_ENV==="test"&&h?.()};pt(function(){k&&N()},[a,C,O,k]),pt(function(){if(L===td)A(rd);else if(L===rd){var X=tI(j.current,!1,C,O);A(nd),R(X)}},[L]);var I=S.useRef(),M=function(){bo.cancel(I.current)},W=function(ue){L===nd&&(l?.(ue),s&&(M(),I.current=bo(function(){N()})))};S.useEffect(function(){return M},[]);var $=k?F:null,H=xe(xe({},d),$);return(L===td||L===rd)&&(H.overflowY="hidden",H.overflowX="hidden"),S.createElement(Ro,{onResize:W,disabled:!(s||l)},S.createElement("textarea",Mt({},g,{ref:j,style:H,className:_e(n,c,Ce({},"".concat(n,"-disabled"),u)),disabled:u,value:y,onChange:b})))}),iI=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],oI=m.forwardRef(function(e,t){var r,n=e.defaultValue,i=e.value,a=e.onFocus,s=e.onBlur,l=e.onChange,c=e.allowClear,d=e.maxLength,u=e.onCompositionStart,f=e.onCompositionEnd,h=e.suffix,g=e.prefixCls,v=g===void 0?"rc-textarea":g,x=e.showCount,y=e.count,w=e.className,b=e.style,j=e.disabled,P=e.hidden,E=e.classNames,C=e.styles,O=e.onResize,k=e.onClear,T=e.onPressEnter,D=e.readOnly,L=e.autoSize,A=e.onKeyDown,B=Jr(e,iI),z=go(n,{value:i,defaultValue:n}),F=je(z,2),R=F[0],N=F[1],I=R==null?"":String(R),M=m.useState(!1),W=je(M,2),$=W[0],H=W[1],X=m.useRef(!1),ue=m.useState(null),fe=je(ue,2),me=fe[0],Pe=fe[1],Ee=m.useRef(null),J=m.useRef(null),ye=function(){var be;return(be=J.current)===null||be===void 0?void 0:be.textArea},ge=function(){ye().focus()};m.useImperativeHandle(t,function(){var ve;return{resizableTextArea:J.current,focus:ge,blur:function(){ye().blur()},nativeElement:((ve=Ee.current)===null||ve===void 0?void 0:ve.nativeElement)||ye()}}),m.useEffect(function(){H(function(ve){return!j&&ve})},[j]);var V=m.useState(null),oe=je(V,2),K=oe[0],ce=oe[1];m.useEffect(function(){if(K){var ve;(ve=ye()).setSelectionRange.apply(ve,zt(K))}},[K]);var he=LC(y,x),we=(r=he.max)!==null&&r!==void 0?r:d,Se=Number(we)>0,Te=he.strategy(I),Ne=!!we&&Te>we,U=function(be,Be){var se=Be;!X.current&&he.exceedFormatter&&he.max&&he.strategy(Be)>he.max&&(se=he.exceedFormatter(Be,{max:he.max}),Be!==se&&ce([ye().selectionStart||0,ye().selectionEnd||0])),N(se),Hl(be.currentTarget,be,l,se)},ne=function(be){X.current=!0,u?.(be)},re=function(be){X.current=!1,U(be,be.currentTarget.value),f?.(be)},G=function(be){U(be,be.target.value)},te=function(be){be.key==="Enter"&&T&&T(be),A?.(be)},de=function(be){H(!0),a?.(be)},q=function(be){H(!1),s?.(be)},Q=function(be){N(""),ge(),Hl(ye(),be,l)},Z=h,le;he.show&&(he.showFormatter?le=he.showFormatter({value:I,count:Te,maxLength:we}):le="".concat(Te).concat(Se?" / ".concat(we):""),Z=m.createElement(m.Fragment,null,Z,m.createElement("span",{className:_e("".concat(v,"-data-count"),E?.count),style:C?.count},le)));var ie=function(be){var Be;O?.(be),(Be=ye())!==null&&Be!==void 0&&Be.style.height&&Pe(!0)},pe=!L&&!x&&!c;return m.createElement($C,{ref:Ee,value:I,allowClear:c,handleReset:Q,suffix:Z,prefixCls:v,classNames:xe(xe({},E),{},{affixWrapper:_e(E?.affixWrapper,Ce(Ce({},"".concat(v,"-show-count"),x),"".concat(v,"-textarea-allow-clear"),c))}),disabled:j,focused:$,className:_e(w,Ne&&"".concat(v,"-out-of-range")),style:xe(xe({},b),me&&!pe?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof le=="string"?le:void 0}},hidden:P,readOnly:D,onClear:k},m.createElement(nI,Mt({},B,{autoSize:L,maxLength:d,onKeyDown:te,onChange:G,onFocus:de,onBlur:q,onCompositionStart:ne,onCompositionEnd:re,className:_e(E?.textarea),style:xe(xe({},C?.textarea),{},{resize:b?.resize}),disabled:j,prefixCls:v,onResize:ie,ref:J,readOnly:D})))}),aI={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},sI=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:aI}))},zC=S.forwardRef(sI);process.env.NODE_ENV!=="production"&&(zC.displayName="CloseCircleFilled");const FC=e=>{let t;return typeof e=="object"&&e?.clearIcon?t=e:e&&(t={clearIcon:m.createElement(zC,null)}),t};function kp(e,t,r){return _e({[`${e}-status-success`]:t==="success",[`${e}-status-warning`]:t==="warning",[`${e}-status-error`]:t==="error",[`${e}-status-validating`]:t==="validating",[`${e}-has-feedback`]:r})}const VC=(e,t)=>t||e,HC=e=>{const[,,,,t]=Io();return t?`${e}-css-var`:""},UC=(e,t,r=void 0)=>{var n,i;const{variant:a,[e]:s}=S.useContext(Mn),l=S.useContext(JR),c=s?.variant;let d;typeof t<"u"?d=t:r===!1?d="borderless":d=(i=(n=l??c)!==null&&n!==void 0?n:a)!==null&&i!==void 0?i:"outlined";const u=bM.includes(d);return[d,u]};function lI(e,t){const r=m.useRef([]),n=()=>{r.current.push(setTimeout(()=>{var i,a,s,l;!((i=e.current)===null||i===void 0)&&i.input&&((a=e.current)===null||a===void 0?void 0:a.input.getAttribute("type"))==="password"&&(!((s=e.current)===null||s===void 0)&&s.input.hasAttribute("value"))&&((l=e.current)===null||l===void 0||l.input.removeAttribute("value"))}))};return m.useEffect(()=>(n(),()=>r.current.forEach(i=>{i&&clearTimeout(i)})),[]),n}function cI(e,t,r,n){const{focusElCls:i,focus:a,borderElCls:s}=r,l=s?"> *":"",c=["hover",a?"focus":null,"active"].filter(Boolean).map(d=>`&:${d} ${l}`).join(",");return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":Object.assign(Object.assign({[c]:{zIndex:3}},i?{[`&${i}`]:{zIndex:3}}:{}),{[`&[disabled] ${l}`]:{zIndex:0}})}}function uI(e,t,r){const{borderElCls:n}=r,i=n?`> ${n}`:"";return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function dI(e,t={focus:!0}){const{componentCls:r}=e,n=`${r}-compact`;return{[n]:Object.assign(Object.assign({},cI(e,n,t,r)),uI(r,n,t))}}function qh(e){return _n(e,{inputAffixPadding:e.paddingXXS})}const Yh=e=>{const{controlHeight:t,fontSize:r,lineHeight:n,lineWidth:i,controlHeightSM:a,controlHeightLG:s,fontSizeLG:l,lineHeightLG:c,paddingSM:d,controlPaddingHorizontalSM:u,controlPaddingHorizontal:f,colorFillAlter:h,colorPrimaryHover:g,colorPrimary:v,controlOutlineWidth:x,controlOutline:y,colorErrorOutline:w,colorWarningOutline:b,colorBgContainer:j,inputFontSize:P,inputFontSizeLG:E,inputFontSizeSM:C}=e,O=P||r,k=C||O,T=E||l,D=Math.round((t-O*n)/2*10)/10-i,L=Math.round((a-k*n)/2*10)/10-i,A=Math.ceil((s-T*c)/2*10)/10-i;return{paddingBlock:Math.max(D,0),paddingBlockSM:Math.max(L,0),paddingBlockLG:Math.max(A,0),paddingInline:d-i,paddingInlineSM:u-i,paddingInlineLG:f-i,addonBg:h,activeBorderColor:v,hoverBorderColor:g,activeShadow:`0 0 0 ${x}px ${y}`,errorActiveShadow:`0 0 0 ${x}px ${w}`,warningActiveShadow:`0 0 0 ${x}px ${b}`,hoverBg:j,activeBg:j,inputFontSize:O,inputFontSizeLG:T,inputFontSizeSM:k}},fI=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),Gh=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},fI(_n(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),WC=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),C0=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},WC(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:t.borderColor}}),pI=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},WC(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gh(e))}),C0(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),C0(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),S0=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),hI=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group`]:{"&-addon":{background:e.addonBg,border:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},S0(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),S0(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group-addon`]:Object.assign({},Gh(e))}})}),gI=(e,t)=>{const{componentCls:r}=e;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${r}-disabled, &[disabled]`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${r}-status-error`]:{"&, & input, & textarea":{color:e.colorError}},[`&${r}-status-warning`]:{"&, & input, & textarea":{color:e.colorWarning}}},t)}},KC=(e,t)=>{var r;return{background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:(r=t?.inputColor)!==null&&r!==void 0?r:"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}},j0=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},KC(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}})}),mI=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},KC(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gh(e))}),j0(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),j0(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),E0=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{background:t.addonBg,color:t.addonColor}}}),vI=e=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group-addon`]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}}},E0(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),E0(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group`]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`}}}})}),qC=(e,t)=>({background:e.colorBgContainer,borderWidth:`${Qe(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${t.borderColor} transparent`,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0,backgroundColor:e.activeBg}}),P0=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},qC(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:`transparent transparent ${t.borderColor} transparent`}}),yI=(e,t)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},qC(e,{borderColor:e.colorBorder,activeBorderColor:e.activeBorderColor})),{[`&${e.componentCls}-disabled, &[disabled]`]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${e.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),P0(e,{status:"error",borderColor:e.colorError,activeBorderColor:e.colorError,affixColor:e.colorError})),P0(e,{status:"warning",borderColor:e.colorWarning,activeBorderColor:e.colorWarning,affixColor:e.colorWarning})),t)}),xI=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),YC=e=>{const{paddingBlockLG:t,lineHeightLG:r,borderRadiusLG:n,paddingInlineLG:i}=e;return{padding:`${Qe(t)} ${Qe(i)}`,fontSize:e.inputFontSizeLG,lineHeight:r,borderRadius:n}},GC=e=>({padding:`${Qe(e.paddingBlockSM)} ${Qe(e.paddingInlineSM)}`,fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),XC=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Qe(e.paddingBlock)} ${Qe(e.paddingInline)}`,color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`},xI(e.colorTextPlaceholder)),{"&-lg":Object.assign({},YC(e)),"&-sm":Object.assign({},GC(e)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),bI=e=>{const{componentCls:t,antCls:r}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:Object.assign({},YC(e)),[`&-sm ${t}, &-sm > ${t}-group-addon`]:Object.assign({},GC(e)),[`&-lg ${r}-select-single ${r}-select-selector`]:{height:e.controlHeightLG},[`&-sm ${r}-select-single ${r}-select-selector`]:{height:e.controlHeightSM},[`> ${t}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Qe(e.paddingInline)}`,color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${r}-select`]:{margin:`${Qe(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${Qe(e.calc(e.paddingInline).mul(-1).equal())}`,[`&${r}-select-single:not(${r}-select-customize-input):not(${r}-pagination-size-changer)`]:{[`${r}-select-selector`]:{backgroundColor:"inherit",border:`${Qe(e.lineWidth)} ${e.lineType} transparent`,boxShadow:"none"}}},[`${r}-cascader-picker`]:{margin:`-9px ${Qe(e.calc(e.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${r}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${t}-search-with-button &`]:{zIndex:0}}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${r}-select ${r}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${r}-select ${r}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-search &`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},[`&:not(:first-child), ${t}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:Object.assign(Object.assign({display:"block"},WM()),{[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`
149
+ `,JA=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],ed={},fr;function eI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&ed[r])return ed[r];var n=window.getComputedStyle(e),i=n.getPropertyValue("box-sizing")||n.getPropertyValue("-moz-box-sizing")||n.getPropertyValue("-webkit-box-sizing"),a=parseFloat(n.getPropertyValue("padding-bottom"))+parseFloat(n.getPropertyValue("padding-top")),s=parseFloat(n.getPropertyValue("border-bottom-width"))+parseFloat(n.getPropertyValue("border-top-width")),l=JA.map(function(d){return"".concat(d,":").concat(n.getPropertyValue(d))}).join(";"),c={sizingStyle:l,paddingSize:a,borderSize:s,boxSizing:i};return t&&r&&(ed[r]=c),c}function tI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;fr||(fr=document.createElement("textarea"),fr.setAttribute("tab-index","-1"),fr.setAttribute("aria-hidden","true"),fr.setAttribute("name","hiddenTextarea"),document.body.appendChild(fr)),e.getAttribute("wrap")?fr.setAttribute("wrap",e.getAttribute("wrap")):fr.removeAttribute("wrap");var i=eI(e,t),a=i.paddingSize,s=i.borderSize,l=i.boxSizing,c=i.sizingStyle;fr.setAttribute("style","".concat(c,";").concat(QA)),fr.value=e.value||e.placeholder||"";var d=void 0,u=void 0,f,h=fr.scrollHeight;if(l==="border-box"?h+=s:l==="content-box"&&(h-=a),r!==null||n!==null){fr.value=" ";var g=fr.scrollHeight-a;r!==null&&(d=g*r,l==="border-box"&&(d=d+a+s),h=Math.max(d,h)),n!==null&&(u=g*n,l==="border-box"&&(u=u+a+s),f=h>u?"":"hidden",h=Math.min(u,h))}var v={height:h,overflowY:f,resize:"none"};return d&&(v.minHeight=d),u&&(v.maxHeight=u),v}var rI=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],td=0,rd=1,nd=2,nI=S.forwardRef(function(e,t){var r=e,n=r.prefixCls,i=r.defaultValue,a=r.value,s=r.autoSize,l=r.onResize,c=r.className,d=r.style,u=r.disabled,f=r.onChange,h=r.onInternalAutoSize,g=Jr(r,rI),v=go(i,{value:a,postState:function(ue){return ue??""}}),x=je(v,2),y=x[0],w=x[1],b=function(ue){w(ue.target.value),f?.(ue)},j=S.useRef();S.useImperativeHandle(t,function(){return{textArea:j.current}});var P=S.useMemo(function(){return s&&He(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),E=je(P,2),C=E[0],O=E[1],k=!!s,T=S.useState(nd),D=je(T,2),L=D[0],A=D[1],B=S.useState(),z=je(B,2),F=z[0],R=z[1],N=function(){A(td),process.env.NODE_ENV==="test"&&h?.()};pt(function(){k&&N()},[a,C,O,k]),pt(function(){if(L===td)A(rd);else if(L===rd){var X=tI(j.current,!1,C,O);A(nd),R(X)}},[L]);var I=S.useRef(),M=function(){bo.cancel(I.current)},W=function(ue){L===nd&&(l?.(ue),s&&(M(),I.current=bo(function(){N()})))};S.useEffect(function(){return M},[]);var $=k?F:null,H=xe(xe({},d),$);return(L===td||L===rd)&&(H.overflowY="hidden",H.overflowX="hidden"),S.createElement(Ro,{onResize:W,disabled:!(s||l)},S.createElement("textarea",Mt({},g,{ref:j,style:H,className:_e(n,c,Ce({},"".concat(n,"-disabled"),u)),disabled:u,value:y,onChange:b})))}),iI=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],oI=m.forwardRef(function(e,t){var r,n=e.defaultValue,i=e.value,a=e.onFocus,s=e.onBlur,l=e.onChange,c=e.allowClear,d=e.maxLength,u=e.onCompositionStart,f=e.onCompositionEnd,h=e.suffix,g=e.prefixCls,v=g===void 0?"rc-textarea":g,x=e.showCount,y=e.count,w=e.className,b=e.style,j=e.disabled,P=e.hidden,E=e.classNames,C=e.styles,O=e.onResize,k=e.onClear,T=e.onPressEnter,D=e.readOnly,L=e.autoSize,A=e.onKeyDown,B=Jr(e,iI),z=go(n,{value:i,defaultValue:n}),F=je(z,2),R=F[0],N=F[1],I=R==null?"":String(R),M=m.useState(!1),W=je(M,2),$=W[0],H=W[1],X=m.useRef(!1),ue=m.useState(null),fe=je(ue,2),me=fe[0],Pe=fe[1],Ee=m.useRef(null),J=m.useRef(null),ye=function(){var be;return(be=J.current)===null||be===void 0?void 0:be.textArea},ge=function(){ye().focus()};m.useImperativeHandle(t,function(){var ve;return{resizableTextArea:J.current,focus:ge,blur:function(){ye().blur()},nativeElement:((ve=Ee.current)===null||ve===void 0?void 0:ve.nativeElement)||ye()}}),m.useEffect(function(){H(function(ve){return!j&&ve})},[j]);var V=m.useState(null),oe=je(V,2),K=oe[0],ce=oe[1];m.useEffect(function(){if(K){var ve;(ve=ye()).setSelectionRange.apply(ve,zt(K))}},[K]);var he=LC(y,x),we=(r=he.max)!==null&&r!==void 0?r:d,Se=Number(we)>0,Te=he.strategy(I),Ne=!!we&&Te>we,U=function(be,Be){var ae=Be;!X.current&&he.exceedFormatter&&he.max&&he.strategy(Be)>he.max&&(ae=he.exceedFormatter(Be,{max:he.max}),Be!==ae&&ce([ye().selectionStart||0,ye().selectionEnd||0])),N(ae),Hl(be.currentTarget,be,l,ae)},ne=function(be){X.current=!0,u?.(be)},re=function(be){X.current=!1,U(be,be.currentTarget.value),f?.(be)},G=function(be){U(be,be.target.value)},te=function(be){be.key==="Enter"&&T&&T(be),A?.(be)},de=function(be){H(!0),a?.(be)},q=function(be){H(!1),s?.(be)},Q=function(be){N(""),ge(),Hl(ye(),be,l)},Z=h,le;he.show&&(he.showFormatter?le=he.showFormatter({value:I,count:Te,maxLength:we}):le="".concat(Te).concat(Se?" / ".concat(we):""),Z=m.createElement(m.Fragment,null,Z,m.createElement("span",{className:_e("".concat(v,"-data-count"),E?.count),style:C?.count},le)));var ie=function(be){var Be;O?.(be),(Be=ye())!==null&&Be!==void 0&&Be.style.height&&Pe(!0)},pe=!L&&!x&&!c;return m.createElement($C,{ref:Ee,value:I,allowClear:c,handleReset:Q,suffix:Z,prefixCls:v,classNames:xe(xe({},E),{},{affixWrapper:_e(E?.affixWrapper,Ce(Ce({},"".concat(v,"-show-count"),x),"".concat(v,"-textarea-allow-clear"),c))}),disabled:j,focused:$,className:_e(w,Ne&&"".concat(v,"-out-of-range")),style:xe(xe({},b),me&&!pe?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof le=="string"?le:void 0}},hidden:P,readOnly:D,onClear:k},m.createElement(nI,Mt({},B,{autoSize:L,maxLength:d,onKeyDown:te,onChange:G,onFocus:de,onBlur:q,onCompositionStart:ne,onCompositionEnd:re,className:_e(E?.textarea),style:xe(xe({},C?.textarea),{},{resize:b?.resize}),disabled:j,prefixCls:v,onResize:ie,ref:J,readOnly:D})))}),aI={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},sI=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:aI}))},zC=S.forwardRef(sI);process.env.NODE_ENV!=="production"&&(zC.displayName="CloseCircleFilled");const FC=e=>{let t;return typeof e=="object"&&e?.clearIcon?t=e:e&&(t={clearIcon:m.createElement(zC,null)}),t};function kp(e,t,r){return _e({[`${e}-status-success`]:t==="success",[`${e}-status-warning`]:t==="warning",[`${e}-status-error`]:t==="error",[`${e}-status-validating`]:t==="validating",[`${e}-has-feedback`]:r})}const VC=(e,t)=>t||e,HC=e=>{const[,,,,t]=Io();return t?`${e}-css-var`:""},UC=(e,t,r=void 0)=>{var n,i;const{variant:a,[e]:s}=S.useContext(Mn),l=S.useContext(JR),c=s?.variant;let d;typeof t<"u"?d=t:r===!1?d="borderless":d=(i=(n=l??c)!==null&&n!==void 0?n:a)!==null&&i!==void 0?i:"outlined";const u=bM.includes(d);return[d,u]};function lI(e,t){const r=m.useRef([]),n=()=>{r.current.push(setTimeout(()=>{var i,a,s,l;!((i=e.current)===null||i===void 0)&&i.input&&((a=e.current)===null||a===void 0?void 0:a.input.getAttribute("type"))==="password"&&(!((s=e.current)===null||s===void 0)&&s.input.hasAttribute("value"))&&((l=e.current)===null||l===void 0||l.input.removeAttribute("value"))}))};return m.useEffect(()=>(n(),()=>r.current.forEach(i=>{i&&clearTimeout(i)})),[]),n}function cI(e,t,r,n){const{focusElCls:i,focus:a,borderElCls:s}=r,l=s?"> *":"",c=["hover",a?"focus":null,"active"].filter(Boolean).map(d=>`&:${d} ${l}`).join(",");return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":Object.assign(Object.assign({[c]:{zIndex:3}},i?{[`&${i}`]:{zIndex:3}}:{}),{[`&[disabled] ${l}`]:{zIndex:0}})}}function uI(e,t,r){const{borderElCls:n}=r,i=n?`> ${n}`:"";return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${i}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${i}, &${e}-sm ${i}, &${e}-lg ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function dI(e,t={focus:!0}){const{componentCls:r}=e,n=`${r}-compact`;return{[n]:Object.assign(Object.assign({},cI(e,n,t,r)),uI(r,n,t))}}function qh(e){return _n(e,{inputAffixPadding:e.paddingXXS})}const Yh=e=>{const{controlHeight:t,fontSize:r,lineHeight:n,lineWidth:i,controlHeightSM:a,controlHeightLG:s,fontSizeLG:l,lineHeightLG:c,paddingSM:d,controlPaddingHorizontalSM:u,controlPaddingHorizontal:f,colorFillAlter:h,colorPrimaryHover:g,colorPrimary:v,controlOutlineWidth:x,controlOutline:y,colorErrorOutline:w,colorWarningOutline:b,colorBgContainer:j,inputFontSize:P,inputFontSizeLG:E,inputFontSizeSM:C}=e,O=P||r,k=C||O,T=E||l,D=Math.round((t-O*n)/2*10)/10-i,L=Math.round((a-k*n)/2*10)/10-i,A=Math.ceil((s-T*c)/2*10)/10-i;return{paddingBlock:Math.max(D,0),paddingBlockSM:Math.max(L,0),paddingBlockLG:Math.max(A,0),paddingInline:d-i,paddingInlineSM:u-i,paddingInlineLG:f-i,addonBg:h,activeBorderColor:v,hoverBorderColor:g,activeShadow:`0 0 0 ${x}px ${y}`,errorActiveShadow:`0 0 0 ${x}px ${w}`,warningActiveShadow:`0 0 0 ${x}px ${b}`,hoverBg:j,activeBg:j,inputFontSize:O,inputFontSizeLG:T,inputFontSizeSM:k}},fI=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),Gh=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},fI(_n(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),WC=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),C0=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},WC(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:t.borderColor}}),pI=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},WC(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gh(e))}),C0(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),C0(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),S0=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),hI=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group`]:{"&-addon":{background:e.addonBg,border:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},S0(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),S0(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group-addon`]:Object.assign({},Gh(e))}})}),gI=(e,t)=>{const{componentCls:r}=e;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${r}-disabled, &[disabled]`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${r}-status-error`]:{"&, & input, & textarea":{color:e.colorError}},[`&${r}-status-warning`]:{"&, & input, & textarea":{color:e.colorWarning}}},t)}},KC=(e,t)=>{var r;return{background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:(r=t?.inputColor)!==null&&r!==void 0?r:"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}},j0=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},KC(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}})}),mI=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},KC(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor})),{[`&${e.componentCls}-disabled, &[disabled]`]:Object.assign({},Gh(e))}),j0(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),j0(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),E0=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{background:t.addonBg,color:t.addonColor}}}),vI=e=>({"&-filled":Object.assign(Object.assign(Object.assign({[`${e.componentCls}-group-addon`]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}}},E0(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),E0(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group`]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Qe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`}}}})}),qC=(e,t)=>({background:e.colorBgContainer,borderWidth:`${Qe(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${t.borderColor} transparent`,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0,backgroundColor:e.activeBg}}),P0=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:Object.assign(Object.assign({},qC(e,t)),{[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}),[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:`transparent transparent ${t.borderColor} transparent`}}),yI=(e,t)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},qC(e,{borderColor:e.colorBorder,activeBorderColor:e.activeBorderColor})),{[`&${e.componentCls}-disabled, &[disabled]`]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${e.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),P0(e,{status:"error",borderColor:e.colorError,activeBorderColor:e.colorError,affixColor:e.colorError})),P0(e,{status:"warning",borderColor:e.colorWarning,activeBorderColor:e.colorWarning,affixColor:e.colorWarning})),t)}),xI=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),YC=e=>{const{paddingBlockLG:t,lineHeightLG:r,borderRadiusLG:n,paddingInlineLG:i}=e;return{padding:`${Qe(t)} ${Qe(i)}`,fontSize:e.inputFontSizeLG,lineHeight:r,borderRadius:n}},GC=e=>({padding:`${Qe(e.paddingBlockSM)} ${Qe(e.paddingInlineSM)}`,fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),XC=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Qe(e.paddingBlock)} ${Qe(e.paddingInline)}`,color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`},xI(e.colorTextPlaceholder)),{"&-lg":Object.assign({},YC(e)),"&-sm":Object.assign({},GC(e)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),bI=e=>{const{componentCls:t,antCls:r}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:Object.assign({},YC(e)),[`&-sm ${t}, &-sm > ${t}-group-addon`]:Object.assign({},GC(e)),[`&-lg ${r}-select-single ${r}-select-selector`]:{height:e.controlHeightLG},[`&-sm ${r}-select-single ${r}-select-selector`]:{height:e.controlHeightSM},[`> ${t}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Qe(e.paddingInline)}`,color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${r}-select`]:{margin:`${Qe(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${Qe(e.calc(e.paddingInline).mul(-1).equal())}`,[`&${r}-select-single:not(${r}-select-customize-input):not(${r}-pagination-size-changer)`]:{[`${r}-select-selector`]:{backgroundColor:"inherit",border:`${Qe(e.lineWidth)} ${e.lineType} transparent`,boxShadow:"none"}}},[`${r}-cascader-picker`]:{margin:`-9px ${Qe(e.calc(e.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${r}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${t}-search-with-button &`]:{zIndex:0}}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${r}-select ${r}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${r}-select ${r}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-search &`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},[`&:not(:first-child), ${t}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:Object.assign(Object.assign({display:"block"},WM()),{[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[`
150
150
  & > ${t}-affix-wrapper,
151
151
  & > ${t}-number-affix-wrapper,
152
152
  & > ${r}-picker-range
@@ -180,7 +180,7 @@ html body {
180
180
  ${t}-collapse,
181
181
  ${t}-edit,
182
182
  ${t}-copy
183
- `]:Object.assign(Object.assign({},oC(e)),{marginInlineStart:e.marginXXS})}),LI(e)),zI(e)),FI()),{"&-rtl":{direction:"rtl"}})}},HI=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),QC=os("Typography",VI,HI),UI=e=>{const{prefixCls:t,"aria-label":r,className:n,style:i,direction:a,maxLength:s,autoSize:l=!0,value:c,onSave:d,onCancel:u,onEnd:f,component:h,enterIcon:g=S.createElement(_C,null)}=e,v=S.useRef(null),x=S.useRef(!1),y=S.useRef(null),[w,b]=S.useState(c);S.useEffect(()=>{b(c)},[c]),S.useEffect(()=>{var z;if(!((z=v.current)===null||z===void 0)&&z.resizableTextArea){const{textArea:F}=v.current.resizableTextArea;F.focus();const{length:R}=F.value;F.setSelectionRange(R,R)}},[]);const j=({target:z})=>{b(z.value.replace(/[\n\r]/g,""))},P=()=>{x.current=!0},E=()=>{x.current=!1},C=({keyCode:z})=>{x.current||(y.current=z)},O=()=>{d(w.trim())},k=({keyCode:z,ctrlKey:F,altKey:R,metaKey:N,shiftKey:I})=>{y.current!==z||x.current||F||R||N||I||(z===b0.ENTER?(O(),f?.()):z===b0.ESC&&u())},T=()=>{O()},[D,L,A]=QC(t),B=_e(t,`${t}-edit-content`,{[`${t}-rtl`]:a==="rtl",[`${t}-${h}`]:!!h},n,L,A);return D(S.createElement("div",{className:B,style:i},S.createElement(NI,{ref:v,maxLength:s,value:w,onChange:j,onKeyDown:C,onKeyUp:k,onCompositionStart:P,onCompositionEnd:E,onBlur:T,"aria-label":r,rows:1,autoSize:l}),g!==null?IC(g,{className:`${t}-edit-content-confirm`}):null))};var id,O0;function WI(){return O0||(O0=1,id=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(i){e.addRange(i)}),t&&t.focus()}}),id}var od,k0;function JC(){if(k0)return od;k0=1;var e=WI(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function i(a,s){var l,c,d,u,f,h,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),f=document.getSelection(),h=document.createElement("span"),h.textContent=a,h.ariaHidden="true",h.style.all="unset",h.style.position="fixed",h.style.top=0,h.style.clip="rect(0, 0, 0, 0)",h.style.whiteSpace="pre",h.style.webkitUserSelect="text",h.style.MozUserSelect="text",h.style.msUserSelect="text",h.style.userSelect="text",h.addEventListener("copy",function(x){if(x.stopPropagation(),s.format)if(x.preventDefault(),typeof x.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=t[s.format]||t.default;window.clipboardData.setData(y,a)}else x.clipboardData.clearData(),x.clipboardData.setData(s.format,a);s.onCopy&&(x.preventDefault(),s.onCopy(x.clipboardData))}),document.body.appendChild(h),u.selectNodeContents(h),f.addRange(u);var v=document.execCommand("copy");if(!v)throw new Error("copy command was unsuccessful");g=!0}catch(x){l&&console.error("unable to copy using execCommand: ",x),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",a),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(y){l&&console.error("unable to copy using clipboardData: ",y),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,a)}}finally{f&&(typeof f.removeRange=="function"?f.removeRange(u):f.removeAllRanges()),h&&document.body.removeChild(h),d()}return g}return od=i,od}var KI=JC();const qI=wr(KI),YI=(e,t=!1)=>t&&e==null?[]:Array.isArray(e)?e:[e];var GI=exports&&exports.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function l(u){try{d(n.next(u))}catch(f){s(f)}}function c(u){try{d(n.throw(u))}catch(f){s(f)}}function d(u){u.done?a(u.value):i(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};const XI=({copyConfig:e,children:t})=>{const[r,n]=S.useState(!1),[i,a]=S.useState(!1),s=S.useRef(null),l=()=>{s.current&&clearTimeout(s.current)},c={};e.format&&(c.format=e.format),S.useEffect(()=>l,[]);const d=yr(u=>GI(void 0,void 0,void 0,function*(){var f;u?.preventDefault(),u?.stopPropagation(),a(!0);try{const h=typeof e.text=="function"?yield e.text():e.text;qI(h||YI(t,!0).join("")||"",c),a(!1),n(!0),l(),s.current=setTimeout(()=>{n(!1)},3e3),(f=e.onCopy)===null||f===void 0||f.call(e,u)}catch(h){throw a(!1),h}}));return{copied:r,copyLoading:i,onClick:d}};function ad(e,t){return S.useMemo(()=>{const r=!!e;return[r,Object.assign(Object.assign({},t),r&&typeof e=="object"?e:null)]},[e])}const ZI=e=>{const t=m.useRef(void 0);return m.useEffect(()=>{t.current=e}),t.current},QI=(e,t,r)=>m.useMemo(()=>e===!0?{title:t??r}:m.isValidElement(e)?{title:e}:typeof e=="object"?Object.assign({title:t??r},e):{title:e},[e,t,r]);var JI=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const eS=S.forwardRef((e,t)=>{const{prefixCls:r,component:n="article",className:i,rootClassName:a,setContentRef:s,children:l,direction:c,style:d}=e,u=JI(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:f,direction:h,className:g,style:v}=Ic("typography"),x=c??h,y=s?es(t,s):t,w=f("typography",r);process.env.NODE_ENV!=="production"&&pn("Typography").deprecated(!s,"setContentRef","ref");const[b,j,P]=QC(w),E=_e(w,g,{[`${w}-rtl`]:x==="rtl"},i,a,j,P),C=Object.assign(Object.assign({},v),d);return b(S.createElement(n,Object.assign({className:E,style:C,ref:y},u),l))});process.env.NODE_ENV!=="production"&&(eS.displayName="Typography");var eN={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},tN=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:eN}))},tS=S.forwardRef(tN);process.env.NODE_ENV!=="production"&&(tS.displayName="CheckOutlined");var rN={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},nN=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:rN}))},rS=S.forwardRef(nN);process.env.NODE_ENV!=="production"&&(rS.displayName="CopyOutlined");var iN={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},oN=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:iN}))},nS=S.forwardRef(oN);process.env.NODE_ENV!=="production"&&(nS.displayName="LoadingOutlined");function T0(e){return e===!1?[!1,!1]:Array.isArray(e)?e:[e]}function sd(e,t,r){return e===!0||e===void 0?t:e||r&&t}function aN(e){const t=document.createElement("em");e.appendChild(t),process.env.NODE_ENV!=="production"&&(t.className="ant-typography-css-ellipsis-content-measure");const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return e.removeChild(t),r.left>n.left||n.right>r.right||r.top>n.top||n.bottom>r.bottom}const Xh=e=>["string","number"].includes(typeof e),sN=({prefixCls:e,copied:t,locale:r,iconOnly:n,tooltips:i,icon:a,tabIndex:s,onCopy:l,loading:c})=>{const d=T0(i),u=T0(a),{copied:f,copy:h}=r??{},g=t?f:h,v=sd(d[t?1:0],g),x=typeof v=="string"?v:g;return S.createElement(ss,{title:v,getPopupContainer:y=>y.parentNode},S.createElement("button",{type:"button",className:_e(`${e}-copy`,{[`${e}-copy-success`]:t,[`${e}-copy-icon-only`]:n}),onClick:l,"aria-label":x,tabIndex:s},t?sd(u[1],S.createElement(tS,null),!0):sd(u[0],c?S.createElement(nS,null):S.createElement(rS,null),!0)))},Ys=S.forwardRef(({style:e,children:t},r)=>{const n=S.useRef(null);return S.useImperativeHandle(r,()=>({isExceed:()=>{const i=n.current;return i.scrollHeight>i.clientHeight},getHeight:()=>n.current.clientHeight})),S.createElement("span",{"aria-hidden":!0,ref:n,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},e)},t)}),lN=e=>e.reduce((t,r)=>t+(Xh(r)?String(r).length:1),0);function M0(e,t){let r=0;const n=[];for(let i=0;i<e.length;i+=1){if(r===t)return n;const a=e[i],l=Xh(a)?String(a).length:1,c=r+l;if(c>t){const d=t-r;return n.push(String(a).slice(0,d)),n}n.push(a),r=c}return e}const ld=0,cd=1,ud=2,dd=3,R0=4,Gs={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function cN(e){const{enableMeasure:t,width:r,text:n,children:i,rows:a,expanded:s,miscDeps:l,onEllipsis:c}=e,d=S.useMemo(()=>Ma(n),[n]),u=S.useMemo(()=>lN(d),[n]),f=S.useMemo(()=>i(d,!1),[n]),[h,g]=S.useState(null),v=S.useRef(null),x=S.useRef(null),y=S.useRef(null),w=S.useRef(null),b=S.useRef(null),[j,P]=S.useState(!1),[E,C]=S.useState(ld),[O,k]=S.useState(0),[T,D]=S.useState(null);pt(()=>{C(t&&r&&u?cd:ld)},[r,n,a,t,d]),pt(()=>{var z,F,R,N;if(E===cd){C(ud);const I=x.current&&getComputedStyle(x.current).whiteSpace;D(I)}else if(E===ud){const I=!!(!((z=y.current)===null||z===void 0)&&z.isExceed());C(I?dd:R0),g(I?[0,u]:null),P(I);const M=((F=y.current)===null||F===void 0?void 0:F.getHeight())||0,W=a===1?0:((R=w.current)===null||R===void 0?void 0:R.getHeight())||0,$=((N=b.current)===null||N===void 0?void 0:N.getHeight())||0,H=Math.max(M,W+$);k(H+1),c(I)}},[E]);const L=h?Math.ceil((h[0]+h[1])/2):0;pt(()=>{var z;const[F,R]=h||[0,0];if(F!==R){const I=(((z=v.current)===null||z===void 0?void 0:z.getHeight())||0)>O;let M=L;R-F===1&&(M=I?F:R),g(I?[F,M]:[M,R])}},[h,L]);const A=S.useMemo(()=>{if(!t)return i(d,!1);if(E!==dd||!h||h[0]!==h[1]){const z=i(d,!1);return[R0,ld].includes(E)?z:S.createElement("span",{style:Object.assign(Object.assign({},Gs),{WebkitLineClamp:a})},z)}return i(s?d:M0(d,h[0]),j)},[s,E,h,d].concat(zt(l))),B={width:r,margin:0,padding:0,whiteSpace:T==="nowrap"?"normal":"inherit"};return S.createElement(S.Fragment,null,A,E===ud&&S.createElement(S.Fragment,null,S.createElement(Ys,{style:Object.assign(Object.assign(Object.assign({},B),Gs),{WebkitLineClamp:a}),ref:y},f),S.createElement(Ys,{style:Object.assign(Object.assign(Object.assign({},B),Gs),{WebkitLineClamp:a-1}),ref:w},f),S.createElement(Ys,{style:Object.assign(Object.assign(Object.assign({},B),Gs),{WebkitLineClamp:1}),ref:b},i([],!0))),E===dd&&h&&h[0]!==h[1]&&S.createElement(Ys,{style:Object.assign(Object.assign({},B),{top:400}),ref:v},i(M0(d,L),!0)),E===cd&&S.createElement("span",{style:{whiteSpace:"inherit"},ref:x}))}const iS=({enableEllipsis:e,isEllipsis:t,children:r,tooltipProps:n})=>!n?.title||!e?r:S.createElement(ss,Object.assign({open:t?void 0:!1},n),r);process.env.NODE_ENV!=="production"&&(iS.displayName="EllipsisTooltip");var uN=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};function dN({mark:e,code:t,underline:r,delete:n,strong:i,keyboard:a,italic:s},l){let c=l;function d(u,f){f&&(c=S.createElement(u,{},c))}return d("strong",i),d("u",r),d("del",n),d("code",t),d("mark",e),d("kbd",a),d("i",s),c}const fN="...",A0=["delete","mark","code","underline","strong","keyboard","italic"],pN=S.forwardRef((e,t)=>{var r;const{prefixCls:n,className:i,style:a,type:s,disabled:l,children:c,ellipsis:d,editable:u,copyable:f,component:h,title:g}=e,v=uN(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:x,direction:y}=S.useContext(Mn),[w]=lM("Text"),b=S.useRef(null),j=S.useRef(null),P=x("typography",n),E=Ow(v,A0),[C,O]=ad(u),[k,T]=go(!1,{value:O.editing}),{triggerType:D=["icon"]}=O,L=se=>{var Me;se&&((Me=O.onStart)===null||Me===void 0||Me.call(O)),T(se)},A=ZI(k);pt(()=>{var se;!k&&A&&((se=j.current)===null||se===void 0||se.focus())},[k]);const B=se=>{se?.preventDefault(),L(!0)},z=se=>{var Me;(Me=O.onChange)===null||Me===void 0||Me.call(O,se),L(!1)},F=()=>{var se;(se=O.onCancel)===null||se===void 0||se.call(O),L(!1)},[R,N]=ad(f),{copied:I,copyLoading:M,onClick:W}=XI({copyConfig:N,children:c}),[$,H]=S.useState(!1),[X,ue]=S.useState(!1),[fe,me]=S.useState(!1),[Pe,Ee]=S.useState(!1),[J,ye]=S.useState(!0),[ge,V]=ad(d,{expandable:!1,symbol:se=>se?w?.collapse:w?.expand}),[oe,K]=go(V.defaultExpanded||!1,{value:V.expanded}),ce=ge&&(!oe||V.expandable==="collapsible"),{rows:he=1}=V,we=S.useMemo(()=>ce&&(V.suffix!==void 0||V.onEllipsis||V.expandable||C||R),[ce,V,C,R]);pt(()=>{ge&&!we&&(H(Mv("webkitLineClamp")),ue(Mv("textOverflow")))},[we,ge]);const[Se,Te]=S.useState(ce),Ne=S.useMemo(()=>we?!1:he===1?X:$,[we,X,$]);pt(()=>{Te(Ne&&ce)},[Ne,ce]);const U=ce&&(Se?Pe:fe),ne=ce&&he===1&&Se,re=ce&&he>1&&Se,G=(se,Me)=>{var Fe;K(Me.expanded),(Fe=V.onExpand)===null||Fe===void 0||Fe.call(V,se,Me)},[te,de]=S.useState(0),q=({offsetWidth:se})=>{de(se)},Q=se=>{var Me;me(se),fe!==se&&((Me=V.onEllipsis)===null||Me===void 0||Me.call(V,se))};S.useEffect(()=>{const se=b.current;if(ge&&Se&&se){const Me=aN(se);Pe!==Me&&Ee(Me)}},[ge,Se,c,re,J,te]),S.useEffect(()=>{const se=b.current;if(typeof IntersectionObserver>"u"||!se||!Se||!ce)return;const Me=new IntersectionObserver(()=>{ye(!!se.offsetParent)});return Me.observe(se),()=>{Me.disconnect()}},[Se,ce]);const Z=QI(V.tooltip,O.text,c),le=S.useMemo(()=>{if(!(!ge||Se))return[O.text,c,g,Z.title].find(Xh)},[ge,Se,g,Z.title,U]);if(k)return S.createElement(UI,{value:(r=O.text)!==null&&r!==void 0?r:typeof c=="string"?c:"",onSave:z,onCancel:F,onEnd:O.onEnd,prefixCls:P,className:i,style:a,direction:y,component:h,maxLength:O.maxLength,autoSize:O.autoSize,enterIcon:O.enterIcon});const ie=()=>{const{expandable:se,symbol:Me}=V;return se?S.createElement("button",{type:"button",key:"expand",className:`${P}-${oe?"collapse":"expand"}`,onClick:Fe=>G(Fe,{expanded:!oe}),"aria-label":oe?w.collapse:w?.expand},typeof Me=="function"?Me(oe):Me):null},pe=()=>{if(!C)return;const{icon:se,tooltip:Me,tabIndex:Fe}=O,Hr=Ma(Me)[0]||w?.edit,tn=typeof Hr=="string"?Hr:"";return D.includes("icon")?S.createElement(ss,{key:"edit",title:Me===!1?"":Hr},S.createElement("button",{type:"button",ref:j,className:`${P}-edit`,onClick:B,"aria-label":tn,tabIndex:Fe},se||S.createElement(gw,{role:"button"}))):null},ve=()=>R?S.createElement(sN,Object.assign({key:"copy"},N,{prefixCls:P,copied:I,locale:w,onCopy:W,loading:M,iconOnly:c==null})):null,be=se=>[se&&ie(),pe(),ve()],Be=se=>[se&&!oe&&S.createElement("span",{"aria-hidden":!0,key:"ellipsis"},fN),V.suffix,be(se)];return S.createElement(Ro,{onResize:q,disabled:!ce},se=>S.createElement(iS,{tooltipProps:Z,enableEllipsis:ce,isEllipsis:U},S.createElement(eS,Object.assign({className:_e({[`${P}-${s}`]:s,[`${P}-disabled`]:l,[`${P}-ellipsis`]:ge,[`${P}-ellipsis-single-line`]:ne,[`${P}-ellipsis-multiple-line`]:re},i),prefixCls:n,style:Object.assign(Object.assign({},a),{WebkitLineClamp:re?he:void 0}),component:h,ref:es(se,b,t),direction:y,onClick:D.includes("text")?B:void 0,"aria-label":le?.toString(),title:g},E),S.createElement(cN,{enableMeasure:ce&&!Se,text:c,rows:he,width:te,onEllipsis:Q,expanded:oe,miscDeps:[I,oe,M,C,R,w].concat(zt(A0.map(Me=>e[Me])))},(Me,Fe)=>dN(e,S.createElement(S.Fragment,null,Me.length>0&&Fe&&!oe&&le?S.createElement("span",{key:"show-content","aria-hidden":!0},Me):Me,Be(Fe)))))))}),hN=S.forwardRef((e,t)=>S.createElement(pN,Object.assign({ref:t},e,{component:"div"}))),oS=(e,t,r=null)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.key===t)return{node:i,ctx:{parent:r,index:n,siblings:e}};if(i.children?.length){const a=oS(i.children,t,i);if(a.node)return a}}return{node:null,ctx:null}},aS=(e,t)=>{if(!e.children)return!1;for(const r of e.children)if(r.key===t||aS(r,t))return!0;return!1};function gN({open:e,onClose:t}){const{nodes:r,rootIds:n,addFolder:i,editFolder:a,removeFolder:s,removeMenu:l,moveNode:c}=tt.useFavoriteStore(),d=m.useRef(null),[u,f]=m.useState([]),[h,g]=m.useState([]),[v,x]=m.useState(""),[y,w]=m.useState("ADD"),[b,j]=m.useState(!1),[P,E]=m.useState("");m.useEffect(()=>{e&&g(n)},[e]),m.useEffect(()=>{const k=C(r,n);f(k)},[r]),m.useEffect(()=>{b&&P&&(d.current.setFieldValue("prntBkmkId",P),d.current.setFieldValue("prntBkmkNm",r[P]?.bkmkNm??"-")),b&&y==="EDIT"&&(d.current.setFieldValue("bkmkId",P),d.current.setFieldValue("bkmkNm",r[P]?.bkmkNm)),!b&&y=="ADD"&&g(k=>[...k,P]),!b&&d.current&&(E("-"),d.current.resetFields())},[b,y,P,r]);const C=(k,T)=>{const D=(L,A="-")=>{const B=k[L];if(!B)return null;const z={key:B.bkmkId,type:B.type,title:B.type==="F"?B.bkmkNm:B.menuNm?`${B.menuNm} (${B.menuId})`:B.menuId,parentId:A,sortOrdr:B.sortOrdr??0};if(B.type==="F"){const R=(B.children??[]).map(N=>D(N,B.bkmkId)).filter(Boolean);return{...z,children:R}}return z};return T.map(L=>D(L,"-")).filter(Boolean)},O=()=>{if(w("ADD"),!v){E("-"),j(!0);return}const k=r[v];if(!k){E("-"),j(!0);return}k.type==="F"?E(k.bkmkId):E(k.prntBkmkId),j(!0)};return o.jsxs(p.ConfigProvider,{theme:{components:{Modal:{wireframe:!0},Button:{defaultColor:"var(--text-secondary)",defaultHoverColor:"var(--primary-color)",defaultHoverBorderColor:"var(--primary-color)",controlHeight:30,fontSize:13,borderRadius:"var(--border-radius-sm)"}}},children:[o.jsxs(p.Modal,{open:e,okButtonProps:{style:{display:"none"}},cancelText:"닫기",width:560,style:{zIndex:1001},styles:{body:{paddingTop:12,paddingBottom:12}},title:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:12},children:o.jsx(p.Typography.Text,{style:{fontSize:18},children:"북마크 관리"})}),onCancel:t,children:[o.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginBottom:10},children:[o.jsx(p.Button,{type:"primary",variant:"solid",className:"bwg-btn",icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsxs("g",{"clip-path":"url(#clip0_1298_1781)",children:[o.jsx("path",{d:"M9.3002 14.26H13.5702C14.4002 14.26 15.0702 13.59 15.0702 12.76V7.45999C15.0702 6.89999 14.6102 6.43999 14.0502 6.43999H8.8302L7.7102 3.48999H4.1702C3.6402 3.48999 3.2002 3.92999 3.2002 4.45999V8.10999",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M8.18018 4.58997H14.0502C14.6102 4.58997 15.0702 5.04997 15.0702 5.60997V8.25997",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M5.43018 9.52002V14.52",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M7.93018 12.01H2.93018",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1298_1781",children:o.jsx("rect",{width:"18",height:"18",fill:"white"})})})]}),style:{padding:"0 10px",boxShadow:"none"},onClick:O,children:"새 폴더"}),o.jsx("div",{children:o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultHoverColor:"#333333",defaultHoverBorderColor:"#d9d9d9",defaultHoverBg:"#f1f1f1",defaultActiveColor:"#777777",defaultActiveBorderColor:"#d9d9d9",contentFontSize:13,defaultColor:"#777777"}}},children:[o.jsx(p.Tooltip,{title:"펼치기",children:o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332M7.99984 2.66667V13.3333",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28},onClick:()=>{const k=Object.values(r).filter(T=>T.type==="F").map(T=>T.bkmkId);g(k)}})}),o.jsx(p.Tooltip,{title:"접기",children:o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28,marginLeft:5},onClick:()=>g([])})})]})})]}),o.jsxs("div",{style:{maxHeight:420,height:350,overflow:"auto",border:"1px solid #e0e0e0",borderRadius:8,padding:10},children:[u.length==0&&o.jsx(p.Empty,{description:o.jsxs(p.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",o.jsx("br",{}),"새로운 폴더를 생성해보세요."]})}),o.jsx(p.Tree,{blockNode:!0,draggable:!0,allowDrop:({dropNode:k,dropPosition:T})=>{const D=k.type==="F";return T===0?D:!0},onDrop:k=>{const{dragNode:T,node:D,dropPosition:L,dropToGap:A}=k;if(T.key===D.key||aS(T,D.key))return;let B,z;if(A){const R=oS(u,D.key).ctx,N=R.index;B=R.parent?R.parent.key:"-",z=L>0?N+1:N}else{if(D.type!=="F")return;const R=D.children||[];B=D.key,z=R.length}const F=ae.getUserId();if(T.type==="F")c({bkmkId:T.key,newPrntBkmkId:B,sortOrdr:z,userId:F}).catch(()=>{p.Modal.error({title:"이동 실패",content:"폴더 이동 중 오류가 발생했어요."})});else{if(B==="-"){p.Modal.warning({title:"이동 불가",content:"메뉴는 최상위로 이동할 수 없어요."});return}c({bkmkId:T.key,newPrntBkmkId:B,sortOrdr:z,userId:F}).catch(()=>{p.Modal.error({title:"이동 실패",content:"메뉴 이동 중 오류가 발생했어요."})})}A===!1&&g(R=>Array.from(new Set([...R,D.key])))},showLine:!0,treeData:u,selectedKeys:[v],expandedKeys:h,onExpand:g,onSelect:k=>x(k[0]),titleRender:k=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[o.jsxs("span",{children:[k.type==="F"?"📁":"📄"," ",k.title,k.isNew?o.jsx(p.Tag,{color:"gold",style:{marginLeft:4,fontSize:"10px",height:"16px",lineHeight:"16px",padding:"0 5px"},children:"N"}):null]}),o.jsxs("span",{style:{display:"inline-flex",gap:8},children:[k.type==="F"&&o.jsxs(o.Fragment,{children:[o.jsx(Y.PlusOutlined,{style:{opacity:.8},onClick:()=>{w("ADD"),E(k.key),j(!0)}}),o.jsx(Y.EditOutlined,{style:{opacity:.8},onClick:()=>{w("EDIT"),E(k.key),j(!0)}})]}),o.jsx(Y.DeleteOutlined,{style:{cursor:"pointer",opacity:.5},onClick:()=>{k.type==="F"?p.Modal.confirm({title:"삭제 안내",content:"폴더를 삭제하면 하위 폴더와 메뉴도 모두 삭제됩니다. 삭제하시겠습니까?",centered:!0,onOk:()=>s(k.key)}):p.Modal.confirm({title:"삭제 안내",centered:!0,content:"메뉴를 삭제하시겠습니까?",onOk:()=>l(k.key)})}})]})]})})]})]}),o.jsx(p.ConfigProvider,{theme:{components:{Modal:{titleColor:y==="ADD"?"var(--primary-color)":"#ff6767",headerBg:y==="ADD"?"var(--drawer-header-bg)":"#fff0f0",titleFontSize:18},Button:{defaultColor:"var(--text-secondary)",defaultHoverColor:"var(--primary-color)",defaultHoverBorderColor:"var(--primary-color)",controlHeight:30,fontSize:13,borderRadius:"var(--border-radius-sm)"}}},children:o.jsx(p.Modal,{title:o.jsx(o.Fragment,{children:o.jsxs(p.Typography.Text,{style:{fontSize:16,display:"flex",alignItems:"center",gap:6},children:[y==="ADD"?o.jsx("span",{className:"bookmark-folder-modal-icon ico-new-folder"}):o.jsx("span",{className:"bookmark-folder-modal-icon ico-edit-folder"}),"폴더",y==="ADD"?" 추가":"명 수정"]})}),open:b,okText:"저장",onOk:()=>{const k=d.current.getFieldValue("bkmkNm"),T=ae.getUserId();if(y==="ADD"){const D=__SYS_CD__??"KH",L=d.current.getFieldValue("prntBkmkId");i(k,L,D,T).then(()=>{j(!1)})}else{const D=d.current.getFieldValue("bkmkId");a(D,T,k).then(()=>{j(!1)})}},centered:!0,width:400,onCancel:()=>j(!1),okButtonProps:{className:"bwg-btn"},cancelButtonProps:{className:"bwg-btn"},styles:{body:{padding:20}},children:o.jsxs(_.BwgForm,{ref:d,style:{padding:0},children:[o.jsx(_.BwgInput,{itemProps:{name:y==="EDIT"?"bkmkId":"prntBkmkId",hidden:!0}}),o.jsx(_.BwgInput,{itemProps:{label:"상위 폴더명",name:"prntBkmkNm",hidden:P==="-"||y==="EDIT"},inputProps:{disabled:!0}}),o.jsx(_.BwgInput,{itemProps:{label:"폴더명",name:"bkmkNm"}})]})})})]})}function mN({triggerIcon:e}){const[t,r]=m.useState(!1),[n,i]=m.useState(""),[a,s]=m.useState(null),[l,c]=m.useState([]),[d,u]=m.useState([]),[f,h]=m.useState(!1),[g,v]=m.useState(!1),[x,y]=m.useState(!1),[w,b]=m.useState(null);tt.useFavoriteStore(M=>M.treeNodes);const{nodes:j,getPrntBkmkIdByMenuId:P,getNodeByMenuId:E,isMenuBookmarked:C,removeMenuByMenuId:O,addMenuToFolder:k,convertToAntTreeData:T}=tt.useFavoriteStore(),D=tt.useFavoriteStore(M=>M.rootIds),L=m.useMemo(()=>T(j,D,n,!0),[j,D,n]),A=tt.useMenuViewStore(M=>M.activeMenuItem??{menuId:"",menuNm:""}),B=m.useMemo(()=>{if(!A?.menuId)return"";const M=E(A.menuId);if(!M)return"";if(M.fullPath)return M.fullPath;const W=$=>{const H=j[$];if(!H)return"";if(H.prntBkmkId==="-")return`${H.bkmkNm||A?.menuNm}`;const X=W(H.prntBkmkId);return X?`${X} > ${H.bkmkNm||A?.menuNm}`:H.bkmkNm||A?.menuNm};return console.log("bookmarkNode ::::: ",M),console.log(W(M.bkmkId)),W(M.bkmkId)},[A?.menuId,E,j]);m.useEffect(()=>{t&&A?.menuId&&C(A.menuId)?u([P(A.menuId)]):t&&A?.menuId&&!C(A.menuId)?u(D):(u([]),c([]),b(null),y(!1))},[t,A?.menuId,C,P]),m.useEffect(()=>{if(!x||!A?.menuId)return;const M=P(A.menuId);!M||!j[M]||(i(""),c([M]),b(M))},[x,A?.menuId,j,P]);const z=(M,W)=>{k(M,W).then($=>{console.log("AddMenuToFolder ::::: ",$),$||u(H=>H.includes(M)?H:[...H,M])})},F=M=>{O(M)},R=async M=>{A?.menuId&&(await O(A.menuId),await k(M,A),y(!1),b(null),u(W=>W.includes(M)?W:[...W,M]))},N=()=>o.jsxs("div",{className:"bookmark-popover-wrap",style:{width:360},children:[o.jsx("div",{style:{padding:"20px 20px 15px",borderBottom:"1px solid #eeeeee"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%",rowGap:10},children:[o.jsxs(p.Typography.Text,{style:{fontSize:18,display:"flex",alignItems:"center",gap:6},children:[o.jsx(p.Button,{type:"text",icon:o.jsx(Y.ArrowLeftOutlined,{}),onClick:()=>y(!1),style:{width:26,height:26}}),"폴더 변경"]}),A&&o.jsxs(p.Typography.Text,{type:"secondary",style:{display:"inline-block",width:"100%",color:"#555555",fontWeight:"400",background:"#f0eff4",padding:"3px 10px",borderRadius:6},children:["현재 화면: ",o.jsx("b",{children:A.menuNm})," ",o.jsxs("span",{style:{color:"#939393"},children:["(",A.menuId,")"]})]})]})}),I(),o.jsxs("div",{style:{padding:"15px 20px",borderTop:"1px solid #eeeeee",display:"flex",justifyContent:"flex-end",gap:8},children:[o.jsx(p.Button,{type:"default",className:"bwg-btn",onClick:()=>{y(!1),b(null)},children:"취소"}),o.jsx(p.Button,{type:"primary",className:"bwg-btn",disabled:!w,onClick:()=>w&&R(String(w)),children:"이동"})]})]}),I=()=>o.jsxs("div",{style:{maxHeight:360,overflow:"auto",padding:"15px 20px 20px"},children:[o.jsxs(p.Space,{style:{width:"100%",marginBottom:12,display:"flex",justifyContent:"space-between",columnGap:10},children:[o.jsx(p.Input,{placeholder:"검색(폴더명)",prefix:o.jsx(Y.SearchOutlined,{}),allowClear:!0,value:n,onChange:M=>i(M.target.value),style:{width:"250px",height:28}}),o.jsx(p.ConfigProvider,{theme:{components:{Button:{defaultHoverColor:"#333333",defaultHoverBorderColor:"#d9d9d9",defaultHoverBg:"#f1f1f1",defaultActiveColor:"#777777",defaultActiveBorderColor:"#d9d9d9",contentFontSize:13,defaultColor:"#777777"}}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332M7.99984 2.66667V13.3333",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28},onClick:()=>{const M=Object.values(j).filter(W=>W.type==="F").map(W=>W.bkmkId);u(M)},title:"모두 확장"}),o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28},onClick:()=>u([]),title:"모두 축소"})]})})]}),L.length===0?o.jsx(p.Empty,{description:o.jsxs(p.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",o.jsx("br",{}),"새로운 폴더를 만들어 시작해보세요."]}),image:p.Empty.PRESENTED_IMAGE_SIMPLE}):o.jsx(p.Tree,{blockNode:!0,showLine:!0,treeData:L,selectedKeys:l,expandedKeys:d,onExpand:u,onSelect:M=>{c(M),b(M[0])},autoExpandParent:!0,titleRender:M=>{const W=String(M.key),$=a===W;return o.jsxs("div",{onMouseEnter:()=>s(W),onMouseLeave:()=>s(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[o.jsx("div",{children:M.title}),!C(A?.menuId)&&A&&$&&o.jsx(p.ConfigProvider,{theme:{components:{Button:{defaultColor:"rgba(0,0,0,0.5)",defaultHoverColor:"rgba(0,0,0,0.8)"}}},children:o.jsx(p.Button,{size:"small",type:"link",onClick:H=>{H.stopPropagation(),z(W,A)},style:{color:"rgba(0,0,0,0.5)"},children:"+ 현재화면 추가"})})]})}})]});return o.jsxs(o.Fragment,{children:[o.jsx(p.Popover,{open:t&&!f,onOpenChange:r,trigger:"click",placement:"bottomLeft",styles:{body:{padding:0,borderRadius:12,boxShadow:"0 12px 32px rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.2)",background:"#ffffff",zIndex:1e3}},content:x?N():o.jsxs("div",{style:{width:360},children:[o.jsx("div",{style:{padding:"20px 20px 15px",borderBottom:"1px solid #eeeeee"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%",rowGap:10},children:[o.jsxs(p.Typography.Text,{style:{fontSize:18,display:"flex",alignItems:"center",gap:6},children:[o.jsx("span",{className:`bookmark-title-icon ${C(A?.menuId)?"saved":"add"}`}),"북마크"," ",C(A?.menuId)?"저장됨":"추가"]}),A&&o.jsxs(p.Typography.Text,{type:"secondary",style:{display:"inline-block",width:"100%",color:"#555555",fontWeight:"400",background:"#f0eff4",padding:"3px 10px",borderRadius:6},children:["현재 화면: ",o.jsx("b",{children:A.menuNm})," ",o.jsxs("span",{style:{color:"#939393"},children:["(",A.menuId,")"]})]})]})}),C(A?.menuId)?o.jsxs("div",{style:{padding:"10px 12px",margin:"15px 20px",borderRadius:8,backgroundColor:"#f7f6fB"},children:[o.jsx(p.Typography.Text,{type:"secondary",style:{fontSize:13},children:"저장 위치"}),o.jsx("div",{style:{marginTop:4},children:`📁 > ${B}`||"알 수 없음"})]}):I(),o.jsxs(ze,{style:{padding:"15px 20px",borderTop:"1px solid #eeeeee"},layoutAlign:"right",children:[A&&!C(A.menuId)?o.jsx(p.Button,{style:{padding:"0 10px"},type:"primary",className:"bwg-btn",icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:o.jsx("path",{d:"M3 9H15M9 3V15",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),onClick:()=>{const M=String(l[0]);let W="-";M&&j[M]&&(W=j[M].type=="M"?j[M].prntBkmkId:M),z(W,A)},children:"추가"}):o.jsxs(ze,{layoutAlign:"between",children:[o.jsx(p.Button,{type:"default",className:"bwg-btn",style:{padding:"0 10px"},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsxs("g",{"clip-path":"url(#clip0_1289_1745)",children:[o.jsx("path",{d:"M13.9198 6.57H8.69982L7.57982 3.62H4.03982C3.50982 3.62 3.06982 4.06 3.06982 4.59V12.89C3.06982 13.72 3.73982 14.39 4.56982 14.39H13.4398C14.2698 14.39 14.9398 13.72 14.9398 12.89V7.59C14.9398 7.03 14.4798 6.57 13.9198 6.57Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M8.0498 4.72H13.9198C14.4798 4.72 14.9398 5.18 14.9398 5.74V8.39",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1289_1745",children:o.jsx("rect",{width:"18",height:"18",fill:"white"})})})]}),onClick:()=>y(!0),children:"폴더 변경"}),o.jsx(p.Button,{type:"default",className:"bwg-btn",style:{padding:"0 10px"},color:"danger",variant:"solid",icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:o.jsx("path",{d:"M7.5 7.5V12M10.5 7.5V12M13.5 4.5V13.5C13.5 14.3284 12.8284 15 12 15H6C5.17157 15 4.5 14.3284 4.5 13.5V4.5M3 4.5H15M11.25 4.5V3.75C11.25 2.92157 10.5784 2.25 9.75 2.25H8.25C7.42157 2.25 6.75 2.92157 6.75 3.75V4.5",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),onClick:()=>F(A.menuId),children:"삭제"})]}),o.jsx(p.Button,{type:"default",className:"bwg-btn",style:{padding:"0 10px",marginLeft:5},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsx("path",{d:"M8.25 2.25H9.75C10.1642 2.25 10.5 2.58579 10.5 3V3.42659C10.5 3.74744 10.7153 4.02619 11.0117 4.14921C11.3081 4.27229 11.6532 4.22538 11.8802 3.99842L12.182 3.69668C12.4748 3.40379 12.9497 3.40379 13.2426 3.69668L14.3033 4.75734C14.5962 5.05023 14.5962 5.52511 14.3033 5.818L14.0016 6.1197C13.7746 6.34667 13.7277 6.69185 13.8508 6.98831C13.9738 7.28465 14.2526 7.5 14.5734 7.5L15 7.5C15.4142 7.5 15.75 7.83579 15.75 8.25V9.75C15.75 10.1642 15.4142 10.5 15 10.5H14.5734C14.2526 10.5 13.9738 10.7153 13.8508 11.0117C13.7277 11.3081 13.7746 11.6533 14.0016 11.8803L14.3033 12.182C14.5962 12.4749 14.5962 12.9497 14.3033 13.2426L13.2426 14.3033C12.9497 14.5962 12.4749 14.5962 12.182 14.3033L11.8803 14.0016C11.6533 13.7746 11.3081 13.7277 11.0117 13.8508C10.7153 13.9738 10.5 14.2526 10.5 14.5734V15C10.5 15.4142 10.1642 15.75 9.75 15.75H8.25C7.83579 15.75 7.5 15.4142 7.5 15V14.5734C7.5 14.2526 7.28465 13.9738 6.98831 13.8508C6.69185 13.7277 6.34667 13.7746 6.1197 14.0016L5.81799 14.3033C5.5251 14.5962 5.05022 14.5962 4.75733 14.3033L3.69667 13.2426C3.40378 12.9497 3.40378 12.4749 3.69667 12.182L3.99842 11.8802C4.22538 11.6532 4.27229 11.3081 4.14921 11.0117C4.02619 10.7153 3.74744 10.5 3.42659 10.5H3C2.58579 10.5 2.25 10.1642 2.25 9.75V8.25C2.25 7.83579 2.58579 7.5 3 7.5L3.42657 7.5C3.74743 7.5 4.02619 7.28466 4.14922 6.98832C4.2723 6.69188 4.22539 6.34671 3.99842 6.11975L3.69668 5.818C3.40379 5.52511 3.40379 5.05024 3.69668 4.75734L4.75734 3.69668C5.05023 3.40379 5.52511 3.40379 5.818 3.69668L6.11974 3.99842C6.34671 4.22539 6.69187 4.2723 6.98832 4.14922C7.28466 4.02619 7.5 3.74743 7.5 3.42657V3C7.5 2.58579 7.83579 2.25 8.25 2.25Z",stroke:"currentColor"}),o.jsx("path",{d:"M10.5 9C10.5 9.82843 9.82843 10.5 9 10.5C8.17157 10.5 7.5 9.82843 7.5 9C7.5 8.17157 8.17157 7.5 9 7.5C9.82843 7.5 10.5 8.17157 10.5 9Z",stroke:"currentColor"})]}),onClick:()=>{v(t),h(!0)},children:"관리"})]})]}),children:o.jsx("span",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center"},children:e})}),o.jsx(gN,{open:f,onClose:()=>{h(!1),g&&r(!0)}})]})}const vN=e=>{const{searchBoxRef:t}=at.useSearchBox();return o.jsx(ko,{ref:t,...e})},kt=m.forwardRef(({children:e,searchBox:t,title:r,preRenderEvents:n=[],postRenderEvents:i=[],loading:a=!1,error:s=null,grantEvent:l={},customEvent:c={},buttons:d},u)=>{const{user:f,spacingSize:h}=tt.useUserStore(),{activeMenuItem:g}=tt.useMenuViewStore(),{loadFavoritesIfNeeded:v,isMenuBookmarked:x}=tt.useFavoriteStore(),{loading:y}=tt.useLoadingStore(),{resetForm:w,setDefaultValue:b,searchBoxRef:j}=at.useSearchBox(),P=at.useSizeConfig();m.useImperativeHandle(u,()=>({menuId:g?.menuId}),[g?.menuId]);const[E,C]=m.useState({isInitialized:!1,isReady:!1,error:null,loading:!0,preRenderComplete:!1,postRenderComplete:!1}),{openCorePopup:O}=at.usePopup(),k=async()=>{if(n.length===0){C(I=>({...I,preRenderComplete:!0}));return}try{for(const I of n)await I();C(I=>({...I,preRenderComplete:!0}))}catch(I){C(M=>({...M,error:I instanceof Error?I.message:"사전 렌더링 실패",preRenderComplete:!0}))}},T=async()=>{if(i.length===0){C(I=>({...I,postRenderComplete:!0}));return}try{for(const I of i)await I();C(I=>({...I,postRenderComplete:!0}))}catch(I){C(M=>({...M,error:I instanceof Error?I.message:"사후 렌더링 실패",postRenderComplete:!0}))}};m.useEffect(()=>{if(E.isInitialized)return;(async()=>{try{await k(),C(M=>({...M,isInitialized:!0,loading:!1}))}catch(M){console.error("BwgView 초기화 실패:",M),C(W=>({...W,isInitialized:!0,loading:!1}))}})()},[]),m.useEffect(()=>{f?.userId&&v(f.userId)},[v,f?.userId]);const D=m.useMemo(()=>g?.menuId?{menuId:g.menuId,grpId:"CUSTOM"}:!1,[g?.menuId]),L=m.useMemo(()=>g?.menuId?{menuId:g.menuId,grpId:"DEFAULT"}:!1,[g?.menuId]);m.useEffect(()=>{E.isInitialized&&E.preRenderComplete&&!E.isReady&&setTimeout(async()=>{await T(),C(M=>({...M,isReady:!0}))},100)},[E.isInitialized,E.preRenderComplete,E.isReady]),m.useEffect(()=>{s&&C(I=>({...I,error:s}))},[s]),m.useEffect(()=>{t&&t.defaultValue&&j?.current&&b(t.defaultValue)},[t,j,b]),m.useEffect(()=>{if(!t)return;const I=M=>{M.ctrlKey&&(M.key==="d"||M.key==="D")&&(M.preventDefault(),M.stopPropagation(),w()),M.ctrlKey&&M.key==="s"&&(M.preventDefault(),M.stopPropagation(),d?.grant?.find(W=>W.id==="search")?.onClick?.())};return window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I)}},[t,w]);const A=()=>o.jsxs("div",{className:"bwgview-header-container",children:[o.jsxs("div",{className:"bwgview-header",children:[o.jsx("div",{className:"bwgview-header-left",children:N.LEFT}),o.jsx("div",{className:"bwgview-header-right",children:N.RIGHT})]}),t&&o.jsx(vN,{reqRows:t.reqRows,subRows:t.subRows,border:t.border,labelDisplay:t.labelDisplay,header:t.header})]});if(m.useEffect(()=>{},[f,g]),E.error||s)return o.jsx("div",{style:{padding:"24px"},children:o.jsx(p.Alert,{message:"오류 발생",description:E.error||s,type:"error",showIcon:!0})});const B=()=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:o.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62179 6.15374 7.92513 5.5344L9.9348 1.4645Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10"})}),z=()=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:o.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62178 6.15374 7.92513 5.5344L9.9348 1.4645Z",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",fill:"none"})}),F=I=>o.jsx(Y,{component:B,...I}),R=I=>o.jsx(Y,{component:z,...I}),N={LEFT:o.jsx("div",{className:"bwgview-header-left",children:o.jsxs(p.ConfigProvider,{theme:{components:{Tag:{controlHeight:28,controlHeightLG:28,controlHeightSM:28,controlHeightXS:28}}},children:[o.jsxs(p.Space,{children:[g&&o.jsx(mN,{triggerIcon:x(g.menuId)?o.jsx(F,{className:"bookmark-icon",style:{color:"#faad14"}}):o.jsx(R,{className:"bookmark-icon"})}),o.jsxs(p.Space.Compact,{style:{alignItems:"center"},children:[o.jsx("span",{className:"pageMenuNm",children:(()=>{let I="";return r?.useMenuTitle&&g?I=g.menuNm:r?.text?I=r.text:g&&(I=g.menuPrntId==="CM00"?g.menuNm.substring(g.menuNm.indexOf(" ")+1):g.menuNm),r?.prefix&&(I=`${r.prefix} ${I}`),r?.suffix&&(I=`${I} ${r.suffix}`),I})()}),g?.menuNo&&o.jsx(p.Tag,{className:"page-num-tag",children:g?.menuNo}),o.jsx(p.Tooltip,{title:"도움말",color:"geekblue",children:o.jsx(p.Button,{variant:"text",type:"text",className:"menu-help-btn",icon:o.jsx(Y.QuestionCircleTwoTone,{twoToneColor:"orange"})})}),o.jsx(p.Tooltip,{title:"게시판",color:"geekblue",children:o.jsx(p.Button,{variant:"text",type:"text",onClick:()=>O("CORE_REPORT"),icon:o.jsx(Y.BugFilled,{style:{color:"#1890ff"}})})})]})]}),g?.scrnId&&ae.isLocal&&o.jsx(p.Tag,{style:{marginLeft:8,fontSize:13,fontWeight:500,display:"flex"},children:o.jsx(hN,{copyable:!0,style:{display:"inherit",justifyContent:"center",alignItems:"center",marginBottom:0},children:g?.scrnId})})]})}),RIGHT:o.jsx("div",{className:"bwgview-header-right",children:o.jsx(p.ConfigProvider,{theme:{components:{Space:{padding:8},Divider:{verticalMarginInline:0}}},children:o.jsxs(p.Space,{children:[o.jsx(p.Flex,{gap:8,children:o.jsx(qf,{checkAuth:D,buttons:d?.custom||[],gap:8})}),o.jsx(p.Divider,{type:"vertical"}),o.jsx(p.Flex,{gap:8,className:"permission-buttons",children:o.jsx(qf,{checkAuth:L,buttons:d?.grant||[],gap:8})}),o.jsx(p.Divider,{type:"vertical"}),o.jsx(p.Tooltip,{placement:"bottom",color:ae.colorFormat.default.gray05,title:o.jsxs(o.Fragment,{children:["검색영역 초기화",o.jsx("br",{}),"단축키 : ",o.jsx(p.Tag,{children:"Ctrl"})," + ",o.jsx(p.Tag,{children:"D"})]}),children:o.jsx(_.BwgButton,{icon:o.jsx(Y.ClearOutlined,{style:{color:ae.colorFormat.site.purple05}}),onClick:()=>{t&&w()}})})]})})})};return o.jsxs("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column",gap:h===0?8:h===1?14:20,padding:h===0?"8px 12px":h===1?"14px 20px":"20px 30px 26px"},children:[A(),o.jsx("div",{className:"bwgview-content",children:o.jsxs("div",{className:"bwgview-content",children:[o.jsx(p.ConfigProvider,{componentSize:P.componentSize,theme:{token:{fontSize:P.fontSize}},children:o.jsx(at.BwgViewProvider,{menuId:g?.menuId,children:o.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",fontSize:`${P.fontSize}px`},children:e})})}),(E.loading||a||y)&&o.jsx(oO.LoadingContainer,{dimStyle:"light",text:y?"처리 중...":"화면 로드 중..."})]})})]})});kt.displayName="BwgView";const yN=({children:e,customTheme:t,customComponentSize:r="middle"})=>{const n={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif',fontSize:14,fontSizeHeading1:38,fontSizeHeading2:30,fontSizeHeading3:24,fontSizeHeading4:20,fontSizeHeading5:16,padding:16,margin:16,borderRadius:6,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:p.theme.defaultAlgorithm},i={...n,...t,token:{...n.token,...t?.token}};return o.jsx(p.ConfigProvider,{locale:Z1,theme:i,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},children:e})},xN="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9289)'%3e%3cpath%20d='M27.3705%2010.9919C28.5405%2010.9919%2029.489%2010.0434%2029.489%208.87338C29.489%207.70337%2028.5405%206.75488%2027.3705%206.75488C26.2004%206.75488%2025.252%207.70337%2025.252%208.87338C25.252%2010.0434%2026.2004%2010.9919%2027.3705%2010.9919Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.3053%2017.2998V32.3098H24.4248V17.2998'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M27.3701%2032.31V23.3135'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2305%2022.1925V17.642V15.6945C22.2305%2014.3075%2023.3515%2013.1865%2024.7385%2013.1865H29.9825C31.3695%2013.1865%2032.4905%2014.3075%2032.4905%2015.6945V17.642V22.1925'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.2519%2021.4229H18.6199C19.1044%2021.4229%2019.5034%2021.8219%2019.5034%2022.3064V24.4154H16.3779V22.3064C16.3779%2021.8219%2016.7769%2021.4229%2017.2614%2021.4229H17.2519Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M20.8339%2024.4062H15.0294C14.6254%2024.4062%2014.2979%2024.7338%2014.2979%2025.1377V31.6832C14.2979%2032.0872%2014.6254%2032.4147%2015.0294%2032.4147H20.8339C21.2378%2032.4147%2021.5654%2032.0872%2021.5654%2031.6832V25.1377C21.5654%2024.7338%2021.2378%2024.4062%2020.8339%2024.4062Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8252%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.0391%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.71875%2014.1642H8.53075C9.03425%2014.1642%209.49025%2013.8602%209.68025%2013.4042L10.3263%2011.8652'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.4991%205.54803L12.2266%2011.8655H17.5371L19.8836%205.51953L17.4991%205.54803Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2017%2016.4639H6.57421C5.97571%2016.4639%205.49121%2015.9794%205.49121%2015.3809C5.49121%2013.4334%207.06821%2011.8564%209.01571%2011.8564H20.3492'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.56738%2032.4805H32.2909'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9289'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",bN="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9314)'%3e%3cpath%20d='M15.1807%2019.3994L18.7717%2029.7164'%20stroke='%23FF8CC3'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2010.7443%2014.7724%2013.2618%2022.0209'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2016.2448%2012.8534%2018.7718%2020.1019'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8257%2016.71C22.2202%2012.112%2017.1947%209.67999%2012.5967%2011.276C7.99871%2012.8815%205.56671%2017.907%207.16271%2022.505L7.67571%2023.968L7.88471%2023.892C7.93221%2022.7235%208.67321%2021.6405%209.85121%2021.232C11.0292%2020.8235%2012.2737%2021.2035%2013.0432%2022.0965L13.4422%2021.954C13.4897%2020.7855%2014.2307%2019.7025%2015.4087%2019.294C16.5867%2018.8855%2017.8312%2019.2655%2018.6007%2020.1585L18.9997%2020.016C19.0472%2018.8475%2019.7882%2017.7645%2020.9662%2017.356C22.1442%2016.9475%2023.3887%2017.3275%2024.1582%2018.2205L24.3577%2018.154L23.8447%2016.691L23.8257%2016.71Z'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.37%2015.4193C23.636%2015.4858%2023.9115%2015.5238%2024.1965%2015.5238C26.068%2015.5238%2027.5785%2014.0038%2027.5785%2012.1418C27.5785%2010.2798%2026.0585%208.75977%2024.1965%208.75977C22.3345%208.75977%2020.8145%2010.2798%2020.8145%2012.1418'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M24.2061%206.12784V5.00684'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.8641%207.79018L19.1611%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5381%2016.4736L29.2411%2017.1766'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.21%2012.1318H31.331'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5469%207.79018L29.2404%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M29.3355%2029.8213H14.2305'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.2302%2029.8213L10.3447%2025.2803'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.8527%2028.4531L7.76074%2032.9941'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8447%2029.8213L27.4072%2032.9943'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9314'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",wN="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9273)'%3e%3cpath%20d='M25.9254%2020.8996C27.5151%2020.8996%2028.8039%2019.6108%2028.8039%2018.0211C28.8039%2016.4313%2027.5151%2015.1426%2025.9254%2015.1426C24.3356%2015.1426%2023.0469%2016.4313%2023.0469%2018.0211C23.0469%2019.6108%2024.3356%2020.8996%2025.9254%2020.8996Z'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M31.4825%2032.4711V25.9066C31.4825%2024.5671%2030.485%2023.4746%2029.2595%2023.4746H22.6C21.3745%2023.4746%2020.377%2024.5671%2020.377%2025.9066'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M25.2696%2026.7334H14.2686L16.5106%2032.6234H27.5021L25.2696%2026.7334Z'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.5617%2018.8385C6.1462%2017.4135%205.2627%2015.447%205.2627%2013.2715C5.2627%208.91095%208.7967%205.37695%2013.1572%205.37695C17.5177%205.37695%2021.0517%208.91095%2021.0517%2013.2715C21.0517%2015.124%2020.4152%2016.815%2019.3512%2018.164C18.0497%2019.8075%2016.1117%2020.919%2013.9172%2021.128'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%2013.2715L16.0167%2015.5705'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%208.62598V13.2715'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.35963%2016.1973L7.84663%2019.1328L4.91113%2018.6293'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M4.91113%2032.623H33.0881'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9273'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",CN=({children:e})=>{const[t,r]=m.useState({x:0,y:0}),[n,i]=m.useState(!1),[a,s]=m.useState({x:0,y:0}),[l,c]=m.useState(!1),[d,u]=m.useState(!0),f=m.useRef(null),h=[{id:"overtime",title:"시간 외 근무신청",icon:o.jsx("img",{src:wN,alt:"시간외근무신청",className:"quick-overtime"}),color:"#722ed1",onClick:()=>{console.log("시간 외 근무 신청 클릭")}},{id:"business-trip",title:"출장신청",icon:o.jsx("img",{src:xN,alt:"출장신청",className:"quick-business-trip"}),color:"#1890ff",onClick:()=>{console.log("출장 신청 클릭")}},{id:"vacation",title:"휴가신청",icon:o.jsx("img",{src:bN,alt:"휴가신청",className:"quick-holiday"}),color:"#eb2f96",onClick:()=>{console.log("휴가 신청 클릭")}},{id:"document",title:"문서신청",icon:o.jsx(Y.FileTextOutlined,{}),color:"#52c41a",onClick:()=>{console.log("문서 신청 클릭")}},{id:"profile",title:"인사정보",icon:o.jsx(Y.UserOutlined,{}),color:"#fa8c16",onClick:()=>{console.log("인사 정보 클릭")}},{id:"settings",title:"설정",icon:o.jsx(Y.SettingOutlined,{}),color:"#13c2c2",onClick:()=>{console.log("설정 클릭")}}];m.useEffect(()=>{const b=()=>{const j=window.innerHeight,E=Math.max(64,(j-300)/3);r({x:0,y:E});const C=j/2;u(E<C)};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const g=b=>{if(b.preventDefault(),b.stopPropagation(),f.current){const j=f.current.getBoundingClientRect();s({x:b.clientX-j.left,y:b.clientY-j.top}),i(!0)}},v=b=>{if(n){const j=b.clientY-a.y,P=window.innerHeight-24,C=Math.max(64,Math.min(P,j));r({x:t.x,y:C});const O=window.innerHeight/2;u(C<O)}},x=()=>{i(!1)},y=()=>{c(!l)},w=b=>{b.onClick&&b.onClick()};return m.useEffect(()=>{if(n)return document.addEventListener("mousemove",v),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",x)}},[n,a]),o.jsxs("div",{className:"quick-tab-container",ref:f,style:{position:"fixed",right:0,top:t.y,zIndex:1e3,userSelect:"none",touchAction:"none"},children:[o.jsxs("div",{className:"quick-tab",style:{position:"absolute",right:"40px",top:d?0:"auto",bottom:d?"auto":0,display:"flex",flexDirection:"column",gap:"15px",border:"1px solid #E0DEEF",borderRadius:"15px",padding:"8px",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",minWidth:"88px",maxWidth:"88px",maxHeight:d?`calc(100vh - ${t.y+12}px)`:`${t.y-12}px`,transform:l?"translateX(0)":"translateX(calc(100% + 100px))",transition:"transform 0.3s ease",marginTop:d&&t.y<100?"32px":"0",marginBottom:!d&&t.y>window.innerHeight-100?"8px":"0"},children:[o.jsx("div",{className:"quick-tab-items-wrap",style:{background:"#ffffff",borderRadius:"10px",flex:1,overflowY:"auto",maxHeight:d?`calc(100vh - ${t.y+120}px)`:`${t.y-60}px`,padding:"14px 0"},children:h.map(b=>o.jsx(p.Card,{className:"quick-tab-items",size:"small",style:{border:"none",boxShadow:"none",marginBottom:"15px",cursor:"pointer",transition:"all 0.2s ease"},styles:{body:{padding:"0"}},onClick:()=>w(b),onMouseEnter:j=>{},onMouseLeave:j=>{},children:o.jsxs("div",{className:"quick-tab-item-inner",children:[o.jsx("div",{className:"quick-tab-items-icon",style:{width:"44px",height:"44px",borderRadius:"8PX",fontSize:"24px",color:b.color,marginBottom:"5px"},children:b.icon}),o.jsx("div",{className:"quick-tab-items-title",children:b.title})]})},b.id))}),o.jsx("div",{className:"quick-tab-add-btn",style:{height:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",flexShrink:0,marginBottom:"7px"},onMouseEnter:b=>{},onMouseLeave:b=>{},children:o.jsx("span",{className:"quick-tab-add-icon",children:o.jsx(Y.PlusOutlined,{style:{color:"#CDC4FF",fontSize:"15px"}})})})]}),o.jsx("div",{className:"quick-tab-drag-btn",style:{cursor:n?"grabbing":"grab",zIndex:1001},onMouseDown:b=>g(b)}),o.jsx(p.Button,{className:`quick-tab-toggle-btn ${l?"expanded":""}`,type:"default",style:{border:"0",backgroundColor:"transparent"},onClick:y})]})},SN=()=>{const{verifyWithToken:e}=at.useAuth(),t=Xm.useNavigate(),r=Xm.useLocation();return m.useEffect(()=>{const i=new URLSearchParams(r.search).get("token");if(!i){t("/login",{replace:!0});return}(async()=>{const a=await e(i);t(a?"/main":"/login",{replace:!0})})()},[r.search]),o.jsx("div",{style:{display:"grid",placeItems:"center",height:"100dvh"},children:o.jsx(p.Spin,{tip:"인증중..."})})},jN=e=>{const{showPopup:t}=at.usePopup(),r=m.useRef(null),n=m.useRef(null),i=m.useRef(null),a=m.useRef(null),[s,l]=m.useState(!1),[c,d]=m.useState(null),[u,f]=m.useState("common"),{getCodeColor:h,getCodeName:g,getCodeList:v}=at.useCommonCode(),x=m.useMemo(()=>ae.createBwgGridRenderer((N,I,M,W,$)=>{const H=I.value,X=h?.(H)||"blue",ue=g?.(H)||H,fe=H?o.jsx(p.Tag,{color:X,style:{fontSize:"11px"},children:ue}):null;$.render(o.jsx("div",{style:{padding:"4px"},children:fe}))}),[h,g]),[y,w]=m.useState({crprCd:"",systId:"",authId:"",authNm:"",authDscr:"",authMenu:"",enblYn:"Y"}),[b,j]=m.useState(!1),P=m.useMemo(()=>[{fieldName:"authId",header:{text:"권한ID"},width:120,visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:120,visible:!1},{fieldName:"menuNm",header:{text:"메뉴명"},width:200,visible:!1},{fieldName:"grpId",header:{text:"그룹ID"},width:100},{fieldName:"btnId",header:{text:"버튼ID"},width:100},{fieldName:"btnNm",header:{text:"버튼명"},width:150},{fieldName:"btnSq",header:{text:"출력순서"},width:80,dataType:"number"},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),E={container:{check:!0,indicator:!0,footer:!0}},C={onCurrentRowChanged(N,I,M){console.log("공통 버튼 그리드 - 현재 행 변경:",{oldRow:I,newRow:M,activeTabKey:u})}},O={onCurrentRowChanged(N,I,M){console.log("커스텀 버튼 그리드 - 현재 행 변경:",{oldRow:I,newRow:M,activeTabKey:u})}},k=N=>{f(N)};m.useEffect(()=>{},[]),m.useEffect(()=>{const N=n.current?.vw?.getCurrent().itemIndex??-1;if(N<0)return;const I=n.current?.vw?.getValues(N);L.SCMAUTH00201({crprCd:I.crprCd,systId:I.systId,authId:I.authId,menuId:I.authMenu,grpId:u==="common"?"DEFAULT":"CUSTOM"})},[u]);const T=m.useMemo(()=>[{fieldName:"crprCd",header:{text:"회사코드"},width:80,visible:!1},{fieldName:"systId",header:{text:"업무분류"},width:80,renderer:"tag"},{fieldName:"authId",header:{text:"권한ID"},width:120,required:!0},{fieldName:"authNm",header:{text:"권한명칭"},width:200,styleName:"left",editable:!0},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{fieldName:"authMenu",header:{text:"메뉴"},width:100,visible:!1},{fieldName:"authMenuNm",header:{text:"메뉴"},width:100,styleName:"left"},{fieldName:"authDscr",header:{text:"권한설명"},width:300,visible:!1}],[]),D={onCurrentRowChanged(N,I,M){if(M<0)return;const W=N.getValues(M);console.log("권한 선택:",W),console.log("현재 activeTabKey:",u),r.current?.setFieldsValue(W),L.SCMAUTH00201({crprCd:W.crprCd,systId:W.systId,authId:W.authId,menuId:W.authMenu,grpId:u==="common"?"DEFAULT":"CUSTOM"})}},L={SCMAUTH00101:()=>{ae.callService("SCMAUTH00101",{crprCd:ae.getCrprCd()},{}).then(N=>{n.current?.addAllData(N.data)})},SCMAUTH00102:N=>{ae.callService("SCMAUTH00102",{...N},{}).then(I=>{I.result||r.current?.setFields([{name:"authId",errors:[I.message]}])})},SCMAUTH00201:N=>{ae.callService("SCMAUTH00201",{...N},{}).then(I=>{u==="common"?i.current?.addAllData(I.data):a.current?.addAllData(I.data)}).catch(I=>{console.error("SCMAUTH00201 호출 실패:",I)})},SCMAUTH00301:async N=>{try{const I=await ae.callService("SCMAUTH00301",{...N,crprCd:ae.getCrprCd()},{});return console.log("권한 정보 저장 성공:",I),j(!1),L.SCMAUTH00101(),I}catch(I){throw console.error("권한 정보 저장 실패:",I),I}},SCMAUTH00401:async N=>{try{const I=await ae.callService("SCMAUTH00401",{...N,crprCd:ae.getCrprCd()},{});return console.log("권한 정보 수정 성공:",I),j(!1),L.SCMAUTH00101(),I}catch(I){throw console.error("권한 정보 수정 실패:",I),I}}},A={search:()=>{L.SCMAUTH00101()},new:()=>{j(!1),w({crprCd:String(ae.getCrprCd()||""),systId:"",authId:"",authNm:"",authDscr:"",authMenu:"",enblYn:"Y"}),l(!0)},edit:()=>{const N=n.current?.getCurrentRow();N&&typeof N=="object"&&(j(!0),w({crprCd:N.crprCd||String(ae.getCrprCd()||""),systId:N.systId||"",authId:N.authId||"",authNm:N.authNm||"",authDscr:N.authDscr||"",authMenu:N.authMenu||"",enblYn:N.enblYn||"Y"}),l(!0))}},B={test:()=>{console.log("test")}},z={openPopup:N=>{t("CMDprtSrchP02",{isDefault:N})},add:()=>{console.log("add")},modify:()=>{console.log("edit")},delete:()=>{console.log("delete")}},F=(N,I)=>{w(M=>({...M,[N]:I}))},R=async()=>{try{b||await L.SCMAUTH00102({auth:r.current?.getFieldsValue()})}catch(N){console.error("권한 정보 처리 실패:",N)}};return m.useEffect(()=>{L.SCMAUTH00101()},[]),m.useEffect(()=>{},[n.current?.getGridInstance()?.gridView]),o.jsx(kt,{grantEvent:A,customEvent:B,children:o.jsxs(ze,{children:[o.jsxs(Ie,{className:"w40",children:[o.jsx(Le,{title:"권한 관리",icons:{type:"antd"},children:o.jsx(p.Popover,{styles:{body:{border:"1px solid #ededed",background:"#ededed"}},content:o.jsxs(p.Flex,{gap:3,children:[o.jsx(p.Button,{type:"primary",onClick:()=>z.openPopup(!0),children:"공통권한버튼"}),o.jsx(p.Button,{onClick:()=>z.openPopup(!1),children:"커스텀 버튼"})]}),placement:"bottom",children:o.jsx(p.Button,{icon:o.jsx(Y.SettingTwoTone,{}),title:"버튼관리",children:"버튼관리"})})}),o.jsx(Ve,{type:"nrml",ref:n,gridColumns:T,renderers:[{name:"tag",renderer:x}],gridOptions:{container:{indicator:!0,check:!0,checkAll:!0}},gridEvents:D})]}),o.jsx(Ie,{className:"w60",border:!0,children:o.jsxs(fn,{title:"권한 상세",children:[o.jsxs(_.BwgForm,{ref:r,style:{padding:"10px 20px"},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{label:"업무분류",name:"systId"},selectProps:{variant:"borderless",options:v("SYST"),copyable:!0,disabled:!0}})}),o.jsx(p.Col,{span:8,children:o.jsx(_.BwgFormItem,{label:"사용여부",name:"enblYn",children:o.jsx(p.Select,{variant:"borderless",options:[{label:"사용",value:"Y"},{label:"미사용",value:"N"}],disabled:!0})})}),o.jsx(p.Col,{span:8})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:8,children:o.jsx(_.BwgFormItem,{label:"권한ID",name:"authId",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})}),o.jsx(p.Col,{span:16,children:o.jsx(_.BwgFormItem,{label:"권한명",name:"authNm",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{label:"권한메뉴",style:{width:"100%",marginBottom:0},validateStatus:"",help:"",children:o.jsxs(p.Space.Compact,{block:!0,children:[o.jsx(p.Form.Item,{name:"authMenu",style:{width:"40%"},validateStatus:"",help:"",children:o.jsx(p.Input,{readOnly:!0,variant:"filled"})}),o.jsx(p.Form.Item,{name:"authMenuNm",style:{width:"60%"},validateStatus:"",help:"",children:o.jsx(p.Input,{readOnly:!0})})]})})})}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{label:"권한설명",name:"authDscr",children:o.jsx(p.Input.TextArea,{variant:"borderless",readOnly:!0})})})})]}),o.jsx(ar,{size:"small",activeKey:u,onChange:k,items:[{key:"common",label:"공통버튼",children:o.jsxs(Ie,{children:[o.jsx(Le,{title:"공통 버튼 매핑",children:o.jsx(Yf,{grpId:"AUTH",menuId:"CM010303",btnEvent:z})}),o.jsx(Ve,{ref:i,type:"nrml",gridColumns:P,gridOptions:E,gridEvents:C})]})},{key:"custom",label:"커스텀",children:o.jsxs(Ie,{children:[o.jsx(Le,{title:"커스텀 버튼 매핑",children:o.jsx(Yf,{grpId:"AUTH2",menuId:"CM010303"})}),o.jsx(Ve,{ref:a,type:"nrml",gridColumns:P,gridOptions:E,gridEvents:O})]})}],tabPosition:"left"})]})}),o.jsx(dn,{title:`권한별 메뉴 관리 - ${c?.authNm||""}`,open:s,placement:"right",onClose:()=>{l(!1),w({crprCd:"",systId:"",authId:"",authNm:"",authDscr:"",authMenu:"",enblYn:"Y"}),j(!1)},width:"40%",size:"large",afterOpenChange:N=>{console.log("afterOpenChange:",N)},footer:o.jsxs("div",{className:"drawer-footer-btn-group",children:[o.jsx(p.Button,{onClick:()=>{l(!1),r.current?.resetFields(),j(!1)},className:"bwg-btn",children:"취소"}),o.jsx(p.Button,{type:"primary",onClick:R,className:"bwg-btn",children:"저장"})]}),children:o.jsxs(_.BwgForm,{ref:r,initialValues:y,children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSearch,{itemProps:{name:["crprCd","crprNm"],label:"회사 코드"},placeholder:["회사 코드","회사 명칭"],popuCd:"CMAuthMstrP01"})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"systId",label:"시스템 ID"},selectProps:{variant:"borderless",options:v("SYST"),copyable:!0,disabled:!0}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{name:"authId",label:"권한 ID",children:o.jsx(p.Input,{onChange:N=>F("authId",N.target.value),placeholder:"권한 ID를 입력하세요",disabled:b})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{name:"enblYn",label:"사용여부",children:o.jsx(p.Select,{onChange:N=>F("enblYn",N),options:[{value:"Y",label:"사용"},{value:"N",label:"미사용"}]})})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{name:"authNm",label:"권한 명칭",children:o.jsx(p.Input,{onChange:N=>F("authNm",N.target.value),placeholder:"권한 명칭을 입력하세요"})})})}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{name:"authDscr",label:"권한 설명",children:o.jsx(p.Input.TextArea,{onChange:N=>F("authDscr",N.target.value),placeholder:"권한 설명을 입력하세요",rows:2})})})}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgSearch,{itemProps:{name:["authMenu","authMenuNm"],label:"권한 메뉴"},placeholder:["메뉴ID","메뉴명명"],popuCd:"CMMenuMstrP01"})})})]})})]})})},EN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),[i,a]=m.useState("menu"),s=m.useMemo(()=>ae.createBwgGridRenderer((v,x,y,w,b)=>{const j=v.getValue(x.index?.itemIndex,"systId"),P=v.getValue(x.index?.itemIndex,"roleId"),E=v.getValue(x.index?.itemIndex,"roleNm"),C=v.getValue(x.index?.itemIndex,"enblYn"),O=v.getValue(x.index?.itemIndex,"roleDscr");b.render(o.jsx(p.Card,{size:"small",style:{height:"95px"},children:o.jsxs(p.Flex,{style:{height:"95px"},children:[o.jsxs(Ie,{className:"w60",style:{position:"relative",padding:"8px"},children:[o.jsx("div",{style:{position:"absolute",top:"8px",left:"8px"},children:o.jsx(p.Tag,{color:"blue",style:{fontSize:"13px"},children:j})}),o.jsx("div",{style:{position:"absolute",top:"30%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"16px",fontWeight:"bold",color:"#262626",textAlign:"center"},children:E}),o.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translateX(-50%)",fontSize:"13px",color:"#8c8c8c",fontFamily:"monospace"},children:P}),o.jsx("div",{style:{position:"absolute",bottom:"8px",right:"8px",fontSize:"16px",color:C==="Y"?"#52c41a":"#ff4d4f"},children:C==="Y"?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):o.jsx(Y.CloseCircleOutlined,{style:{color:"#ff4d4f"}})})]}),o.jsx(p.Divider,{type:"vertical",style:{height:"95px"}}),o.jsx(Ie,{className:"w40",children:O&&o.jsx(p.Typography.Text,{style:{fontSize:"13px",color:"#595959",lineHeight:"1.4",textAlign:"left",display:"block",wordBreak:"break-word",whiteSpace:"pre-wrap"},children:o.jsx("blockquote",{children:O})})})]})}))}),[]),l=m.useMemo(()=>[{fieldName:"crprCd",header:{text:"법인코드"},width:100,visible:!1},{fieldName:"systId",header:{text:"시스템ID"},width:100,renderer:"systCard"},{fieldName:"roleId",header:{text:"역할ID"},width:120},{fieldName:"roleNm",header:{text:"역할명"},width:150},{fieldName:"roleDscr",header:{text:"역할설명"},width:200,visible:!1},{fieldName:"sortOrd",header:{text:"정렬순서"},width:80,visible:!1},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"},visible:!1}],[]),c=[{fieldName:"crprCd",header:{text:"법인코드"},width:100,visible:!1},{fieldName:"roleId",header:{text:"역할ID"},width:120,visible:!1},{fieldName:"dprtCd",header:{text:"부서코드"},width:120},{fieldName:"dprtNm",header:{text:"부서"},width:120},{fieldName:"subSyncYn",header:{text:"동기화여부"},width:100,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],d=[{fieldName:"userId",header:{text:"사용자ID"},width:120},{fieldName:"userNm",header:{text:"사용자명"},width:150},{fieldName:"deptNm",header:{text:"부서명"},width:150},{fieldName:"email",header:{text:"이메일"},width:200,visible:!1},{fieldName:"enblYn",header:{text:"사용여부"},width:80,visible:!1}],u=m.useMemo(()=>({display:{rowHeight:100},layout:{colspan:[{fieldName:"systId",span:3}]},container:{state:!0,check:!0,checkAll:!0,indicator:!0,footer:!0}}),[]),f={onCurrentRowChanged(v,x,y){if(y<0)return;const w=v.getValues(y);switch(i){case"menu":break;case"dept":h.SCMROLE00103(w.roleId);break;case"user":h.SCMROLE00104(w.roleId);break}}},h={SCMROLE00101:()=>{ae.callService("SCMROLE00101",{crprCd:ae.getCrprCd()}).then(v=>{console.log("SCMROLE00101:",v),t.current?.addAllData(v.data)})},SCMROLE00102:v=>{ae.callService("SCMROLE00102",{crprCd:ae.getCrprCd(),roleId:v}).then(x=>{console.log("SCMROLE00102:",x)})},SCMROLE00103:v=>{ae.callService("SCMROLE00103",{crprCd:ae.getCrprCd(),roleId:v}).then(x=>{console.log("SCMROLE00103:",x),r.current?.addAllData(x.data)})},SCMROLE00104:v=>{ae.callService("SCMROLE00104",{crprCd:ae.getCrprCd(),roleId:v}).then(x=>{console.log("SCMROLE00104:",x),n.current?.addAllData(x.data)})}},g={search:()=>{h.SCMROLE00101()}};return m.useEffect(()=>{const v=t.current?.getCurrentIndex()??-1;if(v<0)return;const x=t.current?.vw?.getValue(v,"roleId");switch(i){case"menu":break;case"dept":h.SCMROLE00103(x);break;case"user":h.SCMROLE00104(x);break}},[i]),o.jsx(kt,{grantEvent:g,children:o.jsxs(ze,{children:[o.jsxs(Ie,{className:"w40",children:[o.jsx(Le,{title:"역할 목록",icons:{type:"antd"}}),o.jsx(Ve,{ref:t,type:"nrml",gridColumns:l,gridOptions:u,gridEvents:f,renderers:[{name:"systCard",renderer:s}]})]}),o.jsxs(Ie,{className:"w60",children:[o.jsx(Le,{title:"역할별 관리"}),o.jsx(p.Tabs,{className:"bwg-tab",activeKey:i,onChange:v=>a(v),items:[{key:"menu",label:"역할별 메뉴",icon:o.jsx(Y.MenuOutlined,{}),children:o.jsx(Ve,{type:"tree",gridColumns:[{fieldName:"menuId",header:{text:"메뉴ID"},width:120},{fieldName:"menuNm",header:{text:"메뉴명"},width:200},{fieldName:"menuPath",header:{text:"메뉴경로"},width:300},{fieldName:"enblYn",header:{text:"사용여부"},width:80}],gridOptions:{display:{rowHeight:40}}})},{key:"dept",label:"역할별 부서",icon:o.jsx(Y.TeamOutlined,{}),children:o.jsxs(ze,{children:[o.jsx(Ie,{className:"w50",children:o.jsx(Ve,{ref:r,type:"nrml",gridColumns:c,gridOptions:{display:{rowHeight:40}}})}),o.jsx(Ie,{className:"w50",border:!0,children:o.jsx(fn,{title:"부서정보",children:"123"})})]})},{key:"user",label:"역할별 사용자",icon:o.jsx(Y.UserOutlined,{}),children:o.jsxs(ze,{children:[o.jsx(Ie,{className:"w50",children:o.jsx(Ve,{ref:n,type:"nrml",gridColumns:d,gridOptions:{display:{rowHeight:40}}})}),o.jsx(Ie,{className:"w50",border:!0,children:o.jsx(fn,{title:"사용자정보",children:"123"})})]})}]})]})]})})};var ca={},I0;function PN(){if(I0)return ca;I0=1;function e(E){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},e(E)}Object.defineProperty(ca,"__esModule",{value:!0}),ca.CopyToClipboard=void 0;var t=i(m),r=i(JC()),n=["text","onCopy","options","children"];function i(E){return E&&E.__esModule?E:{default:E}}function a(E,C){var O=Object.keys(E);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(E);C&&(k=k.filter(function(T){return Object.getOwnPropertyDescriptor(E,T).enumerable})),O.push.apply(O,k)}return O}function s(E){for(var C=1;C<arguments.length;C++){var O=arguments[C]!=null?arguments[C]:{};C%2?a(Object(O),!0).forEach(function(k){j(E,k,O[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(O)):a(Object(O)).forEach(function(k){Object.defineProperty(E,k,Object.getOwnPropertyDescriptor(O,k))})}return E}function l(E,C){if(E==null)return{};var O=c(E,C),k,T;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(E);for(T=0;T<D.length;T++)k=D[T],!(C.indexOf(k)>=0)&&Object.prototype.propertyIsEnumerable.call(E,k)&&(O[k]=E[k])}return O}function c(E,C){if(E==null)return{};var O={},k=Object.keys(E),T,D;for(D=0;D<k.length;D++)T=k[D],!(C.indexOf(T)>=0)&&(O[T]=E[T]);return O}function d(E,C){if(!(E instanceof C))throw new TypeError("Cannot call a class as a function")}function u(E,C){for(var O=0;O<C.length;O++){var k=C[O];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}function f(E,C,O){return C&&u(E.prototype,C),Object.defineProperty(E,"prototype",{writable:!1}),E}function h(E,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(C&&C.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),Object.defineProperty(E,"prototype",{writable:!1}),C&&g(E,C)}function g(E,C){return g=Object.setPrototypeOf||function(k,T){return k.__proto__=T,k},g(E,C)}function v(E){var C=w();return function(){var k=b(E),T;if(C){var D=b(this).constructor;T=Reflect.construct(k,arguments,D)}else T=k.apply(this,arguments);return x(this,T)}}function x(E,C){if(C&&(e(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(E)}function y(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function w(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(E){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(O){return O.__proto__||Object.getPrototypeOf(O)},b(E)}function j(E,C,O){return C in E?Object.defineProperty(E,C,{value:O,enumerable:!0,configurable:!0,writable:!0}):E[C]=O,E}var P=(function(E){h(O,E);var C=v(O);function O(){var k;d(this,O);for(var T=arguments.length,D=new Array(T),L=0;L<T;L++)D[L]=arguments[L];return k=C.call.apply(C,[this].concat(D)),j(y(k),"onClick",function(A){var B=k.props,z=B.text,F=B.onCopy,R=B.children,N=B.options,I=t.default.Children.only(R),M=(0,r.default)(z,N);F&&F(z,M),I&&I.props&&typeof I.props.onClick=="function"&&I.props.onClick(A)}),k}return f(O,[{key:"render",value:function(){var T=this.props,D=T.children,L=l(T,n),A=t.default.Children.only(D);return t.default.cloneElement(A,s(s({},L),{},{onClick:this.onClick}))}}]),O})(t.default.PureComponent);return ca.CopyToClipboard=P,j(P,"defaultProps",{onCopy:void 0,options:void 0}),ca}var fd,N0;function ON(){if(N0)return fd;N0=1;var e=PN(),t=e.CopyToClipboard;return t.CopyToClipboard=t,fd=t,fd}var kN=ON();const Zh=wr(kN),pr=({children:e,onClick:t,isActive:r=!1,icon:n})=>{const[i,a]=m.useState(!1),s={width:"100%",textAlign:"left",marginBottom:"8px",border:"none",borderRadius:"8px",padding:"12px 16px",fontWeight:500,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative",overflow:"hidden",background:r?"#00bcd4":"transparent",color:r?"#ffffff":"#595959",transform:i?"translateX(4px)":"translateX(0)",boxShadow:r?i?"0 4px 12px rgba(0, 188, 212, 0.3)":"none":i?"0 2px 8px rgba(0, 0, 0, 0.1)":"none"},l={position:"absolute",left:0,top:0,bottom:0,width:"4px",background:"#00bcd4",borderRadius:"0 2px 2px 0"};return o.jsxs(p.Button,{type:"text",onClick:t,style:s,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[r&&o.jsx("div",{style:l}),n&&o.jsx("span",{style:{marginRight:"8px",fontSize:"16px"},children:n}),o.jsx("span",{style:{fontSize:"14px",lineHeight:1.4},children:e})]})},hr=({importText:e,onCopy:t})=>o.jsx(Zh,{text:e,onCopy:()=>{p.message.success("import 문이 복사되었습니다!"),t?.()},children:o.jsxs("div",{style:{background:"#1e1e1e",border:"1px solid #3c3c3c",borderRadius:"6px",padding:"12px 16px",fontFamily:'Monaco, Menlo, "Ubuntu Mono", monospace',fontSize:"13px",color:"#d4d4d4",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"all 0.2s ease",userSelect:"none"},onMouseEnter:r=>{r.currentTarget.style.background="#2d2d30",r.currentTarget.style.borderColor="#4a4a4a"},onMouseLeave:r=>{r.currentTarget.style.background="#1e1e1e",r.currentTarget.style.borderColor="#3c3c3c"},children:[o.jsx("code",{children:e}),o.jsx(Y.CopyOutlined,{style:{color:"#858585",fontSize:"14px"}})]})}),Yr=({selectedRowKeys:e,onSelectionChange:t,componentName:r})=>{const n=[{property:"label",description:"폼 아이템의 라벨 텍스트입니다. 필수 항목일 경우 자동으로 별표(*)가 추가됩니다.",type:"string | React.ReactNode"},{property:"name",description:"폼 필드의 이름입니다. Form.useForm과 함께 사용되어 필드 값을 관리합니다.",type:"string | string[]"},{property:"rules",description:'필드의 유효성 검사 규칙입니다. Ant Design의 Form.Item rules를 따릅니다. (예: [{ required: true, message: "필수 입력 항목입니다." }])',type:"Rule[]"},{property:"initialValue",description:"필드의 초기값을 설정합니다.",type:"any"}],i=()=>{if(e.length===0){p.message.warning("선택된 속성이 없습니다!");return}const a={label:"'라벨'",name:"'fieldName'",rules:"[{ required: true, message: '필수 항목입니다.' }]",initialValue:"'초기값'"},s=e.map(c=>` ${c}: ${a[c]||"true"}`).join(`,
183
+ `]:Object.assign(Object.assign({},oC(e)),{marginInlineStart:e.marginXXS})}),LI(e)),zI(e)),FI()),{"&-rtl":{direction:"rtl"}})}},HI=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),QC=os("Typography",VI,HI),UI=e=>{const{prefixCls:t,"aria-label":r,className:n,style:i,direction:a,maxLength:s,autoSize:l=!0,value:c,onSave:d,onCancel:u,onEnd:f,component:h,enterIcon:g=S.createElement(_C,null)}=e,v=S.useRef(null),x=S.useRef(!1),y=S.useRef(null),[w,b]=S.useState(c);S.useEffect(()=>{b(c)},[c]),S.useEffect(()=>{var z;if(!((z=v.current)===null||z===void 0)&&z.resizableTextArea){const{textArea:F}=v.current.resizableTextArea;F.focus();const{length:R}=F.value;F.setSelectionRange(R,R)}},[]);const j=({target:z})=>{b(z.value.replace(/[\n\r]/g,""))},P=()=>{x.current=!0},E=()=>{x.current=!1},C=({keyCode:z})=>{x.current||(y.current=z)},O=()=>{d(w.trim())},k=({keyCode:z,ctrlKey:F,altKey:R,metaKey:N,shiftKey:I})=>{y.current!==z||x.current||F||R||N||I||(z===b0.ENTER?(O(),f?.()):z===b0.ESC&&u())},T=()=>{O()},[D,L,A]=QC(t),B=_e(t,`${t}-edit-content`,{[`${t}-rtl`]:a==="rtl",[`${t}-${h}`]:!!h},n,L,A);return D(S.createElement("div",{className:B,style:i},S.createElement(NI,{ref:v,maxLength:s,value:w,onChange:j,onKeyDown:C,onKeyUp:k,onCompositionStart:P,onCompositionEnd:E,onBlur:T,"aria-label":r,rows:1,autoSize:l}),g!==null?IC(g,{className:`${t}-edit-content-confirm`}):null))};var id,O0;function WI(){return O0||(O0=1,id=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||r.forEach(function(i){e.addRange(i)}),t&&t.focus()}}),id}var od,k0;function JC(){if(k0)return od;k0=1;var e=WI(),t={"text/plain":"Text","text/html":"Url",default:"Text"},r="Copy to clipboard: #{key}, Enter";function n(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function i(a,s){var l,c,d,u,f,h,g=!1;s||(s={}),l=s.debug||!1;try{d=e(),u=document.createRange(),f=document.getSelection(),h=document.createElement("span"),h.textContent=a,h.ariaHidden="true",h.style.all="unset",h.style.position="fixed",h.style.top=0,h.style.clip="rect(0, 0, 0, 0)",h.style.whiteSpace="pre",h.style.webkitUserSelect="text",h.style.MozUserSelect="text",h.style.msUserSelect="text",h.style.userSelect="text",h.addEventListener("copy",function(x){if(x.stopPropagation(),s.format)if(x.preventDefault(),typeof x.clipboardData>"u"){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var y=t[s.format]||t.default;window.clipboardData.setData(y,a)}else x.clipboardData.clearData(),x.clipboardData.setData(s.format,a);s.onCopy&&(x.preventDefault(),s.onCopy(x.clipboardData))}),document.body.appendChild(h),u.selectNodeContents(h),f.addRange(u);var v=document.execCommand("copy");if(!v)throw new Error("copy command was unsuccessful");g=!0}catch(x){l&&console.error("unable to copy using execCommand: ",x),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",a),s.onCopy&&s.onCopy(window.clipboardData),g=!0}catch(y){l&&console.error("unable to copy using clipboardData: ",y),l&&console.error("falling back to prompt"),c=n("message"in s?s.message:r),window.prompt(c,a)}}finally{f&&(typeof f.removeRange=="function"?f.removeRange(u):f.removeAllRanges()),h&&document.body.removeChild(h),d()}return g}return od=i,od}var KI=JC();const qI=wr(KI),YI=(e,t=!1)=>t&&e==null?[]:Array.isArray(e)?e:[e];var GI=exports&&exports.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function l(u){try{d(n.next(u))}catch(f){s(f)}}function c(u){try{d(n.throw(u))}catch(f){s(f)}}function d(u){u.done?a(u.value):i(u.value).then(l,c)}d((n=n.apply(e,t||[])).next())})};const XI=({copyConfig:e,children:t})=>{const[r,n]=S.useState(!1),[i,a]=S.useState(!1),s=S.useRef(null),l=()=>{s.current&&clearTimeout(s.current)},c={};e.format&&(c.format=e.format),S.useEffect(()=>l,[]);const d=yr(u=>GI(void 0,void 0,void 0,function*(){var f;u?.preventDefault(),u?.stopPropagation(),a(!0);try{const h=typeof e.text=="function"?yield e.text():e.text;qI(h||YI(t,!0).join("")||"",c),a(!1),n(!0),l(),s.current=setTimeout(()=>{n(!1)},3e3),(f=e.onCopy)===null||f===void 0||f.call(e,u)}catch(h){throw a(!1),h}}));return{copied:r,copyLoading:i,onClick:d}};function ad(e,t){return S.useMemo(()=>{const r=!!e;return[r,Object.assign(Object.assign({},t),r&&typeof e=="object"?e:null)]},[e])}const ZI=e=>{const t=m.useRef(void 0);return m.useEffect(()=>{t.current=e}),t.current},QI=(e,t,r)=>m.useMemo(()=>e===!0?{title:t??r}:m.isValidElement(e)?{title:e}:typeof e=="object"?Object.assign({title:t??r},e):{title:e},[e,t,r]);var JI=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const eS=S.forwardRef((e,t)=>{const{prefixCls:r,component:n="article",className:i,rootClassName:a,setContentRef:s,children:l,direction:c,style:d}=e,u=JI(e,["prefixCls","component","className","rootClassName","setContentRef","children","direction","style"]),{getPrefixCls:f,direction:h,className:g,style:v}=Ic("typography"),x=c??h,y=s?es(t,s):t,w=f("typography",r);process.env.NODE_ENV!=="production"&&pn("Typography").deprecated(!s,"setContentRef","ref");const[b,j,P]=QC(w),E=_e(w,g,{[`${w}-rtl`]:x==="rtl"},i,a,j,P),C=Object.assign(Object.assign({},v),d);return b(S.createElement(n,Object.assign({className:E,style:C,ref:y},u),l))});process.env.NODE_ENV!=="production"&&(eS.displayName="Typography");var eN={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},tN=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:eN}))},tS=S.forwardRef(tN);process.env.NODE_ENV!=="production"&&(tS.displayName="CheckOutlined");var rN={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},nN=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:rN}))},rS=S.forwardRef(nN);process.env.NODE_ENV!=="production"&&(rS.displayName="CopyOutlined");var iN={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},oN=function(t,r){return S.createElement(Dn,Mt({},t,{ref:r,icon:iN}))},nS=S.forwardRef(oN);process.env.NODE_ENV!=="production"&&(nS.displayName="LoadingOutlined");function T0(e){return e===!1?[!1,!1]:Array.isArray(e)?e:[e]}function sd(e,t,r){return e===!0||e===void 0?t:e||r&&t}function aN(e){const t=document.createElement("em");e.appendChild(t),process.env.NODE_ENV!=="production"&&(t.className="ant-typography-css-ellipsis-content-measure");const r=e.getBoundingClientRect(),n=t.getBoundingClientRect();return e.removeChild(t),r.left>n.left||n.right>r.right||r.top>n.top||n.bottom>r.bottom}const Xh=e=>["string","number"].includes(typeof e),sN=({prefixCls:e,copied:t,locale:r,iconOnly:n,tooltips:i,icon:a,tabIndex:s,onCopy:l,loading:c})=>{const d=T0(i),u=T0(a),{copied:f,copy:h}=r??{},g=t?f:h,v=sd(d[t?1:0],g),x=typeof v=="string"?v:g;return S.createElement(ss,{title:v,getPopupContainer:y=>y.parentNode},S.createElement("button",{type:"button",className:_e(`${e}-copy`,{[`${e}-copy-success`]:t,[`${e}-copy-icon-only`]:n}),onClick:l,"aria-label":x,tabIndex:s},t?sd(u[1],S.createElement(tS,null),!0):sd(u[0],c?S.createElement(nS,null):S.createElement(rS,null),!0)))},Ys=S.forwardRef(({style:e,children:t},r)=>{const n=S.useRef(null);return S.useImperativeHandle(r,()=>({isExceed:()=>{const i=n.current;return i.scrollHeight>i.clientHeight},getHeight:()=>n.current.clientHeight})),S.createElement("span",{"aria-hidden":!0,ref:n,style:Object.assign({position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)"},e)},t)}),lN=e=>e.reduce((t,r)=>t+(Xh(r)?String(r).length:1),0);function M0(e,t){let r=0;const n=[];for(let i=0;i<e.length;i+=1){if(r===t)return n;const a=e[i],l=Xh(a)?String(a).length:1,c=r+l;if(c>t){const d=t-r;return n.push(String(a).slice(0,d)),n}n.push(a),r=c}return e}const ld=0,cd=1,ud=2,dd=3,R0=4,Gs={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function cN(e){const{enableMeasure:t,width:r,text:n,children:i,rows:a,expanded:s,miscDeps:l,onEllipsis:c}=e,d=S.useMemo(()=>Ma(n),[n]),u=S.useMemo(()=>lN(d),[n]),f=S.useMemo(()=>i(d,!1),[n]),[h,g]=S.useState(null),v=S.useRef(null),x=S.useRef(null),y=S.useRef(null),w=S.useRef(null),b=S.useRef(null),[j,P]=S.useState(!1),[E,C]=S.useState(ld),[O,k]=S.useState(0),[T,D]=S.useState(null);pt(()=>{C(t&&r&&u?cd:ld)},[r,n,a,t,d]),pt(()=>{var z,F,R,N;if(E===cd){C(ud);const I=x.current&&getComputedStyle(x.current).whiteSpace;D(I)}else if(E===ud){const I=!!(!((z=y.current)===null||z===void 0)&&z.isExceed());C(I?dd:R0),g(I?[0,u]:null),P(I);const M=((F=y.current)===null||F===void 0?void 0:F.getHeight())||0,W=a===1?0:((R=w.current)===null||R===void 0?void 0:R.getHeight())||0,$=((N=b.current)===null||N===void 0?void 0:N.getHeight())||0,H=Math.max(M,W+$);k(H+1),c(I)}},[E]);const L=h?Math.ceil((h[0]+h[1])/2):0;pt(()=>{var z;const[F,R]=h||[0,0];if(F!==R){const I=(((z=v.current)===null||z===void 0?void 0:z.getHeight())||0)>O;let M=L;R-F===1&&(M=I?F:R),g(I?[F,M]:[M,R])}},[h,L]);const A=S.useMemo(()=>{if(!t)return i(d,!1);if(E!==dd||!h||h[0]!==h[1]){const z=i(d,!1);return[R0,ld].includes(E)?z:S.createElement("span",{style:Object.assign(Object.assign({},Gs),{WebkitLineClamp:a})},z)}return i(s?d:M0(d,h[0]),j)},[s,E,h,d].concat(zt(l))),B={width:r,margin:0,padding:0,whiteSpace:T==="nowrap"?"normal":"inherit"};return S.createElement(S.Fragment,null,A,E===ud&&S.createElement(S.Fragment,null,S.createElement(Ys,{style:Object.assign(Object.assign(Object.assign({},B),Gs),{WebkitLineClamp:a}),ref:y},f),S.createElement(Ys,{style:Object.assign(Object.assign(Object.assign({},B),Gs),{WebkitLineClamp:a-1}),ref:w},f),S.createElement(Ys,{style:Object.assign(Object.assign(Object.assign({},B),Gs),{WebkitLineClamp:1}),ref:b},i([],!0))),E===dd&&h&&h[0]!==h[1]&&S.createElement(Ys,{style:Object.assign(Object.assign({},B),{top:400}),ref:v},i(M0(d,L),!0)),E===cd&&S.createElement("span",{style:{whiteSpace:"inherit"},ref:x}))}const iS=({enableEllipsis:e,isEllipsis:t,children:r,tooltipProps:n})=>!n?.title||!e?r:S.createElement(ss,Object.assign({open:t?void 0:!1},n),r);process.env.NODE_ENV!=="production"&&(iS.displayName="EllipsisTooltip");var uN=exports&&exports.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};function dN({mark:e,code:t,underline:r,delete:n,strong:i,keyboard:a,italic:s},l){let c=l;function d(u,f){f&&(c=S.createElement(u,{},c))}return d("strong",i),d("u",r),d("del",n),d("code",t),d("mark",e),d("kbd",a),d("i",s),c}const fN="...",A0=["delete","mark","code","underline","strong","keyboard","italic"],pN=S.forwardRef((e,t)=>{var r;const{prefixCls:n,className:i,style:a,type:s,disabled:l,children:c,ellipsis:d,editable:u,copyable:f,component:h,title:g}=e,v=uN(e,["prefixCls","className","style","type","disabled","children","ellipsis","editable","copyable","component","title"]),{getPrefixCls:x,direction:y}=S.useContext(Mn),[w]=lM("Text"),b=S.useRef(null),j=S.useRef(null),P=x("typography",n),E=Ow(v,A0),[C,O]=ad(u),[k,T]=go(!1,{value:O.editing}),{triggerType:D=["icon"]}=O,L=ae=>{var Me;ae&&((Me=O.onStart)===null||Me===void 0||Me.call(O)),T(ae)},A=ZI(k);pt(()=>{var ae;!k&&A&&((ae=j.current)===null||ae===void 0||ae.focus())},[k]);const B=ae=>{ae?.preventDefault(),L(!0)},z=ae=>{var Me;(Me=O.onChange)===null||Me===void 0||Me.call(O,ae),L(!1)},F=()=>{var ae;(ae=O.onCancel)===null||ae===void 0||ae.call(O),L(!1)},[R,N]=ad(f),{copied:I,copyLoading:M,onClick:W}=XI({copyConfig:N,children:c}),[$,H]=S.useState(!1),[X,ue]=S.useState(!1),[fe,me]=S.useState(!1),[Pe,Ee]=S.useState(!1),[J,ye]=S.useState(!0),[ge,V]=ad(d,{expandable:!1,symbol:ae=>ae?w?.collapse:w?.expand}),[oe,K]=go(V.defaultExpanded||!1,{value:V.expanded}),ce=ge&&(!oe||V.expandable==="collapsible"),{rows:he=1}=V,we=S.useMemo(()=>ce&&(V.suffix!==void 0||V.onEllipsis||V.expandable||C||R),[ce,V,C,R]);pt(()=>{ge&&!we&&(H(Mv("webkitLineClamp")),ue(Mv("textOverflow")))},[we,ge]);const[Se,Te]=S.useState(ce),Ne=S.useMemo(()=>we?!1:he===1?X:$,[we,X,$]);pt(()=>{Te(Ne&&ce)},[Ne,ce]);const U=ce&&(Se?Pe:fe),ne=ce&&he===1&&Se,re=ce&&he>1&&Se,G=(ae,Me)=>{var Fe;K(Me.expanded),(Fe=V.onExpand)===null||Fe===void 0||Fe.call(V,ae,Me)},[te,de]=S.useState(0),q=({offsetWidth:ae})=>{de(ae)},Q=ae=>{var Me;me(ae),fe!==ae&&((Me=V.onEllipsis)===null||Me===void 0||Me.call(V,ae))};S.useEffect(()=>{const ae=b.current;if(ge&&Se&&ae){const Me=aN(ae);Pe!==Me&&Ee(Me)}},[ge,Se,c,re,J,te]),S.useEffect(()=>{const ae=b.current;if(typeof IntersectionObserver>"u"||!ae||!Se||!ce)return;const Me=new IntersectionObserver(()=>{ye(!!ae.offsetParent)});return Me.observe(ae),()=>{Me.disconnect()}},[Se,ce]);const Z=QI(V.tooltip,O.text,c),le=S.useMemo(()=>{if(!(!ge||Se))return[O.text,c,g,Z.title].find(Xh)},[ge,Se,g,Z.title,U]);if(k)return S.createElement(UI,{value:(r=O.text)!==null&&r!==void 0?r:typeof c=="string"?c:"",onSave:z,onCancel:F,onEnd:O.onEnd,prefixCls:P,className:i,style:a,direction:y,component:h,maxLength:O.maxLength,autoSize:O.autoSize,enterIcon:O.enterIcon});const ie=()=>{const{expandable:ae,symbol:Me}=V;return ae?S.createElement("button",{type:"button",key:"expand",className:`${P}-${oe?"collapse":"expand"}`,onClick:Fe=>G(Fe,{expanded:!oe}),"aria-label":oe?w.collapse:w?.expand},typeof Me=="function"?Me(oe):Me):null},pe=()=>{if(!C)return;const{icon:ae,tooltip:Me,tabIndex:Fe}=O,Hr=Ma(Me)[0]||w?.edit,tn=typeof Hr=="string"?Hr:"";return D.includes("icon")?S.createElement(ss,{key:"edit",title:Me===!1?"":Hr},S.createElement("button",{type:"button",ref:j,className:`${P}-edit`,onClick:B,"aria-label":tn,tabIndex:Fe},ae||S.createElement(gw,{role:"button"}))):null},ve=()=>R?S.createElement(sN,Object.assign({key:"copy"},N,{prefixCls:P,copied:I,locale:w,onCopy:W,loading:M,iconOnly:c==null})):null,be=ae=>[ae&&ie(),pe(),ve()],Be=ae=>[ae&&!oe&&S.createElement("span",{"aria-hidden":!0,key:"ellipsis"},fN),V.suffix,be(ae)];return S.createElement(Ro,{onResize:q,disabled:!ce},ae=>S.createElement(iS,{tooltipProps:Z,enableEllipsis:ce,isEllipsis:U},S.createElement(eS,Object.assign({className:_e({[`${P}-${s}`]:s,[`${P}-disabled`]:l,[`${P}-ellipsis`]:ge,[`${P}-ellipsis-single-line`]:ne,[`${P}-ellipsis-multiple-line`]:re},i),prefixCls:n,style:Object.assign(Object.assign({},a),{WebkitLineClamp:re?he:void 0}),component:h,ref:es(ae,b,t),direction:y,onClick:D.includes("text")?B:void 0,"aria-label":le?.toString(),title:g},E),S.createElement(cN,{enableMeasure:ce&&!Se,text:c,rows:he,width:te,onEllipsis:Q,expanded:oe,miscDeps:[I,oe,M,C,R,w].concat(zt(A0.map(Me=>e[Me])))},(Me,Fe)=>dN(e,S.createElement(S.Fragment,null,Me.length>0&&Fe&&!oe&&le?S.createElement("span",{key:"show-content","aria-hidden":!0},Me):Me,Be(Fe)))))))}),hN=S.forwardRef((e,t)=>S.createElement(pN,Object.assign({ref:t},e,{component:"div"}))),oS=(e,t,r=null)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.key===t)return{node:i,ctx:{parent:r,index:n,siblings:e}};if(i.children?.length){const a=oS(i.children,t,i);if(a.node)return a}}return{node:null,ctx:null}},aS=(e,t)=>{if(!e.children)return!1;for(const r of e.children)if(r.key===t||aS(r,t))return!0;return!1};function gN({open:e,onClose:t}){const{nodes:r,rootIds:n,addFolder:i,editFolder:a,removeFolder:s,removeMenu:l,moveNode:c}=tt.useFavoriteStore(),d=m.useRef(null),[u,f]=m.useState([]),[h,g]=m.useState([]),[v,x]=m.useState(""),[y,w]=m.useState("ADD"),[b,j]=m.useState(!1),[P,E]=m.useState("");m.useEffect(()=>{e&&g(n)},[e]),m.useEffect(()=>{const k=C(r,n);f(k)},[r]),m.useEffect(()=>{b&&P&&(d.current.setFieldValue("prntBkmkId",P),d.current.setFieldValue("prntBkmkNm",r[P]?.bkmkNm??"-")),b&&y==="EDIT"&&(d.current.setFieldValue("bkmkId",P),d.current.setFieldValue("bkmkNm",r[P]?.bkmkNm)),!b&&y=="ADD"&&g(k=>[...k,P]),!b&&d.current&&(E("-"),d.current.resetFields())},[b,y,P,r]);const C=(k,T)=>{const D=(L,A="-")=>{const B=k[L];if(!B)return null;const z={key:B.bkmkId,type:B.type,title:B.type==="F"?B.bkmkNm:B.menuNm?`${B.menuNm} (${B.menuId})`:B.menuId,parentId:A,sortOrdr:B.sortOrdr??0};if(B.type==="F"){const R=(B.children??[]).map(N=>D(N,B.bkmkId)).filter(Boolean);return{...z,children:R}}return z};return T.map(L=>D(L,"-")).filter(Boolean)},O=()=>{if(w("ADD"),!v){E("-"),j(!0);return}const k=r[v];if(!k){E("-"),j(!0);return}k.type==="F"?E(k.bkmkId):E(k.prntBkmkId),j(!0)};return o.jsxs(p.ConfigProvider,{theme:{components:{Modal:{wireframe:!0},Button:{defaultColor:"var(--text-secondary)",defaultHoverColor:"var(--primary-color)",defaultHoverBorderColor:"var(--primary-color)",controlHeight:30,fontSize:13,borderRadius:"var(--border-radius-sm)"}}},children:[o.jsxs(p.Modal,{open:e,okButtonProps:{style:{display:"none"}},cancelText:"닫기",width:560,style:{zIndex:1001},styles:{body:{paddingTop:12,paddingBottom:12}},title:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:12},children:o.jsx(p.Typography.Text,{style:{fontSize:18},children:"북마크 관리"})}),onCancel:t,children:[o.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginBottom:10},children:[o.jsx(p.Button,{type:"primary",variant:"solid",className:"bwg-btn",icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsxs("g",{"clip-path":"url(#clip0_1298_1781)",children:[o.jsx("path",{d:"M9.3002 14.26H13.5702C14.4002 14.26 15.0702 13.59 15.0702 12.76V7.45999C15.0702 6.89999 14.6102 6.43999 14.0502 6.43999H8.8302L7.7102 3.48999H4.1702C3.6402 3.48999 3.2002 3.92999 3.2002 4.45999V8.10999",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M8.18018 4.58997H14.0502C14.6102 4.58997 15.0702 5.04997 15.0702 5.60997V8.25997",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M5.43018 9.52002V14.52",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M7.93018 12.01H2.93018",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1298_1781",children:o.jsx("rect",{width:"18",height:"18",fill:"white"})})})]}),style:{padding:"0 10px",boxShadow:"none"},onClick:O,children:"새 폴더"}),o.jsx("div",{children:o.jsxs(p.ConfigProvider,{theme:{components:{Button:{defaultHoverColor:"#333333",defaultHoverBorderColor:"#d9d9d9",defaultHoverBg:"#f1f1f1",defaultActiveColor:"#777777",defaultActiveBorderColor:"#d9d9d9",contentFontSize:13,defaultColor:"#777777"}}},children:[o.jsx(p.Tooltip,{title:"펼치기",children:o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332M7.99984 2.66667V13.3333",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28},onClick:()=>{const k=Object.values(r).filter(T=>T.type==="F").map(T=>T.bkmkId);g(k)}})}),o.jsx(p.Tooltip,{title:"접기",children:o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28,marginLeft:5},onClick:()=>g([])})})]})})]}),o.jsxs("div",{style:{maxHeight:420,height:350,overflow:"auto",border:"1px solid #e0e0e0",borderRadius:8,padding:10},children:[u.length==0&&o.jsx(p.Empty,{description:o.jsxs(p.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",o.jsx("br",{}),"새로운 폴더를 생성해보세요."]})}),o.jsx(p.Tree,{blockNode:!0,draggable:!0,allowDrop:({dropNode:k,dropPosition:T})=>{const D=k.type==="F";return T===0?D:!0},onDrop:k=>{const{dragNode:T,node:D,dropPosition:L,dropToGap:A}=k;if(T.key===D.key||aS(T,D.key))return;let B,z;if(A){const R=oS(u,D.key).ctx,N=R.index;B=R.parent?R.parent.key:"-",z=L>0?N+1:N}else{if(D.type!=="F")return;const R=D.children||[];B=D.key,z=R.length}const F=se.getUserId();if(T.type==="F")c({bkmkId:T.key,newPrntBkmkId:B,sortOrdr:z,userId:F}).catch(()=>{p.Modal.error({title:"이동 실패",content:"폴더 이동 중 오류가 발생했어요."})});else{if(B==="-"){p.Modal.warning({title:"이동 불가",content:"메뉴는 최상위로 이동할 수 없어요."});return}c({bkmkId:T.key,newPrntBkmkId:B,sortOrdr:z,userId:F}).catch(()=>{p.Modal.error({title:"이동 실패",content:"메뉴 이동 중 오류가 발생했어요."})})}A===!1&&g(R=>Array.from(new Set([...R,D.key])))},showLine:!0,treeData:u,selectedKeys:[v],expandedKeys:h,onExpand:g,onSelect:k=>x(k[0]),titleRender:k=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[o.jsxs("span",{children:[k.type==="F"?"📁":"📄"," ",k.title,k.isNew?o.jsx(p.Tag,{color:"gold",style:{marginLeft:4,fontSize:"10px",height:"16px",lineHeight:"16px",padding:"0 5px"},children:"N"}):null]}),o.jsxs("span",{style:{display:"inline-flex",gap:8},children:[k.type==="F"&&o.jsxs(o.Fragment,{children:[o.jsx(Y.PlusOutlined,{style:{opacity:.8},onClick:()=>{w("ADD"),E(k.key),j(!0)}}),o.jsx(Y.EditOutlined,{style:{opacity:.8},onClick:()=>{w("EDIT"),E(k.key),j(!0)}})]}),o.jsx(Y.DeleteOutlined,{style:{cursor:"pointer",opacity:.5},onClick:()=>{k.type==="F"?p.Modal.confirm({title:"삭제 안내",content:"폴더를 삭제하면 하위 폴더와 메뉴도 모두 삭제됩니다. 삭제하시겠습니까?",centered:!0,onOk:()=>s(k.key)}):p.Modal.confirm({title:"삭제 안내",centered:!0,content:"메뉴를 삭제하시겠습니까?",onOk:()=>l(k.key)})}})]})]})})]})]}),o.jsx(p.ConfigProvider,{theme:{components:{Modal:{titleColor:y==="ADD"?"var(--primary-color)":"#ff6767",headerBg:y==="ADD"?"var(--drawer-header-bg)":"#fff0f0",titleFontSize:18},Button:{defaultColor:"var(--text-secondary)",defaultHoverColor:"var(--primary-color)",defaultHoverBorderColor:"var(--primary-color)",controlHeight:30,fontSize:13,borderRadius:"var(--border-radius-sm)"}}},children:o.jsx(p.Modal,{title:o.jsx(o.Fragment,{children:o.jsxs(p.Typography.Text,{style:{fontSize:16,display:"flex",alignItems:"center",gap:6},children:[y==="ADD"?o.jsx("span",{className:"bookmark-folder-modal-icon ico-new-folder"}):o.jsx("span",{className:"bookmark-folder-modal-icon ico-edit-folder"}),"폴더",y==="ADD"?" 추가":"명 수정"]})}),open:b,okText:"저장",onOk:()=>{const k=d.current.getFieldValue("bkmkNm"),T=se.getUserId();if(y==="ADD"){const D=__SYS_CD__??"KH",L=d.current.getFieldValue("prntBkmkId");i(k,L,D,T).then(()=>{j(!1)})}else{const D=d.current.getFieldValue("bkmkId");a(D,T,k).then(()=>{j(!1)})}},centered:!0,width:400,onCancel:()=>j(!1),okButtonProps:{className:"bwg-btn"},cancelButtonProps:{className:"bwg-btn"},styles:{body:{padding:20}},children:o.jsxs(_.BwgForm,{ref:d,style:{padding:0},children:[o.jsx(_.BwgInput,{itemProps:{name:y==="EDIT"?"bkmkId":"prntBkmkId",hidden:!0}}),o.jsx(_.BwgInput,{itemProps:{label:"상위 폴더명",name:"prntBkmkNm",hidden:P==="-"||y==="EDIT"},inputProps:{disabled:!0}}),o.jsx(_.BwgInput,{itemProps:{label:"폴더명",name:"bkmkNm"}})]})})})]})}function mN({triggerIcon:e}){const[t,r]=m.useState(!1),[n,i]=m.useState(""),[a,s]=m.useState(null),[l,c]=m.useState([]),[d,u]=m.useState([]),[f,h]=m.useState(!1),[g,v]=m.useState(!1),[x,y]=m.useState(!1),[w,b]=m.useState(null);tt.useFavoriteStore(M=>M.treeNodes);const{nodes:j,getPrntBkmkIdByMenuId:P,getNodeByMenuId:E,isMenuBookmarked:C,removeMenuByMenuId:O,addMenuToFolder:k,convertToAntTreeData:T}=tt.useFavoriteStore(),D=tt.useFavoriteStore(M=>M.rootIds),L=m.useMemo(()=>T(j,D,n,!0),[j,D,n]),A=tt.useMenuViewStore(M=>M.activeMenuItem??{menuId:"",menuNm:""}),B=m.useMemo(()=>{if(!A?.menuId)return"";const M=E(A.menuId);if(!M)return"";if(M.fullPath)return M.fullPath;const W=$=>{const H=j[$];if(!H)return"";if(H.prntBkmkId==="-")return`${H.bkmkNm||A?.menuNm}`;const X=W(H.prntBkmkId);return X?`${X} > ${H.bkmkNm||A?.menuNm}`:H.bkmkNm||A?.menuNm};return console.log("bookmarkNode ::::: ",M),console.log(W(M.bkmkId)),W(M.bkmkId)},[A?.menuId,E,j]);m.useEffect(()=>{t&&A?.menuId&&C(A.menuId)?u([P(A.menuId)]):t&&A?.menuId&&!C(A.menuId)?u(D):(u([]),c([]),b(null),y(!1))},[t,A?.menuId,C,P]),m.useEffect(()=>{if(!x||!A?.menuId)return;const M=P(A.menuId);!M||!j[M]||(i(""),c([M]),b(M))},[x,A?.menuId,j,P]);const z=(M,W)=>{k(M,W).then($=>{console.log("AddMenuToFolder ::::: ",$),$||u(H=>H.includes(M)?H:[...H,M])})},F=M=>{O(M)},R=async M=>{A?.menuId&&(await O(A.menuId),await k(M,A),y(!1),b(null),u(W=>W.includes(M)?W:[...W,M]))},N=()=>o.jsxs("div",{className:"bookmark-popover-wrap",style:{width:360},children:[o.jsx("div",{style:{padding:"20px 20px 15px",borderBottom:"1px solid #eeeeee"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%",rowGap:10},children:[o.jsxs(p.Typography.Text,{style:{fontSize:18,display:"flex",alignItems:"center",gap:6},children:[o.jsx(p.Button,{type:"text",icon:o.jsx(Y.ArrowLeftOutlined,{}),onClick:()=>y(!1),style:{width:26,height:26}}),"폴더 변경"]}),A&&o.jsxs(p.Typography.Text,{type:"secondary",style:{display:"inline-block",width:"100%",color:"#555555",fontWeight:"400",background:"#f0eff4",padding:"3px 10px",borderRadius:6},children:["현재 화면: ",o.jsx("b",{children:A.menuNm})," ",o.jsxs("span",{style:{color:"#939393"},children:["(",A.menuId,")"]})]})]})}),I(),o.jsxs("div",{style:{padding:"15px 20px",borderTop:"1px solid #eeeeee",display:"flex",justifyContent:"flex-end",gap:8},children:[o.jsx(p.Button,{type:"default",className:"bwg-btn",onClick:()=>{y(!1),b(null)},children:"취소"}),o.jsx(p.Button,{type:"primary",className:"bwg-btn",disabled:!w,onClick:()=>w&&R(String(w)),children:"이동"})]})]}),I=()=>o.jsxs("div",{style:{maxHeight:360,overflow:"auto",padding:"15px 20px 20px"},children:[o.jsxs(p.Space,{style:{width:"100%",marginBottom:12,display:"flex",justifyContent:"space-between",columnGap:10},children:[o.jsx(p.Input,{placeholder:"검색(폴더명)",prefix:o.jsx(Y.SearchOutlined,{}),allowClear:!0,value:n,onChange:M=>i(M.target.value),style:{width:"250px",height:28}}),o.jsx(p.ConfigProvider,{theme:{components:{Button:{defaultHoverColor:"#333333",defaultHoverBorderColor:"#d9d9d9",defaultHoverBg:"#f1f1f1",defaultActiveColor:"#777777",defaultActiveBorderColor:"#d9d9d9",contentFontSize:13,defaultColor:"#777777"}}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332M7.99984 2.66667V13.3333",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28},onClick:()=>{const M=Object.values(j).filter(W=>W.type==="F").map(W=>W.bkmkId);u(M)},title:"모두 확장"}),o.jsx(p.Button,{icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:o.jsx("path",{d:"M2.6665 8H13.3332",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})}),size:"small",style:{width:28,height:28},onClick:()=>u([]),title:"모두 축소"})]})})]}),L.length===0?o.jsx(p.Empty,{description:o.jsxs(p.Typography.Text,{type:"secondary",style:{fontSize:13},children:["아직 저장된 북마크가 없습니다.",o.jsx("br",{}),"새로운 폴더를 만들어 시작해보세요."]}),image:p.Empty.PRESENTED_IMAGE_SIMPLE}):o.jsx(p.Tree,{blockNode:!0,showLine:!0,treeData:L,selectedKeys:l,expandedKeys:d,onExpand:u,onSelect:M=>{c(M),b(M[0])},autoExpandParent:!0,titleRender:M=>{const W=String(M.key),$=a===W;return o.jsxs("div",{onMouseEnter:()=>s(W),onMouseLeave:()=>s(null),style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[o.jsx("div",{children:M.title}),!C(A?.menuId)&&A&&$&&o.jsx(p.ConfigProvider,{theme:{components:{Button:{defaultColor:"rgba(0,0,0,0.5)",defaultHoverColor:"rgba(0,0,0,0.8)"}}},children:o.jsx(p.Button,{size:"small",type:"link",onClick:H=>{H.stopPropagation(),z(W,A)},style:{color:"rgba(0,0,0,0.5)"},children:"+ 현재화면 추가"})})]})}})]});return o.jsxs(o.Fragment,{children:[o.jsx(p.Popover,{open:t&&!f,onOpenChange:r,trigger:"click",placement:"bottomLeft",styles:{body:{padding:0,borderRadius:12,boxShadow:"0 12px 32px rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.2)",background:"#ffffff",zIndex:1e3}},content:x?N():o.jsxs("div",{style:{width:360},children:[o.jsx("div",{style:{padding:"20px 20px 15px",borderBottom:"1px solid #eeeeee"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%",rowGap:10},children:[o.jsxs(p.Typography.Text,{style:{fontSize:18,display:"flex",alignItems:"center",gap:6},children:[o.jsx("span",{className:`bookmark-title-icon ${C(A?.menuId)?"saved":"add"}`}),"북마크"," ",C(A?.menuId)?"저장됨":"추가"]}),A&&o.jsxs(p.Typography.Text,{type:"secondary",style:{display:"inline-block",width:"100%",color:"#555555",fontWeight:"400",background:"#f0eff4",padding:"3px 10px",borderRadius:6},children:["현재 화면: ",o.jsx("b",{children:A.menuNm})," ",o.jsxs("span",{style:{color:"#939393"},children:["(",A.menuId,")"]})]})]})}),C(A?.menuId)?o.jsxs("div",{style:{padding:"10px 12px",margin:"15px 20px",borderRadius:8,backgroundColor:"#f7f6fB"},children:[o.jsx(p.Typography.Text,{type:"secondary",style:{fontSize:13},children:"저장 위치"}),o.jsx("div",{style:{marginTop:4},children:`📁 > ${B}`||"알 수 없음"})]}):I(),o.jsxs(ze,{style:{padding:"15px 20px",borderTop:"1px solid #eeeeee"},layoutAlign:"right",children:[A&&!C(A.menuId)?o.jsx(p.Button,{style:{padding:"0 10px"},type:"primary",className:"bwg-btn",icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:o.jsx("path",{d:"M3 9H15M9 3V15",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),onClick:()=>{const M=String(l[0]);let W="-";M&&j[M]&&(W=j[M].type=="M"?j[M].prntBkmkId:M),z(W,A)},children:"추가"}):o.jsxs(ze,{layoutAlign:"between",children:[o.jsx(p.Button,{type:"default",className:"bwg-btn",style:{padding:"0 10px"},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsxs("g",{"clip-path":"url(#clip0_1289_1745)",children:[o.jsx("path",{d:"M13.9198 6.57H8.69982L7.57982 3.62H4.03982C3.50982 3.62 3.06982 4.06 3.06982 4.59V12.89C3.06982 13.72 3.73982 14.39 4.56982 14.39H13.4398C14.2698 14.39 14.9398 13.72 14.9398 12.89V7.59C14.9398 7.03 14.4798 6.57 13.9198 6.57Z",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M8.0498 4.72H13.9198C14.4798 4.72 14.9398 5.18 14.9398 5.74V8.39",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),o.jsx("defs",{children:o.jsx("clipPath",{id:"clip0_1289_1745",children:o.jsx("rect",{width:"18",height:"18",fill:"white"})})})]}),onClick:()=>y(!0),children:"폴더 변경"}),o.jsx(p.Button,{type:"default",className:"bwg-btn",style:{padding:"0 10px"},color:"danger",variant:"solid",icon:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:o.jsx("path",{d:"M7.5 7.5V12M10.5 7.5V12M13.5 4.5V13.5C13.5 14.3284 12.8284 15 12 15H6C5.17157 15 4.5 14.3284 4.5 13.5V4.5M3 4.5H15M11.25 4.5V3.75C11.25 2.92157 10.5784 2.25 9.75 2.25H8.25C7.42157 2.25 6.75 2.92157 6.75 3.75V4.5",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})}),onClick:()=>F(A.menuId),children:"삭제"})]}),o.jsx(p.Button,{type:"default",className:"bwg-btn",style:{padding:"0 10px",marginLeft:5},icon:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[o.jsx("path",{d:"M8.25 2.25H9.75C10.1642 2.25 10.5 2.58579 10.5 3V3.42659C10.5 3.74744 10.7153 4.02619 11.0117 4.14921C11.3081 4.27229 11.6532 4.22538 11.8802 3.99842L12.182 3.69668C12.4748 3.40379 12.9497 3.40379 13.2426 3.69668L14.3033 4.75734C14.5962 5.05023 14.5962 5.52511 14.3033 5.818L14.0016 6.1197C13.7746 6.34667 13.7277 6.69185 13.8508 6.98831C13.9738 7.28465 14.2526 7.5 14.5734 7.5L15 7.5C15.4142 7.5 15.75 7.83579 15.75 8.25V9.75C15.75 10.1642 15.4142 10.5 15 10.5H14.5734C14.2526 10.5 13.9738 10.7153 13.8508 11.0117C13.7277 11.3081 13.7746 11.6533 14.0016 11.8803L14.3033 12.182C14.5962 12.4749 14.5962 12.9497 14.3033 13.2426L13.2426 14.3033C12.9497 14.5962 12.4749 14.5962 12.182 14.3033L11.8803 14.0016C11.6533 13.7746 11.3081 13.7277 11.0117 13.8508C10.7153 13.9738 10.5 14.2526 10.5 14.5734V15C10.5 15.4142 10.1642 15.75 9.75 15.75H8.25C7.83579 15.75 7.5 15.4142 7.5 15V14.5734C7.5 14.2526 7.28465 13.9738 6.98831 13.8508C6.69185 13.7277 6.34667 13.7746 6.1197 14.0016L5.81799 14.3033C5.5251 14.5962 5.05022 14.5962 4.75733 14.3033L3.69667 13.2426C3.40378 12.9497 3.40378 12.4749 3.69667 12.182L3.99842 11.8802C4.22538 11.6532 4.27229 11.3081 4.14921 11.0117C4.02619 10.7153 3.74744 10.5 3.42659 10.5H3C2.58579 10.5 2.25 10.1642 2.25 9.75V8.25C2.25 7.83579 2.58579 7.5 3 7.5L3.42657 7.5C3.74743 7.5 4.02619 7.28466 4.14922 6.98832C4.2723 6.69188 4.22539 6.34671 3.99842 6.11975L3.69668 5.818C3.40379 5.52511 3.40379 5.05024 3.69668 4.75734L4.75734 3.69668C5.05023 3.40379 5.52511 3.40379 5.818 3.69668L6.11974 3.99842C6.34671 4.22539 6.69187 4.2723 6.98832 4.14922C7.28466 4.02619 7.5 3.74743 7.5 3.42657V3C7.5 2.58579 7.83579 2.25 8.25 2.25Z",stroke:"currentColor"}),o.jsx("path",{d:"M10.5 9C10.5 9.82843 9.82843 10.5 9 10.5C8.17157 10.5 7.5 9.82843 7.5 9C7.5 8.17157 8.17157 7.5 9 7.5C9.82843 7.5 10.5 8.17157 10.5 9Z",stroke:"currentColor"})]}),onClick:()=>{v(t),h(!0)},children:"관리"})]})]}),children:o.jsx("span",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center"},children:e})}),o.jsx(gN,{open:f,onClose:()=>{h(!1),g&&r(!0)}})]})}const vN=e=>{const{searchBoxRef:t}=at.useSearchBox();return o.jsx(ko,{ref:t,...e})},kt=m.forwardRef(({children:e,searchBox:t,title:r,preRenderEvents:n=[],postRenderEvents:i=[],loading:a=!1,error:s=null,grantEvent:l={},customEvent:c={},buttons:d},u)=>{const{user:f,spacingSize:h}=tt.useUserStore(),{activeMenuItem:g}=tt.useMenuViewStore(),{loadFavoritesIfNeeded:v,isMenuBookmarked:x}=tt.useFavoriteStore(),{loading:y}=tt.useLoadingStore(),{resetForm:w,setDefaultValue:b,searchBoxRef:j}=at.useSearchBox(),P=at.useSizeConfig();m.useImperativeHandle(u,()=>({menuId:g?.menuId}),[g?.menuId]);const[E,C]=m.useState({isInitialized:!1,isReady:!1,error:null,loading:!0,preRenderComplete:!1,postRenderComplete:!1}),{openCorePopup:O}=at.usePopup(),k=async()=>{if(n.length===0){C(I=>({...I,preRenderComplete:!0}));return}try{for(const I of n)await I();C(I=>({...I,preRenderComplete:!0}))}catch(I){C(M=>({...M,error:I instanceof Error?I.message:"사전 렌더링 실패",preRenderComplete:!0}))}},T=async()=>{if(i.length===0){C(I=>({...I,postRenderComplete:!0}));return}try{for(const I of i)await I();C(I=>({...I,postRenderComplete:!0}))}catch(I){C(M=>({...M,error:I instanceof Error?I.message:"사후 렌더링 실패",postRenderComplete:!0}))}};m.useEffect(()=>{if(E.isInitialized)return;(async()=>{try{await k(),C(M=>({...M,isInitialized:!0,loading:!1}))}catch(M){console.error("BwgView 초기화 실패:",M),C(W=>({...W,isInitialized:!0,loading:!1}))}})()},[]),m.useEffect(()=>{f?.userId&&v(f.userId)},[v,f?.userId]);const D=m.useMemo(()=>g?.menuId?{menuId:g.menuId,grpId:"CUSTOM"}:!1,[g?.menuId]),L=m.useMemo(()=>g?.menuId?{menuId:g.menuId,grpId:"DEFAULT"}:!1,[g?.menuId]);m.useEffect(()=>{E.isInitialized&&E.preRenderComplete&&!E.isReady&&setTimeout(async()=>{await T(),C(M=>({...M,isReady:!0}))},100)},[E.isInitialized,E.preRenderComplete,E.isReady]),m.useEffect(()=>{s&&C(I=>({...I,error:s}))},[s]),m.useEffect(()=>{t&&t.defaultValue&&j?.current&&b(t.defaultValue)},[t,j,b]),m.useEffect(()=>{if(!t)return;const I=M=>{M.ctrlKey&&(M.key==="d"||M.key==="D")&&(M.preventDefault(),M.stopPropagation(),w()),M.ctrlKey&&M.key==="s"&&(M.preventDefault(),M.stopPropagation(),d?.grant?.find(W=>W.id==="search")?.onClick?.())};return window.addEventListener("keydown",I),()=>{window.removeEventListener("keydown",I)}},[t,w]);const A=()=>o.jsxs("div",{className:"bwgview-header-container",children:[o.jsxs("div",{className:"bwgview-header",children:[o.jsx("div",{className:"bwgview-header-left",children:N.LEFT}),o.jsx("div",{className:"bwgview-header-right",children:N.RIGHT})]}),t&&o.jsx(vN,{reqRows:t.reqRows,subRows:t.subRows,border:t.border,labelDisplay:t.labelDisplay,header:t.header})]});if(m.useEffect(()=>{},[f,g]),E.error||s)return o.jsx("div",{style:{padding:"24px"},children:o.jsx(p.Alert,{message:"오류 발생",description:E.error||s,type:"error",showIcon:!0})});const B=()=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:o.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62179 6.15374 7.92513 5.5344L9.9348 1.4645Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10"})}),z=()=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 21 20",width:"1em",height:"1em",fill:"none",children:o.jsx("path",{d:"M9.9348 1.4645C10.2382 0.845167 10.7437 0.845167 11.0597 1.4645L13.0694 5.5344C13.3727 6.15374 14.1943 6.74779 14.8768 6.84891L19.3638 7.50616C20.0464 7.60727 20.2107 8.08757 19.7051 8.56787L16.4568 11.7277C15.9638 12.208 15.6478 13.1686 15.7616 13.8512L16.5326 18.3129C16.6464 18.9954 16.2419 19.2988 15.6226 18.9701L11.6159 16.8594C10.9965 16.5307 9.998 16.5307 9.37867 16.8594L5.37196 18.9701C4.75263 19.2988 4.34817 18.9954 4.46192 18.3129L5.23293 13.8512C5.34668 13.1686 5.04334 12.208 4.53776 11.7277L1.28942 8.56787C0.79648 8.08757 0.948154 7.60727 1.63068 7.50616L6.11769 6.84891C6.80022 6.74779 7.62178 6.15374 7.92513 5.5344L9.9348 1.4645Z",stroke:"currentColor",strokeWidth:"1.5",strokeMiterlimit:"10",fill:"none"})}),F=I=>o.jsx(Y,{component:B,...I}),R=I=>o.jsx(Y,{component:z,...I}),N={LEFT:o.jsx("div",{className:"bwgview-header-left",children:o.jsxs(p.ConfigProvider,{theme:{components:{Tag:{controlHeight:28,controlHeightLG:28,controlHeightSM:28,controlHeightXS:28}}},children:[o.jsxs(p.Space,{children:[g&&o.jsx(mN,{triggerIcon:x(g.menuId)?o.jsx(F,{className:"bookmark-icon",style:{color:"#faad14"}}):o.jsx(R,{className:"bookmark-icon"})}),o.jsxs(p.Space.Compact,{style:{alignItems:"center"},children:[o.jsx("span",{className:"pageMenuNm",children:(()=>{let I="";return r?.useMenuTitle&&g?I=g.menuNm:r?.text?I=r.text:g&&(I=g.menuPrntId==="CM00"?g.menuNm.substring(g.menuNm.indexOf(" ")+1):g.menuNm),r?.prefix&&(I=`${r.prefix} ${I}`),r?.suffix&&(I=`${I} ${r.suffix}`),I})()}),g?.menuNo&&o.jsx(p.Tag,{className:"page-num-tag",children:g?.menuNo}),o.jsx(p.Tooltip,{title:"도움말",color:"geekblue",children:o.jsx(p.Button,{variant:"text",type:"text",className:"menu-help-btn",icon:o.jsx(Y.QuestionCircleTwoTone,{twoToneColor:"orange"})})}),o.jsx(p.Tooltip,{title:"게시판",color:"geekblue",children:o.jsx(p.Button,{variant:"text",type:"text",onClick:()=>O("CORE_REPORT"),icon:o.jsx(Y.BugFilled,{style:{color:"#1890ff"}})})})]})]}),g?.scrnId&&se.isLocal&&o.jsx(p.Tag,{style:{marginLeft:8,fontSize:13,fontWeight:500,display:"flex"},children:o.jsx(hN,{copyable:!0,style:{display:"inherit",justifyContent:"center",alignItems:"center",marginBottom:0},children:g?.scrnId})})]})}),RIGHT:o.jsx("div",{className:"bwgview-header-right",children:o.jsx(p.ConfigProvider,{theme:{components:{Space:{padding:8},Divider:{verticalMarginInline:0}}},children:o.jsxs(p.Space,{children:[d?.custom&&d.custom.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(p.Flex,{gap:8,children:o.jsx(qf,{checkAuth:D,buttons:d.custom,gap:8})}),o.jsx(p.Divider,{type:"vertical"})]}),o.jsx(p.Flex,{gap:8,className:"permission-buttons",children:o.jsx(qf,{checkAuth:L,buttons:d?.grant||[],gap:8})}),t&&o.jsxs(o.Fragment,{children:[o.jsx(p.Divider,{type:"vertical"}),o.jsx(p.Tooltip,{placement:"bottom",color:se.colorFormat.default.gray05,title:o.jsxs(o.Fragment,{children:["검색영역 초기화",o.jsx("br",{}),"단축키 : ",o.jsx(p.Tag,{children:"Ctrl"})," + ",o.jsx(p.Tag,{children:"D"})]}),children:o.jsx(_.BwgButton,{icon:o.jsx(Y.ClearOutlined,{style:{color:se.colorFormat.site.purple05}}),onClick:()=>{w()}})})]})]})})})};return o.jsxs("div",{className:"bwg-view main-view",style:{height:"100%",display:"flex",flexDirection:"column",gap:h===0?8:h===1?14:20,padding:h===0?"8px 12px":h===1?"14px 20px":"20px 30px 26px"},children:[A(),o.jsx("div",{className:"bwgview-content",children:o.jsxs("div",{className:"bwgview-content",children:[o.jsx(p.ConfigProvider,{componentSize:P.componentSize,theme:{token:{fontSize:P.fontSize}},children:o.jsx(at.BwgViewProvider,{menuId:g?.menuId,children:o.jsx("div",{style:{display:"flex",flexDirection:"column",height:"100%",fontSize:`${P.fontSize}px`},children:e})})}),(E.loading||a||y)&&o.jsx(oO.LoadingContainer,{dimStyle:"light",text:y?"처리 중...":"화면 로드 중..."})]})})]})});kt.displayName="BwgView";const yN=({children:e,customTheme:t,customComponentSize:r="middle"})=>{const n={token:{colorPrimary:"#1890ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1890ff",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif',fontSize:14,fontSizeHeading1:38,fontSizeHeading2:30,fontSizeHeading3:24,fontSizeHeading4:20,fontSizeHeading5:16,padding:16,margin:16,borderRadius:6,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)",boxShadowSecondary:"0 2px 4px rgba(0, 0, 0, 0.12)"},algorithm:p.theme.defaultAlgorithm},i={...n,...t,token:{...n.token,...t?.token}};return o.jsx(p.ConfigProvider,{locale:Z1,theme:i,componentSize:r,space:{size:r},form:{validateMessages:{required:"${label}을(를) 입력해주세요.",types:{email:"${label}이(가) 유효한 이메일이 아닙니다.",number:"${label}이(가) 유효한 숫자가 아닙니다."},number:{range:"${label}은(는) ${min} ~ ${max} 사이의 값이어야 합니다."}}},pagination:{showSizeChanger:!0},children:e})},xN="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9289)'%3e%3cpath%20d='M27.3705%2010.9919C28.5405%2010.9919%2029.489%2010.0434%2029.489%208.87338C29.489%207.70337%2028.5405%206.75488%2027.3705%206.75488C26.2004%206.75488%2025.252%207.70337%2025.252%208.87338C25.252%2010.0434%2026.2004%2010.9919%2027.3705%2010.9919Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.3053%2017.2998V32.3098H24.4248V17.2998'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M27.3701%2032.31V23.3135'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2305%2022.1925V17.642V15.6945C22.2305%2014.3075%2023.3515%2013.1865%2024.7385%2013.1865H29.9825C31.3695%2013.1865%2032.4905%2014.3075%2032.4905%2015.6945V17.642V22.1925'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.2519%2021.4229H18.6199C19.1044%2021.4229%2019.5034%2021.8219%2019.5034%2022.3064V24.4154H16.3779V22.3064C16.3779%2021.8219%2016.7769%2021.4229%2017.2614%2021.4229H17.2519Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M20.8339%2024.4062H15.0294C14.6254%2024.4062%2014.2979%2024.7338%2014.2979%2025.1377V31.6832C14.2979%2032.0872%2014.6254%2032.4147%2015.0294%2032.4147H20.8339C21.2378%2032.4147%2021.5654%2032.0872%2021.5654%2031.6832V25.1377C21.5654%2024.7338%2021.2378%2024.4062%2020.8339%2024.4062Z'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8252%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.0391%2027.1895V29.631'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.71875%2014.1642H8.53075C9.03425%2014.1642%209.49025%2013.8602%209.68025%2013.4042L10.3263%2011.8652'%20stroke='%2342AAFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M17.4991%205.54803L12.2266%2011.8655H17.5371L19.8836%205.51953L17.4991%205.54803Z'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M22.2017%2016.4639H6.57421C5.97571%2016.4639%205.49121%2015.9794%205.49121%2015.3809C5.49121%2013.4334%207.06821%2011.8564%209.01571%2011.8564H20.3492'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.56738%2032.4805H32.2909'%20stroke='%23204AA4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9289'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",bN="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9314)'%3e%3cpath%20d='M15.1807%2019.3994L18.7717%2029.7164'%20stroke='%23FF8CC3'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2010.7443%2014.7724%2013.2618%2022.0209'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M11.9033%209.25293L12.6063%2011.2574C12.6063%2011.2574%2016.2448%2012.8534%2018.7718%2020.1019'%20stroke='%23FF8CC4'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8257%2016.71C22.2202%2012.112%2017.1947%209.67999%2012.5967%2011.276C7.99871%2012.8815%205.56671%2017.907%207.16271%2022.505L7.67571%2023.968L7.88471%2023.892C7.93221%2022.7235%208.67321%2021.6405%209.85121%2021.232C11.0292%2020.8235%2012.2737%2021.2035%2013.0432%2022.0965L13.4422%2021.954C13.4897%2020.7855%2014.2307%2019.7025%2015.4087%2019.294C16.5867%2018.8855%2017.8312%2019.2655%2018.6007%2020.1585L18.9997%2020.016C19.0472%2018.8475%2019.7882%2017.7645%2020.9662%2017.356C22.1442%2016.9475%2023.3887%2017.3275%2024.1582%2018.2205L24.3577%2018.154L23.8447%2016.691L23.8257%2016.71Z'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.37%2015.4193C23.636%2015.4858%2023.9115%2015.5238%2024.1965%2015.5238C26.068%2015.5238%2027.5785%2014.0038%2027.5785%2012.1418C27.5785%2010.2798%2026.0585%208.75977%2024.1965%208.75977C22.3345%208.75977%2020.8145%2010.2798%2020.8145%2012.1418'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M24.2061%206.12784V5.00684'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M19.8641%207.79018L19.1611%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5381%2016.4736L29.2411%2017.1766'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M30.21%2012.1318H31.331'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M28.5469%207.79018L29.2404%207.09668'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M29.3355%2029.8213H14.2305'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.2302%2029.8213L10.3447%2025.2803'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M12.8527%2028.4531L7.76074%2032.9941'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M23.8447%2029.8213L27.4072%2032.9943'%20stroke='%239F2878'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9314'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",wN="data:image/svg+xml,%3csvg%20width='38'%20height='38'%20viewBox='0%200%2038%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_127_9273)'%3e%3cpath%20d='M25.9254%2020.8996C27.5151%2020.8996%2028.8039%2019.6108%2028.8039%2018.0211C28.8039%2016.4313%2027.5151%2015.1426%2025.9254%2015.1426C24.3356%2015.1426%2023.0469%2016.4313%2023.0469%2018.0211C23.0469%2019.6108%2024.3356%2020.8996%2025.9254%2020.8996Z'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M31.4825%2032.4711V25.9066C31.4825%2024.5671%2030.485%2023.4746%2029.2595%2023.4746H22.6C21.3745%2023.4746%2020.377%2024.5671%2020.377%2025.9066'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M25.2696%2026.7334H14.2686L16.5106%2032.6234H27.5021L25.2696%2026.7334Z'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.5617%2018.8385C6.1462%2017.4135%205.2627%2015.447%205.2627%2013.2715C5.2627%208.91095%208.7967%205.37695%2013.1572%205.37695C17.5177%205.37695%2021.0517%208.91095%2021.0517%2013.2715C21.0517%2015.124%2020.4152%2016.815%2019.3512%2018.164C18.0497%2019.8075%2016.1117%2020.919%2013.9172%2021.128'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%2013.2715L16.0167%2015.5705'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.1572%208.62598V13.2715'%20stroke='%23925CFF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M8.35963%2016.1973L7.84663%2019.1328L4.91113%2018.6293'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M4.91113%2032.623H33.0881'%20stroke='%235244A2'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_127_9273'%3e%3crect%20width='38'%20height='38'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",CN=({children:e})=>{const[t,r]=m.useState({x:0,y:0}),[n,i]=m.useState(!1),[a,s]=m.useState({x:0,y:0}),[l,c]=m.useState(!1),[d,u]=m.useState(!0),f=m.useRef(null),h=[{id:"overtime",title:"시간 외 근무신청",icon:o.jsx("img",{src:wN,alt:"시간외근무신청",className:"quick-overtime"}),color:"#722ed1",onClick:()=>{console.log("시간 외 근무 신청 클릭")}},{id:"business-trip",title:"출장신청",icon:o.jsx("img",{src:xN,alt:"출장신청",className:"quick-business-trip"}),color:"#1890ff",onClick:()=>{console.log("출장 신청 클릭")}},{id:"vacation",title:"휴가신청",icon:o.jsx("img",{src:bN,alt:"휴가신청",className:"quick-holiday"}),color:"#eb2f96",onClick:()=>{console.log("휴가 신청 클릭")}},{id:"document",title:"문서신청",icon:o.jsx(Y.FileTextOutlined,{}),color:"#52c41a",onClick:()=>{console.log("문서 신청 클릭")}},{id:"profile",title:"인사정보",icon:o.jsx(Y.UserOutlined,{}),color:"#fa8c16",onClick:()=>{console.log("인사 정보 클릭")}},{id:"settings",title:"설정",icon:o.jsx(Y.SettingOutlined,{}),color:"#13c2c2",onClick:()=>{console.log("설정 클릭")}}];m.useEffect(()=>{const b=()=>{const j=window.innerHeight,E=Math.max(64,(j-300)/3);r({x:0,y:E});const C=j/2;u(E<C)};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const g=b=>{if(b.preventDefault(),b.stopPropagation(),f.current){const j=f.current.getBoundingClientRect();s({x:b.clientX-j.left,y:b.clientY-j.top}),i(!0)}},v=b=>{if(n){const j=b.clientY-a.y,P=window.innerHeight-24,C=Math.max(64,Math.min(P,j));r({x:t.x,y:C});const O=window.innerHeight/2;u(C<O)}},x=()=>{i(!1)},y=()=>{c(!l)},w=b=>{b.onClick&&b.onClick()};return m.useEffect(()=>{if(n)return document.addEventListener("mousemove",v),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",x)}},[n,a]),o.jsxs("div",{className:"quick-tab-container",ref:f,style:{position:"fixed",right:0,top:t.y,zIndex:1e3,userSelect:"none",touchAction:"none"},children:[o.jsxs("div",{className:"quick-tab",style:{position:"absolute",right:"40px",top:d?0:"auto",bottom:d?"auto":0,display:"flex",flexDirection:"column",gap:"15px",border:"1px solid #E0DEEF",borderRadius:"15px",padding:"8px",boxShadow:"0 0 10px rgba(0, 0, 0, 0.3)",minWidth:"88px",maxWidth:"88px",maxHeight:d?`calc(100vh - ${t.y+12}px)`:`${t.y-12}px`,transform:l?"translateX(0)":"translateX(calc(100% + 100px))",transition:"transform 0.3s ease",marginTop:d&&t.y<100?"32px":"0",marginBottom:!d&&t.y>window.innerHeight-100?"8px":"0"},children:[o.jsx("div",{className:"quick-tab-items-wrap",style:{background:"#ffffff",borderRadius:"10px",flex:1,overflowY:"auto",maxHeight:d?`calc(100vh - ${t.y+120}px)`:`${t.y-60}px`,padding:"14px 0"},children:h.map(b=>o.jsx(p.Card,{className:"quick-tab-items",size:"small",style:{border:"none",boxShadow:"none",marginBottom:"15px",cursor:"pointer",transition:"all 0.2s ease"},styles:{body:{padding:"0"}},onClick:()=>w(b),onMouseEnter:j=>{},onMouseLeave:j=>{},children:o.jsxs("div",{className:"quick-tab-item-inner",children:[o.jsx("div",{className:"quick-tab-items-icon",style:{width:"44px",height:"44px",borderRadius:"8PX",fontSize:"24px",color:b.color,marginBottom:"5px"},children:b.icon}),o.jsx("div",{className:"quick-tab-items-title",children:b.title})]})},b.id))}),o.jsx("div",{className:"quick-tab-add-btn",style:{height:"30px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",flexShrink:0,marginBottom:"7px"},onMouseEnter:b=>{},onMouseLeave:b=>{},children:o.jsx("span",{className:"quick-tab-add-icon",children:o.jsx(Y.PlusOutlined,{style:{color:"#CDC4FF",fontSize:"15px"}})})})]}),o.jsx("div",{className:"quick-tab-drag-btn",style:{cursor:n?"grabbing":"grab",zIndex:1001},onMouseDown:b=>g(b)}),o.jsx(p.Button,{className:`quick-tab-toggle-btn ${l?"expanded":""}`,type:"default",style:{border:"0",backgroundColor:"transparent"},onClick:y})]})},SN=()=>{const{verifyWithToken:e}=at.useAuth(),t=Xm.useNavigate(),r=Xm.useLocation();return m.useEffect(()=>{const i=new URLSearchParams(r.search).get("token");if(!i){t("/login",{replace:!0});return}(async()=>{const a=await e(i);t(a?"/main":"/login",{replace:!0})})()},[r.search]),o.jsx("div",{style:{display:"grid",placeItems:"center",height:"100dvh"},children:o.jsx(p.Spin,{tip:"인증중..."})})},jN=e=>{const{showPopup:t}=at.usePopup(),r=m.useRef(null),n=m.useRef(null),i=m.useRef(null),a=m.useRef(null),[s,l]=m.useState(!1),[c,d]=m.useState(null),[u,f]=m.useState("common"),{getCodeColor:h,getCodeName:g,getCodeList:v}=at.useCommonCode(),x=m.useMemo(()=>se.createBwgGridRenderer((N,I,M,W,$)=>{const H=I.value,X=h?.(H)||"blue",ue=g?.(H)||H,fe=H?o.jsx(p.Tag,{color:X,style:{fontSize:"11px"},children:ue}):null;$.render(o.jsx("div",{style:{padding:"4px"},children:fe}))}),[h,g]),[y,w]=m.useState({crprCd:"",systId:"",authId:"",authNm:"",authDscr:"",authMenu:"",enblYn:"Y"}),[b,j]=m.useState(!1),P=m.useMemo(()=>[{fieldName:"authId",header:{text:"권한ID"},width:120,visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:120,visible:!1},{fieldName:"menuNm",header:{text:"메뉴명"},width:200,visible:!1},{fieldName:"grpId",header:{text:"그룹ID"},width:100},{fieldName:"btnId",header:{text:"버튼ID"},width:100},{fieldName:"btnNm",header:{text:"버튼명"},width:150},{fieldName:"btnSq",header:{text:"출력순서"},width:80,dataType:"number"},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),E={container:{check:!0,indicator:!0,footer:!0}},C={onCurrentRowChanged(N,I,M){console.log("공통 버튼 그리드 - 현재 행 변경:",{oldRow:I,newRow:M,activeTabKey:u})}},O={onCurrentRowChanged(N,I,M){console.log("커스텀 버튼 그리드 - 현재 행 변경:",{oldRow:I,newRow:M,activeTabKey:u})}},k=N=>{f(N)};m.useEffect(()=>{},[]),m.useEffect(()=>{const N=n.current?.vw?.getCurrent().itemIndex??-1;if(N<0)return;const I=n.current?.vw?.getValues(N);L.SCMAUTH00201({crprCd:I.crprCd,systId:I.systId,authId:I.authId,menuId:I.authMenu,grpId:u==="common"?"DEFAULT":"CUSTOM"})},[u]);const T=m.useMemo(()=>[{fieldName:"crprCd",header:{text:"회사코드"},width:80,visible:!1},{fieldName:"systId",header:{text:"업무분류"},width:80,renderer:"tag"},{fieldName:"authId",header:{text:"권한ID"},width:120,required:!0},{fieldName:"authNm",header:{text:"권한명칭"},width:200,styleName:"left",editable:!0},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{fieldName:"authMenu",header:{text:"메뉴"},width:100,visible:!1},{fieldName:"authMenuNm",header:{text:"메뉴"},width:100,styleName:"left"},{fieldName:"authDscr",header:{text:"권한설명"},width:300,visible:!1}],[]),D={onCurrentRowChanged(N,I,M){if(M<0)return;const W=N.getValues(M);console.log("권한 선택:",W),console.log("현재 activeTabKey:",u),r.current?.setFieldsValue(W),L.SCMAUTH00201({crprCd:W.crprCd,systId:W.systId,authId:W.authId,menuId:W.authMenu,grpId:u==="common"?"DEFAULT":"CUSTOM"})}},L={SCMAUTH00101:()=>{se.callService("SCMAUTH00101",{crprCd:se.getCrprCd()},{}).then(N=>{n.current?.addAllData(N.data)})},SCMAUTH00102:N=>{se.callService("SCMAUTH00102",{...N},{}).then(I=>{I.result||r.current?.setFields([{name:"authId",errors:[I.message]}])})},SCMAUTH00201:N=>{se.callService("SCMAUTH00201",{...N},{}).then(I=>{u==="common"?i.current?.addAllData(I.data):a.current?.addAllData(I.data)}).catch(I=>{console.error("SCMAUTH00201 호출 실패:",I)})},SCMAUTH00301:async N=>{try{const I=await se.callService("SCMAUTH00301",{...N,crprCd:se.getCrprCd()},{});return console.log("권한 정보 저장 성공:",I),j(!1),L.SCMAUTH00101(),I}catch(I){throw console.error("권한 정보 저장 실패:",I),I}},SCMAUTH00401:async N=>{try{const I=await se.callService("SCMAUTH00401",{...N,crprCd:se.getCrprCd()},{});return console.log("권한 정보 수정 성공:",I),j(!1),L.SCMAUTH00101(),I}catch(I){throw console.error("권한 정보 수정 실패:",I),I}}},A={search:()=>{L.SCMAUTH00101()},new:()=>{j(!1),w({crprCd:String(se.getCrprCd()||""),systId:"",authId:"",authNm:"",authDscr:"",authMenu:"",enblYn:"Y"}),l(!0)},edit:()=>{const N=n.current?.getCurrentRow();N&&typeof N=="object"&&(j(!0),w({crprCd:N.crprCd||String(se.getCrprCd()||""),systId:N.systId||"",authId:N.authId||"",authNm:N.authNm||"",authDscr:N.authDscr||"",authMenu:N.authMenu||"",enblYn:N.enblYn||"Y"}),l(!0))}},B={test:()=>{console.log("test")}},z={openPopup:N=>{t("CMDprtSrchP02",{isDefault:N})},add:()=>{console.log("add")},modify:()=>{console.log("edit")},delete:()=>{console.log("delete")}},F=(N,I)=>{w(M=>({...M,[N]:I}))},R=async()=>{try{b||await L.SCMAUTH00102({auth:r.current?.getFieldsValue()})}catch(N){console.error("권한 정보 처리 실패:",N)}};return m.useEffect(()=>{L.SCMAUTH00101()},[]),m.useEffect(()=>{},[n.current?.getGridInstance()?.gridView]),o.jsx(kt,{grantEvent:A,customEvent:B,children:o.jsxs(ze,{children:[o.jsxs(Ie,{className:"w40",children:[o.jsx(Le,{title:"권한 관리",icons:{type:"antd"},children:o.jsx(p.Popover,{styles:{body:{border:"1px solid #ededed",background:"#ededed"}},content:o.jsxs(p.Flex,{gap:3,children:[o.jsx(p.Button,{type:"primary",onClick:()=>z.openPopup(!0),children:"공통권한버튼"}),o.jsx(p.Button,{onClick:()=>z.openPopup(!1),children:"커스텀 버튼"})]}),placement:"bottom",children:o.jsx(p.Button,{icon:o.jsx(Y.SettingTwoTone,{}),title:"버튼관리",children:"버튼관리"})})}),o.jsx(Ve,{type:"nrml",ref:n,gridColumns:T,renderers:[{name:"tag",renderer:x}],gridOptions:{container:{indicator:!0,check:!0,checkAll:!0}},gridEvents:D})]}),o.jsx(Ie,{className:"w60",border:!0,children:o.jsxs(fn,{title:"권한 상세",children:[o.jsxs(_.BwgForm,{ref:r,style:{padding:"10px 20px"},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{label:"업무분류",name:"systId"},selectProps:{variant:"borderless",options:v("SYST"),copyable:!0,disabled:!0}})}),o.jsx(p.Col,{span:8,children:o.jsx(_.BwgFormItem,{label:"사용여부",name:"enblYn",children:o.jsx(p.Select,{variant:"borderless",options:[{label:"사용",value:"Y"},{label:"미사용",value:"N"}],disabled:!0})})}),o.jsx(p.Col,{span:8})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:8,children:o.jsx(_.BwgFormItem,{label:"권한ID",name:"authId",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})}),o.jsx(p.Col,{span:16,children:o.jsx(_.BwgFormItem,{label:"권한명",name:"authNm",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{label:"권한메뉴",style:{width:"100%",marginBottom:0},validateStatus:"",help:"",children:o.jsxs(p.Space.Compact,{block:!0,children:[o.jsx(p.Form.Item,{name:"authMenu",style:{width:"40%"},validateStatus:"",help:"",children:o.jsx(p.Input,{readOnly:!0,variant:"filled"})}),o.jsx(p.Form.Item,{name:"authMenuNm",style:{width:"60%"},validateStatus:"",help:"",children:o.jsx(p.Input,{readOnly:!0})})]})})})}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{label:"권한설명",name:"authDscr",children:o.jsx(p.Input.TextArea,{variant:"borderless",readOnly:!0})})})})]}),o.jsx(ar,{size:"small",activeKey:u,onChange:k,items:[{key:"common",label:"공통버튼",children:o.jsxs(Ie,{children:[o.jsx(Le,{title:"공통 버튼 매핑",children:o.jsx(Yf,{grpId:"AUTH",menuId:"CM010303",btnEvent:z})}),o.jsx(Ve,{ref:i,type:"nrml",gridColumns:P,gridOptions:E,gridEvents:C})]})},{key:"custom",label:"커스텀",children:o.jsxs(Ie,{children:[o.jsx(Le,{title:"커스텀 버튼 매핑",children:o.jsx(Yf,{grpId:"AUTH2",menuId:"CM010303"})}),o.jsx(Ve,{ref:a,type:"nrml",gridColumns:P,gridOptions:E,gridEvents:O})]})}],tabPosition:"left"})]})}),o.jsx(dn,{title:`권한별 메뉴 관리 - ${c?.authNm||""}`,open:s,placement:"right",onClose:()=>{l(!1),w({crprCd:"",systId:"",authId:"",authNm:"",authDscr:"",authMenu:"",enblYn:"Y"}),j(!1)},width:"40%",size:"large",afterOpenChange:N=>{console.log("afterOpenChange:",N)},footer:o.jsxs("div",{className:"drawer-footer-btn-group",children:[o.jsx(p.Button,{onClick:()=>{l(!1),r.current?.resetFields(),j(!1)},className:"bwg-btn",children:"취소"}),o.jsx(p.Button,{type:"primary",onClick:R,className:"bwg-btn",children:"저장"})]}),children:o.jsxs(_.BwgForm,{ref:r,initialValues:y,children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSearch,{itemProps:{name:["crprCd","crprNm"],label:"회사 코드"},placeholder:["회사 코드","회사 명칭"],popuCd:"CMAuthMstrP01"})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"systId",label:"시스템 ID"},selectProps:{variant:"borderless",options:v("SYST"),copyable:!0,disabled:!0}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{name:"authId",label:"권한 ID",children:o.jsx(p.Input,{onChange:N=>F("authId",N.target.value),placeholder:"권한 ID를 입력하세요",disabled:b})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{name:"enblYn",label:"사용여부",children:o.jsx(p.Select,{onChange:N=>F("enblYn",N),options:[{value:"Y",label:"사용"},{value:"N",label:"미사용"}]})})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{name:"authNm",label:"권한 명칭",children:o.jsx(p.Input,{onChange:N=>F("authNm",N.target.value),placeholder:"권한 명칭을 입력하세요"})})})}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgFormItem,{name:"authDscr",label:"권한 설명",children:o.jsx(p.Input.TextArea,{onChange:N=>F("authDscr",N.target.value),placeholder:"권한 설명을 입력하세요",rows:2})})})}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgSearch,{itemProps:{name:["authMenu","authMenuNm"],label:"권한 메뉴"},placeholder:["메뉴ID","메뉴명명"],popuCd:"CMMenuMstrP01"})})})]})})]})})},EN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),[i,a]=m.useState("menu"),s=m.useMemo(()=>se.createBwgGridRenderer((v,x,y,w,b)=>{const j=v.getValue(x.index?.itemIndex,"systId"),P=v.getValue(x.index?.itemIndex,"roleId"),E=v.getValue(x.index?.itemIndex,"roleNm"),C=v.getValue(x.index?.itemIndex,"enblYn"),O=v.getValue(x.index?.itemIndex,"roleDscr");b.render(o.jsx(p.Card,{size:"small",style:{height:"95px"},children:o.jsxs(p.Flex,{style:{height:"95px"},children:[o.jsxs(Ie,{className:"w60",style:{position:"relative",padding:"8px"},children:[o.jsx("div",{style:{position:"absolute",top:"8px",left:"8px"},children:o.jsx(p.Tag,{color:"blue",style:{fontSize:"13px"},children:j})}),o.jsx("div",{style:{position:"absolute",top:"30%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"16px",fontWeight:"bold",color:"#262626",textAlign:"center"},children:E}),o.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translateX(-50%)",fontSize:"13px",color:"#8c8c8c",fontFamily:"monospace"},children:P}),o.jsx("div",{style:{position:"absolute",bottom:"8px",right:"8px",fontSize:"16px",color:C==="Y"?"#52c41a":"#ff4d4f"},children:C==="Y"?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):o.jsx(Y.CloseCircleOutlined,{style:{color:"#ff4d4f"}})})]}),o.jsx(p.Divider,{type:"vertical",style:{height:"95px"}}),o.jsx(Ie,{className:"w40",children:O&&o.jsx(p.Typography.Text,{style:{fontSize:"13px",color:"#595959",lineHeight:"1.4",textAlign:"left",display:"block",wordBreak:"break-word",whiteSpace:"pre-wrap"},children:o.jsx("blockquote",{children:O})})})]})}))}),[]),l=m.useMemo(()=>[{fieldName:"crprCd",header:{text:"법인코드"},width:100,visible:!1},{fieldName:"systId",header:{text:"시스템ID"},width:100,renderer:"systCard"},{fieldName:"roleId",header:{text:"역할ID"},width:120},{fieldName:"roleNm",header:{text:"역할명"},width:150},{fieldName:"roleDscr",header:{text:"역할설명"},width:200,visible:!1},{fieldName:"sortOrd",header:{text:"정렬순서"},width:80,visible:!1},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"},visible:!1}],[]),c=[{fieldName:"crprCd",header:{text:"법인코드"},width:100,visible:!1},{fieldName:"roleId",header:{text:"역할ID"},width:120,visible:!1},{fieldName:"dprtCd",header:{text:"부서코드"},width:120},{fieldName:"dprtNm",header:{text:"부서"},width:120},{fieldName:"subSyncYn",header:{text:"동기화여부"},width:100,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],d=[{fieldName:"userId",header:{text:"사용자ID"},width:120},{fieldName:"userNm",header:{text:"사용자명"},width:150},{fieldName:"deptNm",header:{text:"부서명"},width:150},{fieldName:"email",header:{text:"이메일"},width:200,visible:!1},{fieldName:"enblYn",header:{text:"사용여부"},width:80,visible:!1}],u=m.useMemo(()=>({display:{rowHeight:100},layout:{colspan:[{fieldName:"systId",span:3}]},container:{state:!0,check:!0,checkAll:!0,indicator:!0,footer:!0}}),[]),f={onCurrentRowChanged(v,x,y){if(y<0)return;const w=v.getValues(y);switch(i){case"menu":break;case"dept":h.SCMROLE00103(w.roleId);break;case"user":h.SCMROLE00104(w.roleId);break}}},h={SCMROLE00101:()=>{se.callService("SCMROLE00101",{crprCd:se.getCrprCd()}).then(v=>{console.log("SCMROLE00101:",v),t.current?.addAllData(v.data)})},SCMROLE00102:v=>{se.callService("SCMROLE00102",{crprCd:se.getCrprCd(),roleId:v}).then(x=>{console.log("SCMROLE00102:",x)})},SCMROLE00103:v=>{se.callService("SCMROLE00103",{crprCd:se.getCrprCd(),roleId:v}).then(x=>{console.log("SCMROLE00103:",x),r.current?.addAllData(x.data)})},SCMROLE00104:v=>{se.callService("SCMROLE00104",{crprCd:se.getCrprCd(),roleId:v}).then(x=>{console.log("SCMROLE00104:",x),n.current?.addAllData(x.data)})}},g={search:()=>{h.SCMROLE00101()}};return m.useEffect(()=>{const v=t.current?.getCurrentIndex()??-1;if(v<0)return;const x=t.current?.vw?.getValue(v,"roleId");switch(i){case"menu":break;case"dept":h.SCMROLE00103(x);break;case"user":h.SCMROLE00104(x);break}},[i]),o.jsx(kt,{grantEvent:g,children:o.jsxs(ze,{children:[o.jsxs(Ie,{className:"w40",children:[o.jsx(Le,{title:"역할 목록",icons:{type:"antd"}}),o.jsx(Ve,{ref:t,type:"nrml",gridColumns:l,gridOptions:u,gridEvents:f,renderers:[{name:"systCard",renderer:s}]})]}),o.jsxs(Ie,{className:"w60",children:[o.jsx(Le,{title:"역할별 관리"}),o.jsx(p.Tabs,{className:"bwg-tab",activeKey:i,onChange:v=>a(v),items:[{key:"menu",label:"역할별 메뉴",icon:o.jsx(Y.MenuOutlined,{}),children:o.jsx(Ve,{type:"tree",gridColumns:[{fieldName:"menuId",header:{text:"메뉴ID"},width:120},{fieldName:"menuNm",header:{text:"메뉴명"},width:200},{fieldName:"menuPath",header:{text:"메뉴경로"},width:300},{fieldName:"enblYn",header:{text:"사용여부"},width:80}],gridOptions:{display:{rowHeight:40}}})},{key:"dept",label:"역할별 부서",icon:o.jsx(Y.TeamOutlined,{}),children:o.jsxs(ze,{children:[o.jsx(Ie,{className:"w50",children:o.jsx(Ve,{ref:r,type:"nrml",gridColumns:c,gridOptions:{display:{rowHeight:40}}})}),o.jsx(Ie,{className:"w50",border:!0,children:o.jsx(fn,{title:"부서정보",children:"123"})})]})},{key:"user",label:"역할별 사용자",icon:o.jsx(Y.UserOutlined,{}),children:o.jsxs(ze,{children:[o.jsx(Ie,{className:"w50",children:o.jsx(Ve,{ref:n,type:"nrml",gridColumns:d,gridOptions:{display:{rowHeight:40}}})}),o.jsx(Ie,{className:"w50",border:!0,children:o.jsx(fn,{title:"사용자정보",children:"123"})})]})}]})]})]})})};var ca={},I0;function PN(){if(I0)return ca;I0=1;function e(E){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},e(E)}Object.defineProperty(ca,"__esModule",{value:!0}),ca.CopyToClipboard=void 0;var t=i(m),r=i(JC()),n=["text","onCopy","options","children"];function i(E){return E&&E.__esModule?E:{default:E}}function a(E,C){var O=Object.keys(E);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(E);C&&(k=k.filter(function(T){return Object.getOwnPropertyDescriptor(E,T).enumerable})),O.push.apply(O,k)}return O}function s(E){for(var C=1;C<arguments.length;C++){var O=arguments[C]!=null?arguments[C]:{};C%2?a(Object(O),!0).forEach(function(k){j(E,k,O[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(O)):a(Object(O)).forEach(function(k){Object.defineProperty(E,k,Object.getOwnPropertyDescriptor(O,k))})}return E}function l(E,C){if(E==null)return{};var O=c(E,C),k,T;if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(E);for(T=0;T<D.length;T++)k=D[T],!(C.indexOf(k)>=0)&&Object.prototype.propertyIsEnumerable.call(E,k)&&(O[k]=E[k])}return O}function c(E,C){if(E==null)return{};var O={},k=Object.keys(E),T,D;for(D=0;D<k.length;D++)T=k[D],!(C.indexOf(T)>=0)&&(O[T]=E[T]);return O}function d(E,C){if(!(E instanceof C))throw new TypeError("Cannot call a class as a function")}function u(E,C){for(var O=0;O<C.length;O++){var k=C[O];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}function f(E,C,O){return C&&u(E.prototype,C),Object.defineProperty(E,"prototype",{writable:!1}),E}function h(E,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");E.prototype=Object.create(C&&C.prototype,{constructor:{value:E,writable:!0,configurable:!0}}),Object.defineProperty(E,"prototype",{writable:!1}),C&&g(E,C)}function g(E,C){return g=Object.setPrototypeOf||function(k,T){return k.__proto__=T,k},g(E,C)}function v(E){var C=w();return function(){var k=b(E),T;if(C){var D=b(this).constructor;T=Reflect.construct(k,arguments,D)}else T=k.apply(this,arguments);return x(this,T)}}function x(E,C){if(C&&(e(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(E)}function y(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function w(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(E){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(O){return O.__proto__||Object.getPrototypeOf(O)},b(E)}function j(E,C,O){return C in E?Object.defineProperty(E,C,{value:O,enumerable:!0,configurable:!0,writable:!0}):E[C]=O,E}var P=(function(E){h(O,E);var C=v(O);function O(){var k;d(this,O);for(var T=arguments.length,D=new Array(T),L=0;L<T;L++)D[L]=arguments[L];return k=C.call.apply(C,[this].concat(D)),j(y(k),"onClick",function(A){var B=k.props,z=B.text,F=B.onCopy,R=B.children,N=B.options,I=t.default.Children.only(R),M=(0,r.default)(z,N);F&&F(z,M),I&&I.props&&typeof I.props.onClick=="function"&&I.props.onClick(A)}),k}return f(O,[{key:"render",value:function(){var T=this.props,D=T.children,L=l(T,n),A=t.default.Children.only(D);return t.default.cloneElement(A,s(s({},L),{},{onClick:this.onClick}))}}]),O})(t.default.PureComponent);return ca.CopyToClipboard=P,j(P,"defaultProps",{onCopy:void 0,options:void 0}),ca}var fd,N0;function ON(){if(N0)return fd;N0=1;var e=PN(),t=e.CopyToClipboard;return t.CopyToClipboard=t,fd=t,fd}var kN=ON();const Zh=wr(kN),pr=({children:e,onClick:t,isActive:r=!1,icon:n})=>{const[i,a]=m.useState(!1),s={width:"100%",textAlign:"left",marginBottom:"8px",border:"none",borderRadius:"8px",padding:"12px 16px",fontWeight:500,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative",overflow:"hidden",background:r?"#00bcd4":"transparent",color:r?"#ffffff":"#595959",transform:i?"translateX(4px)":"translateX(0)",boxShadow:r?i?"0 4px 12px rgba(0, 188, 212, 0.3)":"none":i?"0 2px 8px rgba(0, 0, 0, 0.1)":"none"},l={position:"absolute",left:0,top:0,bottom:0,width:"4px",background:"#00bcd4",borderRadius:"0 2px 2px 0"};return o.jsxs(p.Button,{type:"text",onClick:t,style:s,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[r&&o.jsx("div",{style:l}),n&&o.jsx("span",{style:{marginRight:"8px",fontSize:"16px"},children:n}),o.jsx("span",{style:{fontSize:"14px",lineHeight:1.4},children:e})]})},hr=({importText:e,onCopy:t})=>o.jsx(Zh,{text:e,onCopy:()=>{p.message.success("import 문이 복사되었습니다!"),t?.()},children:o.jsxs("div",{style:{background:"#1e1e1e",border:"1px solid #3c3c3c",borderRadius:"6px",padding:"12px 16px",fontFamily:'Monaco, Menlo, "Ubuntu Mono", monospace',fontSize:"13px",color:"#d4d4d4",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"all 0.2s ease",userSelect:"none"},onMouseEnter:r=>{r.currentTarget.style.background="#2d2d30",r.currentTarget.style.borderColor="#4a4a4a"},onMouseLeave:r=>{r.currentTarget.style.background="#1e1e1e",r.currentTarget.style.borderColor="#3c3c3c"},children:[o.jsx("code",{children:e}),o.jsx(Y.CopyOutlined,{style:{color:"#858585",fontSize:"14px"}})]})}),Yr=({selectedRowKeys:e,onSelectionChange:t,componentName:r})=>{const n=[{property:"label",description:"폼 아이템의 라벨 텍스트입니다. 필수 항목일 경우 자동으로 별표(*)가 추가됩니다.",type:"string | React.ReactNode"},{property:"name",description:"폼 필드의 이름입니다. Form.useForm과 함께 사용되어 필드 값을 관리합니다.",type:"string | string[]"},{property:"rules",description:'필드의 유효성 검사 규칙입니다. Ant Design의 Form.Item rules를 따릅니다. (예: [{ required: true, message: "필수 입력 항목입니다." }])',type:"Rule[]"},{property:"initialValue",description:"필드의 초기값을 설정합니다.",type:"any"}],i=()=>{if(e.length===0){p.message.warning("선택된 속성이 없습니다!");return}const a={label:"'라벨'",name:"'fieldName'",rules:"[{ required: true, message: '필수 항목입니다.' }]",initialValue:"'초기값'"},s=e.map(c=>` ${c}: ${a[c]||"true"}`).join(`,
184
184
  `),l=`<${r}
185
185
  itemProps={{
186
186
  ${s}
@@ -1025,7 +1025,7 @@ const Parent = () => {
1025
1025
  <button onClick={handleGetValue}>값 가져오기</button>
1026
1026
  </div>
1027
1027
  );
1028
- };`})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Title,{level:4,children:"🔍 forwardRef vs useImperativeHandle"}),o.jsxs("div",{style:{display:"flex",gap:"16px"},children:[o.jsxs("div",{style:{flex:1,padding:"12px",background:"#f0f9ff",borderRadius:"6px"},children:[o.jsx("strong",{children:"forwardRef"}),o.jsxs("ul",{style:{paddingLeft:"16px",fontSize:"14px"},children:[o.jsx("li",{children:"DOM 요소를 그대로 전달"}),o.jsx("li",{children:"단순한 ref 전달"}),o.jsx("li",{children:"DOM의 모든 속성/메서드 접근 가능"})]})]}),o.jsxs("div",{style:{flex:1,padding:"12px",background:"#f0fdf4",borderRadius:"6px"},children:[o.jsx("strong",{children:"useImperativeHandle"}),o.jsxs("ul",{style:{paddingLeft:"16px",fontSize:"14px"},children:[o.jsx("li",{children:"커스텀 메서드만 노출"}),o.jsx("li",{children:"내부 구현 숨김"}),o.jsx("li",{children:"필요한 기능만 선택적 제공"})]})]})]})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Title,{level:4,children:"⚠️ 주의사항"}),o.jsx(p.Alert,{message:"꼭 필요한 경우에만 사용하세요!",description:"useImperativeHandle은 React의 선언적 패러다임을 벗어나는 명령형 API입니다. 대부분의 경우 props와 state로 충분하므로, 정말 필요한 경우에만 사용하세요.",type:"warning",showIcon:!0})]}),o.jsx(DN,{})]})})})]})]})})},$N=e=>{m.useEffect(()=>{g({sysCd:__SYS_CD__,fileGrpKey:null}),j.search()},[]);const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),[i,a]=m.useState(""),[s,l]=m.useState(""),[c,d]=m.useState(""),[u,f]=m.useState(""),{getFormData:h,setFormData:g}=at.useSearchBox(),v=m.useMemo(()=>[{fieldName:"crprCd",header:{text:"법인코드"},width:80,styleName:"center"},{fieldName:"sysCd",header:{text:"시스템코드"},width:100,styleName:"center"},{fieldName:"fileGrpKey",header:{text:"파일그룹키"},width:120,styleName:"center"},{fieldName:"fileKey",header:{text:"파일키"},width:200,styleName:"center"},{fieldName:"lgclFileNm",header:{text:"파일 논리명"},width:250,styleName:"left"},{fieldName:"fileSize",header:{text:"파일 크기"},width:100,styleName:"right",displayCallback:(P,E,C)=>{if(!C)return"0 Bytes";const O=Number(C);if(isNaN(O)||O===0)return"0 Bytes";const k=1024,T=["Bytes","KB","MB","GB","TB"],D=Math.floor(Math.log(O)/Math.log(k));return parseFloat((O/Math.pow(k,D)).toFixed(2))+" "+T[D]}},{fieldName:"fileExtn",header:{text:"파일 확장자"},width:100,styleName:"center"},{fieldName:"fileType",header:{text:"파일 타입"},width:120,styleName:"center"}],[]),x=m.useMemo(()=>[{fieldName:"fileGrpKey",header:{text:"파일 그룹키"},width:50,styleName:"center"},{fieldName:"fileKey",header:{text:"파일 키"},width:50,styleName:"center"},{fieldName:"fileSeq",header:{text:"파일 정렬순서"},width:50,styleName:"center"},{fieldName:"lgclFileNm",header:{text:"파일 논리명"},width:200,styleName:"left"},{fieldName:"physFileNm",header:{text:"파일 물리명"},width:200,styleName:"left"},{fieldName:"fileExtn",header:{text:"파일 확장자"},width:100},{fieldName:"mltpYn",header:{text:"대용량파일 여부"},width:100},{fieldName:"fileSize",header:{text:"파일 크기"},width:100,styleName:"right",displayCallback:(P,E,C)=>{if(!C)return"0 Bytes";const O=Number(C);if(isNaN(O)||O===0)return"0 Bytes";const k=1024,T=["Bytes","KB","MB","GB","TB"],D=Math.floor(Math.log(O)/Math.log(k));return parseFloat((O/Math.pow(k,D)).toFixed(2))+" "+T[D]}},{fieldName:"filePath",header:{text:"파일 경로"},width:100,styleName:"right"}],[]),y={onCurrentRowChanged(P,E,C){if(C<0)return;let O=P.getDataSource().getJsonRow(C);a(O.fileGrpKey),O.mltpYn=="Y"?ae.callEndpoint({trxCd:"SCMFILE00106",appCd:e.appCd},{crprCd:ae.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:O.fileGrpKey,fileKey:O.fileKey}).then(k=>{n.current?.addAllData(k.sub)}):n.current?.dp?.clearRows()}},w={container:{check:!0,checkAll:!0,indicator:!0,footer:!0}},b={SCMFILE00101:()=>{ae.callEndpoint({trxCd:"SCMFILE00101",appCd:e.appCd},{crprCd:ae.getUserInfo()?.crprCd,...h()}).then(P=>{r.current?.addAllData(P.sub)}).catch(P=>{console.error("오류:",P)})}},j={search:()=>{b.SCMFILE00101()},download:()=>{console.log("download");let P=r.current?.dp?.getJsonRow(r.current?.getCurrentRow());ae.downloadByFileKey(P.fileKey)}};return o.jsx(kt,{searchBox:{reqRows:[o.jsxs(wt,{children:[o.jsx($e,{span:6,children:o.jsx(_.BwgInput,{itemProps:{label:"시스템 코드",name:"sysCd"}})}),o.jsx($e,{span:6,children:o.jsx(_.BwgInput,{itemProps:{label:"파일 그룹키",name:"fileGrpKey"}})})]})]},buttons:{grant:[{id:"search",label:"조회",onClick:()=>{j.search()}},{id:"download",label:"다운로드",onClick:()=>{j.download()}}]},children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w60",children:[o.jsx(Le,{title:"파일 목록",children:o.jsx("div",{style:{float:"right"},children:o.jsx(p.Space,{children:o.jsx(_.BwgButton,{onClick:()=>j.download(),children:"다운로드"})})})}),o.jsx(Ve,{ref:r,gridColumns:x,gridOptions:w,gridEvents:y})]}),o.jsx(Ie,{className:"w40",border:!0,children:o.jsx(p.Tabs,{type:"card",defaultActiveKey:"1",style:{height:"100%"},items:[{label:"파일상세",key:"1",children:o.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[o.jsx(Le,{title:"dtls 그리드"}),o.jsx(Ve,{ref:n,gridColumns:v})]})},{label:"파일 샘플",key:"2",children:o.jsx("div",{style:{height:"100%",overflowY:"auto",padding:"10px"},children:o.jsx(fn,{title:"샘플 업로드",children:o.jsxs(p.Form,{layout:"vertical",ref:t,children:[o.jsx(p.Divider,{orientation:"left",style:{borderColor:"#7cb305"},children:"그리드 onCurrentRowChanged연동"}),o.jsx(_.BwgInput,{itemProps:{label:"파일 그룹키 (fileGrpKey)"},inputProps:{value:i,onChange:P=>a(P.target.value)}}),o.jsx(_.BwgUploader,{fileGrpKey:i}),o.jsx(p.Divider,{orientation:"left",style:{borderColor:"#7cb305"},children:"파일업로드시 fileGrpKey 채번 및 연동"}),o.jsx(_.BwgInput,{itemProps:{label:"채번 그룹키 (fileGrpKey2)"},inputProps:{value:s,disabled:!0}}),o.jsx(_.BwgUploader,{fileGrpKey:s,multiple:!0,onUploadComplete:P=>{console.log(P),s||l(P.fileGrpKey)}}),o.jsx(p.Divider,{orientation:"left",style:{borderColor:"#7cb305"},children:"대용량파일 업로드(zip압축 후 업로드)"}),o.jsx(_.BwgLargeUploader,{fileGrpKey:s})]})})})},{label:"파일 다운로드",key:"3",children:o.jsxs("div",{children:[o.jsx(_.BwgInput,{itemProps:{label:"파일 그룹키 (fileGrpKey)"},inputProps:{value:c,onChange:P=>d(P.target.value)}}),o.jsx(_.BwgInput,{itemProps:{label:"앱코드 (appCd)"},inputProps:{value:u,onChange:P=>f(P.target.value)}}),o.jsx(_.BwgDownload,{fileGrpKey:c,appCd:u})]})}]})})]})})},sS=({width:e="40%",searchContext:t,onOk:r,onClose:n,...i})=>{const a=m.useRef(null),s=m.useRef(null),[l,c]=m.useState([]),d=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appCd",width:60,header:{text:"애플리케이션"},styleName:"left"},{fieldName:"prgrId",width:120,header:{text:"프로그램ID"},styleName:"left"},{fieldName:"prgrNm",width:200,header:{text:"프로그램명"},styleName:"left"},{fieldName:"enblYn",width:80,header:{text:"사용여부"},styleName:"center",renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]);m.useEffect(()=>{t?.sysCd&&(a.current?.setFormData({sysCd:t.sysCd}),v.SCMPRGR00101())},[t?.sysCd]);const u=()=>{v.SCMPRGR00101()},f=y=>{y.key==="Enter"&&u()},h=()=>{console.log("selectedRows:",l),l.length>0?r?.(l[0]):r?.({})},g=()=>{i.onCancel?.(),n?.()},v=m.useMemo(()=>({SCMPRGR00101:()=>{const y={...a.current?.getFormData()};ae.callService("SCMPRGR00101",y).then(w=>{console.log("response.programs:",w.data),s.current?.addAllData(w.data||[])}).catch(w=>{console.error("오류:",w)})}}),[]),x={onCurrentRowChanged:(y,w,b)=>{if(b>=0){const j=s.current?.vw?.getItemIndex(b),P=s.current?.vw?.getValues(j||0);c([P])}},onCellDblClicked:(y,w)=>{const b=w.itemIndex;if(b>=0){const j=s.current?.vw?.getValues(b);console.log(j),c([j]),r?.(j)}}};return o.jsx(p.ConfigProvider,{theme:{components:{Modal:{wireframe:!0,titleColor:"#08979c",headerBg:"#e6fffb"}}},children:o.jsx(p.Modal,{title:"프로그램 선택",width:e,maskClosable:!1,styles:{body:{paddingTop:"10px"}},okText:"적용",...i,onOk:h,onCancel:g,children:o.jsxs("div",{style:{padding:"8px 0"},children:[o.jsx(ko,{ref:a,reqRows:o.jsxs(p.Row,{gutter:[16,8],children:[o.jsx(p.Col,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",style:{marginBottom:0},labelCol:{flex:"80px"}},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],style:{fontSize:"12px"},onChange:v.SCMPRGR00101}})}),o.jsx(p.Col,{span:16,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"검색어",style:{marginBottom:0},labelCol:{flex:"90px"}},inputProps:{placeholder:"프로그램ID 또는 프로그램명을 입력하세요",suffix:o.jsx(Y.SearchOutlined,{style:{color:"#1890ff",cursor:"pointer"},onClick:u}),onKeyPress:f}})})]})}),o.jsx(Ve,{ref:s,gridColumns:d,gridOptions:{container:{radio:!0,footer:!1}},gridEvents:x,gridDivStyle:{marginTop:8,height:400}}),l.length>0&&o.jsxs("div",{style:{marginTop:16,padding:12,backgroundColor:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[o.jsx("strong",{children:"선택된 프로그램:"})," ",l[0]?.prgrNm," (",l[0]?.prgrId,")"]})]})})})},lS=({width:e="40%",searchContext:t,onOk:r,onClose:n,...i})=>{const a=m.useRef(null),s=m.useRef(null),[l,c]=m.useState([]),d=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appCd",width:120,header:{text:"애플리케이션"},styleName:"left"},{fieldName:"menuGbCd",width:100,header:{text:"메뉴구분"},styleName:"center",lookupDisplay:!0,labels:["메인메뉴","서브메뉴","프로그램"],values:["CMPRGRM","CMPRGRS","CMPRGRP"],renderer:{type:"text",showTooltip:!1}},{fieldName:"menuId",width:120,header:{text:"메뉴ID"},styleName:"left"},{fieldName:"menuNm",width:200,header:{text:"메뉴명"},styleName:"left"},{fieldName:"menuPrntId",width:120,header:{text:"상위메뉴ID"},styleName:"left"}],[]);m.useEffect(()=>{setTimeout(()=>{s.current?.vw&&s.current.vw.setRowStyleCallback(function(b,j,P){const E=b.getValue(j.index,"menuGbCd");if(E==="CMPRGRM")return{style:{background:"#e8f0ff"}};if(E==="CMPRGRS")return{style:{background:"#f0f8ff"}}})},200)},[]),m.useEffect(()=>{t?.sysCd&&a.current?.setFormData({sysCd:t.sysCd,appCd:"",keyword:t.keyword||""})},[t?.sysCd,t?.keyword]);const u=()=>{x.SCMMENU00104()},f=w=>{w.key==="Enter"&&u()},h=()=>{a.current?.setFormData({sysCd:"",appCd:"",keyword:""})},g=()=>{console.log("selectedRows:",l),l.length>0?r?.(l[0]):r?.({})},v=()=>{i.onCancel?.(),n?.()},x=m.useMemo(()=>({SCMMENU00104:()=>{const w={crprCd:ae.getCrprCd(),...a.current?.getFormData()};ae.callService("SCMMENU00104",w).then(b=>{console.log("response.menus:",b.sub),s.current?.addAllData(b.sub,{treeOption:{isExpand:!0,dataField:"menuId",parentField:"menuPrntId"}})}).catch(b=>{console.error("오류:",b)})}}),[]),y=m.useMemo(()=>({onCurrentRowChanged:(w,b,j)=>{if(j>=0){const P=s.current?.vw?.getItemIndex(j),E=s?.current?.vw?.getValues(P||0);c([E])}},onCellDblClicked:(w,b)=>{const j=b.itemIndex;if(j>=0){const P=s.current?.vw?.getValues(j);console.log(P),c([P]),r?.(P)}}}),[r]);return o.jsx(p.ConfigProvider,{theme:{components:{Modal:{wireframe:!0,titleColor:"#08979c",headerBg:"#e6fffb"}}},children:o.jsx(p.Modal,{title:"상위 메뉴 선택",width:e,maskClosable:!1,styles:{body:{paddingTop:"10px"}},okText:"적용",...i,onOk:g,onCancel:v,children:o.jsxs("div",{style:{padding:"8px 0"},children:[o.jsx(ko,{border:!0,header:{title:"메뉴 선택",buttons:[o.jsx(_.BwgButton,{onClick:()=>x.SCMMENU00104(),style:{marginRight:8},children:"검색"},"search"),o.jsx(_.BwgButton,{onClick:h,children:"초기화"},"reset")]},ref:a,reqRows:o.jsxs(p.Row,{gutter:[20,5],children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",style:{marginBottom:0}},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],style:{fontSize:"12px"},onChange:x.SCMMENU00104}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션",style:{marginBottom:0}},selectProps:{options:[{label:"선택하세요",value:""},{label:"ERP",value:"ERP"},{label:"HR",value:"HR"},{label:"SUPPORT",value:"SUPPORT"}],style:{fontSize:"12px"}}})}),o.jsx(p.Col,{span:7,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"검색어",style:{marginBottom:0}},inputProps:{placeholder:"메뉴ID 또는 메뉴명을 입력하세요",style:{fontSize:"12px"},onKeyPress:f}})}),o.jsx(p.Col,{span:5,style:{textAlign:"right"}})]})}),o.jsx(Ve,{ref:s,type:"tree",gridColumns:d,gridOptions:{container:{radio:!0,footer:!1}},gridEvents:y,gridDivStyle:{marginTop:8,height:400}}),l.length>0&&o.jsxs("div",{style:{marginTop:16,padding:12,backgroundColor:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[o.jsx("strong",{children:"선택된 메뉴:"})," ",l[0]?.menuNm," (",l[0].menuId,")"]})]})})})},ao={KE:[{label:"재무회계",value:"FI"},{label:"예산관리",value:"FM"},{label:"구매계약",value:"MM"},{label:"영업관리",value:"SD"},{label:"파트너관리",value:"PMN"}],KH:[{label:"HR 솔루션",value:"HR"},{label:"연말정산",value:"YT"},{label:"평정",value:"PE"}],KS:[{label:"온통",value:"BCOM"},{label:"e-감사",value:"EAUD"},{label:"청령신고",value:"INR"},{label:"ITAM",value:"ITAM"},{label:"차량/회의실",value:"CMM"},{label:"OA전산물품관리",value:"OAM"},{label:"총무관리",value:"GAM"},{label:"출입관리",value:"ACM"},{label:"비품관리",value:"IVM"},{label:"인장서비스",value:"SGS"},{label:"사료관리",value:"HIS"},{label:"웹펙스서비스",value:"WFAX"},{label:"메시지서비스",value:"SMS"},{label:"경영공시",value:"BID"},{label:"언론미디어",value:"PAM"},{label:"심의자문위원회",value:"DAC"},{label:"지식재산권신청",value:"IPR"},{label:"정보공유게시판",value:"ISB"}]},LN={container:{check:!0,checkAll:!0,indicator:!0,footer:!0}},z0=({readOnly:e=!1,drawerMode:t=""})=>{const r=p.Form.useFormInstance(),[n,i]=m.useState(null),[a,s]=m.useState(null),[l,c]=m.useState([]),[d,u]=m.useState("CMPRGRP"),[f,h]=m.useState(!0),[g,v]=m.useState(!1),[x,y]=m.useState({}),[w,b]=m.useState(!1),[j,P]=m.useState({});m.useEffect(()=>{const T=r.getFieldValue("sysCd"),D=r.getFieldValue("appCd"),L=r.getFieldValue("menuGbCd"),A=r.getFieldValue("deftMenuNo");i(T??null),s(D??null),u(L??"CMPRGRP"),h(A??!0),T&&ao[T]?c(ao[T]):c([])},[r]);const E=T=>{i(T),T&&ao[T]?c(ao[T]):c([]),r.resetFields(["appCd","scrnId","scrnNm","menuPrntId","menuPrntNm"])},C=T=>{h(T),T&&r.setFieldsValue({menuNo:""})},O=T=>{T&&r.setFieldsValue({menuPrntId:T.menuId,menuPrntNm:T.menuNm}),v(!1),y({})},k=T=>{T&&r.setFieldsValue({scrnId:T.prgrId,scrnNm:T.prgrNm}),b(!1),P({})};return o.jsxs(o.Fragment,{children:[o.jsx(p.Row,{gutter:12,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgRadio,{itemProps:{name:"menuGbCd"},inputProps:{options:[{label:"메인메뉴",value:"CMPRGRM"},{label:"서브메뉴",value:"CMPRGRS"},{label:"프로그램",value:"CMPRGRP"}],defaultValue:"CMPRGRP",optionType:"button",size:"middle",style:{pointerEvents:e?"none":void 0},onChange:T=>{u(T.target.value)}}})})}),o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템"},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],onChange:E,disabled:e||t==="EDIT",placeholder:"시스템을 선택하세요"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션"},selectProps:{options:l,disabled:e||!n||t==="EDIT",placeholder:"시스템을 먼저 선택하세요"}})})]}),o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"menuId",label:"메뉴ID"},inputProps:{placeholder:"자동 채번",disabled:!0,readOnly:e,variant:e?"borderless":"outlined"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"menuNm",label:"메뉴명"},inputProps:{readOnly:e,variant:e?"borderless":"outlined"}})})]}),d==="CMPRGRP"&&o.jsx(p.Row,{gutter:24,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgSearch,{itemProps:{label:"프로그램ID",name:["scrnId","scrnNm"]},readOnly:e,popupConfig:!0,onSearch:()=>{n?(b(!0),P({sysCd:n,keyword:r.getFieldValue("scrnNm")})):ae.showWarning("시스템을 선택하세요")}})})}),d!=="CMPRGRM"&&o.jsx(p.Row,{gutter:24,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgSearch,{itemProps:{label:"상위 메뉴",name:["menuPrntId","menuPrntNm"]},readOnly:e,onSearch:()=>{console.log("formSysCd:",n),n?(v(!0),y({sysCd:n,keyword:r.getFieldValue("menuPrntNm")})):ae.showWarning("시스템을 선택하세요")}})})}),o.jsxs(p.Row,{gutter:12,children:[d=="CMPRGRP"&&o.jsxs(o.Fragment,{children:[o.jsx(p.Col,{span:t=="NEW"?8:12,children:o.jsx(_.BwgFormItem,{name:"menuNo",label:"메뉴번호",children:o.jsx(p.Input.OTP,{length:4,formatter:T=>T.replace(/\D/g,""),disabled:t=="NEW"?f:e,style:{width:"180px"}})})}),t=="NEW"&&o.jsx(p.Col,{span:3,offset:1,children:o.jsx(_.BwgCheck,{itemProps:{name:"isAutoMenuNo",label:"자동채번"},inputProps:{defaultChecked:!0,onChange:T=>C(T.target.checked)}})})]}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgRadio,{itemProps:{name:"useYn",label:"사용여부"},inputProps:{defaultValue:"Y",options:[{label:"Y",value:"Y"},{label:"N",value:"N"}],optionType:"button",style:{pointerEvents:e?"none":void 0,width:"100%"}}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgNumber,{itemProps:{name:"sortOrdr",label:"정렬순서"},inputProps:{defaultValue:0,min:1,max:99,precision:0,controls:!0,readOnly:e,variant:e?"borderless":"outlined"}})}),d=="CMPRGRM"&&o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"iconCd",label:"아이콘명"},inputProps:{readOnly:e,variant:e?"borderless":"outlined"}})})]}),o.jsx(_.BwgTextArea,{itemProps:{name:"menuDscr",label:"메뉴 설명"},inputProps:{disabled:e,rows:3}}),o.jsx(sS,{open:w,searchContext:j,onOk:k,onClose:()=>{b(!1),P({})}}),o.jsx(lS,{open:g,searchContext:x,onOk:O,onClose:()=>{v(!1),y({})}})]})},zN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),i=tt.useCodeStore(),{getFormData:a,setFormData:s}=at.useSearchBox(),[l,c]=m.useState([]),[d,u]=m.useState(!1),[f,h]=m.useState(""),[g,v]=m.useState(-1),x=m.useCallback(k=>{u(!0),h(k)},[]),y=m.useCallback(()=>{u(!1),h("")},[]),w=m.useMemo(()=>i.getGridLookup("CMPRGR"),[i]),b=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appCd",visible:!1},{fieldName:"menuPrntId",visible:!1},{fieldName:"menuPrntNm",visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,styleName:"left"},{fieldName:"menuGbCd",header:{text:"메뉴구분"},width:100,styleName:"left",...w},{name:"menuNm",fieldName:"menuNm",header:{text:"메뉴명"},width:200,styleName:"left"},{fieldName:"scrnId",header:{text:"화면ID"},width:100,styleName:"left"},{fieldName:"scrnNm",header:{text:"화면이름"},width:100,styleName:"left"},{fieldName:"menuNo",header:{text:"메뉴번호"},width:100,styleName:"left"},{fieldName:"useYn",visible:!1},{fieldName:"sortOrdr",visible:!1},{fieldName:"iconCd",visible:!1},{fieldName:"menuDscr",visible:!1}],[w]);m.useEffect(()=>{if(f==="NEW")r.current?.setFieldsValue({useYn:"Y",deftMenuNo:!0,menuGbCd:"CMPRGRP"});else if(f==="EDIT"){const k=n.current?.getCurrentIndex();if(k!==void 0&&k>=0){const T=n.current?.vw?.getValues(k);r.current?.setFieldsValue(T)}}else r.current?.resetFields()},[f]),m.useEffect(()=>{setTimeout(()=>{n.current?.vw&&n.current.vw.setRowStyleCallback(function(T,D,L){const A=T.getValue(D.index,"menuGbCd");if(A==="CMPRGRM")return{style:{background:"#e8f0ff"}};if(A==="CMPRGRS")return{style:{background:"#f0f8ff"}};if(A==="CMPRGRP")return{style:{background:"#fff"}}})},200)},[]);const j=k=>{k&&ao[k]?c([{label:"전체",value:""},...ao[k]]):c([{label:"전체",value:""}]),s({appCd:""}),E.SCMMENU00101()},P=()=>{r.current?.validateFields().then(k=>{console.log("Form values:",k),(f==="NEW"||f==="EDIT")&&E.SCMMENU00102()}).catch(k=>{console.log("Validation failed:",k)})},E={SCMMENU00101:()=>{const k={crprCd:ae.getCrprCd(),...a()};console.log("Search data:",k),ae.callService("SCMMENU00101",k,{}).then(T=>{n.current?.addAllData(T.menus,{treeOption:{isExpand:!0,dataField:"menuId",parentField:"menuPrntId"}})}).catch(T=>{console.error("오류:",T)})},SCMMENU00102:()=>{const k={iudFlag:f==="EDIT"?"U":"I",crprCd:ae.getCrprCd(),...r?.current?.getFieldsValue()};delete k.scrnNm,delete k.menuPrntNm,ae.callService("SCMMENU00102",k,{}).then(T=>{console.log("Save response:",T),T.result>0&&(y(),E.SCMMENU00101())}).catch(T=>{console.error("저장 오류:",T)})},SCMMENU00103:()=>{const k={},T=n.current?.vw?.getCheckedRows(!1),D=[];T?.forEach(L=>{const A=n.current?.dp?.getJsonRow(L);D.push({crprCd:A.crprCd,sysCd:A.sysCd,appCd:A.appCd,menuId:A.menuId,menuGbCd:A.menuGbCd})}),k.sub=D,ae.callService("SCMMENU00103",k,{}).then(L=>{console.log(L),L?.result>0&&E.SCMMENU00101()})}},C={search:()=>{E.SCMMENU00101()},new:()=>{x("NEW")},delete:()=>{const k=n.current?.vw?.getCheckedRows(!1);if(k?.length==0){ae.showWarning("삭제할 행을 체크하세요");return}else{let T=0,D=0,L=0;k?.forEach(A=>{const B=n.current?.dp?.getValue(A,"menuGbCd");B==="CMPRGRM"?T++:B==="CMPRGRS"?D++:B==="CMPRGRP"&&L++}),p.Modal.confirm({title:"삭제 안내",content:o.jsxs(o.Fragment,{children:[T>0&&o.jsx(o.Fragment,{children:o.jsxs(p.Tag,{color:"blue",children:["메인메뉴: ",T,"개"]})}),D>0&&o.jsx(o.Fragment,{children:o.jsxs(p.Tag,{color:"green",children:["서브메뉴: ",D,"개"]})}),L>0&&o.jsx(o.Fragment,{children:o.jsxs(p.Tag,{color:"orange",children:["프로그램: ",L,"개"]})}),"를 삭제하시겠습니까?"]}),onOk:()=>{E.SCMMENU00103()},onCancel:()=>{}})}}},O=m.useMemo(()=>({onCurrentRowChanged:(k,T,D)=>{v(D)},onItemChecked:(k,T,D)=>{if(!k._isUpdatingChildren)try{k._isUpdatingChildren=!0;const L=(A,B)=>{const z=k.getChildren(A);z&&z.length>0&&z.forEach(F=>{k.isCheckedItem(F)!==B&&(k.checkItem(F,B),L(F,B))})};L(T,D)}finally{setTimeout(()=>{k._isUpdatingChildren=!1},0)}}}),[]);return o.jsxs(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:C.search},{id:"new",label:"신규",onClick:C.new},{id:"delete",label:"삭제",onClick:C.delete}]},searchBox:{reqRows:o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",initialValue:"",labelCol:{flex:"180px"}},selectProps:{options:[{label:"전체",value:""},{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],onChange:j}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션",initialValue:""},selectProps:{options:l,placeholder:"시스템코드를 먼저 선택해주세요",onChange:C.search}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"검색어"},inputProps:{placeholder:"메뉴ID/메뉴명을 입력하세요.",onPressEnter:C.search}})})]})},children:[o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w65 mr20",children:[o.jsx(Le,{title:"메뉴 트리"}),o.jsx(Ve,{ref:n,type:"tree",gridColumns:b,gridOptions:LN,gridEvents:O,bindRef:t})]}),o.jsx(Ie,{className:"w35",border:!0,overflow:{x:"auto",y:"auto"},children:o.jsx(fn,{title:"메뉴 상세",titleChildren:o.jsx(o.Fragment,{children:g>=0&&o.jsx(_.BwgButton,{color:"gold",onClick:()=>x("EDIT"),children:"변경"})}),children:o.jsx(p.Form,{layout:"vertical",ref:t,children:o.jsx(z0,{readOnly:!0})})})})]}),o.jsx(dn,{title:`메뉴 ${f==="EDIT"?"변경":"등록"}`,open:d,placement:"right",onClose:y,width:"30%",size:"large",afterOpenChange:k=>{console.log("Drawer afterOpenChange:",k)},footer:o.jsxs("div",{className:"drawer-footer-btn-group",children:[o.jsx(p.Button,{onClick:y,className:"bwg-btn",children:"취소"}),o.jsx(p.Button,{type:"primary",onClick:P,className:"bwg-btn",children:"저장"})]}),children:o.jsx(p.Form,{layout:"vertical",ref:r,className:"sub-form pd10",children:o.jsx(z0,{readOnly:!1,drawerMode:f})})})]})},FN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),i=tt.useCodeStore(),{showPopup:a}=at.usePopup(),{getFormData:s}=at.useSearchBox(),[l,c]=m.useState(!1),[d,u]=m.useState("new"),[f,h]=m.useState(null),[g,v]=m.useState([]),[x,y]=m.useState(""),[w,b]=m.useState(!1),[j,P]=m.useState(["조회","닫기"]),[E,C]=m.useState("");m.useEffect(()=>{console.log("SYST 공통코드 목록 :: ",i.getCodeList("SYST"))},[i]),m.useEffect(()=>()=>{r.current&&(r.current.resetFields(),console.log("CMPopuMstrM01: BwgInfoArea form 초기화 완료")),n.current&&(n.current.resetFields(),console.log("CMPopuMstrM01: Drawer form 초기화 완료")),h(null),v([]),y(""),b(!1),P(["조회","닫기"]),C(""),console.log("CMPopuMstrM01: 컴포넌트 언마운트 - 모든 상태 초기화 완료")},[]);const O=m.useMemo(()=>[{name:"crprCd",fieldName:"crprCd",width:80,header:{text:"회사코드"},visible:!1},{name:"systId",fieldName:"systId",width:80,header:{text:"시스템ID"},lookupDisplay:!0,editor:{type:"dropdown"},tag:"req"},{name:"popuCd",fieldName:"popuCd",width:120,header:{text:"팝업코드"},styleName:"left",tag:"req"},{name:"popuNm",fieldName:"popuNm",width:200,header:{text:"팝업명칭"},styleName:"left"},{name:"popuUrl",fieldName:"popuUrl",width:250,header:{text:"팝업호출URL"},styleName:"left"},{name:"popuWdth",fieldName:"popuWdth",width:80,header:{text:"팝업너비"},visible:!1},{name:"wdthUnit",fieldName:"wdthUnit",width:60,header:{text:"너비단위"},visible:!1},{name:"popuHght",fieldName:"popuHght",width:80,header:{text:"팝업높이"},visible:!1},{name:"hghtUnit",fieldName:"hghtUnit",width:60,header:{text:"높이단위"},visible:!1},{name:"enblYn",fieldName:"enblYn",width:60,header:{text:"사용여부"},renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{name:"rmrk",fieldName:"rmrk",width:200,header:{text:"비고"},styleName:"left",visible:!1},{name:"inptDt",fieldName:"inptDt",width:150,header:{text:"입력일시"},visible:!1},{name:"inptId",fieldName:"inptId",width:100,header:{text:"입력자ID"},visible:!1},{name:"chngDt",fieldName:"chngDt",width:150,header:{text:"변경일시"},visible:!1},{name:"chngId",fieldName:"chngId",width:100,header:{text:"변경자ID"},visible:!1},{name:"dtlsInfo",fieldName:"dtlsInfo",width:100,header:{text:"버튼목록"},dataType:"json",visible:!1}],[]),k={display:{},edit:{editable:!1},copy:{singleMode:!0},container:{state:!0,check:!0,checkAll:!0,indicator:!0}},T={SCMPOPU00101:()=>{ae.callService("SCMPOPU00101",{},{}).then($=>{console.log("SCMPOPU00101:",$.data)}).catch($=>{console.error("오류:",$)})},SCMPOPU00102:$=>{ae.callService("SCMPOPU00102",$,{}).then(H=>{console.log("SCMPOPU00102:",H.data),t.current?.addAllData(H.data)}).catch(H=>{console.error("오류:",H)})},SCMPOPU00103:$=>{console.log("save params:",$),ae.callService("SCMPOPU00103",$,{}).then(H=>{console.log("response:",H),H.result?(ae.showSuccess(d==="new"?"팝업이 등록되었습니다.":"팝업이 수정되었습니다."),c(!1),h(null),v([]),y(""),n.current?.resetFields(),T.SCMPOPU00102()):(ae.showDuplicateError("팝업코드"),n.current?.setFields([{name:"popuCd",errors:["이미 사용중인 팝업코드입니다."]}]))}).catch(H=>{console.error("오류:",H),ae.showError("저장 중 오류가 발생했습니다.")})}},D={formFinish:async()=>{try{const $=await n.current?.validateFields();if(g.length>0&&g.filter(X=>!X.btnId||X.btnId.trim()==="").length>0){C("버튼ID가 입력되지 않은 버튼이 있습니다. 모든 버튼의 버튼ID를 입력해주세요.");return}C(""),T.SCMPOPU00103({edit:d!=="new",info:{crprCd:ae.getUserInfo()?.crprCd||"100",systId:$.systId,popuCd:$.popuCd,popuNm:$.popuNm,popuUrl:$.popuUrl,popuWdth:$.popuWdth,wdthUnit:$.wdthUnit,popuHght:$.popuHght,hghtUnit:$.hghtUnit,enblYn:$.enblYn,rmrk:$.rmrk,dtlsInfo:g}})}catch($){console.error("폼 유효성 검사 실패:",$)}},addButton:()=>{const $=g.length>0?Math.max(...g.map(X=>X.btnSq||0)):0,H={key:Date.now().toString(),btnSq:$+1,btnId:"",btnNm:"",iconType:"ANTD",iconVal:"",enblYn:"Y"};v(X=>[...X,H]),y(H.key)},openDefaultModal:()=>{b(!0)},applyDefaultButtons:()=>{const $={조회:{btnId:"SEARCH",btnNm:"조회",iconType:"ANTD",iconVal:"SearchOutlined",enblYn:"Y"},선택적용:{btnId:"APPLY",btnNm:"선택적용",iconType:"ANTD",iconVal:"CheckOutlined",enblYn:"Y"},신규:{btnId:"NEW",btnNm:"신규",iconType:"ANTD",iconVal:"PlusOutlined",enblYn:"Y"},저장:{btnId:"SAVE",btnNm:"저장",iconType:"ANTD",iconVal:"SaveOutlined",enblYn:"Y"},삭제:{btnId:"DELETE",btnNm:"삭제",iconType:"ANTD",iconVal:"DeleteOutlined",enblYn:"Y"},닫기:{btnId:"CLOSE",btnNm:"닫기",iconType:"ANTD",iconVal:"CloseOutlined",enblYn:"Y"}},H=g.length>0?Math.max(...g.map(ue=>ue.btnSq||0)):0,X=j.map((ue,fe)=>({key:"btn_"+ae.generateUID(),btnSq:H+fe+1,...$[ue]}));v(ue=>[...ue,...X]),b(!1)},previewPopup:async()=>{let $=f;if(!$){const H=t.current?.getCurrentRow();if(H===void 0||H<0){ae.showError("미리보기할 팝업을 선택해주세요.");return}if($=t.current?.vw?.getDataSource()?.getJsonRow(H),!$){ae.showError("팝업 데이터를 가져올 수 없습니다.");return}}try{console.log("미리보기 팝업 실행:",$.popuCd),await a($.popuCd,{popupData:$,isPreview:!0}),console.log("미리보기 팝업 열기 완료")}catch(H){console.error("미리보기 팝업 열기 실패:",H),ae.showError("미리보기 팝업을 열 수 없습니다.")}}},L={onCurrentRowChanged($,H,X){if(X<0)return;const ue=$.getValues(X);console.log("onCurrentRowChanged rowData:",ue),r.current?.setFieldsValue(ue),h(ue)}},A={search:async()=>{try{const $=s();console.log("SearchBox FormData:",$);const H={...$,userId:ae.getUserInfo()?.userId};console.log("검색 파라미터:",H),T.SCMPOPU00102(H)}catch($){console.error("SearchBox formData 접근 오류:",$),T.SCMPOPU00102()}},new:()=>{u("new"),h(null),v([]),c(!0),setTimeout(()=>{n.current?.resetFields()},100)},update:()=>{const $=t.current?.getCurrentRow();if($===void 0||$<0){console.log("선택된 행이 없습니다.");return}const H=t.current?.vw?.getDataSource()?.getJsonRow($);if(H){if(u("update"),h(H),c(!0),console.log("전체 rowData:",H),console.log("rowData.dtlsInfo 존재 여부:",!!H.dtlsInfo),console.log("rowData.dtlsInfo 타입:",typeof H.dtlsInfo),console.log("rowData.dtlsInfo 값:",H.dtlsInfo),H.dtlsInfo){console.log("rowData.dtlsInfo 원본:",H.dtlsInfo);let X;if(Array.isArray(H.dtlsInfo)?(X=H.dtlsInfo,console.log("dtlsInfo가 배열입니다:",X)):typeof H.dtlsInfo=="object"?(X=[H.dtlsInfo],console.log("dtlsInfo가 객체입니다. 배열로 변환:",X)):(X=[],console.log("dtlsInfo가 다른 타입입니다:",typeof H.dtlsInfo)),X&&X.length>0){console.log("최종 buttonListData:",X);const ue=X.map((fe,me)=>({...fe,key:fe.key||`btn_${Date.now()}_${me}`,btnSq:fe.btnSq||me+1}));console.log("처리된 buttonListWithKeys:",ue),v(ue)}else console.log("buttonListData가 비어있음, 빈 배열로 설정"),v([])}else console.log("dtlsInfo가 없음, 빈 배열로 설정"),v([]);setTimeout(()=>{const X={...H,popuUrl:H.popuUrl?.startsWith("/popup/")?H.popuUrl.substring(8):H.popuUrl};n.current?.setFieldsValue(X)},100)}}},B={previewPopup:D.previewPopup},z=[{title:"순서",key:"order",width:80,align:"center",render:($,H)=>{const X=g.findIndex(ue=>ue.key===H.key);return o.jsxs(p.Space,{direction:"vertical",size:"small",children:[o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.UpOutlined,{}),disabled:X===0,onClick:()=>M(H.key)}),o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.DownOutlined,{}),disabled:X===g.length-1,onClick:()=>W(H.key)})]})}},{title:"순번",dataIndex:"btnSq",key:"btnSq",width:60,align:"center",render:$=>$||"-"},{title:"버튼ID",dataIndex:"btnId",key:"btnId",width:120,render:($,H)=>{const X=H.key===x,ue=!$||$.trim()==="",fe=E&&ue;return X?o.jsx(p.Input,{value:$,status:fe?"error":void 0,onChange:me=>{const Pe=[...g],Ee=Pe.find(J=>H.key===J.key);Ee&&(Ee.btnId=me.target.value,v(Pe),me.target.value.trim()!==""&&C(""))}}):o.jsx("span",{style:{color:fe?"#cf1322":"inherit",fontWeight:fe?"bold":"normal"},children:$||(fe?"입력 필요":"")})}},{title:"버튼명",dataIndex:"btnNm",key:"btnNm",width:150,render:($,H)=>H.key===x?o.jsx(p.Input,{value:$,onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.btnNm=ue.target.value,v(fe))}}):$},{title:"아이콘타입",dataIndex:"iconType",align:"center",key:"iconType",width:100,render:($,H)=>H.key===x?o.jsx(p.Select,{value:$,style:{width:"100%"},onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.iconType=ue,v(fe))},options:[{label:"ANTD",value:"ANTD"},{label:"CSS",value:"CSS"},{label:"SVG",value:"SVG"}]}):o.jsx(p.Tag,{color:$==="ANTD"?"blue":$==="CSS"?"green":"orange",children:$})},{title:"아이콘값",dataIndex:"iconVal",key:"iconVal",width:120,render:($,H)=>H.key===x?o.jsx(p.Input,{value:$,onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.iconVal=ue.target.value,v(fe))}}):$},{title:"사용여부",dataIndex:"enblYn",align:"center",key:"enblYn",width:80,render:($,H)=>H.key===x?o.jsx(p.Switch,{checked:$==="Y",onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.enblYn=ue?"Y":"N",v(fe))}}):o.jsx(p.Tag,{color:$==="Y"?"green":"red",children:$==="Y"?"사용":"미사용"})},{title:"작업",key:"action",align:"center",width:120,render:($,H)=>H.key===x?o.jsxs(p.Space,{children:[o.jsx(p.Tooltip,{title:"저장",children:o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.SaveOutlined,{}),onClick:()=>N()})}),o.jsx(p.Tooltip,{title:"취소",children:o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.RedoOutlined,{}),onClick:R})})]}):o.jsxs(p.Space,{children:[o.jsx(p.Tooltip,{title:"편집",children:o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.EditOutlined,{}),onClick:()=>F(H)})}),o.jsx(p.Tooltip,{title:"삭제",children:o.jsx(p.Button,{type:"link",size:"small",danger:!0,icon:o.jsx(Y.RestOutlined,{}),onClick:()=>I(H.key)})})]})}],F=$=>{y($.key)},R=()=>{y("")},N=$=>{y("")},I=$=>{v(H=>H.filter(X=>X.key!==$))},M=$=>{v(H=>{const X=H.findIndex(ue=>ue.key===$);if(X>0){const ue=[...H];return[ue[X],ue[X-1]]=[ue[X-1],ue[X]],ue.forEach((fe,me)=>{fe.btnSq=me+1}),ue}return H})},W=$=>{v(H=>{const X=H.findIndex(ue=>ue.key===$);if(X<H.length-1){const ue=[...H];return[ue[X],ue[X+1]]=[ue[X+1],ue[X]],ue.forEach((fe,me)=>{fe.btnSq=me+1}),ue}return H})};return console.log("CMPopuMstrM01 grantEvent:",A),console.log("CMPopuMstrM01 customEvent:",B),console.log("grantEvent.update 함수 존재 여부:",!!A.update),o.jsx(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:A.search},{id:"new",label:"신규",onClick:A.new},{id:"update",label:"변경",onClick:A.update}],custom:[{id:"preview",label:"미리보기",onClick:B.previewPopup}]},searchBox:{reqRows:[o.jsx(_.BwgFormItem,{name:"systId",label:"시스템ID",children:o.jsx(p.Select,{options:i.getCodeList("SYST"),placeholder:"검색어를 입력하세요",allowClear:!0},"input1")}),o.jsx(_.BwgFormItem,{name:"keyword",label:"검색어",children:o.jsx(p.Input,{placeholder:"프로그램ID, 프로그램명, 페이지URL"})}),o.jsx(o.Fragment,{}),o.jsx(o.Fragment,{})]},children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w60",children:[o.jsx(Le,{title:"팝업 목록",icons:{type:"antd"}}),o.jsx(Ve,{type:"nrml",gridColumns:O,gridOptions:k,gridEvents:L,ref:t})]}),o.jsx(Ie,{className:"w40",border:!0,children:o.jsx(fn,{title:"팝업 상세",children:o.jsxs(p.Form,{layout:"vertical",ref:r,style:{padding:"10px 20px"},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템ID",name:"systId"},selectProps:{variant:"borderless",options:[{label:"공통",value:"CM"},{label:"인사",value:"HR"}],copyable:!0,disabled:!0}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"사용여부",name:"enblYn",children:o.jsx(p.Select,{variant:"borderless",options:[{label:"사용",value:"Y"},{label:"미사용",value:"N"}],disabled:!0})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업코드",name:"popuCd",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업명",name:"popuNm",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업너비",name:"popuWdth",children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuWdth",noStyle:!0,children:o.jsx(p.InputNumber,{variant:"borderless",style:{flex:1},readOnly:!0})}),o.jsx(p.Form.Item,{name:"wdthUnit",noStyle:!0,children:o.jsx(p.Select,{variant:"borderless",style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}],disabled:!0})})]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업높이",name:"popuHght",children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuHght",noStyle:!0,children:o.jsx(p.InputNumber,{variant:"borderless",style:{flex:1},readOnly:!0})}),o.jsx(p.Form.Item,{name:"hghtUnit",noStyle:!0,children:o.jsx(p.Select,{variant:"borderless",style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}],disabled:!0})})]})})})]}),o.jsx(_.BwgFormItem,{label:"팝업호출URL",name:"popuUrl",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})}),o.jsx(_.BwgFormItem,{label:"비고",name:"rmrk",children:o.jsx(p.Input.TextArea,{variant:"borderless",readOnly:!0,rows:3})}),o.jsx(_.BwgFormItem,{label:"할당버튼",name:"btnList",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(p.Row,{gutter:[16,8],children:f?.dtlsInfo&&Array.isArray(f.dtlsInfo)?f.dtlsInfo.map(($,H)=>o.jsx(p.Col,{span:6,children:o.jsx(p.Button,{disabled:$.enblYn!=="Y",style:{width:"100%",marginBottom:"8px"},children:$.btnNm})},H)):o.jsx(p.Col,{span:24,children:o.jsx("div",{style:{textAlign:"center",color:"#999",padding:"20px"},children:"등록된 버튼이 없습니다."})})})})})]})})}),o.jsx(dn,{title:d==="new"?"팝업 등록":"팝업 수정",open:l,placement:"right",width:"40%",onClose:()=>{c(!1),h(null),v([]),y("")},children:o.jsxs(_.BwgForm,{ref:n,style:{padding:"10px 20px"},initialValues:{popuWdth:400,wdthUnit:"px",popuHght:100,hghtUnit:"%"},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템ID",name:"systId"},selectProps:{placeholder:"시스템을 선택하세요",variant:"borderless",options:[{label:"공통",value:"CM"},{label:"인사",value:"HR"}]}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"사용여부",name:"enblYn",initialValue:"Y",children:o.jsx(p.Select,{options:[{label:"사용",value:"Y"},{label:"미사용",value:"N"}]})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업코드",name:"popuCd",rules:[{required:!0,message:"팝업코드를 입력하세요"}],children:o.jsx(p.Input,{placeholder:"팝업코드를 입력하세요"})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업명",name:"popuNm",rules:[{required:!0,message:"팝업명을 입력하세요"}],children:o.jsx(p.Input,{placeholder:"팝업명을 입력하세요"})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업너비",name:"popuWdth",rules:[{required:!0,message:"팝업너비를 입력하세요"}],children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuWdth",noStyle:!0,children:o.jsx(p.InputNumber,{placeholder:"팝업너비를 입력하세요",style:{flex:1},min:1})}),o.jsx(p.Form.Item,{name:"wdthUnit",noStyle:!0,children:o.jsx(p.Select,{style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}]})})]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업높이",name:"popuHght",rules:[{required:!0,message:"팝업높이를 입력하세요"}],children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuHght",noStyle:!0,children:o.jsx(p.InputNumber,{placeholder:"팝업높이를 입력하세요",style:{flex:1},min:1})}),o.jsx(p.Form.Item,{name:"hghtUnit",noStyle:!0,children:o.jsx(p.Select,{style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}]})})]})})})]}),o.jsx(_.BwgFormItem,{label:"팝업호출URL",name:"popuUrl",rules:[{required:!0,message:"팝업호출URL을 입력하세요"}],children:o.jsx(p.Input,{placeholder:"팝업 URL을 입력하세요 (예: cm/TestPopup)",addonBefore:"popup/"})}),o.jsx(_.BwgFormItem,{label:"비고",name:"rmrk",children:o.jsx(p.Input.TextArea,{placeholder:"비고를 입력하세요",rows:3})}),o.jsxs(Le,{title:"버튼 목록",iconVisible:!1,children:[o.jsx(p.Button,{icon:o.jsx(Y.SettingTwoTone,{}),onClick:D.openDefaultModal,children:"기본값"}),o.jsx(p.Button,{icon:o.jsx(Y.PlusOutlined,{}),onClick:D.addButton,children:"추가"})]}),o.jsx(p.Table,{columns:z,dataSource:g,pagination:!1,size:"small",bordered:!0,scroll:{x:600},rowKey:"key"}),E&&o.jsxs("div",{style:{marginTop:"8px",padding:"8px 12px",backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"6px",color:"#cf1322",fontSize:"14px"},children:["⚠️ ",E]}),o.jsxs("div",{style:{textAlign:"right",marginTop:"16px"},children:[o.jsx(p.Button,{type:"primary",onClick:D.formFinish,style:{marginRight:"8px"},children:"저장"}),o.jsx(p.Button,{onClick:()=>{c(!1),h(null)},children:"취소"})]})]})}),o.jsxs(p.Modal,{title:"기본 버튼 선택",open:w,onOk:D.applyDefaultButtons,onCancel:()=>b(!1),okText:"적용",cancelText:"취소",children:[o.jsx("p",{children:"추가할 기본 버튼을 선택하세요:"}),o.jsx(p.Checkbox.Group,{value:j,onChange:$=>P($),style:{width:"100%"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%"},children:[o.jsx(p.Checkbox,{value:"조회",children:"조회"}),o.jsx(p.Checkbox,{value:"선택적용",children:"선택적용"}),o.jsx(p.Checkbox,{value:"신규",children:"신규"}),o.jsx(p.Checkbox,{value:"저장",children:"저장"}),o.jsx(p.Checkbox,{value:"삭제",children:"삭제"}),o.jsx(p.Checkbox,{value:"닫기",children:"닫기"})]})})]})]})})},{confirm:VN}=p.Modal,Pi={KE:[{label:"재무회계",value:"FI"},{label:"예산관리",value:"FM"},{label:"구매계약",value:"MM"},{label:"영업관리",value:"SD"},{label:"파트너관리",value:"PMN"}],KH:[{label:"HR 솔루션",value:"HR"},{label:"연말정산",value:"YT"},{label:"평정",value:"PE"}],KS:[{label:"온통",value:"BCOM"},{label:"e-감사",value:"EAUD"},{label:"청령신고",value:"INR"},{label:"ITAM",value:"ITAM"},{label:"차량/회의실",value:"CMM"},{label:"OA전산물품관리",value:"OAM"},{label:"총무관리",value:"GAM"},{label:"출입관리",value:"ACM"},{label:"비품관리",value:"IVM"},{label:"인장서비스",value:"SGS"},{label:"사료관리",value:"HIS"},{label:"웹펙스서비스",value:"WFAX"},{label:"메시지서비스",value:"SMS"},{label:"경영공시",value:"BID"},{label:"언론미디어",value:"PAM"},{label:"심의자문위원회",value:"DAC"},{label:"지식재산권신청",value:"IPR"},{label:"정보공유게시판",value:"ISB"}]},HN=[{name:"appCd",fieldName:"appCd",visible:!1},{name:"sysCd",fieldName:"sysCd",width:80,header:{text:"업무"},tag:"req"},{name:"prgrId",fieldName:"prgrId",width:150,header:{text:"프로그램 코드"},styleName:"left",tag:"req"},{name:"prgrNm",fieldName:"prgrNm",width:200,header:{text:"프로그램 명칭"},styleName:"left"},{name:"prgrUrl",fieldName:"prgrUrl",width:250,header:{text:"프로그램 URL"},styleName:"left"},{name:"enblYn",fieldName:"enblYn",width:60,header:{text:"사용"},renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{name:"prsnInfoYn",fieldName:"prsnInfoYn",visible:!1}],UN={display:{},edit:{editable:!1},copy:{singleMode:!0},container:{state:!0,check:!0,checkAll:!0,indicator:!0}},F0=({readOnly:e=!1,drawerMode:t=""})=>{const r=p.Form.useFormInstance(),[n,i]=m.useState(null),[a,s]=m.useState([]);m.useEffect(()=>{const c=r.getFieldValue("sysCd");i(c??null),c&&Pi[c]?s(Pi[c]):s([])},[r]);const l=c=>{i(c??null),c&&Pi[c]?s(Pi[c]):s([]),r.setFieldsValue({sysCd:c,appCd:null})};return o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템"},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"HR"},{label:"K-업무지원",value:"KS"}],onChange:l,disabled:e||t==="EDIT",placeholder:"시스템을 선택하세요"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션"},selectProps:{options:a,disabled:e||!n||t==="EDIT",placeholder:"시스템을 먼저 선택하세요"}})})]}),o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"prgrId",label:"프로그램 코드"},inputProps:{disabled:t==="EDIT",readOnly:e,variant:e?"borderless":"outlined"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"prgrNm",label:"프로그램 명칭"},inputProps:{readOnly:e,variant:e?"borderless":"outlined"}})})]}),o.jsxs(p.Row,{children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgRadio,{itemProps:{name:"enblYn",label:"사용여부"},inputProps:{defaultValue:"Y",options:[{label:"Y",value:"Y"},{label:"N",value:"N"}],optionType:"button",style:{pointerEvents:e?"none":void 0}}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgRadio,{itemProps:{name:"prsnInfoYn",label:"개인정보 포함여부"},inputProps:{defaultValue:"Y",options:[{label:"Y",value:"Y"},{label:"N",value:"N"}],optionType:"button",style:{pointerEvents:e?"none":void 0}}})})]}),o.jsx(_.BwgInput,{itemProps:{name:"prgrUrl",label:"프로그램 URL"},inputProps:{readOnly:e,variant:e?"borderless":"outlined",placeholder:"/cm/rsrc/파일명 (.tsx 생략)"}}),o.jsx(_.BwgTextArea,{itemProps:{name:"prgrDscr",label:"프로그램 설명"},inputProps:{readOnly:e,rows:4,variant:e?"borderless":"outlined"}})]})},WN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),{getFormData:i,setFormData:a}=at.useSearchBox(),[s,l]=m.useState([]),[c,d]=m.useState(!1),[u,f]=m.useState(""),[h,g]=m.useState(-1),v=m.useCallback(C=>{d(!0),f(C)},[]),x=m.useCallback(()=>{d(!1),f("")},[]);m.useEffect(()=>{const C=tt.useSystemCode().findByAppCd(e.appCd);console.log("PRGR APPCD :: ",e.appCd),a({sysCd:C?.sysCd,appCd:C?.appCd})},[e.appCd]),m.useEffect(()=>{if(u=="NEW")n.current?.setFieldsValue({enblYn:"Y",prsnInfoYn:"Y"});else if(u=="EDIT"){const C=t.current?.getCurrentIndex()??-1,O=t.current?.vw?.getValues(C)??{};n.current?.setFieldsValue(O)}else n.current?.resetFields()},[u]);const y=m.useCallback(C=>{if(C==="ALL"){const O=Object.values(Pi).flat();l(O)}else C&&Pi[C]?l(Pi[C]):l([]);a({appCd:null}),b.search()},[a]),w=m.useCallback(()=>{j.SCMPRGR00102()},[u]),b={search:()=>{j.SCMPRGR00101()},new:()=>{v("NEW")},delete:()=>{const C=t.current?.vw?.getCheckedRows(!1)??[];if(C.length==0){ae.showWarning("삭제할 행을 체크하세요");return}VN({title:"삭제 안내",content:`${C.length}개 행을 삭제하시겠습니까?`,onOk:()=>{j.SCMPRGR00103()}})}},j={SCMPRGR00101:()=>{ae.callService("SCMPRGR00101",i(),{}).then(C=>{t.current?.addAllData(C.data)})},SCMPRGR00102:()=>{const C={iudFlag:u==="EDIT"?"U":"I",...n.current?.getFieldsValue()??{}};ae.callService("SCMPRGR00102",C,{}).then(O=>{O.result>0?(x(),j.SCMPRGR00101()):ae.showError(O.message)}).catch(O=>{console.error("오류:",O)})},SCMPRGR00103:()=>{const C={},O=t.current?.vw?.getCheckedRows(!1)??[],k=[];O.forEach(T=>{const D=t.current?.dp?.getJsonRow(T);k.push({sysCd:D.sysCd,appCd:D.appCd,prgrId:D.prgrId})}),C.sub=k,ae.callService("SCMPRGR00103",C).then(T=>{T.result>0&&j.SCMPRGR00101()}).catch(T=>{console.error("오류:",T)})}},P={editForm:()=>{if((t.current?.getCurrentRow()??-1)<0){ae.showWarning("행 선택 후 변경 가능합니다.");return}v("EDIT")}},E={onCurrentRowChanged(C,O,k){g(k)}};return o.jsxs(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:()=>{b.search()}},{id:"new",label:"신규",onClick:()=>{b.new()}},{id:"delete",label:"삭제",onClick:()=>{b.delete()}}]},searchBox:{reqRows:o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",initialValue:""},selectProps:{options:[{label:"전체",value:""},{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],onChange:y}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션"},selectProps:{options:s,placeholder:"시스템코드를 먼저 선택해주세요",onChange:b.search}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"프로그램명"},inputProps:{placeholder:"프로그램ID/프로그램명을 입력하세요.",onPressEnter:b.search}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgRadio,{itemProps:{name:"enblYn",label:"사용여부"},inputProps:{defaultValue:"",size:"small",options:[{label:"전체",value:""},{label:"Y",value:"Y"},{label:"N",value:"N"}]}})})]})},children:[o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w60 mr20",children:[o.jsx(Le,{title:"프로그램 목록",icons:{type:"antd"}}),o.jsx(Ve,{ref:t,gridColumns:HN,gridOptions:UN,gridEvents:E,bindRef:r})]}),o.jsx(Ie,{className:"w40",border:!0,children:o.jsx(fn,{title:"프로그램 상세",titleChildren:o.jsx(o.Fragment,{children:h>=0&&o.jsx(_.BwgButton,{type:"dashed",onClick:P.editForm,children:"변경"})}),children:o.jsx(p.Form,{layout:"vertical",ref:r,className:"sub-form pd10",children:o.jsx(F0,{readOnly:!0})})})})]}),o.jsx(dn,{title:`프로그램 ${u=="EDIT"?"변경":"등록"}`,open:c,placement:"right",onClose:x,width:"30%",size:"large",afterOpenChange:C=>{console.log("afterOpenChange:",C)},footer:o.jsxs("div",{className:"drawer-footer-btn-group",children:[o.jsx(p.Button,{onClick:()=>{x()},className:"bwg-btn",children:"취소"}),o.jsx(p.Button,{type:"primary",onClick:w,className:"bwg-btn",children:"저장"})]}),children:o.jsx(p.Form,{layout:"vertical",ref:n,className:"sub-form pd10",children:o.jsx(F0,{readOnly:!1,drawerMode:u})})})]})},KN=()=>{const e=m.useRef(null),t=m.useRef(null),r=m.useRef(null),{openCorePopup:n}=at.usePopup(),i=m.useMemo(()=>[{fieldName:"seq",header:{text:"순번"},width:60,styleName:"center",visible:!1},{fieldName:"stndYmd",header:{text:"휴일일자"},width:100,styleName:"center",required:!0},{fieldName:"hldyDscr",header:{text:"휴일명"},width:150,styleName:"left",required:!0},{fieldName:"hldyYn",header:{text:"휴일여부"},width:100,styleName:"center"},{fieldName:"lglHldyYn",header:{text:"법정휴일여부"},width:100,styleName:"center"}],[]),a=m.useMemo(()=>[{fieldName:"seq",header:{text:"순번"},width:60,styleName:"center",visible:!1},{fieldName:"stndYmd",header:{text:"휴일일자"},width:100,styleName:"center",required:!0},{fieldName:"hldyDscr",header:{text:"휴일명"},width:150,styleName:"left",required:!0},{fieldName:"hldyYn",header:{text:"휴일여부"},width:100,styleName:"center",renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{fieldName:"lglHldyYn",header:{text:"법정휴일여부"},width:100,styleName:"center",renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),s={edit:{editable:!1},container:{indicator:!0,footer:!0}},l={edit:{editable:!0},container:{check:!0,checkAll:!0,indicator:!0,footer:!0,state:!0}},c={search:()=>{d.SCMHLDY00101()},edit:()=>{d.SCMHLDY00102()}};m.useEffect(()=>{r.current?.setFormData({stndYmd:xl().format("YYYY")}),c.search()},[]);const d={SCMHLDY00101:()=>{ae.callService("SCMHLDY00101",{...r.current?.getFormData()||{},crprCd:ae.getCrprCd(),sysCd:__SYS_CD__}).then(u=>{e.current?.addAllData(u.sub.filter(f=>f.sysCd==="CM")||[]),t.current?.addAllData(u.sub.filter(f=>f.sysCd!=="CM")||[])})},SCMHLDY00102:()=>{const u=t.current?.getGridSaveData();ae.callService("SCMHLDY00102",{sub:u,crprCd:ae.getCrprCd(),sysCd:__SYS_CD__}).then(f=>{c.search()})}};return o.jsx(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:()=>{c.search()}},{id:"edit",label:"수정",onClick:()=>{c.edit()}}]},children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w50",children:[o.jsx(Le,{title:"국경일/공휴일 API"}),o.jsx(Ve,{ref:e,type:"nrml",gridColumns:i,gridOptions:s})]}),o.jsxs(Ie,{className:"w50",border:!0,children:[o.jsxs(Le,{title:"사업장 휴일",children:[o.jsx(_.BwgButton,{type:"primary",onClick:()=>{t.current?.dp?.addRow?.({iudFlag:"I"})},children:"추가"}),o.jsx(_.BwgButton,{type:"primary",onClick:()=>{t.current?.deleteGridData()},children:"삭제"}),o.jsx(_.BwgButton,{onClick:()=>{n("CORE_HOLIDAY_01")},children:"조회팝업"})]}),o.jsx(Ve,{ref:t,type:"nrml",gridColumns:a,gridOptions:l})]})]})})},qN=e=>o.jsx("div",{children:"CMSystCfgM01"}),YN=e=>{const[t,r]=m.useState(null),[n,i]=m.useState("group"),[a,s]=m.useState(null),l=m.useRef(null),c=m.useRef(null),d=m.useRef(null),u=[{id:"KH",name:"HR 솔루션",description:"인사 관리 시스템",icon:o.jsx(Y.UserOutlined,{}),color:"blue",status:"active"},{id:"KE",name:"K-ERP 서비스",description:"전사적 자원 관리 시스템",icon:o.jsx(Y.DatabaseOutlined,{}),color:"green",status:"active"},{id:"KS",name:"K-업무지원",description:"경영 지원 시스템",icon:o.jsx(Y.SettingOutlined,{}),color:"orange",status:"active"}],f=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"applCd",visible:!1},{fieldName:"systId",header:{text:"업무코드"},width:100},{fieldName:"systNm",header:{text:"업무명"},width:100},{fieldName:"systIco",header:{text:"업무아이콘"},width:100},{fieldName:"sortOrd",header:{text:"정렬순서"},width:100},{fieldName:"enblYn",header:{text:"사용여부"},width:60,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),h=m.useMemo(()=>[{fieldName:"cmmnCd",header:{text:"그룹코드"},width:120},{fieldName:"cmmnCdNm",header:{text:"그룹명"},width:150},{fieldName:"cmmnCdAbrv",header:{text:"설명"},width:200},{fieldName:"sortOrd",header:{text:"정렬순서"},width:80},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),g=m.useMemo(()=>[{fieldName:"grpCd",header:{text:"그룹코드"},width:120},{fieldName:"cmmnCd",header:{text:"코드"},width:100},{fieldName:"cmmnCdNm",header:{text:"코드명"},width:150},{fieldName:"sortOrd",header:{text:"정렬순서"},width:80},{fieldName:"useYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),v={container:{indicator:!0}},x=w=>{r(w)},y=w=>{i(w),w==="group"&&s(null)};return m.useEffect(()=>{t&&ae.callService("SCMSYST00101",{crprCd:ae.getCrprCd(),applCd:t},{}).then(w=>{console.log({SCMSYST00101:w.data}),l.current?.addAllData(w.data)})},[t]),m.useEffect(()=>{t&&ae.callService("SCMCODE00101",{crprCd:ae.getCrprCd(),srchGb:n==="group"?"group":"detail"},{}).then(w=>{console.log({SCMCODE00101:w.data}),n==="group"?c.current?.addAllData(w.data):d.current?.addAllData(w.data)})},[n,t]),o.jsxs(kt,{children:[o.jsx(Ie,{style:{padding:"0px 20px",height:"200px",overflow:"hidden"},children:o.jsx(p.List,{grid:{gutter:16,xs:1,sm:2,md:3,lg:3,xl:3,xxl:3},dataSource:u,renderItem:w=>o.jsx(p.List.Item,{children:o.jsx(p.Card,{hoverable:!0,style:{height:"100%",cursor:"pointer",border:t===w.id?"2px solid #1890ff":"1px solid #f0f0f0",backgroundColor:t===w.id?"#f0f8ff":"#ffffff",boxShadow:t===w.id?"0 4px 12px rgba(24, 144, 255, 0.15)":"0 2px 8px rgba(0, 0, 0, 0.06)",position:"relative",zIndex:t===w.id?1:0},onClick:()=>x(w.id),actions:[o.jsx(p.Tag,{color:w.color,children:w.status==="active"?"활성":"비활성"},"status")],children:o.jsx(p.Card.Meta,{avatar:o.jsx("div",{style:{fontSize:"24px",color:w.color==="blue"?"#1890ff":w.color==="green"?"#52c41a":"#fa8c16"},children:w.icon}),title:o.jsxs(p.Space,{children:[o.jsx("span",{style:{fontWeight:"bold",color:t===w.id?"#1890ff":"#333"},children:w.name}),o.jsx(p.Tag,{color:w.color,children:w.id})]}),description:o.jsx("div",{style:{marginTop:"8px"},children:o.jsx("p",{style:{color:t===w.id?"#1890ff":"#666",margin:0},children:w.description})})})})})})}),o.jsx(Ie,{border:!0,children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w40",children:[o.jsxs(Le,{title:"업무코드 목록",children:[o.jsx(p.Button,{children:"신규"}),o.jsx(p.Button,{children:"변경"})]}),o.jsx(Ve,{ref:l,type:"nrml",gridColumns:f,gridOptions:v})]}),o.jsxs(Ie,{className:"w60",children:[o.jsxs(Le,{title:"시스템 공통코드 목록",tooltip:{title:"시스템 전역에 배포될 코드 목록입니다."},children:[o.jsx(p.Button,{children:"신규"}),o.jsx(p.Button,{children:"변경"})]}),o.jsx(ar,{defaultActiveKey:"group",size:"small",tabPosition:"left",style:{height:"100%"},activeKey:n,onChange:y,items:[{key:"group",label:"그룹코드",icon:o.jsx(Y.GroupOutlined,{}),children:o.jsx(ze,{children:o.jsx(Ie,{children:o.jsx(Ve,{ref:c,type:"nrml",gridColumns:h,gridOptions:v})})})},{key:"detail",label:"상세코드",icon:o.jsx(Y.UngroupOutlined,{}),children:o.jsx(Ve,{ref:d,type:"nrml",gridColumns:g,gridOptions:v})}]})]})]})})]})};function cS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=cS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Je(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=cS(e))&&(n&&(n+=" "),n+=t);return n}var GN=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Qh(e){if(typeof e!="string")return!1;var t=GN;return t.includes(e)}var XN=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"];function uS(e){if(typeof e!="string")return!1;var t=XN;return t.includes(e)}function dS(e){return typeof e=="string"&&e.startsWith("data-")}function Qr(e){var t=Object.entries(e).filter(r=>{var[n]=r;return uS(n)||dS(n)});return Object.fromEntries(t)}function za(e){if(e==null)return null;if(m.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Qr(t)}return typeof e=="object"&&!Array.isArray(e)?Qr(e):null}function Dr(e){var t=Object.entries(e).filter(r=>{var[n]=r;return uS(n)||dS(n)||Qh(n)});return Object.fromEntries(t)}var ZN=["children","width","height","viewBox","className","style","title","desc"];function Tp(){return Tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tp.apply(null,arguments)}function QN(e,t){if(e==null)return{};var r,n,i=JN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function JN(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Jh=m.forwardRef((e,t)=>{var{children:r,width:n,height:i,viewBox:a,className:s,style:l,title:c,desc:d}=e,u=QN(e,ZN),f=a||{width:n,height:i,x:0,y:0},h=Je("recharts-surface",s);return S.createElement("svg",Tp({},Dr(u),{className:h,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),S.createElement("title",null,c),S.createElement("desc",null,d),r)}),eD=["children","className"];function Mp(){return Mp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mp.apply(null,arguments)}function tD(e,t){if(e==null)return{};var r,n,i=rD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function rD(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var ur=S.forwardRef((e,t)=>{var{children:r,className:n}=e,i=tD(e,eD),a=Je("recharts-layer",n);return S.createElement("g",Mp({className:a},Dr(i),{ref:t}),r)}),fS=m.createContext(null),nD=()=>m.useContext(fS);function it(e){return function(){return e}}const pS=Math.cos,Ul=Math.sin,en=Math.sqrt,Wl=Math.PI,_c=2*Wl,Rp=Math.PI,Ap=2*Rp,Ci=1e-6,iD=Ap-Ci;function hS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function oD(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hS;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class aD{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hS:oD(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,s){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=n-t,d=i-r,u=s-t,f=l-r,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Ci)if(!(Math.abs(f*c-d*u)>Ci)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let g=n-s,v=i-l,x=c*c+d*d,y=g*g+v*v,w=Math.sqrt(x),b=Math.sqrt(h),j=a*Math.tan((Rp-Math.acos((x+h-y)/(2*w*b)))/2),P=j/b,E=j/w;Math.abs(P-1)>Ci&&this._append`L${t+P*u},${r+P*f}`,this._append`A${a},${a},0,0,${+(f*g>u*v)},${this._x1=t+E*c},${this._y1=r+E*d}`}}arc(t,r,n,i,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),d=t+l,u=r+c,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>Ci||Math.abs(this._y1-u)>Ci)&&this._append`L${d},${u}`,n&&(h<0&&(h=h%Ap+Ap),h>iD?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:h>Ci&&this._append`A${n},${n},0,${+(h>=Rp)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function eg(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new aD(t)}function tg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gS(e){this._context=e}gS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Bc(e){return new gS(e)}function mS(e){return e[0]}function vS(e){return e[1]}function yS(e,t){var r=it(!0),n=null,i=Bc,a=null,s=eg(l);e=typeof e=="function"?e:e===void 0?mS:it(e),t=typeof t=="function"?t:t===void 0?vS:it(t);function l(c){var d,u=(c=tg(c)).length,f,h=!1,g;for(n==null&&(a=i(g=s())),d=0;d<=u;++d)!(d<u&&r(f=c[d],d,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,d,c),+t(f,d,c));if(g)return a=null,g+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:it(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:it(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:it(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(a=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=a=null:a=i(n=c),l):n},l}function Zs(e,t,r){var n=null,i=it(!0),a=null,s=Bc,l=null,c=eg(d);e=typeof e=="function"?e:e===void 0?mS:it(+e),t=typeof t=="function"?t:it(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?vS:it(+r);function d(f){var h,g,v,x=(f=tg(f)).length,y,w=!1,b,j=new Array(x),P=new Array(x);for(a==null&&(l=s(b=c())),h=0;h<=x;++h){if(!(h<x&&i(y=f[h],h,f))===w)if(w=!w)g=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=h-1;v>=g;--v)l.point(j[v],P[v]);l.lineEnd(),l.areaEnd()}w&&(j[h]=+e(y,h,f),P[h]=+t(y,h,f),l.point(n?+n(y,h,f):j[h],r?+r(y,h,f):P[h]))}if(b)return l=null,b+""||null}function u(){return yS().defined(i).curve(s).context(a)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:it(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:it(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:it(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:it(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:it(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:it(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(i=typeof f=="function"?f:it(!!f),d):i},d.curve=function(f){return arguments.length?(s=f,a!=null&&(l=s(a)),d):s},d.context=function(f){return arguments.length?(f==null?a=l=null:l=s(a=f),d):a},d}class xS{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function sD(e){return new xS(e,!0)}function lD(e){return new xS(e,!1)}const rg={draw(e,t){const r=en(t/Wl);e.moveTo(r,0),e.arc(0,0,r,0,_c)}},cD={draw(e,t){const r=en(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},bS=en(1/3),uD=bS*2,dD={draw(e,t){const r=en(t/uD),n=r*bS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},fD={draw(e,t){const r=en(t),n=-r/2;e.rect(n,n,r,r)}},pD=.8908130915292852,wS=Ul(Wl/10)/Ul(7*Wl/10),hD=Ul(_c/10)*wS,gD=-pS(_c/10)*wS,mD={draw(e,t){const r=en(t*pD),n=hD*r,i=gD*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const s=_c*a/5,l=pS(s),c=Ul(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},pd=en(3),vD={draw(e,t){const r=-en(t/(pd*3));e.moveTo(0,r*2),e.lineTo(-pd*r,-r),e.lineTo(pd*r,-r),e.closePath()}},kr=-.5,Tr=en(3)/2,Ip=1/en(12),yD=(Ip/2+1)*3,xD={draw(e,t){const r=en(t/yD),n=r/2,i=r*Ip,a=n,s=r*Ip+r,l=-a,c=s;e.moveTo(n,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(kr*n-Tr*i,Tr*n+kr*i),e.lineTo(kr*a-Tr*s,Tr*a+kr*s),e.lineTo(kr*l-Tr*c,Tr*l+kr*c),e.lineTo(kr*n+Tr*i,kr*i-Tr*n),e.lineTo(kr*a+Tr*s,kr*s-Tr*a),e.lineTo(kr*l+Tr*c,kr*c-Tr*l),e.closePath()}};function bD(e,t){let r=null,n=eg(i);e=typeof e=="function"?e:it(e||rg),t=typeof t=="function"?t:it(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:it(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:it(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Kl(){}function ql(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function CS(e){this._context=e}CS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ql(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ql(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wD(e){return new CS(e)}function SS(e){this._context=e}SS.prototype={areaStart:Kl,areaEnd:Kl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ql(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CD(e){return new SS(e)}function jS(e){this._context=e}jS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ql(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SD(e){return new jS(e)}function ES(e){this._context=e}ES.prototype={areaStart:Kl,areaEnd:Kl,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function jD(e){return new ES(e)}function V0(e){return e<0?-1:1}function H0(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),l=(a*i+s*n)/(n+i);return(V0(a)+V0(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function U0(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function hd(e,t,r){var n=e._x0,i=e._y0,a=e._x1,s=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,s-l*r,a,s)}function Yl(e){this._context=e}Yl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:hd(this,this._t0,U0(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,hd(this,U0(this,r=H0(this,e,t)),r);break;default:hd(this,this._t0,r=H0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function PS(e){this._context=new OS(e)}(PS.prototype=Object.create(Yl.prototype)).point=function(e,t){Yl.prototype.point.call(this,t,e)};function OS(e){this._context=e}OS.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function ED(e){return new Yl(e)}function PD(e){return new PS(e)}function kS(e){this._context=e}kS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=W0(e),i=W0(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function W0(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function OD(e){return new kS(e)}function $c(e,t){this._context=e,this._t=t}$c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function kD(e){return new $c(e,.5)}function TD(e){return new $c(e,0)}function MD(e){return new $c(e,1)}function wo(e,t){if((s=e.length)>1)for(var r=1,n,i,a=e[t[0]],s,l=a.length;r<s;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Np(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function RD(e,t){return e[t]}function AD(e){const t=[];return t.key=e,t}function ID(){var e=it([]),t=Np,r=wo,n=RD;function i(a){var s=Array.from(e.apply(this,arguments),AD),l,c=s.length,d=-1,u;for(const f of a)for(l=0,++d;l<c;++l)(s[l][d]=[0,+n(f,s[l].key,d,a)]).data=f;for(l=0,u=tg(t(s));l<c;++l)s[u[l]].index=l;return r(s,u),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:it(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:it(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Np:typeof a=="function"?a:it(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??wo,i):r},i}function ND(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,s;i<a;++i){for(s=r=0;r<n;++r)s+=e[r][i][1]||0;if(s)for(r=0;r<n;++r)e[r][i][1]/=s}wo(e,t)}}function DD(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var s=0,l=0;s<i;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}wo(e,t)}}function _D(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,s;n<a;++n){for(var l=0,c=0,d=0;l<s;++l){for(var u=e[t[l]],f=u[n][1]||0,h=u[n-1][1]||0,g=(f-h)/2,v=0;v<l;++v){var x=e[t[v]],y=x[n][1]||0,w=x[n-1][1]||0;g+=y-w}c+=f,d+=g*f}i[n-1][1]+=i[n-1][0]=r,c&&(r-=d/c)}i[n-1][1]+=i[n-1][0]=r,wo(e,t)}}var gd={},md={},K0;function BD(){return K0||(K0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(md)),md}var vd={},q0;function TS(){return q0||(q0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(vd)),vd}var yd={},Y0;function ng(){return Y0||(Y0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="string"||typeof r=="symbol"?r:Object.is(r?.valueOf?.(),-0)?"-0":String(r)}e.toKey=t})(yd)),yd}var xd={},bd={},G0;function $D(){return G0||(G0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t})(bd)),bd}var X0;function ig(){return X0||(X0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$D(),r=ng();function n(i){if(Array.isArray(i))return i.map(r.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],s=i.length;if(s===0)return a;let l=0,c="",d="",u=!1;for(i.charCodeAt(0)===46&&(a.push(""),l++);l<s;){const f=i[l];d?f==="\\"&&l+1<s?(l++,c+=i[l]):f===d?d="":c+=f:u?f==='"'||f==="'"?d=f:f==="]"?(u=!1,a.push(c),c=""):c+=f:f==="["?(u=!0,c&&(a.push(c),c="")):f==="."?c&&(a.push(c),c=""):c+=f,l++}return c&&a.push(c),a}e.toPath=n})(xd)),xd}var Z0;function og(){return Z0||(Z0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BD(),r=TS(),n=ng(),i=ig();function a(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?r.isDeepKey(c)?a(l,i.toPath(c),d):d:u}case"number":case"symbol":{typeof c=="number"&&(c=n.toKey(c));const u=l[c];return u===void 0?d:u}default:{if(Array.isArray(c))return s(l,c,d);if(Object.is(c?.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?d:u}}}function s(l,c,d){if(c.length===0)return d;let u=l;for(let f=0;f<c.length;f++){if(u==null||t.isUnsafeProperty(c[f]))return d;u=u[c[f]]}return u===void 0?d:u}e.get=a})(gd)),gd}var wd,Q0;function LD(){return Q0||(Q0=1,wd=og().get),wd}var zD=LD();const _i=wr(zD);var Lt=e=>e===0?0:e>0?1:-1,_r=e=>typeof e=="number"&&e!=+e,Rn=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ae=e=>(typeof e=="number"||e instanceof Number)&&!_r(e),hn=e=>Ae(e)||typeof e=="string",FD=0,Fa=e=>{var t=++FD;return"".concat(e||"").concat(t)},Zt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ae(t)&&typeof t!="string")return n;var a;if(Rn(t)){if(r==null)return n;var s=t.indexOf("%");a=r*parseFloat(t.slice(0,s))/100}else a=+t;return _r(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},MS=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[e[n]])r[e[n]]=!0;else return!0;return!1};function Yt(e,t,r){return Ae(e)&&Ae(t)?e+r*(t-e):t}function VD(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):_i(n,t))===r)}var Ft=e=>e===null||typeof e>"u",ls=e=>Ft(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),HD=["type","size","sizeType"];function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dp.apply(null,arguments)}function J0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ey(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?J0(Object(r),!0).forEach(function(n){UD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UD(e,t,r){return(t=WD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WD(e){var t=KD(e,"string");return typeof t=="symbol"?t:t+""}function KD(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qD(e,t){if(e==null)return{};var r,n,i=YD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function YD(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var RS={symbolCircle:rg,symbolCross:cD,symbolDiamond:dD,symbolSquare:fD,symbolStar:mD,symbolTriangle:vD,symbolWye:xD},GD=Math.PI/180,XD=e=>{var t="symbol".concat(ls(e));return RS[t]||rg},ZD=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*GD;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},QD=(e,t)=>{RS["symbol".concat(ls(e))]=t},ag=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=qD(e,HD),a=ey(ey({},i),{},{type:t,size:r,sizeType:n}),s="circle";typeof t=="string"&&(s=t);var l=()=>{var h=XD(s),g=bD().type(h).size(ZD(r,n,s)),v=g();if(v!==null)return v},{className:c,cx:d,cy:u}=a,f=Dr(a);return d===+d&&u===+u&&r===+r?S.createElement("path",Dp({},f,{className:Je("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};ag.registerSymbol=QD;var JD=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(m.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Qh(i)&&(n[i]=(a=>r[i](r,a)))}),n},e_=(e,t,r)=>n=>(e(t,r,n),null),cs=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Qh(i)&&typeof a=="function"&&(n||(n={}),n[i]=e_(a,t,r))}),n};function _p(){return _p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_p.apply(null,arguments)}function ty(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function t_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ty(Object(r),!0).forEach(function(n){sg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ty(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sg(e,t,r){return(t=r_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r_(e){var t=n_(e,"string");return typeof t=="symbol"?t:t+""}function n_(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mr=32;class lg extends m.PureComponent{renderIcon(t,r){var{inactiveColor:n}=this.props,i=Mr/2,a=Mr/6,s=Mr/3,l=t.inactive?n:t.color,c=r??t.type;if(c==="none")return null;if(c==="plainline")return S.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:t.payload.strokeDasharray,x1:0,y1:i,x2:Mr,y2:i,className:"recharts-legend-icon"});if(c==="line")return S.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(s,`
1028
+ };`})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Title,{level:4,children:"🔍 forwardRef vs useImperativeHandle"}),o.jsxs("div",{style:{display:"flex",gap:"16px"},children:[o.jsxs("div",{style:{flex:1,padding:"12px",background:"#f0f9ff",borderRadius:"6px"},children:[o.jsx("strong",{children:"forwardRef"}),o.jsxs("ul",{style:{paddingLeft:"16px",fontSize:"14px"},children:[o.jsx("li",{children:"DOM 요소를 그대로 전달"}),o.jsx("li",{children:"단순한 ref 전달"}),o.jsx("li",{children:"DOM의 모든 속성/메서드 접근 가능"})]})]}),o.jsxs("div",{style:{flex:1,padding:"12px",background:"#f0fdf4",borderRadius:"6px"},children:[o.jsx("strong",{children:"useImperativeHandle"}),o.jsxs("ul",{style:{paddingLeft:"16px",fontSize:"14px"},children:[o.jsx("li",{children:"커스텀 메서드만 노출"}),o.jsx("li",{children:"내부 구현 숨김"}),o.jsx("li",{children:"필요한 기능만 선택적 제공"})]})]})]})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Title,{level:4,children:"⚠️ 주의사항"}),o.jsx(p.Alert,{message:"꼭 필요한 경우에만 사용하세요!",description:"useImperativeHandle은 React의 선언적 패러다임을 벗어나는 명령형 API입니다. 대부분의 경우 props와 state로 충분하므로, 정말 필요한 경우에만 사용하세요.",type:"warning",showIcon:!0})]}),o.jsx(DN,{})]})})})]})]})})},$N=e=>{m.useEffect(()=>{g({sysCd:__SYS_CD__,fileGrpKey:null}),j.search()},[]);const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),[i,a]=m.useState(""),[s,l]=m.useState(""),[c,d]=m.useState(""),[u,f]=m.useState(""),{getFormData:h,setFormData:g}=at.useSearchBox(),v=m.useMemo(()=>[{fieldName:"crprCd",header:{text:"법인코드"},width:80,styleName:"center"},{fieldName:"sysCd",header:{text:"시스템코드"},width:100,styleName:"center"},{fieldName:"fileGrpKey",header:{text:"파일그룹키"},width:120,styleName:"center"},{fieldName:"fileKey",header:{text:"파일키"},width:200,styleName:"center"},{fieldName:"lgclFileNm",header:{text:"파일 논리명"},width:250,styleName:"left"},{fieldName:"fileSize",header:{text:"파일 크기"},width:100,styleName:"right",displayCallback:(P,E,C)=>{if(!C)return"0 Bytes";const O=Number(C);if(isNaN(O)||O===0)return"0 Bytes";const k=1024,T=["Bytes","KB","MB","GB","TB"],D=Math.floor(Math.log(O)/Math.log(k));return parseFloat((O/Math.pow(k,D)).toFixed(2))+" "+T[D]}},{fieldName:"fileExtn",header:{text:"파일 확장자"},width:100,styleName:"center"},{fieldName:"fileType",header:{text:"파일 타입"},width:120,styleName:"center"}],[]),x=m.useMemo(()=>[{fieldName:"fileGrpKey",header:{text:"파일 그룹키"},width:50,styleName:"center"},{fieldName:"fileKey",header:{text:"파일 키"},width:50,styleName:"center"},{fieldName:"fileSeq",header:{text:"파일 정렬순서"},width:50,styleName:"center"},{fieldName:"lgclFileNm",header:{text:"파일 논리명"},width:200,styleName:"left"},{fieldName:"physFileNm",header:{text:"파일 물리명"},width:200,styleName:"left"},{fieldName:"fileExtn",header:{text:"파일 확장자"},width:100},{fieldName:"mltpYn",header:{text:"대용량파일 여부"},width:100},{fieldName:"fileSize",header:{text:"파일 크기"},width:100,styleName:"right",displayCallback:(P,E,C)=>{if(!C)return"0 Bytes";const O=Number(C);if(isNaN(O)||O===0)return"0 Bytes";const k=1024,T=["Bytes","KB","MB","GB","TB"],D=Math.floor(Math.log(O)/Math.log(k));return parseFloat((O/Math.pow(k,D)).toFixed(2))+" "+T[D]}},{fieldName:"filePath",header:{text:"파일 경로"},width:100,styleName:"right"}],[]),y={onCurrentRowChanged(P,E,C){if(C<0)return;let O=P.getDataSource().getJsonRow(C);a(O.fileGrpKey),O.mltpYn=="Y"?se.callEndpoint({trxCd:"SCMFILE00106",appCd:e.appCd},{crprCd:se.getUserInfo()?.crprCd,sysCd:__SYS_CD__,fileGrpKey:O.fileGrpKey,fileKey:O.fileKey}).then(k=>{n.current?.addAllData(k.sub)}):n.current?.dp?.clearRows()}},w={container:{check:!0,checkAll:!0,indicator:!0,footer:!0}},b={SCMFILE00101:()=>{se.callEndpoint({trxCd:"SCMFILE00101",appCd:e.appCd},{crprCd:se.getUserInfo()?.crprCd,...h()}).then(P=>{r.current?.addAllData(P.sub)}).catch(P=>{console.error("오류:",P)})}},j={search:()=>{b.SCMFILE00101()},download:()=>{console.log("download");let P=r.current?.dp?.getJsonRow(r.current?.getCurrentRow());se.downloadByFileKey(P.fileKey)}};return o.jsx(kt,{searchBox:{reqRows:[o.jsxs(wt,{children:[o.jsx($e,{span:6,children:o.jsx(_.BwgInput,{itemProps:{label:"시스템 코드",name:"sysCd"}})}),o.jsx($e,{span:6,children:o.jsx(_.BwgInput,{itemProps:{label:"파일 그룹키",name:"fileGrpKey"}})})]})]},buttons:{grant:[{id:"search",label:"조회",onClick:()=>{j.search()}},{id:"download",label:"다운로드",onClick:()=>{j.download()}}]},children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w60",children:[o.jsx(Le,{title:"파일 목록",children:o.jsx("div",{style:{float:"right"},children:o.jsx(p.Space,{children:o.jsx(_.BwgButton,{onClick:()=>j.download(),children:"다운로드"})})})}),o.jsx(Ve,{ref:r,gridColumns:x,gridOptions:w,gridEvents:y})]}),o.jsx(Ie,{className:"w40",border:!0,children:o.jsx(p.Tabs,{type:"card",defaultActiveKey:"1",style:{height:"100%"},items:[{label:"파일상세",key:"1",children:o.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[o.jsx(Le,{title:"dtls 그리드"}),o.jsx(Ve,{ref:n,gridColumns:v})]})},{label:"파일 샘플",key:"2",children:o.jsx("div",{style:{height:"100%",overflowY:"auto",padding:"10px"},children:o.jsx(fn,{title:"샘플 업로드",children:o.jsxs(p.Form,{layout:"vertical",ref:t,children:[o.jsx(p.Divider,{orientation:"left",style:{borderColor:"#7cb305"},children:"그리드 onCurrentRowChanged연동"}),o.jsx(_.BwgInput,{itemProps:{label:"파일 그룹키 (fileGrpKey)"},inputProps:{value:i,onChange:P=>a(P.target.value)}}),o.jsx(_.BwgUploader,{fileGrpKey:i}),o.jsx(p.Divider,{orientation:"left",style:{borderColor:"#7cb305"},children:"파일업로드시 fileGrpKey 채번 및 연동"}),o.jsx(_.BwgInput,{itemProps:{label:"채번 그룹키 (fileGrpKey2)"},inputProps:{value:s,disabled:!0}}),o.jsx(_.BwgUploader,{fileGrpKey:s,multiple:!0,onUploadComplete:P=>{console.log(P),s||l(P.fileGrpKey)}}),o.jsx(p.Divider,{orientation:"left",style:{borderColor:"#7cb305"},children:"대용량파일 업로드(zip압축 후 업로드)"}),o.jsx(_.BwgLargeUploader,{fileGrpKey:s})]})})})},{label:"파일 다운로드",key:"3",children:o.jsxs("div",{children:[o.jsx(_.BwgInput,{itemProps:{label:"파일 그룹키 (fileGrpKey)"},inputProps:{value:c,onChange:P=>d(P.target.value)}}),o.jsx(_.BwgInput,{itemProps:{label:"앱코드 (appCd)"},inputProps:{value:u,onChange:P=>f(P.target.value)}}),o.jsx(_.BwgDownload,{fileGrpKey:c,appCd:u})]})}]})})]})})},sS=({width:e="40%",searchContext:t,onOk:r,onClose:n,...i})=>{const a=m.useRef(null),s=m.useRef(null),[l,c]=m.useState([]),d=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appCd",width:60,header:{text:"애플리케이션"},styleName:"left"},{fieldName:"prgrId",width:120,header:{text:"프로그램ID"},styleName:"left"},{fieldName:"prgrNm",width:200,header:{text:"프로그램명"},styleName:"left"},{fieldName:"enblYn",width:80,header:{text:"사용여부"},styleName:"center",renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]);m.useEffect(()=>{t?.sysCd&&(a.current?.setFormData({sysCd:t.sysCd}),v.SCMPRGR00101())},[t?.sysCd]);const u=()=>{v.SCMPRGR00101()},f=y=>{y.key==="Enter"&&u()},h=()=>{console.log("selectedRows:",l),l.length>0?r?.(l[0]):r?.({})},g=()=>{i.onCancel?.(),n?.()},v=m.useMemo(()=>({SCMPRGR00101:()=>{const y={...a.current?.getFormData()};se.callService("SCMPRGR00101",y).then(w=>{console.log("response.programs:",w.data),s.current?.addAllData(w.data||[])}).catch(w=>{console.error("오류:",w)})}}),[]),x={onCurrentRowChanged:(y,w,b)=>{if(b>=0){const j=s.current?.vw?.getItemIndex(b),P=s.current?.vw?.getValues(j||0);c([P])}},onCellDblClicked:(y,w)=>{const b=w.itemIndex;if(b>=0){const j=s.current?.vw?.getValues(b);console.log(j),c([j]),r?.(j)}}};return o.jsx(p.ConfigProvider,{theme:{components:{Modal:{wireframe:!0,titleColor:"#08979c",headerBg:"#e6fffb"}}},children:o.jsx(p.Modal,{title:"프로그램 선택",width:e,maskClosable:!1,styles:{body:{paddingTop:"10px"}},okText:"적용",...i,onOk:h,onCancel:g,children:o.jsxs("div",{style:{padding:"8px 0"},children:[o.jsx(ko,{ref:a,reqRows:o.jsxs(p.Row,{gutter:[16,8],children:[o.jsx(p.Col,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",style:{marginBottom:0},labelCol:{flex:"80px"}},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],style:{fontSize:"12px"},onChange:v.SCMPRGR00101}})}),o.jsx(p.Col,{span:16,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"검색어",style:{marginBottom:0},labelCol:{flex:"90px"}},inputProps:{placeholder:"프로그램ID 또는 프로그램명을 입력하세요",suffix:o.jsx(Y.SearchOutlined,{style:{color:"#1890ff",cursor:"pointer"},onClick:u}),onKeyPress:f}})})]})}),o.jsx(Ve,{ref:s,gridColumns:d,gridOptions:{container:{radio:!0,footer:!1}},gridEvents:x,gridDivStyle:{marginTop:8,height:400}}),l.length>0&&o.jsxs("div",{style:{marginTop:16,padding:12,backgroundColor:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[o.jsx("strong",{children:"선택된 프로그램:"})," ",l[0]?.prgrNm," (",l[0]?.prgrId,")"]})]})})})},lS=({width:e="40%",searchContext:t,onOk:r,onClose:n,...i})=>{const a=m.useRef(null),s=m.useRef(null),[l,c]=m.useState([]),d=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appCd",width:120,header:{text:"애플리케이션"},styleName:"left"},{fieldName:"menuGbCd",width:100,header:{text:"메뉴구분"},styleName:"center",lookupDisplay:!0,labels:["메인메뉴","서브메뉴","프로그램"],values:["CMPRGRM","CMPRGRS","CMPRGRP"],renderer:{type:"text",showTooltip:!1}},{fieldName:"menuId",width:120,header:{text:"메뉴ID"},styleName:"left"},{fieldName:"menuNm",width:200,header:{text:"메뉴명"},styleName:"left"},{fieldName:"menuPrntId",width:120,header:{text:"상위메뉴ID"},styleName:"left"}],[]);m.useEffect(()=>{setTimeout(()=>{s.current?.vw&&s.current.vw.setRowStyleCallback(function(b,j,P){const E=b.getValue(j.index,"menuGbCd");if(E==="CMPRGRM")return{style:{background:"#e8f0ff"}};if(E==="CMPRGRS")return{style:{background:"#f0f8ff"}}})},200)},[]),m.useEffect(()=>{t?.sysCd&&a.current?.setFormData({sysCd:t.sysCd,appCd:"",keyword:t.keyword||""})},[t?.sysCd,t?.keyword]);const u=()=>{x.SCMMENU00104()},f=w=>{w.key==="Enter"&&u()},h=()=>{a.current?.setFormData({sysCd:"",appCd:"",keyword:""})},g=()=>{console.log("selectedRows:",l),l.length>0?r?.(l[0]):r?.({})},v=()=>{i.onCancel?.(),n?.()},x=m.useMemo(()=>({SCMMENU00104:()=>{const w={crprCd:se.getCrprCd(),...a.current?.getFormData()};se.callService("SCMMENU00104",w).then(b=>{console.log("response.menus:",b.sub),s.current?.addAllData(b.sub,{treeOption:{isExpand:!0,dataField:"menuId",parentField:"menuPrntId"}})}).catch(b=>{console.error("오류:",b)})}}),[]),y=m.useMemo(()=>({onCurrentRowChanged:(w,b,j)=>{if(j>=0){const P=s.current?.vw?.getItemIndex(j),E=s?.current?.vw?.getValues(P||0);c([E])}},onCellDblClicked:(w,b)=>{const j=b.itemIndex;if(j>=0){const P=s.current?.vw?.getValues(j);console.log(P),c([P]),r?.(P)}}}),[r]);return o.jsx(p.ConfigProvider,{theme:{components:{Modal:{wireframe:!0,titleColor:"#08979c",headerBg:"#e6fffb"}}},children:o.jsx(p.Modal,{title:"상위 메뉴 선택",width:e,maskClosable:!1,styles:{body:{paddingTop:"10px"}},okText:"적용",...i,onOk:g,onCancel:v,children:o.jsxs("div",{style:{padding:"8px 0"},children:[o.jsx(ko,{border:!0,header:{title:"메뉴 선택",buttons:[o.jsx(_.BwgButton,{onClick:()=>x.SCMMENU00104(),style:{marginRight:8},children:"검색"},"search"),o.jsx(_.BwgButton,{onClick:h,children:"초기화"},"reset")]},ref:a,reqRows:o.jsxs(p.Row,{gutter:[20,5],children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",style:{marginBottom:0}},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],style:{fontSize:"12px"},onChange:x.SCMMENU00104}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션",style:{marginBottom:0}},selectProps:{options:[{label:"선택하세요",value:""},{label:"ERP",value:"ERP"},{label:"HR",value:"HR"},{label:"SUPPORT",value:"SUPPORT"}],style:{fontSize:"12px"}}})}),o.jsx(p.Col,{span:7,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"검색어",style:{marginBottom:0}},inputProps:{placeholder:"메뉴ID 또는 메뉴명을 입력하세요",style:{fontSize:"12px"},onKeyPress:f}})}),o.jsx(p.Col,{span:5,style:{textAlign:"right"}})]})}),o.jsx(Ve,{ref:s,type:"tree",gridColumns:d,gridOptions:{container:{radio:!0,footer:!1}},gridEvents:y,gridDivStyle:{marginTop:8,height:400}}),l.length>0&&o.jsxs("div",{style:{marginTop:16,padding:12,backgroundColor:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[o.jsx("strong",{children:"선택된 메뉴:"})," ",l[0]?.menuNm," (",l[0].menuId,")"]})]})})})},ao={KE:[{label:"재무회계",value:"FI"},{label:"예산관리",value:"FM"},{label:"구매계약",value:"MM"},{label:"영업관리",value:"SD"},{label:"파트너관리",value:"PMN"}],KH:[{label:"HR 솔루션",value:"HR"},{label:"연말정산",value:"YT"},{label:"평정",value:"PE"}],KS:[{label:"온통",value:"BCOM"},{label:"e-감사",value:"EAUD"},{label:"청령신고",value:"INR"},{label:"ITAM",value:"ITAM"},{label:"차량/회의실",value:"CMM"},{label:"OA전산물품관리",value:"OAM"},{label:"총무관리",value:"GAM"},{label:"출입관리",value:"ACM"},{label:"비품관리",value:"IVM"},{label:"인장서비스",value:"SGS"},{label:"사료관리",value:"HIS"},{label:"웹펙스서비스",value:"WFAX"},{label:"메시지서비스",value:"SMS"},{label:"경영공시",value:"BID"},{label:"언론미디어",value:"PAM"},{label:"심의자문위원회",value:"DAC"},{label:"지식재산권신청",value:"IPR"},{label:"정보공유게시판",value:"ISB"}]},LN={container:{check:!0,checkAll:!0,indicator:!0,footer:!0}},z0=({readOnly:e=!1,drawerMode:t=""})=>{const r=p.Form.useFormInstance(),[n,i]=m.useState(null),[a,s]=m.useState(null),[l,c]=m.useState([]),[d,u]=m.useState("CMPRGRP"),[f,h]=m.useState(!0),[g,v]=m.useState(!1),[x,y]=m.useState({}),[w,b]=m.useState(!1),[j,P]=m.useState({});m.useEffect(()=>{const T=r.getFieldValue("sysCd"),D=r.getFieldValue("appCd"),L=r.getFieldValue("menuGbCd"),A=r.getFieldValue("deftMenuNo");i(T??null),s(D??null),u(L??"CMPRGRP"),h(A??!0),T&&ao[T]?c(ao[T]):c([])},[r]);const E=T=>{i(T),T&&ao[T]?c(ao[T]):c([]),r.resetFields(["appCd","scrnId","scrnNm","menuPrntId","menuPrntNm"])},C=T=>{h(T),T&&r.setFieldsValue({menuNo:""})},O=T=>{T&&r.setFieldsValue({menuPrntId:T.menuId,menuPrntNm:T.menuNm}),v(!1),y({})},k=T=>{T&&r.setFieldsValue({scrnId:T.prgrId,scrnNm:T.prgrNm}),b(!1),P({})};return o.jsxs(o.Fragment,{children:[o.jsx(p.Row,{gutter:12,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgRadio,{itemProps:{name:"menuGbCd"},inputProps:{options:[{label:"메인메뉴",value:"CMPRGRM"},{label:"서브메뉴",value:"CMPRGRS"},{label:"프로그램",value:"CMPRGRP"}],defaultValue:"CMPRGRP",optionType:"button",size:"middle",style:{pointerEvents:e?"none":void 0},onChange:T=>{u(T.target.value)}}})})}),o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템"},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],onChange:E,disabled:e||t==="EDIT",placeholder:"시스템을 선택하세요"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션"},selectProps:{options:l,disabled:e||!n||t==="EDIT",placeholder:"시스템을 먼저 선택하세요"}})})]}),o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"menuId",label:"메뉴ID"},inputProps:{placeholder:"자동 채번",disabled:!0,readOnly:e,variant:e?"borderless":"outlined"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"menuNm",label:"메뉴명"},inputProps:{readOnly:e,variant:e?"borderless":"outlined"}})})]}),d==="CMPRGRP"&&o.jsx(p.Row,{gutter:24,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgSearch,{itemProps:{label:"프로그램ID",name:["scrnId","scrnNm"]},readOnly:e,popupConfig:!0,onSearch:()=>{n?(b(!0),P({sysCd:n,keyword:r.getFieldValue("scrnNm")})):se.openMessage("warning","시스템을 선택하세요")}})})}),d!=="CMPRGRM"&&o.jsx(p.Row,{gutter:24,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgSearch,{itemProps:{label:"상위 메뉴",name:["menuPrntId","menuPrntNm"]},readOnly:e,onSearch:()=>{console.log("formSysCd:",n),n?(v(!0),y({sysCd:n,keyword:r.getFieldValue("menuPrntNm")})):se.openMessage("warning","시스템을 선택하세요")}})})}),o.jsxs(p.Row,{gutter:12,children:[d=="CMPRGRP"&&o.jsxs(o.Fragment,{children:[o.jsx(p.Col,{span:t=="NEW"?8:12,children:o.jsx(_.BwgFormItem,{name:"menuNo",label:"메뉴번호",children:o.jsx(p.Input.OTP,{length:4,formatter:T=>T.replace(/\D/g,""),disabled:t=="NEW"?f:e,style:{width:"180px"}})})}),t=="NEW"&&o.jsx(p.Col,{span:3,offset:1,children:o.jsx(_.BwgCheck,{itemProps:{name:"isAutoMenuNo",label:"자동채번"},inputProps:{defaultChecked:!0,onChange:T=>C(T.target.checked)}})})]}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgRadio,{itemProps:{name:"useYn",label:"사용여부"},inputProps:{defaultValue:"Y",options:[{label:"Y",value:"Y"},{label:"N",value:"N"}],optionType:"button",style:{pointerEvents:e?"none":void 0,width:"100%"}}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgNumber,{itemProps:{name:"sortOrdr",label:"정렬순서"},inputProps:{defaultValue:0,min:1,max:99,precision:0,controls:!0,readOnly:e,variant:e?"borderless":"outlined"}})}),d=="CMPRGRM"&&o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"iconCd",label:"아이콘명"},inputProps:{readOnly:e,variant:e?"borderless":"outlined"}})})]}),o.jsx(_.BwgTextArea,{itemProps:{name:"menuDscr",label:"메뉴 설명"},inputProps:{disabled:e,rows:3}}),o.jsx(sS,{open:w,searchContext:j,onOk:k,onClose:()=>{b(!1),P({})}}),o.jsx(lS,{open:g,searchContext:x,onOk:O,onClose:()=>{v(!1),y({})}})]})},zN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),i=tt.useCodeStore(),{getFormData:a,setFormData:s}=at.useSearchBox(),[l,c]=m.useState([]),[d,u]=m.useState(!1),[f,h]=m.useState(""),[g,v]=m.useState(-1),x=m.useCallback(k=>{u(!0),h(k)},[]),y=m.useCallback(()=>{u(!1),h("")},[]),w=m.useMemo(()=>i.getGridLookup("CMPRGR"),[i]),b=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appCd",visible:!1},{fieldName:"menuPrntId",visible:!1},{fieldName:"menuPrntNm",visible:!1},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,styleName:"left"},{fieldName:"menuGbCd",header:{text:"메뉴구분"},width:100,styleName:"left",...w},{name:"menuNm",fieldName:"menuNm",header:{text:"메뉴명"},width:200,styleName:"left"},{fieldName:"scrnId",header:{text:"화면ID"},width:100,styleName:"left"},{fieldName:"scrnNm",header:{text:"화면이름"},width:100,styleName:"left"},{fieldName:"menuNo",header:{text:"메뉴번호"},width:100,styleName:"left"},{fieldName:"useYn",visible:!1},{fieldName:"sortOrdr",visible:!1},{fieldName:"iconCd",visible:!1},{fieldName:"menuDscr",visible:!1}],[w]);m.useEffect(()=>{if(f==="NEW")r.current?.setFieldsValue({useYn:"Y",deftMenuNo:!0,menuGbCd:"CMPRGRP"});else if(f==="EDIT"){const k=n.current?.getCurrentIndex();if(k!==void 0&&k>=0){const T=n.current?.vw?.getValues(k);r.current?.setFieldsValue(T)}}else r.current?.resetFields()},[f]),m.useEffect(()=>{setTimeout(()=>{n.current?.vw&&n.current.vw.setRowStyleCallback(function(T,D,L){const A=T.getValue(D.index,"menuGbCd");if(A==="CMPRGRM")return{style:{background:"#e8f0ff"}};if(A==="CMPRGRS")return{style:{background:"#f0f8ff"}};if(A==="CMPRGRP")return{style:{background:"#fff"}}})},200)},[]);const j=k=>{k&&ao[k]?c([{label:"전체",value:""},...ao[k]]):c([{label:"전체",value:""}]),s({appCd:""}),E.SCMMENU00101()},P=()=>{r.current?.validateFields().then(k=>{console.log("Form values:",k),(f==="NEW"||f==="EDIT")&&E.SCMMENU00102()}).catch(k=>{console.log("Validation failed:",k)})},E={SCMMENU00101:()=>{const k={crprCd:se.getCrprCd(),...a()};console.log("Search data:",k),se.callService("SCMMENU00101",k,{}).then(T=>{n.current?.addAllData(T.menus,{treeOption:{isExpand:!0,dataField:"menuId",parentField:"menuPrntId"}})}).catch(T=>{console.error("오류:",T)})},SCMMENU00102:()=>{const k={iudFlag:f==="EDIT"?"U":"I",crprCd:se.getCrprCd(),...r?.current?.getFieldsValue()};delete k.scrnNm,delete k.menuPrntNm,se.callService("SCMMENU00102",k,{}).then(T=>{console.log("Save response:",T),T.result>0&&(y(),E.SCMMENU00101())}).catch(T=>{console.error("저장 오류:",T)})},SCMMENU00103:()=>{const k={},T=n.current?.vw?.getCheckedRows(!1),D=[];T?.forEach(L=>{const A=n.current?.dp?.getJsonRow(L);D.push({crprCd:A.crprCd,sysCd:A.sysCd,appCd:A.appCd,menuId:A.menuId,menuGbCd:A.menuGbCd})}),k.sub=D,se.callService("SCMMENU00103",k,{}).then(L=>{console.log(L),L?.result>0&&E.SCMMENU00101()})}},C={search:()=>{E.SCMMENU00101()},new:()=>{x("NEW")},delete:()=>{const k=n.current?.vw?.getCheckedRows(!1);if(k?.length==0){se.openMessage("warning","삭제할 행을 체크하세요");return}else{let T=0,D=0,L=0;k?.forEach(A=>{const B=n.current?.dp?.getValue(A,"menuGbCd");B==="CMPRGRM"?T++:B==="CMPRGRS"?D++:B==="CMPRGRP"&&L++}),p.Modal.confirm({title:"삭제 안내",content:o.jsxs(o.Fragment,{children:[T>0&&o.jsx(o.Fragment,{children:o.jsxs(p.Tag,{color:"blue",children:["메인메뉴: ",T,"개"]})}),D>0&&o.jsx(o.Fragment,{children:o.jsxs(p.Tag,{color:"green",children:["서브메뉴: ",D,"개"]})}),L>0&&o.jsx(o.Fragment,{children:o.jsxs(p.Tag,{color:"orange",children:["프로그램: ",L,"개"]})}),"를 삭제하시겠습니까?"]}),onOk:()=>{E.SCMMENU00103()},onCancel:()=>{}})}}},O=m.useMemo(()=>({onCurrentRowChanged:(k,T,D)=>{v(D)},onItemChecked:(k,T,D)=>{if(!k._isUpdatingChildren)try{k._isUpdatingChildren=!0;const L=(A,B)=>{const z=k.getChildren(A);z&&z.length>0&&z.forEach(F=>{k.isCheckedItem(F)!==B&&(k.checkItem(F,B),L(F,B))})};L(T,D)}finally{setTimeout(()=>{k._isUpdatingChildren=!1},0)}}}),[]);return o.jsxs(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:C.search},{id:"new",label:"신규",onClick:C.new},{id:"delete",label:"삭제",onClick:C.delete}]},searchBox:{reqRows:o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",initialValue:"",labelCol:{flex:"180px"}},selectProps:{options:[{label:"전체",value:""},{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],onChange:j}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션",initialValue:""},selectProps:{options:l,placeholder:"시스템코드를 먼저 선택해주세요",onChange:C.search}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"검색어"},inputProps:{placeholder:"메뉴ID/메뉴명을 입력하세요.",onPressEnter:C.search}})})]})},children:[o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w65 mr20",children:[o.jsx(Le,{title:"메뉴 트리"}),o.jsx(Ve,{ref:n,type:"tree",gridColumns:b,gridOptions:LN,gridEvents:O,bindRef:t})]}),o.jsx(Ie,{className:"w35",border:!0,overflow:{x:"auto",y:"auto"},children:o.jsx(fn,{title:"메뉴 상세",titleChildren:o.jsx(o.Fragment,{children:g>=0&&o.jsx(_.BwgButton,{color:"gold",onClick:()=>x("EDIT"),children:"변경"})}),children:o.jsx(p.Form,{layout:"vertical",ref:t,children:o.jsx(z0,{readOnly:!0})})})})]}),o.jsx(dn,{title:`메뉴 ${f==="EDIT"?"변경":"등록"}`,open:d,placement:"right",onClose:y,width:"30%",size:"large",afterOpenChange:k=>{console.log("Drawer afterOpenChange:",k)},footer:o.jsxs("div",{className:"drawer-footer-btn-group",children:[o.jsx(p.Button,{onClick:y,className:"bwg-btn",children:"취소"}),o.jsx(p.Button,{type:"primary",onClick:P,className:"bwg-btn",children:"저장"})]}),children:o.jsx(p.Form,{layout:"vertical",ref:r,className:"sub-form pd10",children:o.jsx(z0,{readOnly:!1,drawerMode:f})})})]})},FN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),i=tt.useCodeStore(),{showPopup:a}=at.usePopup(),{getFormData:s}=at.useSearchBox(),[l,c]=m.useState(!1),[d,u]=m.useState("new"),[f,h]=m.useState(null),[g,v]=m.useState([]),[x,y]=m.useState(""),[w,b]=m.useState(!1),[j,P]=m.useState(["조회","닫기"]),[E,C]=m.useState("");m.useEffect(()=>{console.log("SYST 공통코드 목록 :: ",i.getCodeList("SYST"))},[i]),m.useEffect(()=>()=>{r.current&&(r.current.resetFields(),console.log("CMPopuMstrM01: BwgInfoArea form 초기화 완료")),n.current&&(n.current.resetFields(),console.log("CMPopuMstrM01: Drawer form 초기화 완료")),h(null),v([]),y(""),b(!1),P(["조회","닫기"]),C(""),console.log("CMPopuMstrM01: 컴포넌트 언마운트 - 모든 상태 초기화 완료")},[]);const O=m.useMemo(()=>[{name:"crprCd",fieldName:"crprCd",width:80,header:{text:"회사코드"},visible:!1},{name:"systId",fieldName:"systId",width:80,header:{text:"시스템ID"},lookupDisplay:!0,editor:{type:"dropdown"},tag:"req"},{name:"popuCd",fieldName:"popuCd",width:120,header:{text:"팝업코드"},styleName:"left",tag:"req"},{name:"popuNm",fieldName:"popuNm",width:200,header:{text:"팝업명칭"},styleName:"left"},{name:"popuUrl",fieldName:"popuUrl",width:250,header:{text:"팝업호출URL"},styleName:"left"},{name:"popuWdth",fieldName:"popuWdth",width:80,header:{text:"팝업너비"},visible:!1},{name:"wdthUnit",fieldName:"wdthUnit",width:60,header:{text:"너비단위"},visible:!1},{name:"popuHght",fieldName:"popuHght",width:80,header:{text:"팝업높이"},visible:!1},{name:"hghtUnit",fieldName:"hghtUnit",width:60,header:{text:"높이단위"},visible:!1},{name:"enblYn",fieldName:"enblYn",width:60,header:{text:"사용여부"},renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{name:"rmrk",fieldName:"rmrk",width:200,header:{text:"비고"},styleName:"left",visible:!1},{name:"inptDt",fieldName:"inptDt",width:150,header:{text:"입력일시"},visible:!1},{name:"inptId",fieldName:"inptId",width:100,header:{text:"입력자ID"},visible:!1},{name:"chngDt",fieldName:"chngDt",width:150,header:{text:"변경일시"},visible:!1},{name:"chngId",fieldName:"chngId",width:100,header:{text:"변경자ID"},visible:!1},{name:"dtlsInfo",fieldName:"dtlsInfo",width:100,header:{text:"버튼목록"},dataType:"json",visible:!1}],[]),k={display:{},edit:{editable:!1},copy:{singleMode:!0},container:{state:!0,check:!0,checkAll:!0,indicator:!0}},T={SCMPOPU00101:()=>{se.callService("SCMPOPU00101",{},{}).then($=>{console.log("SCMPOPU00101:",$.data)}).catch($=>{console.error("오류:",$)})},SCMPOPU00102:$=>{se.callService("SCMPOPU00102",$,{}).then(H=>{console.log("SCMPOPU00102:",H.data),t.current?.addAllData(H.data)}).catch(H=>{console.error("오류:",H)})},SCMPOPU00103:$=>{console.log("save params:",$),se.callService("SCMPOPU00103",$,{}).then(H=>{console.log("response:",H),H.result?(se.openMessage("success",d==="new"?"팝업이 등록되었습니다.":"팝업이 수정되었습니다."),c(!1),h(null),v([]),y(""),n.current?.resetFields(),T.SCMPOPU00102()):(showDuplicateError("팝업코드"),n.current?.setFields([{name:"popuCd",errors:["이미 사용중인 팝업코드입니다."]}]))}).catch(H=>{console.error("오류:",H),se.openMessage("error","저장 중 오류가 발생했습니다.")})}},D={formFinish:async()=>{try{const $=await n.current?.validateFields();if(g.length>0&&g.filter(X=>!X.btnId||X.btnId.trim()==="").length>0){C("버튼ID가 입력되지 않은 버튼이 있습니다. 모든 버튼의 버튼ID를 입력해주세요.");return}C(""),T.SCMPOPU00103({edit:d!=="new",info:{crprCd:se.getUserInfo()?.crprCd||"100",systId:$.systId,popuCd:$.popuCd,popuNm:$.popuNm,popuUrl:$.popuUrl,popuWdth:$.popuWdth,wdthUnit:$.wdthUnit,popuHght:$.popuHght,hghtUnit:$.hghtUnit,enblYn:$.enblYn,rmrk:$.rmrk,dtlsInfo:g}})}catch($){console.error("폼 유효성 검사 실패:",$)}},addButton:()=>{const $=g.length>0?Math.max(...g.map(X=>X.btnSq||0)):0,H={key:Date.now().toString(),btnSq:$+1,btnId:"",btnNm:"",iconType:"ANTD",iconVal:"",enblYn:"Y"};v(X=>[...X,H]),y(H.key)},openDefaultModal:()=>{b(!0)},applyDefaultButtons:()=>{const $={조회:{btnId:"SEARCH",btnNm:"조회",iconType:"ANTD",iconVal:"SearchOutlined",enblYn:"Y"},선택적용:{btnId:"APPLY",btnNm:"선택적용",iconType:"ANTD",iconVal:"CheckOutlined",enblYn:"Y"},신규:{btnId:"NEW",btnNm:"신규",iconType:"ANTD",iconVal:"PlusOutlined",enblYn:"Y"},저장:{btnId:"SAVE",btnNm:"저장",iconType:"ANTD",iconVal:"SaveOutlined",enblYn:"Y"},삭제:{btnId:"DELETE",btnNm:"삭제",iconType:"ANTD",iconVal:"DeleteOutlined",enblYn:"Y"},닫기:{btnId:"CLOSE",btnNm:"닫기",iconType:"ANTD",iconVal:"CloseOutlined",enblYn:"Y"}},H=g.length>0?Math.max(...g.map(ue=>ue.btnSq||0)):0,X=j.map((ue,fe)=>({key:"btn_"+se.generateUID(),btnSq:H+fe+1,...$[ue]}));v(ue=>[...ue,...X]),b(!1)},previewPopup:async()=>{let $=f;if(!$){const H=t.current?.getCurrentRow();if(H===void 0||H<0){se.openMessage("error","미리보기할 팝업을 선택해주세요.");return}if($=t.current?.vw?.getDataSource()?.getJsonRow(H),!$){se.openMessage("error","팝업 데이터를 가져올 수 없습니다.");return}}try{console.log("미리보기 팝업 실행:",$.popuCd),await a($.popuCd,{popupData:$,isPreview:!0}),console.log("미리보기 팝업 열기 완료")}catch(H){console.error("미리보기 팝업 열기 실패:",H),se.openMessage("error","미리보기 팝업을 열 수 없습니다.")}}},L={onCurrentRowChanged($,H,X){if(X<0)return;const ue=$.getValues(X);console.log("onCurrentRowChanged rowData:",ue),r.current?.setFieldsValue(ue),h(ue)}},A={search:async()=>{try{const $=s();console.log("SearchBox FormData:",$);const H={...$,userId:se.getUserInfo()?.userId};console.log("검색 파라미터:",H),T.SCMPOPU00102(H)}catch($){console.error("SearchBox formData 접근 오류:",$),T.SCMPOPU00102()}},new:()=>{u("new"),h(null),v([]),c(!0),setTimeout(()=>{n.current?.resetFields()},100)},update:()=>{const $=t.current?.getCurrentRow();if($===void 0||$<0){console.log("선택된 행이 없습니다.");return}const H=t.current?.vw?.getDataSource()?.getJsonRow($);if(H){if(u("update"),h(H),c(!0),console.log("전체 rowData:",H),console.log("rowData.dtlsInfo 존재 여부:",!!H.dtlsInfo),console.log("rowData.dtlsInfo 타입:",typeof H.dtlsInfo),console.log("rowData.dtlsInfo 값:",H.dtlsInfo),H.dtlsInfo){console.log("rowData.dtlsInfo 원본:",H.dtlsInfo);let X;if(Array.isArray(H.dtlsInfo)?(X=H.dtlsInfo,console.log("dtlsInfo가 배열입니다:",X)):typeof H.dtlsInfo=="object"?(X=[H.dtlsInfo],console.log("dtlsInfo가 객체입니다. 배열로 변환:",X)):(X=[],console.log("dtlsInfo가 다른 타입입니다:",typeof H.dtlsInfo)),X&&X.length>0){console.log("최종 buttonListData:",X);const ue=X.map((fe,me)=>({...fe,key:fe.key||`btn_${Date.now()}_${me}`,btnSq:fe.btnSq||me+1}));console.log("처리된 buttonListWithKeys:",ue),v(ue)}else console.log("buttonListData가 비어있음, 빈 배열로 설정"),v([])}else console.log("dtlsInfo가 없음, 빈 배열로 설정"),v([]);setTimeout(()=>{const X={...H,popuUrl:H.popuUrl?.startsWith("/popup/")?H.popuUrl.substring(8):H.popuUrl};n.current?.setFieldsValue(X)},100)}}},B={previewPopup:D.previewPopup},z=[{title:"순서",key:"order",width:80,align:"center",render:($,H)=>{const X=g.findIndex(ue=>ue.key===H.key);return o.jsxs(p.Space,{direction:"vertical",size:"small",children:[o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.UpOutlined,{}),disabled:X===0,onClick:()=>M(H.key)}),o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.DownOutlined,{}),disabled:X===g.length-1,onClick:()=>W(H.key)})]})}},{title:"순번",dataIndex:"btnSq",key:"btnSq",width:60,align:"center",render:$=>$||"-"},{title:"버튼ID",dataIndex:"btnId",key:"btnId",width:120,render:($,H)=>{const X=H.key===x,ue=!$||$.trim()==="",fe=E&&ue;return X?o.jsx(p.Input,{value:$,status:fe?"error":void 0,onChange:me=>{const Pe=[...g],Ee=Pe.find(J=>H.key===J.key);Ee&&(Ee.btnId=me.target.value,v(Pe),me.target.value.trim()!==""&&C(""))}}):o.jsx("span",{style:{color:fe?"#cf1322":"inherit",fontWeight:fe?"bold":"normal"},children:$||(fe?"입력 필요":"")})}},{title:"버튼명",dataIndex:"btnNm",key:"btnNm",width:150,render:($,H)=>H.key===x?o.jsx(p.Input,{value:$,onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.btnNm=ue.target.value,v(fe))}}):$},{title:"아이콘타입",dataIndex:"iconType",align:"center",key:"iconType",width:100,render:($,H)=>H.key===x?o.jsx(p.Select,{value:$,style:{width:"100%"},onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.iconType=ue,v(fe))},options:[{label:"ANTD",value:"ANTD"},{label:"CSS",value:"CSS"},{label:"SVG",value:"SVG"}]}):o.jsx(p.Tag,{color:$==="ANTD"?"blue":$==="CSS"?"green":"orange",children:$})},{title:"아이콘값",dataIndex:"iconVal",key:"iconVal",width:120,render:($,H)=>H.key===x?o.jsx(p.Input,{value:$,onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.iconVal=ue.target.value,v(fe))}}):$},{title:"사용여부",dataIndex:"enblYn",align:"center",key:"enblYn",width:80,render:($,H)=>H.key===x?o.jsx(p.Switch,{checked:$==="Y",onChange:ue=>{const fe=[...g],me=fe.find(Pe=>H.key===Pe.key);me&&(me.enblYn=ue?"Y":"N",v(fe))}}):o.jsx(p.Tag,{color:$==="Y"?"green":"red",children:$==="Y"?"사용":"미사용"})},{title:"작업",key:"action",align:"center",width:120,render:($,H)=>H.key===x?o.jsxs(p.Space,{children:[o.jsx(p.Tooltip,{title:"저장",children:o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.SaveOutlined,{}),onClick:()=>N()})}),o.jsx(p.Tooltip,{title:"취소",children:o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.RedoOutlined,{}),onClick:R})})]}):o.jsxs(p.Space,{children:[o.jsx(p.Tooltip,{title:"편집",children:o.jsx(p.Button,{type:"link",size:"small",icon:o.jsx(Y.EditOutlined,{}),onClick:()=>F(H)})}),o.jsx(p.Tooltip,{title:"삭제",children:o.jsx(p.Button,{type:"link",size:"small",danger:!0,icon:o.jsx(Y.RestOutlined,{}),onClick:()=>I(H.key)})})]})}],F=$=>{y($.key)},R=()=>{y("")},N=$=>{y("")},I=$=>{v(H=>H.filter(X=>X.key!==$))},M=$=>{v(H=>{const X=H.findIndex(ue=>ue.key===$);if(X>0){const ue=[...H];return[ue[X],ue[X-1]]=[ue[X-1],ue[X]],ue.forEach((fe,me)=>{fe.btnSq=me+1}),ue}return H})},W=$=>{v(H=>{const X=H.findIndex(ue=>ue.key===$);if(X<H.length-1){const ue=[...H];return[ue[X],ue[X+1]]=[ue[X+1],ue[X]],ue.forEach((fe,me)=>{fe.btnSq=me+1}),ue}return H})};return console.log("CMPopuMstrM01 grantEvent:",A),console.log("CMPopuMstrM01 customEvent:",B),console.log("grantEvent.update 함수 존재 여부:",!!A.update),o.jsx(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:A.search},{id:"new",label:"신규",onClick:A.new},{id:"update",label:"변경",onClick:A.update}],custom:[{id:"preview",label:"미리보기",onClick:B.previewPopup}]},searchBox:{reqRows:[o.jsx(_.BwgFormItem,{name:"systId",label:"시스템ID",children:o.jsx(p.Select,{options:i.getCodeList("SYST"),placeholder:"검색어를 입력하세요",allowClear:!0},"input1")}),o.jsx(_.BwgFormItem,{name:"keyword",label:"검색어",children:o.jsx(p.Input,{placeholder:"프로그램ID, 프로그램명, 페이지URL"})}),o.jsx(o.Fragment,{}),o.jsx(o.Fragment,{})]},children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w60",children:[o.jsx(Le,{title:"팝업 목록",icons:{type:"antd"}}),o.jsx(Ve,{type:"nrml",gridColumns:O,gridOptions:k,gridEvents:L,ref:t})]}),o.jsx(Ie,{className:"w40",border:!0,children:o.jsx(fn,{title:"팝업 상세",children:o.jsxs(p.Form,{layout:"vertical",ref:r,style:{padding:"10px 20px"},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템ID",name:"systId"},selectProps:{variant:"borderless",options:[{label:"공통",value:"CM"},{label:"인사",value:"HR"}],copyable:!0,disabled:!0}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"사용여부",name:"enblYn",children:o.jsx(p.Select,{variant:"borderless",options:[{label:"사용",value:"Y"},{label:"미사용",value:"N"}],disabled:!0})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업코드",name:"popuCd",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업명",name:"popuNm",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업너비",name:"popuWdth",children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuWdth",noStyle:!0,children:o.jsx(p.InputNumber,{variant:"borderless",style:{flex:1},readOnly:!0})}),o.jsx(p.Form.Item,{name:"wdthUnit",noStyle:!0,children:o.jsx(p.Select,{variant:"borderless",style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}],disabled:!0})})]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업높이",name:"popuHght",children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuHght",noStyle:!0,children:o.jsx(p.InputNumber,{variant:"borderless",style:{flex:1},readOnly:!0})}),o.jsx(p.Form.Item,{name:"hghtUnit",noStyle:!0,children:o.jsx(p.Select,{variant:"borderless",style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}],disabled:!0})})]})})})]}),o.jsx(_.BwgFormItem,{label:"팝업호출URL",name:"popuUrl",children:o.jsx(p.Input,{variant:"borderless",readOnly:!0})}),o.jsx(_.BwgFormItem,{label:"비고",name:"rmrk",children:o.jsx(p.Input.TextArea,{variant:"borderless",readOnly:!0,rows:3})}),o.jsx(_.BwgFormItem,{label:"할당버튼",name:"btnList",children:o.jsx("div",{style:{width:"100%"},children:o.jsx(p.Row,{gutter:[16,8],children:f?.dtlsInfo&&Array.isArray(f.dtlsInfo)?f.dtlsInfo.map(($,H)=>o.jsx(p.Col,{span:6,children:o.jsx(p.Button,{disabled:$.enblYn!=="Y",style:{width:"100%",marginBottom:"8px"},children:$.btnNm})},H)):o.jsx(p.Col,{span:24,children:o.jsx("div",{style:{textAlign:"center",color:"#999",padding:"20px"},children:"등록된 버튼이 없습니다."})})})})})]})})}),o.jsx(dn,{title:d==="new"?"팝업 등록":"팝업 수정",open:l,placement:"right",width:"40%",onClose:()=>{c(!1),h(null),v([]),y("")},children:o.jsxs(_.BwgForm,{ref:n,style:{padding:"10px 20px"},initialValues:{popuWdth:400,wdthUnit:"px",popuHght:100,hghtUnit:"%"},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템ID",name:"systId"},selectProps:{placeholder:"시스템을 선택하세요",variant:"borderless",options:[{label:"공통",value:"CM"},{label:"인사",value:"HR"}]}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"사용여부",name:"enblYn",initialValue:"Y",children:o.jsx(p.Select,{options:[{label:"사용",value:"Y"},{label:"미사용",value:"N"}]})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업코드",name:"popuCd",rules:[{required:!0,message:"팝업코드를 입력하세요"}],children:o.jsx(p.Input,{placeholder:"팝업코드를 입력하세요"})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업명",name:"popuNm",rules:[{required:!0,message:"팝업명을 입력하세요"}],children:o.jsx(p.Input,{placeholder:"팝업명을 입력하세요"})})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업너비",name:"popuWdth",rules:[{required:!0,message:"팝업너비를 입력하세요"}],children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuWdth",noStyle:!0,children:o.jsx(p.InputNumber,{placeholder:"팝업너비를 입력하세요",style:{flex:1},min:1})}),o.jsx(p.Form.Item,{name:"wdthUnit",noStyle:!0,children:o.jsx(p.Select,{style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}]})})]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"팝업높이",name:"popuHght",rules:[{required:!0,message:"팝업높이를 입력하세요"}],children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"popuHght",noStyle:!0,children:o.jsx(p.InputNumber,{placeholder:"팝업높이를 입력하세요",style:{flex:1},min:1})}),o.jsx(p.Form.Item,{name:"hghtUnit",noStyle:!0,children:o.jsx(p.Select,{style:{width:"80px"},options:[{label:"px",value:"px"},{label:"%",value:"%"}]})})]})})})]}),o.jsx(_.BwgFormItem,{label:"팝업호출URL",name:"popuUrl",rules:[{required:!0,message:"팝업호출URL을 입력하세요"}],children:o.jsx(p.Input,{placeholder:"팝업 URL을 입력하세요 (예: cm/TestPopup)",addonBefore:"popup/"})}),o.jsx(_.BwgFormItem,{label:"비고",name:"rmrk",children:o.jsx(p.Input.TextArea,{placeholder:"비고를 입력하세요",rows:3})}),o.jsxs(Le,{title:"버튼 목록",iconVisible:!1,children:[o.jsx(p.Button,{icon:o.jsx(Y.SettingTwoTone,{}),onClick:D.openDefaultModal,children:"기본값"}),o.jsx(p.Button,{icon:o.jsx(Y.PlusOutlined,{}),onClick:D.addButton,children:"추가"})]}),o.jsx(p.Table,{columns:z,dataSource:g,pagination:!1,size:"small",bordered:!0,scroll:{x:600},rowKey:"key"}),E&&o.jsxs("div",{style:{marginTop:"8px",padding:"8px 12px",backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"6px",color:"#cf1322",fontSize:"14px"},children:["⚠️ ",E]}),o.jsxs("div",{style:{textAlign:"right",marginTop:"16px"},children:[o.jsx(p.Button,{type:"primary",onClick:D.formFinish,style:{marginRight:"8px"},children:"저장"}),o.jsx(p.Button,{onClick:()=>{c(!1),h(null)},children:"취소"})]})]})}),o.jsxs(p.Modal,{title:"기본 버튼 선택",open:w,onOk:D.applyDefaultButtons,onCancel:()=>b(!1),okText:"적용",cancelText:"취소",children:[o.jsx("p",{children:"추가할 기본 버튼을 선택하세요:"}),o.jsx(p.Checkbox.Group,{value:j,onChange:$=>P($),style:{width:"100%"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%"},children:[o.jsx(p.Checkbox,{value:"조회",children:"조회"}),o.jsx(p.Checkbox,{value:"선택적용",children:"선택적용"}),o.jsx(p.Checkbox,{value:"신규",children:"신규"}),o.jsx(p.Checkbox,{value:"저장",children:"저장"}),o.jsx(p.Checkbox,{value:"삭제",children:"삭제"}),o.jsx(p.Checkbox,{value:"닫기",children:"닫기"})]})})]})]})})},{confirm:VN}=p.Modal,Pi={KE:[{label:"재무회계",value:"FI"},{label:"예산관리",value:"FM"},{label:"구매계약",value:"MM"},{label:"영업관리",value:"SD"},{label:"파트너관리",value:"PMN"}],KH:[{label:"HR 솔루션",value:"HR"},{label:"연말정산",value:"YT"},{label:"평정",value:"PE"}],KS:[{label:"온통",value:"BCOM"},{label:"e-감사",value:"EAUD"},{label:"청령신고",value:"INR"},{label:"ITAM",value:"ITAM"},{label:"차량/회의실",value:"CMM"},{label:"OA전산물품관리",value:"OAM"},{label:"총무관리",value:"GAM"},{label:"출입관리",value:"ACM"},{label:"비품관리",value:"IVM"},{label:"인장서비스",value:"SGS"},{label:"사료관리",value:"HIS"},{label:"웹펙스서비스",value:"WFAX"},{label:"메시지서비스",value:"SMS"},{label:"경영공시",value:"BID"},{label:"언론미디어",value:"PAM"},{label:"심의자문위원회",value:"DAC"},{label:"지식재산권신청",value:"IPR"},{label:"정보공유게시판",value:"ISB"}]},HN=[{name:"appCd",fieldName:"appCd",visible:!1},{name:"sysCd",fieldName:"sysCd",width:80,header:{text:"업무"},tag:"req"},{name:"prgrId",fieldName:"prgrId",width:150,header:{text:"프로그램 코드"},styleName:"left",tag:"req"},{name:"prgrNm",fieldName:"prgrNm",width:200,header:{text:"프로그램 명칭"},styleName:"left"},{name:"prgrUrl",fieldName:"prgrUrl",width:250,header:{text:"프로그램 URL"},styleName:"left"},{name:"enblYn",fieldName:"enblYn",width:60,header:{text:"사용"},renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{name:"prsnInfoYn",fieldName:"prsnInfoYn",visible:!1}],UN={display:{},edit:{editable:!1},copy:{singleMode:!0},container:{state:!0,check:!0,checkAll:!0,indicator:!0}},F0=({readOnly:e=!1,drawerMode:t=""})=>{const r=p.Form.useFormInstance(),[n,i]=m.useState(null),[a,s]=m.useState([]);m.useEffect(()=>{const c=r.getFieldValue("sysCd");i(c??null),c&&Pi[c]?s(Pi[c]):s([])},[r]);const l=c=>{i(c??null),c&&Pi[c]?s(Pi[c]):s([]),r.setFieldsValue({sysCd:c,appCd:null})};return o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템"},selectProps:{options:[{label:"K-ERP",value:"KE"},{label:"K-HR",value:"HR"},{label:"K-업무지원",value:"KS"}],onChange:l,disabled:e||t==="EDIT",placeholder:"시스템을 선택하세요"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션"},selectProps:{options:a,disabled:e||!n||t==="EDIT",placeholder:"시스템을 먼저 선택하세요"}})})]}),o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"prgrId",label:"프로그램 코드"},inputProps:{disabled:t==="EDIT",readOnly:e,variant:e?"borderless":"outlined"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{name:"prgrNm",label:"프로그램 명칭"},inputProps:{readOnly:e,variant:e?"borderless":"outlined"}})})]}),o.jsxs(p.Row,{children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgRadio,{itemProps:{name:"enblYn",label:"사용여부"},inputProps:{defaultValue:"Y",options:[{label:"Y",value:"Y"},{label:"N",value:"N"}],optionType:"button",style:{pointerEvents:e?"none":void 0}}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgRadio,{itemProps:{name:"prsnInfoYn",label:"개인정보 포함여부"},inputProps:{defaultValue:"Y",options:[{label:"Y",value:"Y"},{label:"N",value:"N"}],optionType:"button",style:{pointerEvents:e?"none":void 0}}})})]}),o.jsx(_.BwgInput,{itemProps:{name:"prgrUrl",label:"프로그램 URL"},inputProps:{readOnly:e,variant:e?"borderless":"outlined",placeholder:"/cm/rsrc/파일명 (.tsx 생략)"}}),o.jsx(_.BwgTextArea,{itemProps:{name:"prgrDscr",label:"프로그램 설명"},inputProps:{readOnly:e,rows:4,variant:e?"borderless":"outlined"}})]})},WN=e=>{const t=m.useRef(null),r=m.useRef(null),n=m.useRef(null),{getFormData:i,setFormData:a}=at.useSearchBox(),[s,l]=m.useState([]),[c,d]=m.useState(!1),[u,f]=m.useState(""),[h,g]=m.useState(-1),v=m.useCallback(C=>{d(!0),f(C)},[]),x=m.useCallback(()=>{d(!1),f("")},[]);m.useEffect(()=>{const C=tt.useSystemCode().findByAppCd(e.appCd);console.log("PRGR APPCD :: ",e.appCd),a({sysCd:C?.sysCd,appCd:C?.appCd})},[e.appCd]),m.useEffect(()=>{if(u=="NEW")n.current?.setFieldsValue({enblYn:"Y",prsnInfoYn:"Y"});else if(u=="EDIT"){const C=t.current?.getCurrentIndex()??-1,O=t.current?.vw?.getValues(C)??{};n.current?.setFieldsValue(O)}else n.current?.resetFields()},[u]);const y=m.useCallback(C=>{if(C==="ALL"){const O=Object.values(Pi).flat();l(O)}else C&&Pi[C]?l(Pi[C]):l([]);a({appCd:null}),b.search()},[a]),w=m.useCallback(()=>{j.SCMPRGR00102()},[u]),b={search:()=>{j.SCMPRGR00101()},new:()=>{v("NEW")},delete:()=>{const C=t.current?.vw?.getCheckedRows(!1)??[];if(C.length==0){se.openMessage("warning","삭제할 행을 체크하세요");return}VN({title:"삭제 안내",content:`${C.length}개 행을 삭제하시겠습니까?`,onOk:()=>{j.SCMPRGR00103()}})}},j={SCMPRGR00101:()=>{se.callService("SCMPRGR00101",i(),{}).then(C=>{t.current?.addAllData(C.data)})},SCMPRGR00102:()=>{const C={iudFlag:u==="EDIT"?"U":"I",...n.current?.getFieldsValue()??{}};se.callService("SCMPRGR00102",C,{}).then(O=>{O.result>0?(x(),j.SCMPRGR00101()):se.openMessage("error",O.message)}).catch(O=>{console.error("오류:",O)})},SCMPRGR00103:()=>{const C={},O=t.current?.vw?.getCheckedRows(!1)??[],k=[];O.forEach(T=>{const D=t.current?.dp?.getJsonRow(T);k.push({sysCd:D.sysCd,appCd:D.appCd,prgrId:D.prgrId})}),C.sub=k,se.callService("SCMPRGR00103",C).then(T=>{T.result>0&&j.SCMPRGR00101()}).catch(T=>{console.error("오류:",T)})}},P={editForm:()=>{if((t.current?.getCurrentRow()??-1)<0){se.openMessage("warning","행 선택 후 변경 가능합니다.");return}v("EDIT")}},E={onCurrentRowChanged(C,O,k){g(k)}};return o.jsxs(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:()=>{b.search()}},{id:"new",label:"신규",onClick:()=>{b.new()}},{id:"delete",label:"삭제",onClick:()=>{b.delete()}}]},searchBox:{reqRows:o.jsxs(p.Row,{gutter:12,children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템",initialValue:""},selectProps:{options:[{label:"전체",value:""},{label:"K-ERP",value:"KE"},{label:"K-HR",value:"KH"},{label:"K-업무지원",value:"KS"}],onChange:y}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{name:"appCd",label:"애플리케이션"},selectProps:{options:s,placeholder:"시스템코드를 먼저 선택해주세요",onChange:b.search}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgInput,{itemProps:{name:"keyword",label:"프로그램명"},inputProps:{placeholder:"프로그램ID/프로그램명을 입력하세요.",onPressEnter:b.search}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgRadio,{itemProps:{name:"enblYn",label:"사용여부"},inputProps:{defaultValue:"",size:"small",options:[{label:"전체",value:""},{label:"Y",value:"Y"},{label:"N",value:"N"}]}})})]})},children:[o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w60 mr20",children:[o.jsx(Le,{title:"프로그램 목록",icons:{type:"antd"}}),o.jsx(Ve,{ref:t,gridColumns:HN,gridOptions:UN,gridEvents:E,bindRef:r})]}),o.jsx(Ie,{className:"w40",border:!0,children:o.jsx(fn,{title:"프로그램 상세",titleChildren:o.jsx(o.Fragment,{children:h>=0&&o.jsx(_.BwgButton,{type:"dashed",onClick:P.editForm,children:"변경"})}),children:o.jsx(p.Form,{layout:"vertical",ref:r,className:"sub-form pd10",children:o.jsx(F0,{readOnly:!0})})})})]}),o.jsx(dn,{title:`프로그램 ${u=="EDIT"?"변경":"등록"}`,open:c,placement:"right",onClose:x,width:"30%",size:"large",afterOpenChange:C=>{console.log("afterOpenChange:",C)},footer:o.jsxs("div",{className:"drawer-footer-btn-group",children:[o.jsx(p.Button,{onClick:()=>{x()},className:"bwg-btn",children:"취소"}),o.jsx(p.Button,{type:"primary",onClick:w,className:"bwg-btn",children:"저장"})]}),children:o.jsx(p.Form,{layout:"vertical",ref:n,className:"sub-form pd10",children:o.jsx(F0,{readOnly:!1,drawerMode:u})})})]})},KN=()=>{const e=m.useRef(null),t=m.useRef(null),r=m.useRef(null),{openCorePopup:n}=at.usePopup(),i=m.useMemo(()=>[{fieldName:"seq",header:{text:"순번"},width:60,styleName:"center",visible:!1},{fieldName:"stndYmd",header:{text:"휴일일자"},width:100,styleName:"center",required:!0},{fieldName:"hldyDscr",header:{text:"휴일명"},width:150,styleName:"left",required:!0},{fieldName:"hldyYn",header:{text:"휴일여부"},width:100,styleName:"center"},{fieldName:"lglHldyYn",header:{text:"법정휴일여부"},width:100,styleName:"center"}],[]),a=m.useMemo(()=>[{fieldName:"seq",header:{text:"순번"},width:60,styleName:"center",visible:!1},{fieldName:"stndYmd",header:{text:"휴일일자"},width:100,styleName:"center",required:!0},{fieldName:"hldyDscr",header:{text:"휴일명"},width:150,styleName:"left",required:!0},{fieldName:"hldyYn",header:{text:"휴일여부"},width:100,styleName:"center",renderer:{type:"check",trueValues:"Y",falseValues:"N"}},{fieldName:"lglHldyYn",header:{text:"법정휴일여부"},width:100,styleName:"center",renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),s={edit:{editable:!1},container:{indicator:!0,footer:!0}},l={edit:{editable:!0},container:{check:!0,checkAll:!0,indicator:!0,footer:!0,state:!0}},c={search:()=>{d.SCMHLDY00101()},edit:()=>{d.SCMHLDY00102()}};m.useEffect(()=>{r.current?.setFormData({stndYmd:xl().format("YYYY")}),c.search()},[]);const d={SCMHLDY00101:()=>{se.callService("SCMHLDY00101",{...r.current?.getFormData()||{},crprCd:se.getCrprCd(),sysCd:__SYS_CD__}).then(u=>{e.current?.addAllData(u.sub.filter(f=>f.sysCd==="CM")||[]),t.current?.addAllData(u.sub.filter(f=>f.sysCd!=="CM")||[])})},SCMHLDY00102:()=>{const u=t.current?.getGridSaveData();se.callService("SCMHLDY00102",{sub:u,crprCd:se.getCrprCd(),sysCd:__SYS_CD__}).then(f=>{c.search()})}};return o.jsx(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:()=>{c.search()}},{id:"edit",label:"수정",onClick:()=>{c.edit()}}]},children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w50",children:[o.jsx(Le,{title:"국경일/공휴일 API"}),o.jsx(Ve,{ref:e,type:"nrml",gridColumns:i,gridOptions:s})]}),o.jsxs(Ie,{className:"w50",border:!0,children:[o.jsxs(Le,{title:"사업장 휴일",children:[o.jsx(_.BwgButton,{type:"primary",onClick:()=>{t.current?.dp?.addRow?.({iudFlag:"I"})},children:"추가"}),o.jsx(_.BwgButton,{type:"primary",onClick:()=>{t.current?.deleteGridData()},children:"삭제"}),o.jsx(_.BwgButton,{onClick:()=>{n("CORE_HOLIDAY_01")},children:"조회팝업"})]}),o.jsx(Ve,{ref:t,type:"nrml",gridColumns:a,gridOptions:l})]})]})})},qN=e=>o.jsx("div",{children:"CMSystCfgM01"}),YN=e=>{const[t,r]=m.useState(null),[n,i]=m.useState("group"),[a,s]=m.useState(null),l=m.useRef(null),c=m.useRef(null),d=m.useRef(null),u=[{id:"KH",name:"HR 솔루션",description:"인사 관리 시스템",icon:o.jsx(Y.UserOutlined,{}),color:"blue",status:"active"},{id:"KE",name:"K-ERP 서비스",description:"전사적 자원 관리 시스템",icon:o.jsx(Y.DatabaseOutlined,{}),color:"green",status:"active"},{id:"KS",name:"K-업무지원",description:"경영 지원 시스템",icon:o.jsx(Y.SettingOutlined,{}),color:"orange",status:"active"}],f=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"applCd",visible:!1},{fieldName:"systId",header:{text:"업무코드"},width:100},{fieldName:"systNm",header:{text:"업무명"},width:100},{fieldName:"systIco",header:{text:"업무아이콘"},width:100},{fieldName:"sortOrd",header:{text:"정렬순서"},width:100},{fieldName:"enblYn",header:{text:"사용여부"},width:60,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),h=m.useMemo(()=>[{fieldName:"cmmnCd",header:{text:"그룹코드"},width:120},{fieldName:"cmmnCdNm",header:{text:"그룹명"},width:150},{fieldName:"cmmnCdAbrv",header:{text:"설명"},width:200},{fieldName:"sortOrd",header:{text:"정렬순서"},width:80},{fieldName:"enblYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),g=m.useMemo(()=>[{fieldName:"grpCd",header:{text:"그룹코드"},width:120},{fieldName:"cmmnCd",header:{text:"코드"},width:100},{fieldName:"cmmnCdNm",header:{text:"코드명"},width:150},{fieldName:"sortOrd",header:{text:"정렬순서"},width:80},{fieldName:"useYn",header:{text:"사용여부"},width:80,renderer:{type:"check",trueValues:"Y",falseValues:"N"}}],[]),v={container:{indicator:!0}},x=w=>{r(w)},y=w=>{i(w),w==="group"&&s(null)};return m.useEffect(()=>{t&&se.callService("SCMSYST00101",{crprCd:se.getCrprCd(),applCd:t},{}).then(w=>{console.log({SCMSYST00101:w.data}),l.current?.addAllData(w.data)})},[t]),m.useEffect(()=>{t&&se.callService("SCMCODE00101",{crprCd:se.getCrprCd(),srchGb:n==="group"?"group":"detail"},{}).then(w=>{console.log({SCMCODE00101:w.data}),n==="group"?c.current?.addAllData(w.data):d.current?.addAllData(w.data)})},[n,t]),o.jsxs(kt,{children:[o.jsx(Ie,{style:{padding:"0px 20px",height:"200px",overflow:"hidden"},children:o.jsx(p.List,{grid:{gutter:16,xs:1,sm:2,md:3,lg:3,xl:3,xxl:3},dataSource:u,renderItem:w=>o.jsx(p.List.Item,{children:o.jsx(p.Card,{hoverable:!0,style:{height:"100%",cursor:"pointer",border:t===w.id?"2px solid #1890ff":"1px solid #f0f0f0",backgroundColor:t===w.id?"#f0f8ff":"#ffffff",boxShadow:t===w.id?"0 4px 12px rgba(24, 144, 255, 0.15)":"0 2px 8px rgba(0, 0, 0, 0.06)",position:"relative",zIndex:t===w.id?1:0},onClick:()=>x(w.id),actions:[o.jsx(p.Tag,{color:w.color,children:w.status==="active"?"활성":"비활성"},"status")],children:o.jsx(p.Card.Meta,{avatar:o.jsx("div",{style:{fontSize:"24px",color:w.color==="blue"?"#1890ff":w.color==="green"?"#52c41a":"#fa8c16"},children:w.icon}),title:o.jsxs(p.Space,{children:[o.jsx("span",{style:{fontWeight:"bold",color:t===w.id?"#1890ff":"#333"},children:w.name}),o.jsx(p.Tag,{color:w.color,children:w.id})]}),description:o.jsx("div",{style:{marginTop:"8px"},children:o.jsx("p",{style:{color:t===w.id?"#1890ff":"#666",margin:0},children:w.description})})})})})})}),o.jsx(Ie,{border:!0,children:o.jsxs(ze,{type:"horizontal",children:[o.jsxs(Ie,{className:"w40",children:[o.jsxs(Le,{title:"업무코드 목록",children:[o.jsx(p.Button,{children:"신규"}),o.jsx(p.Button,{children:"변경"})]}),o.jsx(Ve,{ref:l,type:"nrml",gridColumns:f,gridOptions:v})]}),o.jsxs(Ie,{className:"w60",children:[o.jsxs(Le,{title:"시스템 공통코드 목록",tooltip:{title:"시스템 전역에 배포될 코드 목록입니다."},children:[o.jsx(p.Button,{children:"신규"}),o.jsx(p.Button,{children:"변경"})]}),o.jsx(ar,{defaultActiveKey:"group",size:"small",tabPosition:"left",style:{height:"100%"},activeKey:n,onChange:y,items:[{key:"group",label:"그룹코드",icon:o.jsx(Y.GroupOutlined,{}),children:o.jsx(ze,{children:o.jsx(Ie,{children:o.jsx(Ve,{ref:c,type:"nrml",gridColumns:h,gridOptions:v})})})},{key:"detail",label:"상세코드",icon:o.jsx(Y.UngroupOutlined,{}),children:o.jsx(Ve,{ref:d,type:"nrml",gridColumns:g,gridOptions:v})}]})]})]})})]})};function cS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=cS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Je(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=cS(e))&&(n&&(n+=" "),n+=t);return n}var GN=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Qh(e){if(typeof e!="string")return!1;var t=GN;return t.includes(e)}var XN=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"];function uS(e){if(typeof e!="string")return!1;var t=XN;return t.includes(e)}function dS(e){return typeof e=="string"&&e.startsWith("data-")}function Qr(e){var t=Object.entries(e).filter(r=>{var[n]=r;return uS(n)||dS(n)});return Object.fromEntries(t)}function za(e){if(e==null)return null;if(m.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Qr(t)}return typeof e=="object"&&!Array.isArray(e)?Qr(e):null}function Dr(e){var t=Object.entries(e).filter(r=>{var[n]=r;return uS(n)||dS(n)||Qh(n)});return Object.fromEntries(t)}var ZN=["children","width","height","viewBox","className","style","title","desc"];function Tp(){return Tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tp.apply(null,arguments)}function QN(e,t){if(e==null)return{};var r,n,i=JN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function JN(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Jh=m.forwardRef((e,t)=>{var{children:r,width:n,height:i,viewBox:a,className:s,style:l,title:c,desc:d}=e,u=QN(e,ZN),f=a||{width:n,height:i,x:0,y:0},h=Je("recharts-surface",s);return S.createElement("svg",Tp({},Dr(u),{className:h,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),S.createElement("title",null,c),S.createElement("desc",null,d),r)}),eD=["children","className"];function Mp(){return Mp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mp.apply(null,arguments)}function tD(e,t){if(e==null)return{};var r,n,i=rD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function rD(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var ur=S.forwardRef((e,t)=>{var{children:r,className:n}=e,i=tD(e,eD),a=Je("recharts-layer",n);return S.createElement("g",Mp({className:a},Dr(i),{ref:t}),r)}),fS=m.createContext(null),nD=()=>m.useContext(fS);function it(e){return function(){return e}}const pS=Math.cos,Ul=Math.sin,en=Math.sqrt,Wl=Math.PI,_c=2*Wl,Rp=Math.PI,Ap=2*Rp,Ci=1e-6,iD=Ap-Ci;function hS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function oD(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hS;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class aD{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hS:oD(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,s){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=n-t,d=i-r,u=s-t,f=l-r,h=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Ci)if(!(Math.abs(f*c-d*u)>Ci)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let g=n-s,v=i-l,x=c*c+d*d,y=g*g+v*v,w=Math.sqrt(x),b=Math.sqrt(h),j=a*Math.tan((Rp-Math.acos((x+h-y)/(2*w*b)))/2),P=j/b,E=j/w;Math.abs(P-1)>Ci&&this._append`L${t+P*u},${r+P*f}`,this._append`A${a},${a},0,0,${+(f*g>u*v)},${this._x1=t+E*c},${this._y1=r+E*d}`}}arc(t,r,n,i,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),d=t+l,u=r+c,f=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>Ci||Math.abs(this._y1-u)>Ci)&&this._append`L${d},${u}`,n&&(h<0&&(h=h%Ap+Ap),h>iD?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:h>Ci&&this._append`A${n},${n},0,${+(h>=Rp)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function eg(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new aD(t)}function tg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gS(e){this._context=e}gS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Bc(e){return new gS(e)}function mS(e){return e[0]}function vS(e){return e[1]}function yS(e,t){var r=it(!0),n=null,i=Bc,a=null,s=eg(l);e=typeof e=="function"?e:e===void 0?mS:it(e),t=typeof t=="function"?t:t===void 0?vS:it(t);function l(c){var d,u=(c=tg(c)).length,f,h=!1,g;for(n==null&&(a=i(g=s())),d=0;d<=u;++d)!(d<u&&r(f=c[d],d,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,d,c),+t(f,d,c));if(g)return a=null,g+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:it(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:it(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:it(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(a=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=a=null:a=i(n=c),l):n},l}function Zs(e,t,r){var n=null,i=it(!0),a=null,s=Bc,l=null,c=eg(d);e=typeof e=="function"?e:e===void 0?mS:it(+e),t=typeof t=="function"?t:it(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?vS:it(+r);function d(f){var h,g,v,x=(f=tg(f)).length,y,w=!1,b,j=new Array(x),P=new Array(x);for(a==null&&(l=s(b=c())),h=0;h<=x;++h){if(!(h<x&&i(y=f[h],h,f))===w)if(w=!w)g=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=h-1;v>=g;--v)l.point(j[v],P[v]);l.lineEnd(),l.areaEnd()}w&&(j[h]=+e(y,h,f),P[h]=+t(y,h,f),l.point(n?+n(y,h,f):j[h],r?+r(y,h,f):P[h]))}if(b)return l=null,b+""||null}function u(){return yS().defined(i).curve(s).context(a)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:it(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:it(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:it(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:it(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:it(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:it(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(i=typeof f=="function"?f:it(!!f),d):i},d.curve=function(f){return arguments.length?(s=f,a!=null&&(l=s(a)),d):s},d.context=function(f){return arguments.length?(f==null?a=l=null:l=s(a=f),d):a},d}class xS{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function sD(e){return new xS(e,!0)}function lD(e){return new xS(e,!1)}const rg={draw(e,t){const r=en(t/Wl);e.moveTo(r,0),e.arc(0,0,r,0,_c)}},cD={draw(e,t){const r=en(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},bS=en(1/3),uD=bS*2,dD={draw(e,t){const r=en(t/uD),n=r*bS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},fD={draw(e,t){const r=en(t),n=-r/2;e.rect(n,n,r,r)}},pD=.8908130915292852,wS=Ul(Wl/10)/Ul(7*Wl/10),hD=Ul(_c/10)*wS,gD=-pS(_c/10)*wS,mD={draw(e,t){const r=en(t*pD),n=hD*r,i=gD*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const s=_c*a/5,l=pS(s),c=Ul(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},pd=en(3),vD={draw(e,t){const r=-en(t/(pd*3));e.moveTo(0,r*2),e.lineTo(-pd*r,-r),e.lineTo(pd*r,-r),e.closePath()}},kr=-.5,Tr=en(3)/2,Ip=1/en(12),yD=(Ip/2+1)*3,xD={draw(e,t){const r=en(t/yD),n=r/2,i=r*Ip,a=n,s=r*Ip+r,l=-a,c=s;e.moveTo(n,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(kr*n-Tr*i,Tr*n+kr*i),e.lineTo(kr*a-Tr*s,Tr*a+kr*s),e.lineTo(kr*l-Tr*c,Tr*l+kr*c),e.lineTo(kr*n+Tr*i,kr*i-Tr*n),e.lineTo(kr*a+Tr*s,kr*s-Tr*a),e.lineTo(kr*l+Tr*c,kr*c-Tr*l),e.closePath()}};function bD(e,t){let r=null,n=eg(i);e=typeof e=="function"?e:it(e||rg),t=typeof t=="function"?t:it(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:it(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:it(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Kl(){}function ql(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function CS(e){this._context=e}CS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ql(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ql(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wD(e){return new CS(e)}function SS(e){this._context=e}SS.prototype={areaStart:Kl,areaEnd:Kl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ql(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function CD(e){return new SS(e)}function jS(e){this._context=e}jS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ql(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SD(e){return new jS(e)}function ES(e){this._context=e}ES.prototype={areaStart:Kl,areaEnd:Kl,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function jD(e){return new ES(e)}function V0(e){return e<0?-1:1}function H0(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),l=(a*i+s*n)/(n+i);return(V0(a)+V0(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function U0(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function hd(e,t,r){var n=e._x0,i=e._y0,a=e._x1,s=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,s-l*r,a,s)}function Yl(e){this._context=e}Yl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:hd(this,this._t0,U0(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,hd(this,U0(this,r=H0(this,e,t)),r);break;default:hd(this,this._t0,r=H0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function PS(e){this._context=new OS(e)}(PS.prototype=Object.create(Yl.prototype)).point=function(e,t){Yl.prototype.point.call(this,t,e)};function OS(e){this._context=e}OS.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function ED(e){return new Yl(e)}function PD(e){return new PS(e)}function kS(e){this._context=e}kS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=W0(e),i=W0(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function W0(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function OD(e){return new kS(e)}function $c(e,t){this._context=e,this._t=t}$c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function kD(e){return new $c(e,.5)}function TD(e){return new $c(e,0)}function MD(e){return new $c(e,1)}function wo(e,t){if((s=e.length)>1)for(var r=1,n,i,a=e[t[0]],s,l=a.length;r<s;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Np(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function RD(e,t){return e[t]}function AD(e){const t=[];return t.key=e,t}function ID(){var e=it([]),t=Np,r=wo,n=RD;function i(a){var s=Array.from(e.apply(this,arguments),AD),l,c=s.length,d=-1,u;for(const f of a)for(l=0,++d;l<c;++l)(s[l][d]=[0,+n(f,s[l].key,d,a)]).data=f;for(l=0,u=tg(t(s));l<c;++l)s[u[l]].index=l;return r(s,u),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:it(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:it(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Np:typeof a=="function"?a:it(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??wo,i):r},i}function ND(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,s;i<a;++i){for(s=r=0;r<n;++r)s+=e[r][i][1]||0;if(s)for(r=0;r<n;++r)e[r][i][1]/=s}wo(e,t)}}function DD(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var s=0,l=0;s<i;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}wo(e,t)}}function _D(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,s;n<a;++n){for(var l=0,c=0,d=0;l<s;++l){for(var u=e[t[l]],f=u[n][1]||0,h=u[n-1][1]||0,g=(f-h)/2,v=0;v<l;++v){var x=e[t[v]],y=x[n][1]||0,w=x[n-1][1]||0;g+=y-w}c+=f,d+=g*f}i[n-1][1]+=i[n-1][0]=r,c&&(r-=d/c)}i[n-1][1]+=i[n-1][0]=r,wo(e,t)}}var gd={},md={},K0;function BD(){return K0||(K0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(md)),md}var vd={},q0;function TS(){return q0||(q0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(vd)),vd}var yd={},Y0;function ng(){return Y0||(Y0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="string"||typeof r=="symbol"?r:Object.is(r?.valueOf?.(),-0)?"-0":String(r)}e.toKey=t})(yd)),yd}var xd={},bd={},G0;function $D(){return G0||(G0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t})(bd)),bd}var X0;function ig(){return X0||(X0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$D(),r=ng();function n(i){if(Array.isArray(i))return i.map(r.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],s=i.length;if(s===0)return a;let l=0,c="",d="",u=!1;for(i.charCodeAt(0)===46&&(a.push(""),l++);l<s;){const f=i[l];d?f==="\\"&&l+1<s?(l++,c+=i[l]):f===d?d="":c+=f:u?f==='"'||f==="'"?d=f:f==="]"?(u=!1,a.push(c),c=""):c+=f:f==="["?(u=!0,c&&(a.push(c),c="")):f==="."?c&&(a.push(c),c=""):c+=f,l++}return c&&a.push(c),a}e.toPath=n})(xd)),xd}var Z0;function og(){return Z0||(Z0=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BD(),r=TS(),n=ng(),i=ig();function a(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?r.isDeepKey(c)?a(l,i.toPath(c),d):d:u}case"number":case"symbol":{typeof c=="number"&&(c=n.toKey(c));const u=l[c];return u===void 0?d:u}default:{if(Array.isArray(c))return s(l,c,d);if(Object.is(c?.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?d:u}}}function s(l,c,d){if(c.length===0)return d;let u=l;for(let f=0;f<c.length;f++){if(u==null||t.isUnsafeProperty(c[f]))return d;u=u[c[f]]}return u===void 0?d:u}e.get=a})(gd)),gd}var wd,Q0;function LD(){return Q0||(Q0=1,wd=og().get),wd}var zD=LD();const _i=wr(zD);var Lt=e=>e===0?0:e>0?1:-1,_r=e=>typeof e=="number"&&e!=+e,Rn=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ae=e=>(typeof e=="number"||e instanceof Number)&&!_r(e),hn=e=>Ae(e)||typeof e=="string",FD=0,Fa=e=>{var t=++FD;return"".concat(e||"").concat(t)},Zt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ae(t)&&typeof t!="string")return n;var a;if(Rn(t)){if(r==null)return n;var s=t.indexOf("%");a=r*parseFloat(t.slice(0,s))/100}else a=+t;return _r(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},MS=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[e[n]])r[e[n]]=!0;else return!0;return!1};function Yt(e,t,r){return Ae(e)&&Ae(t)?e+r*(t-e):t}function VD(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):_i(n,t))===r)}var Ft=e=>e===null||typeof e>"u",ls=e=>Ft(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)),HD=["type","size","sizeType"];function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dp.apply(null,arguments)}function J0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ey(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?J0(Object(r),!0).forEach(function(n){UD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UD(e,t,r){return(t=WD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WD(e){var t=KD(e,"string");return typeof t=="symbol"?t:t+""}function KD(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qD(e,t){if(e==null)return{};var r,n,i=YD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function YD(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var RS={symbolCircle:rg,symbolCross:cD,symbolDiamond:dD,symbolSquare:fD,symbolStar:mD,symbolTriangle:vD,symbolWye:xD},GD=Math.PI/180,XD=e=>{var t="symbol".concat(ls(e));return RS[t]||rg},ZD=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*GD;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},QD=(e,t)=>{RS["symbol".concat(ls(e))]=t},ag=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=qD(e,HD),a=ey(ey({},i),{},{type:t,size:r,sizeType:n}),s="circle";typeof t=="string"&&(s=t);var l=()=>{var h=XD(s),g=bD().type(h).size(ZD(r,n,s)),v=g();if(v!==null)return v},{className:c,cx:d,cy:u}=a,f=Dr(a);return d===+d&&u===+u&&r===+r?S.createElement("path",Dp({},f,{className:Je("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};ag.registerSymbol=QD;var JD=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(m.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Qh(i)&&(n[i]=(a=>r[i](r,a)))}),n},e_=(e,t,r)=>n=>(e(t,r,n),null),cs=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Qh(i)&&typeof a=="function"&&(n||(n={}),n[i]=e_(a,t,r))}),n};function _p(){return _p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_p.apply(null,arguments)}function ty(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function t_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ty(Object(r),!0).forEach(function(n){sg(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ty(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sg(e,t,r){return(t=r_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r_(e){var t=n_(e,"string");return typeof t=="symbol"?t:t+""}function n_(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mr=32;class lg extends m.PureComponent{renderIcon(t,r){var{inactiveColor:n}=this.props,i=Mr/2,a=Mr/6,s=Mr/3,l=t.inactive?n:t.color,c=r??t.type;if(c==="none")return null;if(c==="plainline")return S.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:t.payload.strokeDasharray,x1:0,y1:i,x2:Mr,y2:i,className:"recharts-legend-icon"});if(c==="line")return S.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(s,`
1029
1029
  A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
1030
1030
  H`).concat(Mr,"M").concat(2*s,",").concat(i,`
1031
1031
  A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return S.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Mr/8,"h").concat(Mr,"v").concat(Mr*3/4,"h").concat(-Mr,"z"),className:"recharts-legend-icon"});if(S.isValidElement(t.legendIcon)){var d=t_({},t);return delete d.legendIcon,S.cloneElement(t.legendIcon,d)}return S.createElement(ag,{fill:l,cx:i,cy:i,size:Mr,sizeType:"diameter",type:c})}renderItems(){var{payload:t,iconSize:r,layout:n,formatter:i,inactiveColor:a,iconType:s}=this.props,l={x:0,y:0,width:Mr,height:Mr},c={display:n==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((u,f)=>{var h=u.formatter||i,g=Je({"recharts-legend-item":!0,["legend-item-".concat(f)]:!0,inactive:u.inactive});if(u.type==="none")return null;var v=u.inactive?a:u.color,x=h?h(u.value,u,f):u.value;return S.createElement("li",_p({className:g,style:c,key:"legend-item-".concat(f)},cs(this.props,u,f)),S.createElement(Jh,{width:r,height:r,viewBox:l,style:d,"aria-label":"".concat(x," legend icon")},this.renderIcon(u,s)),S.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},x))})}render(){var{payload:t,layout:r,align:n}=this.props;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:r==="horizontal"?n:"left"};return S.createElement("ul",{className:"recharts-default-legend",style:i},this.renderItems())}}sg(lg,"displayName","Legend");sg(lg,"defaultProps",{align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle"});var Cd={},Sd={},ry;function i_(){return ry||(ry=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const i=new Map;for(let a=0;a<r.length;a++){const s=r[a],l=n(s);i.has(l)||i.set(l,s)}return Array.from(i.values())}e.uniqBy=t})(Sd)),Sd}var jd={},ny;function AS(){return ny||(ny=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(jd)),jd}var Ed={},Pd={},Od={},iy;function o_(){return iy||(iy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(Od)),Od}var oy;function cg(){return oy||(oy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o_();function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(Pd)),Pd}var kd={},ay;function a_(){return ay||(ay=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(kd)),kd}var sy;function s_(){return sy||(sy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cg(),r=a_();function n(i){return r.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=n})(Ed)),Ed}var Td={},Md={},ly;function l_(){return ly||(ly=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=og();function r(n){return function(i){return t.get(i,n)}}e.property=r})(Md)),Md}var Rd={},Ad={},Id={},Nd={},cy;function IS(){return cy||(cy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(Nd)),Nd}var Dd={},uy;function NS(){return uy||(uy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Dd)),Dd}var _d={},dy;function DS(){return dy||(dy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.eq=t})(_d)),_d}var fy;function c_(){return fy||(fy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IS(),r=NS(),n=DS();function i(u,f,h){return typeof h!="function"?i(u,f,()=>{}):a(u,f,function g(v,x,y,w,b,j){const P=h(v,x,y,w,b,j);return P!==void 0?!!P:a(v,x,g,j)},new Map)}function a(u,f,h,g){if(f===u)return!0;switch(typeof f){case"object":return s(u,f,h,g);case"function":return Object.keys(f).length>0?a(u,{...f},h,g):n.eq(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.eq(u,f)}}function s(u,f,h,g){if(f==null)return!0;if(Array.isArray(f))return c(u,f,h,g);if(f instanceof Map)return l(u,f,h,g);if(f instanceof Set)return d(u,f,h,g);const v=Object.keys(f);if(u==null)return v.length===0;if(v.length===0)return!0;if(g?.has(f))return g.get(f)===u;g?.set(f,u);try{for(let x=0;x<v.length;x++){const y=v[x];if(!r.isPrimitive(u)&&!(y in u)||f[y]===void 0&&u[y]!==void 0||f[y]===null&&u[y]!==null||!h(u[y],f[y],y,u,f,g))return!1}return!0}finally{g?.delete(f)}}function l(u,f,h,g){if(f.size===0)return!0;if(!(u instanceof Map))return!1;for(const[v,x]of f.entries()){const y=u.get(v);if(h(y,x,v,u,f,g)===!1)return!1}return!0}function c(u,f,h,g){if(f.length===0)return!0;if(!Array.isArray(u))return!1;const v=new Set;for(let x=0;x<f.length;x++){const y=f[x];let w=!1;for(let b=0;b<u.length;b++){if(v.has(b))continue;const j=u[b];let P=!1;if(h(j,y,x,u,f,g)&&(P=!0),P){v.add(b),w=!0;break}}if(!w)return!1}return!0}function d(u,f,h,g){return f.size===0?!0:u instanceof Set?c([...u],[...f],h,g):!1}e.isMatchWith=i,e.isSetMatch=d})(Id)),Id}var py;function _S(){return py||(py=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=c_();function r(n,i){return t.isMatchWith(n,i,()=>{})}e.isMatch=r})(Ad)),Ad}var Bd={},$d={},Ld={},hy;function u_(){return hy||(hy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(Ld)),Ld}var zd={},gy;function BS(){return gy||(gy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(zd)),zd}var Fd={},my;function $S(){return my||(my=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",i="[object Boolean]",a="[object Arguments]",s="[object Symbol]",l="[object Date]",c="[object Map]",d="[object Set]",u="[object Array]",f="[object Function]",h="[object ArrayBuffer]",g="[object Object]",v="[object Error]",x="[object DataView]",y="[object Uint8Array]",w="[object Uint8ClampedArray]",b="[object Uint16Array]",j="[object Uint32Array]",P="[object BigUint64Array]",E="[object Int8Array]",C="[object Int16Array]",O="[object Int32Array]",k="[object BigInt64Array]",T="[object Float32Array]",D="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=h,e.arrayTag=u,e.bigInt64ArrayTag=k,e.bigUint64ArrayTag=P,e.booleanTag=i,e.dataViewTag=x,e.dateTag=l,e.errorTag=v,e.float32ArrayTag=T,e.float64ArrayTag=D,e.functionTag=f,e.int16ArrayTag=C,e.int32ArrayTag=O,e.int8ArrayTag=E,e.mapTag=c,e.numberTag=n,e.objectTag=g,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=s,e.uint16ArrayTag=b,e.uint32ArrayTag=j,e.uint8ArrayTag=y,e.uint8ClampedArrayTag=w})(Fd)),Fd}var Vd={},vy;function d_(){return vy||(vy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(Vd)),Vd}var yy;function LS(){return yy||(yy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u_(),r=BS(),n=$S(),i=NS(),a=d_();function s(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,h,g=new Map,v=void 0){const x=v?.(u,f,h,g);if(x!==void 0)return x;if(i.isPrimitive(u))return u;if(g.has(u))return g.get(u);if(Array.isArray(u)){const y=new Array(u.length);g.set(u,y);for(let w=0;w<u.length;w++)y[w]=l(u[w],w,h,g,v);return Object.hasOwn(u,"index")&&(y.index=u.index),Object.hasOwn(u,"input")&&(y.input=u.input),y}if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp){const y=new RegExp(u.source,u.flags);return y.lastIndex=u.lastIndex,y}if(u instanceof Map){const y=new Map;g.set(u,y);for(const[w,b]of u)y.set(w,l(b,w,h,g,v));return y}if(u instanceof Set){const y=new Set;g.set(u,y);for(const w of u)y.add(l(w,void 0,h,g,v));return y}if(typeof Buffer<"u"&&Buffer.isBuffer(u))return u.subarray();if(a.isTypedArray(u)){const y=new(Object.getPrototypeOf(u)).constructor(u.length);g.set(u,y);for(let w=0;w<u.length;w++)y[w]=l(u[w],w,h,g,v);return y}if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer)return u.slice(0);if(u instanceof DataView){const y=new DataView(u.buffer.slice(0),u.byteOffset,u.byteLength);return g.set(u,y),c(y,u,h,g,v),y}if(typeof File<"u"&&u instanceof File){const y=new File([u],u.name,{type:u.type});return g.set(u,y),c(y,u,h,g,v),y}if(typeof Blob<"u"&&u instanceof Blob){const y=new Blob([u],{type:u.type});return g.set(u,y),c(y,u,h,g,v),y}if(u instanceof Error){const y=new u.constructor;return g.set(u,y),y.message=u.message,y.name=u.name,y.stack=u.stack,y.cause=u.cause,c(y,u,h,g,v),y}if(u instanceof Boolean){const y=new Boolean(u.valueOf());return g.set(u,y),c(y,u,h,g,v),y}if(u instanceof Number){const y=new Number(u.valueOf());return g.set(u,y),c(y,u,h,g,v),y}if(u instanceof String){const y=new String(u.valueOf());return g.set(u,y),c(y,u,h,g,v),y}if(typeof u=="object"&&d(u)){const y=Object.create(Object.getPrototypeOf(u));return g.set(u,y),c(y,u,h,g,v),y}return u}function c(u,f,h=u,g,v){const x=[...Object.keys(f),...t.getSymbols(f)];for(let y=0;y<x.length;y++){const w=x[y],b=Object.getOwnPropertyDescriptor(u,w);(b==null||b.writable)&&(u[w]=l(f[w],w,h,g,v))}}function d(u){switch(r.getTag(u)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=l,e.copyProperties=c})($d)),$d}var xy;function f_(){return xy||(xy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LS();function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(Bd)),Bd}var by;function p_(){return by||(by=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_S(),r=f_();function n(i){return i=r.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=n})(Rd)),Rd}var Hd={},Ud={},Wd={},wy;function h_(){return wy||(wy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LS(),r=$S();function n(i,a){return t.cloneDeepWith(i,(s,l,c,d)=>{const u=a?.(s,l,c,d);if(u!==void 0)return u;if(typeof i=="object")switch(Object.prototype.toString.call(i)){case r.numberTag:case r.stringTag:case r.booleanTag:{const f=new i.constructor(i?.valueOf());return t.copyProperties(f,i),f}case r.argumentsTag:{const f={};return t.copyProperties(f,i),f.length=i.length,f[Symbol.iterator]=i[Symbol.iterator],f}default:return}})}e.cloneDeepWith=n})(Wd)),Wd}var Cy;function g_(){return Cy||(Cy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=h_();function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(Ud)),Ud}var Kd={},qd={},Sy;function zS(){return Sy||(Sy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,i=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<i;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r})(qd)),qd}var Yd={},jy;function m_(){return jy||(jy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=BS();function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(Yd)),Yd}var Ey;function v_(){return Ey||(Ey=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TS(),r=zS(),n=m_(),i=ig();function a(s,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&s?.[l]==null?c=i.toPath(l):c=[l],c.length===0)return!1;let d=s;for(let u=0;u<c.length;u++){const f=c[u];if((d==null||!Object.hasOwn(d,f))&&!((Array.isArray(d)||n.isArguments(d))&&r.isIndex(f)&&f<d.length))return!1;d=d[f]}return!0}e.has=a})(Kd)),Kd}var Py;function y_(){return Py||(Py=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_S(),r=ng(),n=g_(),i=og(),a=v_();function s(l,c){switch(typeof l){case"object":{Object.is(l?.valueOf(),-0)&&(l="-0");break}case"number":{l=r.toKey(l);break}}return c=n.cloneDeep(c),function(d){const u=i.get(d,l);return u===void 0?a.has(d,l):c===void 0?u===void 0:t.isMatch(u,c)}}e.matchesProperty=s})(Hd)),Hd}var Oy;function x_(){return Oy||(Oy=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AS(),r=l_(),n=p_(),i=y_();function a(s){if(s==null)return t.identity;switch(typeof s){case"function":return s;case"object":return Array.isArray(s)&&s.length===2?i.matchesProperty(s[0],s[1]):n.matches(s);case"string":case"symbol":case"number":return r.property(s)}}e.iteratee=a})(Td)),Td}var ky;function b_(){return ky||(ky=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=i_(),r=AS(),n=s_(),i=x_();function a(s,l=r.identity){return n.isArrayLikeObject(s)?t.uniqBy(Array.from(s),i.iteratee(l)):[]}e.uniqBy=a})(Cd)),Cd}var Gd,Ty;function w_(){return Ty||(Ty=1,Gd=b_().uniqBy),Gd}var C_=w_();const My=wr(C_);function FS(e,t,r){return t===!0?My(e,r):typeof t=="function"?My(e,t):e}var Qs={exports:{}},Xd={},Js={exports:{}},Zd={};/**
@@ -1106,4 +1106,4 @@ Take a look at the reducer(s) handling this action type: ${g.type}.
1106
1106
  A`).concat(n,",").concat(n,",0,").concat(+(T>180),",").concat(+(u>0),",").concat(j.x,",").concat(j.y,`
1107
1107
  A`).concat(a,",").concat(a,",0,0,").concat(+(u<0),",").concat(P.x,",").concat(P.y,"Z")}else b+="L".concat(t,",").concat(r,"Z");return b},$5={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},qj=e=>{var t=ir(e,$5),{cx:r,cy:n,innerRadius:i,outerRadius:a,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:f}=t;if(a<i||d===u)return null;var h=Je("recharts-sector",f),g=a-i,v=Zt(s,g,0,!0),x;return v>0&&Math.abs(d-u)<360?x=B5({cx:r,cy:n,innerRadius:i,outerRadius:a,cornerRadius:Math.min(v,g/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):x=Kj({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:d,endAngle:u}),S.createElement("path",eh({},Dr(t),{className:h,d:x}))};function L5(e,t,r){var n,i,a,s;if(e==="horizontal")n=t.x,a=n,i=r.top,s=r.top+r.height;else if(e==="vertical")i=t.y,s=i,n=r.left,a=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var{cx:l,cy:c,innerRadius:d,outerRadius:u,angle:f}=t,h=jt(l,c,d,f),g=jt(l,c,u,f);n=h.x,i=h.y,a=g.x,s=g.y}else return Wj(t);return[{x:n,y:i},{x:a,y:s}]}var yf={},xf={},bf={},Vx;function z5(){return Vx||(Vx=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=US();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(bf)),bf}var Hx;function F5(){return Hx||(Hx=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=z5();function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(xf)),xf}var Ux;function V5(){return Ux||(Ux=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WS(),r=F5();function n(i,a,s){s&&typeof s!="number"&&t.isIterateeCall(i,a,s)&&(a=s=void 0),i=r.toFinite(i),a===void 0?(a=i,i=0):a=r.toFinite(a),s=s===void 0?i<a?1:-1:r.toFinite(s);const l=Math.max(Math.ceil((a-i)/(s||1)),0),c=new Array(l);for(let d=0;d<l;d++)c[d]=i,i+=s;return c}e.range=n})(yf)),yf}var wf,Wx;function H5(){return Wx||(Wx=1,wf=V5().range),wf}var U5=H5();const Yj=wr(U5);function si(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function W5(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Sg(e){let t,r,n;e.length!==2?(t=si,r=(l,c)=>si(e(l),c),n=(l,c)=>e(l)-c):(t=e===si||e===W5?e:K5,r=e,n=e);function i(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<0?d=f+1:u=f}while(d<u)}return d}function a(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<=0?d=f+1:u=f}while(d<u)}return d}function s(l,c,d=0,u=l.length){const f=i(l,c,d,u-1);return f>d&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:i,center:s,right:a}}function K5(){return 0}function Gj(e){return e===null?NaN:+e}function*q5(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Y5=Sg(si),gs=Y5.right;Sg(Gj).center;class Kx extends Map{constructor(t,r=Z5){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(qx(this,t))}has(t){return super.has(qx(this,t))}set(t,r){return super.set(G5(this,t),r)}delete(t){return super.delete(X5(this,t))}}function qx({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function G5({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function X5({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Z5(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Q5(e=si){if(e===si)return Xj;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function Xj(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const J5=Math.sqrt(50),e$=Math.sqrt(10),t$=Math.sqrt(2);function ac(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=J5?10:a>=e$?5:a>=t$?2:1;let l,c,d;return i<0?(d=Math.pow(10,-i)/s,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,i)*s,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=r&&r<2?ac(e,t,r*2):[l,c,d]}function th(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,s]=n?ac(t,e,r):ac(e,t,r);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(n)if(s<0)for(let d=0;d<l;++d)c[d]=(a-d)/-s;else for(let d=0;d<l;++d)c[d]=(a-d)*s;else if(s<0)for(let d=0;d<l;++d)c[d]=(i+d)/-s;else for(let d=0;d<l;++d)c[d]=(i+d)*s;return c}function rh(e,t,r){return t=+t,e=+e,r=+r,ac(e,t,r)[2]}function nh(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?rh(t,e,r):rh(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function Yx(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Gx(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Zj(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?Xj:Q5(i);n>r;){if(n-r>600){const c=n-r+1,d=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(c-f)/c)*(d-c/2<0?-1:1),g=Math.max(r,Math.floor(t-d*f/c+h)),v=Math.min(n,Math.floor(t+(c-d)*f/c+h));Zj(e,t,g,v,i)}const a=e[t];let s=r,l=n;for(ha(e,r,t),i(e[n],a)>0&&ha(e,r,n);s<l;){for(ha(e,s,l),++s,--l;i(e[s],a)<0;)++s;for(;i(e[l],a)>0;)--l}i(e[r],a)===0?ha(e,r,l):(++l,ha(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function ha(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function r$(e,t,r){if(e=Float64Array.from(q5(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Gx(e);if(t>=1)return Yx(e);var n,i=(n-1)*t,a=Math.floor(i),s=Yx(Zj(e,a).subarray(0,a+1)),l=Gx(e.subarray(a+1));return s+(l-s)*(i-a)}}function n$(e,t,r=Gj){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),s=+r(e[a],a,e),l=+r(e[a+1],a+1,e);return s+(l-s)*(i-a)}}function i$(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function Vr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ln(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const ih=Symbol("implicit");function jg(){var e=new Kx,t=[],r=[],n=ih;function i(a){let s=e.get(a);if(s===void 0){if(n!==ih)return n;e.set(a,s=t.push(a)-1)}return r[s%r.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Kx;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return jg(t,r).unknown(n)},Vr.apply(i,arguments),i}function Eg(){var e=jg().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,s,l=!1,c=0,d=0,u=.5;delete e.unknown;function f(){var h=t().length,g=i<n,v=g?i:n,x=g?n:i;a=(x-v)/Math.max(1,h-c+d*2),l&&(a=Math.floor(a)),v+=(x-v-a*(h-c))*u,s=a*(1-c),l&&(v=Math.round(v),s=Math.round(s));var y=i$(h).map(function(w){return v+a*w});return r(g?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,i]=h,n=+n,i=+i,f()):[n,i]},e.rangeRound=function(h){return[n,i]=h,n=+n,i=+i,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,d=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(d=+h,f()):d},e.align=function(h){return arguments.length?(u=Math.max(0,Math.min(1,h)),f()):u},e.copy=function(){return Eg(t(),[n,i]).round(l).paddingInner(c).paddingOuter(d).align(u)},Vr.apply(f(),arguments)}function Qj(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Qj(t())},e}function o$(){return Qj(Eg.apply(null,arguments).paddingInner(1))}function Pg(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Jj(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ms(){}var Ka=.7,sc=1/Ka,fo="\\s*([+-]?\\d+)\\s*",qa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",a$=/^#([0-9a-f]{3,8})$/,s$=new RegExp(`^rgb\\(${fo},${fo},${fo}\\)$`),l$=new RegExp(`^rgb\\(${un},${un},${un}\\)$`),c$=new RegExp(`^rgba\\(${fo},${fo},${fo},${qa}\\)$`),u$=new RegExp(`^rgba\\(${un},${un},${un},${qa}\\)$`),d$=new RegExp(`^hsl\\(${qa},${un},${un}\\)$`),f$=new RegExp(`^hsla\\(${qa},${un},${un},${qa}\\)$`),Xx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Pg(ms,Ya,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zx,formatHex:Zx,formatHex8:p$,formatHsl:h$,formatRgb:Qx,toString:Qx});function Zx(){return this.rgb().formatHex()}function p$(){return this.rgb().formatHex8()}function h$(){return e2(this).formatHsl()}function Qx(){return this.rgb().formatRgb()}function Ya(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=a$.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Jx(t):r===3?new cr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?dl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?dl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=s$.exec(e))?new cr(t[1],t[2],t[3],1):(t=l$.exec(e))?new cr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=c$.exec(e))?dl(t[1],t[2],t[3],t[4]):(t=u$.exec(e))?dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=d$.exec(e))?rb(t[1],t[2]/100,t[3]/100,1):(t=f$.exec(e))?rb(t[1],t[2]/100,t[3]/100,t[4]):Xx.hasOwnProperty(e)?Jx(Xx[e]):e==="transparent"?new cr(NaN,NaN,NaN,0):null}function Jx(e){return new cr(e>>16&255,e>>8&255,e&255,1)}function dl(e,t,r,n){return n<=0&&(e=t=r=NaN),new cr(e,t,r,n)}function g$(e){return e instanceof ms||(e=Ya(e)),e?(e=e.rgb(),new cr(e.r,e.g,e.b,e.opacity)):new cr}function oh(e,t,r,n){return arguments.length===1?g$(e):new cr(e,t,r,n??1)}function cr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Pg(cr,oh,Jj(ms,{brighter(e){return e=e==null?sc:Math.pow(sc,e),new cr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ka:Math.pow(Ka,e),new cr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cr(Ni(this.r),Ni(this.g),Ni(this.b),lc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eb,formatHex:eb,formatHex8:m$,formatRgb:tb,toString:tb}));function eb(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}`}function m$(){return`#${Oi(this.r)}${Oi(this.g)}${Oi(this.b)}${Oi((isNaN(this.opacity)?1:this.opacity)*255)}`}function tb(){const e=lc(this.opacity);return`${e===1?"rgb(":"rgba("}${Ni(this.r)}, ${Ni(this.g)}, ${Ni(this.b)}${e===1?")":`, ${e})`}`}function lc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ni(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oi(e){return e=Ni(e),(e<16?"0":"")+e.toString(16)}function rb(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xr(e,t,r,n)}function e2(e){if(e instanceof Xr)return new Xr(e.h,e.s,e.l,e.opacity);if(e instanceof ms||(e=Ya(e)),!e)return new Xr;if(e instanceof Xr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,l=a-i,c=(a+i)/2;return l?(t===a?s=(r-n)/l+(r<n)*6:r===a?s=(n-t)/l+2:s=(t-r)/l+4,l/=c<.5?a+i:2-a-i,s*=60):l=c>0&&c<1?0:s,new Xr(s,l,c,e.opacity)}function v$(e,t,r,n){return arguments.length===1?e2(e):new Xr(e,t,r,n??1)}function Xr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Pg(Xr,v$,Jj(ms,{brighter(e){return e=e==null?sc:Math.pow(sc,e),new Xr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ka:Math.pow(Ka,e),new Xr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new cr(Cf(e>=240?e-240:e+120,i,n),Cf(e,i,n),Cf(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Xr(nb(this.h),fl(this.s),fl(this.l),lc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=lc(this.opacity);return`${e===1?"hsl(":"hsla("}${nb(this.h)}, ${fl(this.s)*100}%, ${fl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nb(e){return e=(e||0)%360,e<0?e+360:e}function fl(e){return Math.max(0,Math.min(1,e||0))}function Cf(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Og=e=>()=>e;function y$(e,t){return function(r){return e+r*t}}function x$(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function b$(e){return(e=+e)==1?t2:function(t,r){return r-t?x$(t,r,e):Og(isNaN(t)?r:t)}}function t2(e,t){var r=t-e;return r?y$(e,r):Og(isNaN(e)?t:e)}const ib=(function e(t){var r=b$(t);function n(i,a){var s=r((i=oh(i)).r,(a=oh(a)).r),l=r(i.g,a.g),c=r(i.b,a.b),d=t2(i.opacity,a.opacity);return function(u){return i.r=s(u),i.g=l(u),i.b=c(u),i.opacity=d(u),i+""}}return n.gamma=e,n})(1);function w$(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function C$(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function S$(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)i[s]=Do(e[s],t[s]);for(;s<r;++s)a[s]=t[s];return function(l){for(s=0;s<n;++s)a[s]=i[s](l);return a}}function j$(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function cc(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function E$(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Do(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var ah=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sf=new RegExp(ah.source,"g");function P$(e){return function(){return e}}function O$(e){return function(t){return e(t)+""}}function k$(e,t){var r=ah.lastIndex=Sf.lastIndex=0,n,i,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(n=ah.exec(e))&&(i=Sf.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:cc(n,i)})),r=Sf.lastIndex;return r<t.length&&(a=t.slice(r),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?O$(c[0].x):P$(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(d);return l.join("")})}function Do(e,t){var r=typeof t,n;return t==null||r==="boolean"?Og(t):(r==="number"?cc:r==="string"?(n=Ya(t))?(t=n,ib):k$:t instanceof Ya?ib:t instanceof Date?j$:C$(t)?w$:Array.isArray(t)?S$:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?E$:cc)(e,t)}function kg(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function T$(e,t){t===void 0&&(t=e,e=Do);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(s){var l=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return a[l](s-l)}}function M$(e){return function(){return e}}function uc(e){return+e}var ob=[0,1];function rr(e){return e}function sh(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:M$(isNaN(t)?NaN:.5)}function R$(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function A$(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i<n?(n=sh(i,n),a=r(s,a)):(n=sh(n,i),a=r(a,s)),function(l){return a(n(l))}}function I$(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)i[s]=sh(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(l){var c=gs(e,l,1,n)-1;return a[c](i[c](l))}}function vs(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function eu(){var e=ob,t=ob,r=Do,n,i,a,s=rr,l,c,d;function u(){var h=Math.min(e.length,t.length);return s!==rr&&(s=R$(e[0],e[h-1])),l=h>2?I$:A$,c=d=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(i((d||(d=l(t,e.map(n),cc)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,uc),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=kg,u()},f.clamp=function(h){return arguments.length?(s=h?!0:rr,u()):s!==rr},f.interpolate=function(h){return arguments.length?(r=h,u()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,g){return n=h,i=g,u()}}function Tg(){return eu()(rr,rr)}function N$(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function dc(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function jo(e){return e=dc(Math.abs(e)),e?e[1]:NaN}function D$(e,t){return function(r,n){for(var i=r.length,a=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),a.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[s=(s+1)%e.length];return a.reverse().join(t)}}function _$(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var B$=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ga(e){if(!(t=B$.exec(e)))throw new Error("invalid format: "+e);var t;return new Mg({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ga.prototype=Mg.prototype;function Mg(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Mg.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function $$(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var r2;function L$(e,t){var r=dc(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(r2=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+dc(e,Math.max(0,t+a-1))[0]}function ab(e,t){var r=dc(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const sb={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:N$,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ab(e*100,t),r:ab,s:L$,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lb(e){return e}var cb=Array.prototype.map,ub=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function z$(e){var t=e.grouping===void 0||e.thousands===void 0?lb:D$(cb.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?lb:_$(cb.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f){f=Ga(f);var h=f.fill,g=f.align,v=f.sign,x=f.symbol,y=f.zero,w=f.width,b=f.comma,j=f.precision,P=f.trim,E=f.type;E==="n"?(b=!0,E="g"):sb[E]||(j===void 0&&(j=12),P=!0,E="g"),(y||h==="0"&&g==="=")&&(y=!0,h="0",g="=");var C=x==="$"?r:x==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",O=x==="$"?n:/[%p]/.test(E)?s:"",k=sb[E],T=/[defgprs%]/.test(E);j=j===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function D(L){var A=C,B=O,z,F,R;if(E==="c")B=k(L)+B,L="";else{L=+L;var N=L<0||1/L<0;if(L=isNaN(L)?c:k(Math.abs(L),j),P&&(L=$$(L)),N&&+L==0&&v!=="+"&&(N=!1),A=(N?v==="("?v:l:v==="-"||v==="("?"":v)+A,B=(E==="s"?ub[8+r2/3]:"")+B+(N&&v==="("?")":""),T){for(z=-1,F=L.length;++z<F;)if(R=L.charCodeAt(z),48>R||R>57){B=(R===46?i+L.slice(z+1):L.slice(z))+B,L=L.slice(0,z);break}}}b&&!y&&(L=t(L,1/0));var I=A.length+L.length+B.length,M=I<w?new Array(w-I+1).join(h):"";switch(b&&y&&(L=t(M+L,M.length?w-B.length:1/0),M=""),g){case"<":L=A+L+B+M;break;case"=":L=A+M+L+B;break;case"^":L=M.slice(0,I=M.length>>1)+A+L+B+M.slice(I);break;default:L=M+A+L+B;break}return a(L)}return D.toString=function(){return f+""},D}function u(f,h){var g=d((f=Ga(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(jo(h)/3)))*3,x=Math.pow(10,-v),y=ub[8+v/3];return function(w){return g(x*w)+y}}return{format:d,formatPrefix:u}}var pl,Rg,n2;F$({thousands:",",grouping:[3],currency:["$",""]});function F$(e){return pl=z$(e),Rg=pl.format,n2=pl.formatPrefix,pl}function V$(e){return Math.max(0,-jo(Math.abs(e)))}function H$(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jo(t)/3)))*3-jo(Math.abs(e)))}function U$(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,jo(t)-jo(e))+1}function i2(e,t,r,n){var i=nh(e,t,r),a;switch(n=Ga(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=H$(i,s))&&(n.precision=a),n2(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=U$(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=V$(i))&&(n.precision=a-(n.type==="%")*2);break}}return Rg(n)}function pi(e){var t=e.domain;return e.ticks=function(r){var n=t();return th(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return i2(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,s=n[i],l=n[a],c,d,u=10;for(l<s&&(d=s,s=l,l=d,d=i,i=a,a=d);u-- >0;){if(d=rh(s,l,r),d===c)return n[i]=s,n[a]=l,t(n);if(d>0)s=Math.floor(s/d)*d,l=Math.ceil(l/d)*d;else if(d<0)s=Math.ceil(s*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function o2(){var e=Tg();return e.copy=function(){return vs(e,o2())},Vr.apply(e,arguments),pi(e)}function a2(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,uc),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return a2(e).unknown(t)},e=arguments.length?Array.from(e,uc):[0,1],pi(r)}function s2(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],s;return a<i&&(s=r,r=n,n=s,s=i,i=a,a=s),e[r]=t.floor(i),e[n]=t.ceil(a),e}function db(e){return Math.log(e)}function fb(e){return Math.exp(e)}function W$(e){return-Math.log(-e)}function K$(e){return-Math.exp(-e)}function q$(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Y$(e){return e===10?q$:e===Math.E?Math.exp:t=>Math.pow(e,t)}function G$(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function pb(e){return(t,r)=>-e(-t,r)}function Ag(e){const t=e(db,fb),r=t.domain;let n=10,i,a;function s(){return i=G$(n),a=Y$(n),r()[0]<0?(i=pb(i),a=pb(a),e(W$,K$)):e(db,fb),t}return t.base=function(l){return arguments.length?(n=+l,s()):n},t.domain=function(l){return arguments.length?(r(l),s()):r()},t.ticks=l=>{const c=r();let d=c[0],u=c[c.length-1];const f=u<d;f&&([d,u]=[u,d]);let h=i(d),g=i(u),v,x;const y=l==null?10:+l;let w=[];if(!(n%1)&&g-h<y){if(h=Math.floor(h),g=Math.ceil(g),d>0){for(;h<=g;++h)for(v=1;v<n;++v)if(x=h<0?v/a(-h):v*a(h),!(x<d)){if(x>u)break;w.push(x)}}else for(;h<=g;++h)for(v=n-1;v>=1;--v)if(x=h>0?v/a(-h):v*a(h),!(x<d)){if(x>u)break;w.push(x)}w.length*2<y&&(w=th(d,u,y))}else w=th(h,g,Math.min(g-h,y)).map(a);return f?w.reverse():w},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Ga(c)).precision==null&&(c.trim=!0),c=Rg(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/a(Math.round(i(u)));return f*n<n-.5&&(f*=n),f<=d?c(u):""}},t.nice=()=>r(s2(r(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function l2(){const e=Ag(eu()).domain([1,10]);return e.copy=()=>vs(e,l2()).base(e.base()),Vr.apply(e,arguments),e}function hb(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gb(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ig(e){var t=1,r=e(hb(t),gb(t));return r.constant=function(n){return arguments.length?e(hb(t=+n),gb(t)):t},pi(r)}function c2(){var e=Ig(eu());return e.copy=function(){return vs(e,c2()).constant(e.constant())},Vr.apply(e,arguments)}function mb(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function X$(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Z$(e){return e<0?-e*e:e*e}function Ng(e){var t=e(rr,rr),r=1;function n(){return r===1?e(rr,rr):r===.5?e(X$,Z$):e(mb(r),mb(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},pi(t)}function Dg(){var e=Ng(eu());return e.copy=function(){return vs(e,Dg()).exponent(e.exponent())},Vr.apply(e,arguments),e}function Q$(){return Dg.apply(null,arguments).exponent(.5)}function vb(e){return Math.sign(e)*e*e}function J$(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function u2(){var e=Tg(),t=[0,1],r=!1,n;function i(a){var s=J$(e(a));return isNaN(s)?n:r?Math.round(s):s}return i.invert=function(a){return e.invert(vb(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,uc)).map(vb)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return u2(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Vr.apply(i,arguments),pi(i)}function d2(){var e=[],t=[],r=[],n;function i(){var s=0,l=Math.max(1,t.length);for(r=new Array(l-1);++s<l;)r[s-1]=n$(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?n:t[gs(r,s)]}return a.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(si),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(n=s,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return d2().domain(e).range(t).unknown(n)},Vr.apply(a,arguments)}function f2(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[gs(n,c,0,r)]:a}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var d=i.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,n[0]]:d>=r?[n[r-1],t]:[n[d-1],n[d]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return f2().domain([e,t]).range(i).unknown(a)},Vr.apply(pi(s),arguments)}function p2(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[gs(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return p2().domain(e).range(t).unknown(r)},Vr.apply(i,arguments)}const jf=new Date,Ef=new Date;function At(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),l=i.ceil(a);return a-s<l-a?s:l},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<s)||!(l>0))return c;let d;do c.push(d=new Date(+a)),t(a,l),e(a);while(d<a&&a<s);return c},i.filter=a=>At(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!a(s););else for(;--l>=0;)for(;t(s,1),!a(s););}),r&&(i.count=(a,s)=>(jf.setTime(+a),Ef.setTime(+s),e(jf),e(Ef),Math.floor(r(jf,Ef))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const lh=At(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);lh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?At(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):lh);const En=1e3,Ir=En*60,Pn=Ir*60,In=Pn*24,_g=In*7,yb=In*30,Pf=In*365,so=At(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*En)},(e,t)=>(t-e)/En,e=>e.getUTCSeconds()),h2=At(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*En)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getMinutes()),g2=At(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ir)},(e,t)=>(t-e)/Ir,e=>e.getUTCMinutes()),m2=At(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*En-e.getMinutes()*Ir)},(e,t)=>{e.setTime(+e+t*Pn)},(e,t)=>(t-e)/Pn,e=>e.getHours()),v2=At(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Pn)},(e,t)=>(t-e)/Pn,e=>e.getUTCHours()),tu=At(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ir)/In,e=>e.getDate()-1),Bg=At(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/In,e=>e.getUTCDate()-1),e4=At(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/In,e=>Math.floor(e/In));function Ki(e){return At(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Ir)/_g)}const $g=Ki(0),ch=Ki(1);Ki(2);Ki(3);const Xa=Ki(4);Ki(5);Ki(6);function qi(e){return At(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/_g)}const Lg=qi(0),uh=qi(1);qi(2);qi(3);const Za=qi(4);qi(5);qi(6);const y2=At(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth()),x2=At(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth()),li=At(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());li.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:At(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});const ci=At(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ci.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:At(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});function b2(e,t,r,n,i,a){const s=[[so,1,En],[so,5,5*En],[so,15,15*En],[so,30,30*En],[a,1,Ir],[a,5,5*Ir],[a,15,15*Ir],[a,30,30*Ir],[i,1,Pn],[i,3,3*Pn],[i,6,6*Pn],[i,12,12*Pn],[n,1,In],[n,2,2*In],[r,1,_g],[t,1,yb],[t,3,3*yb],[e,1,Pf]];function l(d,u,f){const h=u<d;h&&([d,u]=[u,d]);const g=f&&typeof f.range=="function"?f:c(d,u,f),v=g?g.range(d,+u+1):[];return h?v.reverse():v}function c(d,u,f){const h=Math.abs(u-d)/f,g=Sg(([,,y])=>y).right(s,h);if(g===s.length)return e.every(nh(d/Pf,u/Pf,f));if(g===0)return lh.every(Math.max(nh(d,u,f),1));const[v,x]=s[h/s[g-1][2]<s[g][2]/h?g-1:g];return v.every(x)}return[l,c]}const[t4,r4]=b2(ci,x2,Lg,e4,v2,g2),[n4,i4]=b2(li,y2,$g,tu,m2,h2);function Of(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function kf(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ga(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function o4(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,d=ma(i),u=va(i),f=ma(a),h=va(a),g=ma(s),v=va(s),x=ma(l),y=va(l),w=ma(c),b=va(c),j={a:N,A:I,b:M,B:W,c:null,d:jb,e:jb,f:k4,g:$4,G:z4,H:E4,I:P4,j:O4,L:w2,m:T4,M:M4,p:$,q:H,Q:Ob,s:kb,S:R4,u:A4,U:I4,V:N4,w:D4,W:_4,x:null,X:null,y:B4,Y:L4,Z:F4,"%":Pb},P={a:X,A:ue,b:fe,B:me,c:null,d:Eb,e:Eb,f:W4,g:t8,G:n8,H:V4,I:H4,j:U4,L:S2,m:K4,M:q4,p:Pe,q:Ee,Q:Ob,s:kb,S:Y4,u:G4,U:X4,V:Z4,w:Q4,W:J4,x:null,X:null,y:e8,Y:r8,Z:i8,"%":Pb},E={a:D,A:L,b:A,B,c:z,d:Cb,e:Cb,f:w4,g:wb,G:bb,H:Sb,I:Sb,j:v4,L:b4,m:m4,M:y4,p:T,q:g4,Q:S4,s:j4,S:x4,u:u4,U:d4,V:f4,w:c4,W:p4,x:F,X:R,y:wb,Y:bb,Z:h4,"%":C4};j.x=C(r,j),j.X=C(n,j),j.c=C(t,j),P.x=C(r,P),P.X=C(n,P),P.c=C(t,P);function C(J,ye){return function(ge){var V=[],oe=-1,K=0,ce=J.length,he,we,Se;for(ge instanceof Date||(ge=new Date(+ge));++oe<ce;)J.charCodeAt(oe)===37&&(V.push(J.slice(K,oe)),(we=xb[he=J.charAt(++oe)])!=null?he=J.charAt(++oe):we=he==="e"?" ":"0",(Se=ye[he])&&(he=Se(ge,we)),V.push(he),K=oe+1);return V.push(J.slice(K,oe)),V.join("")}}function O(J,ye){return function(ge){var V=ga(1900,void 0,1),oe=k(V,J,ge+="",0),K,ce;if(oe!=ge.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(ye&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(K=kf(ga(V.y,0,1)),ce=K.getUTCDay(),K=ce>4||ce===0?uh.ceil(K):uh(K),K=Bg.offset(K,(V.V-1)*7),V.y=K.getUTCFullYear(),V.m=K.getUTCMonth(),V.d=K.getUTCDate()+(V.w+6)%7):(K=Of(ga(V.y,0,1)),ce=K.getDay(),K=ce>4||ce===0?ch.ceil(K):ch(K),K=tu.offset(K,(V.V-1)*7),V.y=K.getFullYear(),V.m=K.getMonth(),V.d=K.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),ce="Z"in V?kf(ga(V.y,0,1)).getUTCDay():Of(ga(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(ce+5)%7:V.w+V.U*7-(ce+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,kf(V)):Of(V)}}function k(J,ye,ge,V){for(var oe=0,K=ye.length,ce=ge.length,he,we;oe<K;){if(V>=ce)return-1;if(he=ye.charCodeAt(oe++),he===37){if(he=ye.charAt(oe++),we=E[he in xb?ye.charAt(oe++):he],!we||(V=we(J,ge,V))<0)return-1}else if(he!=ge.charCodeAt(V++))return-1}return V}function T(J,ye,ge){var V=d.exec(ye.slice(ge));return V?(J.p=u.get(V[0].toLowerCase()),ge+V[0].length):-1}function D(J,ye,ge){var V=g.exec(ye.slice(ge));return V?(J.w=v.get(V[0].toLowerCase()),ge+V[0].length):-1}function L(J,ye,ge){var V=f.exec(ye.slice(ge));return V?(J.w=h.get(V[0].toLowerCase()),ge+V[0].length):-1}function A(J,ye,ge){var V=w.exec(ye.slice(ge));return V?(J.m=b.get(V[0].toLowerCase()),ge+V[0].length):-1}function B(J,ye,ge){var V=x.exec(ye.slice(ge));return V?(J.m=y.get(V[0].toLowerCase()),ge+V[0].length):-1}function z(J,ye,ge){return k(J,t,ye,ge)}function F(J,ye,ge){return k(J,r,ye,ge)}function R(J,ye,ge){return k(J,n,ye,ge)}function N(J){return s[J.getDay()]}function I(J){return a[J.getDay()]}function M(J){return c[J.getMonth()]}function W(J){return l[J.getMonth()]}function $(J){return i[+(J.getHours()>=12)]}function H(J){return 1+~~(J.getMonth()/3)}function X(J){return s[J.getUTCDay()]}function ue(J){return a[J.getUTCDay()]}function fe(J){return c[J.getUTCMonth()]}function me(J){return l[J.getUTCMonth()]}function Pe(J){return i[+(J.getUTCHours()>=12)]}function Ee(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var ye=C(J+="",j);return ye.toString=function(){return J},ye},parse:function(J){var ye=O(J+="",!1);return ye.toString=function(){return J},ye},utcFormat:function(J){var ye=C(J+="",P);return ye.toString=function(){return J},ye},utcParse:function(J){var ye=O(J+="",!0);return ye.toString=function(){return J},ye}}}var xb={"-":"",_:" ",0:"0"},Vt=/^\s*\d+/,a4=/^%/,s4=/[\\^$*+?|[\]().{}]/g;function Ue(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function l4(e){return e.replace(s4,"\\$&")}function ma(e){return new RegExp("^(?:"+e.map(l4).join("|")+")","i")}function va(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function c4(e,t,r){var n=Vt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function u4(e,t,r){var n=Vt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function d4(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function f4(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function p4(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function bb(e,t,r){var n=Vt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function wb(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function h4(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function g4(e,t,r){var n=Vt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function m4(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Cb(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function v4(e,t,r){var n=Vt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Sb(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function y4(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function x4(e,t,r){var n=Vt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function b4(e,t,r){var n=Vt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function w4(e,t,r){var n=Vt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function C4(e,t,r){var n=a4.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function S4(e,t,r){var n=Vt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function j4(e,t,r){var n=Vt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function jb(e,t){return Ue(e.getDate(),t,2)}function E4(e,t){return Ue(e.getHours(),t,2)}function P4(e,t){return Ue(e.getHours()%12||12,t,2)}function O4(e,t){return Ue(1+tu.count(li(e),e),t,3)}function w2(e,t){return Ue(e.getMilliseconds(),t,3)}function k4(e,t){return w2(e,t)+"000"}function T4(e,t){return Ue(e.getMonth()+1,t,2)}function M4(e,t){return Ue(e.getMinutes(),t,2)}function R4(e,t){return Ue(e.getSeconds(),t,2)}function A4(e){var t=e.getDay();return t===0?7:t}function I4(e,t){return Ue($g.count(li(e)-1,e),t,2)}function C2(e){var t=e.getDay();return t>=4||t===0?Xa(e):Xa.ceil(e)}function N4(e,t){return e=C2(e),Ue(Xa.count(li(e),e)+(li(e).getDay()===4),t,2)}function D4(e){return e.getDay()}function _4(e,t){return Ue(ch.count(li(e)-1,e),t,2)}function B4(e,t){return Ue(e.getFullYear()%100,t,2)}function $4(e,t){return e=C2(e),Ue(e.getFullYear()%100,t,2)}function L4(e,t){return Ue(e.getFullYear()%1e4,t,4)}function z4(e,t){var r=e.getDay();return e=r>=4||r===0?Xa(e):Xa.ceil(e),Ue(e.getFullYear()%1e4,t,4)}function F4(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ue(t/60|0,"0",2)+Ue(t%60,"0",2)}function Eb(e,t){return Ue(e.getUTCDate(),t,2)}function V4(e,t){return Ue(e.getUTCHours(),t,2)}function H4(e,t){return Ue(e.getUTCHours()%12||12,t,2)}function U4(e,t){return Ue(1+Bg.count(ci(e),e),t,3)}function S2(e,t){return Ue(e.getUTCMilliseconds(),t,3)}function W4(e,t){return S2(e,t)+"000"}function K4(e,t){return Ue(e.getUTCMonth()+1,t,2)}function q4(e,t){return Ue(e.getUTCMinutes(),t,2)}function Y4(e,t){return Ue(e.getUTCSeconds(),t,2)}function G4(e){var t=e.getUTCDay();return t===0?7:t}function X4(e,t){return Ue(Lg.count(ci(e)-1,e),t,2)}function j2(e){var t=e.getUTCDay();return t>=4||t===0?Za(e):Za.ceil(e)}function Z4(e,t){return e=j2(e),Ue(Za.count(ci(e),e)+(ci(e).getUTCDay()===4),t,2)}function Q4(e){return e.getUTCDay()}function J4(e,t){return Ue(uh.count(ci(e)-1,e),t,2)}function e8(e,t){return Ue(e.getUTCFullYear()%100,t,2)}function t8(e,t){return e=j2(e),Ue(e.getUTCFullYear()%100,t,2)}function r8(e,t){return Ue(e.getUTCFullYear()%1e4,t,4)}function n8(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Za(e):Za.ceil(e),Ue(e.getUTCFullYear()%1e4,t,4)}function i8(){return"+0000"}function Pb(){return"%"}function Ob(e){return+e}function kb(e){return Math.floor(+e/1e3)}var hl,E2,P2;o8({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function o8(e){return hl=o4(e),E2=hl.format,P2=hl.utcFormat,hl}function a8(e){return new Date(e)}function s8(e){return e instanceof Date?+e:+new Date(+e)}function zg(e,t,r,n,i,a,s,l,c,d){var u=Tg(),f=u.invert,h=u.domain,g=d(".%L"),v=d(":%S"),x=d("%I:%M"),y=d("%I %p"),w=d("%a %d"),b=d("%b %d"),j=d("%B"),P=d("%Y");function E(C){return(c(C)<C?g:l(C)<C?v:s(C)<C?x:a(C)<C?y:n(C)<C?i(C)<C?w:b:r(C)<C?j:P)(C)}return u.invert=function(C){return new Date(f(C))},u.domain=function(C){return arguments.length?h(Array.from(C,s8)):h().map(a8)},u.ticks=function(C){var O=h();return e(O[0],O[O.length-1],C??10)},u.tickFormat=function(C,O){return O==null?E:d(O)},u.nice=function(C){var O=h();return(!C||typeof C.range!="function")&&(C=t(O[0],O[O.length-1],C??10)),C?h(s2(O,C)):u},u.copy=function(){return vs(u,zg(e,t,r,n,i,a,s,l,c,d))},u}function l8(){return Vr.apply(zg(n4,i4,li,y2,$g,tu,m2,h2,so,E2).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function c8(){return Vr.apply(zg(t4,r4,ci,x2,Lg,Bg,v2,g2,so,P2).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ru(){var e=0,t=1,r,n,i,a,s=rr,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:s(i===0?.5:(f=(a(f)-r)*i,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),d):[e,t]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(s=f,d):s};function u(f){return function(h){var g,v;return arguments.length?([g,v]=h,s=f(g,v),d):[s(0),s(1)]}}return d.range=u(Do),d.rangeRound=u(kg),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return a=f,r=f(e),n=f(t),i=r===n?0:1/(n-r),d}}function hi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function O2(){var e=pi(ru()(rr));return e.copy=function(){return hi(e,O2())},Ln.apply(e,arguments)}function k2(){var e=Ag(ru()).domain([1,10]);return e.copy=function(){return hi(e,k2()).base(e.base())},Ln.apply(e,arguments)}function T2(){var e=Ig(ru());return e.copy=function(){return hi(e,T2()).constant(e.constant())},Ln.apply(e,arguments)}function Fg(){var e=Ng(ru());return e.copy=function(){return hi(e,Fg()).exponent(e.exponent())},Ln.apply(e,arguments)}function u8(){return Fg.apply(null,arguments).exponent(.5)}function M2(){var e=[],t=rr;function r(n){if(n!=null&&!isNaN(n=+n))return t((gs(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(si),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>r$(e,a/n))},r.copy=function(){return M2(t).domain(e)},Ln.apply(r,arguments)}function nu(){var e=0,t=.5,r=1,n=1,i,a,s,l,c,d=rr,u,f=!1,h;function g(x){return isNaN(x=+x)?h:(x=.5+((x=+u(x))-a)*(n*x<n*a?l:c),d(f?Math.max(0,Math.min(1,x)):x))}g.domain=function(x){return arguments.length?([e,t,r]=x,i=u(e=+e),a=u(t=+t),s=u(r=+r),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),n=a<i?-1:1,g):[e,t,r]},g.clamp=function(x){return arguments.length?(f=!!x,g):f},g.interpolator=function(x){return arguments.length?(d=x,g):d};function v(x){return function(y){var w,b,j;return arguments.length?([w,b,j]=y,d=T$(x,[w,b,j]),g):[d(0),d(.5),d(1)]}}return g.range=v(Do),g.rangeRound=v(kg),g.unknown=function(x){return arguments.length?(h=x,g):h},function(x){return u=x,i=x(e),a=x(t),s=x(r),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),n=a<i?-1:1,g}}function R2(){var e=pi(nu()(rr));return e.copy=function(){return hi(e,R2())},Ln.apply(e,arguments)}function A2(){var e=Ag(nu()).domain([.1,1,10]);return e.copy=function(){return hi(e,A2()).base(e.base())},Ln.apply(e,arguments)}function I2(){var e=Ig(nu());return e.copy=function(){return hi(e,I2()).constant(e.constant())},Ln.apply(e,arguments)}function Vg(){var e=Ng(nu());return e.copy=function(){return hi(e,Vg()).exponent(e.exponent())},Ln.apply(e,arguments)}function d8(){return Vg.apply(null,arguments).exponent(.5)}const ba=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Eg,scaleDiverging:R2,scaleDivergingLog:A2,scaleDivergingPow:Vg,scaleDivergingSqrt:d8,scaleDivergingSymlog:I2,scaleIdentity:a2,scaleImplicit:ih,scaleLinear:o2,scaleLog:l2,scaleOrdinal:jg,scalePoint:o$,scalePow:Dg,scaleQuantile:d2,scaleQuantize:f2,scaleRadial:u2,scaleSequential:O2,scaleSequentialLog:k2,scaleSequentialPow:Fg,scaleSequentialQuantile:M2,scaleSequentialSqrt:u8,scaleSequentialSymlog:T2,scaleSqrt:Q$,scaleSymlog:c2,scaleThreshold:p2,scaleTime:l8,scaleUtc:c8,tickFormat:i2},Symbol.toStringTag,{value:"Module"}));var gi=e=>e.chartData,Hg=ee([gi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Ug=(e,t,r,n)=>n?Hg(e):gi(e);function Li(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Qt(t)&&Qt(r))return!0}return!1}function Tb(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function N2(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,i,a;if(Qt(r))i=r;else if(typeof r=="function")return;if(Qt(n))a=n;else if(typeof n=="function")return;var s=[i,a];if(Li(s))return s}}function f8(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(Li(n))return Tb(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,s,l;if(i==="auto")t!=null&&(s=Math.min(...t));else if(Ae(i))s=i;else if(typeof i=="function")try{t!=null&&(s=i(t?.[0]))}catch{}else if(typeof i=="string"&&fx.test(i)){var c=fx.exec(i);if(c==null||t==null)s=void 0;else{var d=+c[1];s=t[0]-d}}else s=t?.[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(Ae(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t?.[1]))}catch{}else if(typeof a=="string"&&px.test(a)){var u=px.exec(a);if(u==null||t==null)l=void 0;else{var f=+u[1];l=t[1]+f}}else l=t?.[1];var h=[s,l];if(Li(h))return t==null?h:Tb(h,t,r)}}}var _o=1e9,p8={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Kg,ut=!0,$r="[DecimalError] ",Di=$r+"Invalid argument: ",Wg=$r+"Exponent out of range: ",Bo=Math.floor,ji=Math.pow,h8=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,xr,$t=1e7,ot=7,D2=9007199254740991,fc=Bo(D2/ot),Oe={};Oe.absoluteValue=Oe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Oe.comparedTo=Oe.cmp=function(e){var t,r,n,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};Oe.decimalPlaces=Oe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ot;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Oe.dividedBy=Oe.div=function(e){return Tn(this,new this.constructor(e))};Oe.dividedToIntegerBy=Oe.idiv=function(e){var t=this,r=t.constructor;return rt(Tn(t,new r(e),0,1),r.precision)};Oe.equals=Oe.eq=function(e){return!this.cmp(e)};Oe.exponent=function(){return Et(this)};Oe.greaterThan=Oe.gt=function(e){return this.cmp(e)>0};Oe.greaterThanOrEqualTo=Oe.gte=function(e){return this.cmp(e)>=0};Oe.isInteger=Oe.isint=function(){return this.e>this.d.length-2};Oe.isNegative=Oe.isneg=function(){return this.s<0};Oe.isPositive=Oe.ispos=function(){return this.s>0};Oe.isZero=function(){return this.s===0};Oe.lessThan=Oe.lt=function(e){return this.cmp(e)<0};Oe.lessThanOrEqualTo=Oe.lte=function(e){return this.cmp(e)<1};Oe.logarithm=Oe.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(xr))throw Error($r+"NaN");if(r.s<1)throw Error($r+(r.s?"NaN":"-Infinity"));return r.eq(xr)?new n(0):(ut=!1,t=Tn(Qa(r,a),Qa(e,a),a),ut=!0,rt(t,i))};Oe.minus=Oe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?$2(t,e):_2(t,(e.s=-e.s,e))};Oe.modulo=Oe.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error($r+"NaN");return r.s?(ut=!1,t=Tn(r,e,0,1).times(e),ut=!0,r.minus(t)):rt(new n(r),i)};Oe.naturalExponential=Oe.exp=function(){return B2(this)};Oe.naturalLogarithm=Oe.ln=function(){return Qa(this)};Oe.negated=Oe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Oe.plus=Oe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_2(t,e):$2(t,(e.s=-e.s,e))};Oe.precision=Oe.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Di+e);if(t=Et(i)+1,n=i.d.length-1,r=n*ot+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Oe.squareRoot=Oe.sqrt=function(){var e,t,r,n,i,a,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error($r+"NaN")}for(e=Et(l),ut=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=ln(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Bo((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(i.toString()),r=c.precision,i=s=r+3;;)if(a=n,n=a.plus(Tn(l,a,s+2)).times(.5),ln(a.d).slice(0,s)===(t=ln(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(rt(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;s+=4}return ut=!0,rt(n,r)};Oe.times=Oe.mul=function(e){var t,r,n,i,a,s,l,c,d,u=this,f=u.constructor,h=u.d,g=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,c=h.length,d=g.length,c<d&&(a=h,h=g,g=a,s=c,c=d,d=s),a=[],s=c+d,n=s;n--;)a.push(0);for(n=d;--n>=0;){for(t=0,i=c+n;i>n;)l=a[i]+g[n]*h[i-n-1]+t,a[i--]=l%$t|0,t=l/$t|0;a[i]=(a[i]+t)%$t|0}for(;!a[--s];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,ut?rt(e,f.precision):e};Oe.toDecimalPlaces=Oe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(gn(e,0,_o),t===void 0?t=n.rounding:gn(t,0,8),rt(r,e+Et(r)+1,t))};Oe.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=zi(n,!0):(gn(e,0,_o),t===void 0?t=i.rounding:gn(t,0,8),n=rt(new i(n),e+1,t),r=zi(n,!0,e+1)),r};Oe.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?zi(i):(gn(e,0,_o),t===void 0?t=a.rounding:gn(t,0,8),n=rt(new a(i),e+Et(i)+1,t),r=zi(n.abs(),!1,e+Et(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Oe.toInteger=Oe.toint=function(){var e=this,t=e.constructor;return rt(new t(e),Et(e)+1,t.rounding)};Oe.toNumber=function(){return+this};Oe.toPower=Oe.pow=function(e){var t,r,n,i,a,s,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(xr);if(l=new c(l),!l.s){if(e.s<1)throw Error($r+"Infinity");return l}if(l.eq(xr))return l;if(n=c.precision,e.eq(xr))return rt(l,n);if(t=e.e,r=e.d.length-1,s=t>=r,a=l.s,s){if((r=u<0?-u:u)<=D2){for(i=new c(xr),t=Math.ceil(n/ot+4),ut=!1;r%2&&(i=i.times(l),Rb(i.d,t)),r=Bo(r/2),r!==0;)l=l.times(l),Rb(l.d,t);return ut=!0,e.s<0?new c(xr).div(i):rt(i,n)}}else if(a<0)throw Error($r+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,ut=!1,i=e.times(Qa(l,n+d)),ut=!0,i=B2(i),i.s=a,i};Oe.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=Et(i),n=zi(i,r<=a.toExpNeg||r>=a.toExpPos)):(gn(e,1,_o),t===void 0?t=a.rounding:gn(t,0,8),i=rt(new a(i),e,t),r=Et(i),n=zi(i,e<=r||r<=a.toExpNeg,e)),n};Oe.toSignificantDigits=Oe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(gn(e,1,_o),t===void 0?t=n.rounding:gn(t,0,8)),rt(new n(r),e,t)};Oe.toString=Oe.valueOf=Oe.val=Oe.toJSON=Oe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Et(e),r=e.constructor;return zi(e,t<=r.toExpNeg||t>=r.toExpPos)};function _2(e,t){var r,n,i,a,s,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),ut?rt(t,f):t;if(c=e.d,d=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(n=c,a=-a,l=d.length):(n=d,i=s,l=c.length),s=Math.ceil(f/ot),l=s>l?s+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=c.length,a=d.length,l-a<0&&(a=l,n=d,d=c,c=n),r=0;a;)r=(c[--a]=c[a]+d[a]+r)/$t|0,c[a]%=$t;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,ut?rt(t,f):t}function gn(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Di+e)}function ln(e){var t,r,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)n=e[t]+"",r=ot-n.length,r&&(a+=ti(r)),a+=n;s=e[t],n=s+"",r=ot-n.length,r&&(a+=ti(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var Tn=(function(){function e(n,i){var a,s=0,l=n.length;for(n=n.slice();l--;)a=n[l]*i+s,n[l]=a%$t|0,s=a/$t|0;return s&&n.unshift(s),n}function t(n,i,a,s){var l,c;if(a!=s)c=a>s?1:-1;else for(l=c=0;l<a;l++)if(n[l]!=i[l]){c=n[l]>i[l]?1:-1;break}return c}function r(n,i,a){for(var s=0;a--;)n[a]-=s,s=n[a]<i[a]?1:0,n[a]=s*$t+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,s){var l,c,d,u,f,h,g,v,x,y,w,b,j,P,E,C,O,k,T=n.constructor,D=n.s==i.s?1:-1,L=n.d,A=i.d;if(!n.s)return new T(n);if(!i.s)throw Error($r+"Division by zero");for(c=n.e-i.e,O=A.length,E=L.length,g=new T(D),v=g.d=[],d=0;A[d]==(L[d]||0);)++d;if(A[d]>(L[d]||0)&&--c,a==null?b=a=T.precision:s?b=a+(Et(n)-Et(i))+1:b=a,b<0)return new T(0);if(b=b/ot+2|0,d=0,O==1)for(u=0,A=A[0],b++;(d<E||u)&&b--;d++)j=u*$t+(L[d]||0),v[d]=j/A|0,u=j%A|0;else{for(u=$t/(A[0]+1)|0,u>1&&(A=e(A,u),L=e(L,u),O=A.length,E=L.length),P=O,x=L.slice(0,O),y=x.length;y<O;)x[y++]=0;k=A.slice(),k.unshift(0),C=A[0],A[1]>=$t/2&&++C;do u=0,l=t(A,x,O,y),l<0?(w=x[0],O!=y&&(w=w*$t+(x[1]||0)),u=w/C|0,u>1?(u>=$t&&(u=$t-1),f=e(A,u),h=f.length,y=x.length,l=t(f,x,h,y),l==1&&(u--,r(f,O<h?k:A,h))):(u==0&&(l=u=1),f=A.slice()),h=f.length,h<y&&f.unshift(0),r(x,f,y),l==-1&&(y=x.length,l=t(A,x,O,y),l<1&&(u++,r(x,O<y?k:A,y))),y=x.length):l===0&&(u++,x=[0]),v[d++]=u,l&&x[0]?x[y++]=L[P]||0:(x=[L[P]],y=1);while((P++<E||x[0]!==void 0)&&b--)}return v[0]||v.shift(),g.e=c,rt(g,s?a+Et(g)+1:a)}})();function B2(e,t){var r,n,i,a,s,l,c=0,d=0,u=e.constructor,f=u.precision;if(Et(e)>16)throw Error(Wg+Et(e));if(!e.s)return new u(xr);for(ut=!1,l=f,s=new u(.03125);e.abs().gte(.1);)e=e.times(s),d+=5;for(n=Math.log(ji(2,d))/Math.LN10*2+5|0,l+=n,r=i=a=new u(xr),u.precision=l;;){if(i=rt(i.times(e),l),r=r.times(++c),s=a.plus(Tn(i,r,l)),ln(s.d).slice(0,l)===ln(a.d).slice(0,l)){for(;d--;)a=rt(a.times(a),l);return u.precision=f,t==null?(ut=!0,rt(a,f)):a}a=s}}function Et(e){for(var t=e.e*ot,r=e.d[0];r>=10;r/=10)t++;return t}function Tf(e,t,r){if(t>e.LN10.sd())throw ut=!0,r&&(e.precision=r),Error($r+"LN10 precision limit exceeded");return rt(new e(e.LN10),t)}function ti(e){for(var t="";e--;)t+="0";return t}function Qa(e,t){var r,n,i,a,s,l,c,d,u,f=1,h=10,g=e,v=g.d,x=g.constructor,y=x.precision;if(g.s<1)throw Error($r+(g.s?"NaN":"-Infinity"));if(g.eq(xr))return new x(0);if(t==null?(ut=!1,d=y):d=t,g.eq(10))return t==null&&(ut=!0),Tf(x,d);if(d+=h,x.precision=d,r=ln(v),n=r.charAt(0),a=Et(g),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=ln(g.d),n=r.charAt(0),f++;a=Et(g),n>1?(g=new x("0."+r),a++):g=new x(n+"."+r.slice(1))}else return c=Tf(x,d+2,y).times(a+""),g=Qa(new x(n+"."+r.slice(1)),d-h).plus(c),x.precision=y,t==null?(ut=!0,rt(g,y)):g;for(l=s=g=Tn(g.minus(xr),g.plus(xr),d),u=rt(g.times(g),d),i=3;;){if(s=rt(s.times(u),d),c=l.plus(Tn(s,new x(i),d)),ln(c.d).slice(0,d)===ln(l.d).slice(0,d))return l=l.times(2),a!==0&&(l=l.plus(Tf(x,d+2,y).times(a+""))),l=Tn(l,new x(f),d),x.precision=y,t==null?(ut=!0,rt(l,y)):l;l=c,i+=2}}function Mb(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Bo(r/ot),e.d=[],n=(r+1)%ot,r<0&&(n+=ot),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=ot;n<i;)e.d.push(+t.slice(n,n+=ot));t=t.slice(n),n=ot-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),ut&&(e.e>fc||e.e<-fc))throw Error(Wg+r)}else e.s=0,e.e=0,e.d=[0];return e}function rt(e,t,r){var n,i,a,s,l,c,d,u,f=e.d;for(s=1,a=f[0];a>=10;a/=10)s++;if(n=t-s,n<0)n+=ot,i=t,d=f[u=0];else{if(u=Math.ceil((n+1)/ot),a=f.length,u>=a)return e;for(d=a=f[u],s=1;a>=10;a/=10)s++;n%=ot,i=n-ot+s}if(r!==void 0&&(a=ji(10,s-i-1),l=d/a%10|0,c=t<0||f[u+1]!==void 0||d%a,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?d/ji(10,s-i):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=Et(e),f.length=1,t=t-a-1,f[0]=ji(10,(ot-t%ot)%ot),e.e=Bo(-t/ot)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,a=1,u--):(f.length=u+1,a=ji(10,ot-n),f[u]=i>0?(d/ji(10,s-i)%ji(10,i)|0)*a:0),c)for(;;)if(u==0){(f[0]+=a)==$t&&(f[0]=1,++e.e);break}else{if(f[u]+=a,f[u]!=$t)break;f[u--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(ut&&(e.e>fc||e.e<-fc))throw Error(Wg+Et(e));return e}function $2(e,t){var r,n,i,a,s,l,c,d,u,f,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),ut?rt(t,g):t;if(c=e.d,f=t.d,n=t.e,d=e.e,c=c.slice(),s=d-n,s){for(u=s<0,u?(r=c,s=-s,l=f.length):(r=f,n=d,l=c.length),i=Math.max(Math.ceil(g/ot),l)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=f.length,u=i<l,u&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){u=c[i]<f[i];break}s=0}for(u&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>s;){if(c[--i]<f[i]){for(a=i;a&&c[--a]===0;)c[a]=$t-1;--c[a],c[i]+=$t}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,ut?rt(t,g):t):new h(0)}function zi(e,t,r){var n,i=Et(e),a=ln(e.d),s=a.length;return t?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+ti(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ti(-i-1)+a,r&&(n=r-s)>0&&(a+=ti(n))):i>=s?(a+=ti(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+ti(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=ti(n))),e.s<0?"-"+a:a}function Rb(e,t){if(e.length>t)return e.length=t,!0}function L2(e){var t,r,n;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Di+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return Mb(s,a.toString())}else if(typeof a!="string")throw Error(Di+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,h8.test(a))Mb(s,a);else throw Error(Di+a)}if(i.prototype=Oe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=L2,i.config=i.set=g8,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function g8(e){if(!e||typeof e!="object")throw Error($r+"Object expected");var t,r,n,i=["precision",1,_o,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(Bo(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Di+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Di+r+": "+n);return this}var Kg=L2(p8);xr=new Kg(1);const Ze=Kg;var m8=e=>e,z2={},F2=e=>e===z2,Ab=e=>function t(){return arguments.length===0||arguments.length===1&&F2(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},V2=(e,t)=>e===1?t:Ab(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.filter(s=>s!==z2).length;return a>=e?t(...n):V2(e-a,Ab(function(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];var d=n.map(u=>F2(u)?l.shift():u);return t(...d,...l)}))}),v8=e=>V2(e.length,e),dh=(e,t)=>{for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},y8=v8((e,t)=>Array.isArray(t)?t.map(e):Object.keys(t).map(r=>t[r]).map(e)),x8=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return m8;var i=r.reverse(),a=i[0],s=i.slice(1);return function(){return s.reduce((l,c)=>c(l),a(...arguments))}},fh=e=>Array.isArray(e)?e.reverse():e.split("").reverse().join(""),H2=e=>{var t=null,r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return t&&i.every((s,l)=>{var c;return s===((c=t)===null||c===void 0?void 0:c[l])})||(t=i,r=e(...i)),r}};function U2(e){var t;return e===0?t=1:t=Math.floor(new Ze(e).abs().log(10).toNumber())+1,t}function W2(e,t,r){for(var n=new Ze(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var K2=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},q2=(e,t,r)=>{if(e.lte(0))return new Ze(0);var n=U2(e.toNumber()),i=new Ze(10).pow(n),a=e.div(i),s=n!==1?.05:.1,l=new Ze(Math.ceil(a.div(s).toNumber())).add(r).mul(s),c=l.mul(i);return t?new Ze(c.toNumber()):new Ze(Math.ceil(c.toNumber()))},b8=(e,t,r)=>{var n=new Ze(1),i=new Ze(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Ze(10).pow(U2(e)-1),i=new Ze(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Ze(Math.floor(e)))}else e===0?i=new Ze(Math.floor((t-1)/2)):r||(i=new Ze(Math.floor(e)));var s=Math.floor((t-1)/2),l=x8(y8(c=>i.add(new Ze(c-s).mul(n)).toNumber()),dh);return l(0,t)},Y2=function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new Ze(0),tickMin:new Ze(0),tickMax:new Ze(0)};var s=q2(new Ze(r).sub(t).div(n-1),i,a),l;t<=0&&r>=0?l=new Ze(0):(l=new Ze(t).add(r).div(2),l=l.sub(new Ze(l).mod(s)));var c=Math.ceil(l.sub(t).div(s).toNumber()),d=Math.ceil(new Ze(r).sub(l).div(s).toNumber()),u=c+d+1;return u>n?Y2(t,r,n,i,a+1):(u<n&&(d=r>0?d+(n-u):d,c=r>0?c:c+(n-u)),{step:s,tickMin:l.sub(new Ze(c).mul(s)),tickMax:l.add(new Ze(d).mul(s))})};function w8(e){var[t,r]=e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(n,2),[s,l]=K2([t,r]);if(s===-1/0||l===1/0){var c=l===1/0?[s,...dh(0,n-1).map(()=>1/0)]:[...dh(0,n-1).map(()=>-1/0),l];return t>r?fh(c):c}if(s===l)return b8(s,n,i);var{step:d,tickMin:u,tickMax:f}=Y2(s,l,a,i,0),h=W2(u,f.add(new Ze(.1).mul(d)),d);return t>r?fh(h):h}function C8(e,t){var[r,n]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[a,s]=K2([r,n]);if(a===-1/0||s===1/0)return[r,n];if(a===s)return[a];var l=Math.max(t,2),c=q2(new Ze(s).sub(a).div(l-1),i,0),d=[...W2(new Ze(a),new Ze(s),c),s];return i===!1&&(d=d.map(u=>Math.round(u))),r>n?fh(d):d}var S8=H2(w8),j8=H2(C8),G2=e=>e.rootProps.maxBarSize,E8=e=>e.rootProps.barGap,X2=e=>e.rootProps.barCategoryGap,P8=e=>e.rootProps.barSize,ys=e=>e.rootProps.stackOffset,qg=e=>e.options.chartName,Yg=e=>e.rootProps.syncId,Z2=e=>e.rootProps.syncMethod,Gg=e=>e.options.eventEmitter,Cn={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},vr={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},iu=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},O8={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Cn.angleAxisId,includeHidden:!1,name:void 0,reversed:Cn.reversed,scale:Cn.scale,tick:Cn.tick,tickCount:void 0,ticks:void 0,type:Cn.type,unit:void 0},k8={allowDataOverflow:vr.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:vr.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:vr.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:vr.scale,tick:vr.tick,tickCount:vr.tickCount,ticks:void 0,type:vr.type,unit:void 0},T8={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:Cn.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Cn.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:Cn.scale,tick:Cn.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},M8={allowDataOverflow:vr.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:vr.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:vr.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:vr.scale,tick:vr.tick,tickCount:vr.tickCount,ticks:void 0,type:"category",unit:void 0},Xg=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?T8:O8,Zg=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?M8:k8,ou=e=>e.polarOptions,Qg=ee([Bn,$n,Rt],jj),Q2=ee([ou,Qg],(e,t)=>{if(e!=null)return Zt(e.innerRadius,t,0)}),J2=ee([ou,Qg],(e,t)=>{if(e!=null)return Zt(e.outerRadius,t,t*.8)}),R8=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},eE=ee([ou],R8);ee([Xg,eE],iu);var tE=ee([Qg,Q2,J2],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});ee([Zg,tE],iu);var rE=ee([We,ou,Q2,J2,Bn,$n],(e,t,r,n,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:s,cy:l,startAngle:c,endAngle:d}=t;return{cx:Zt(s,i,i/2),cy:Zt(l,a,a/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),ft=(e,t)=>t,xs=(e,t,r)=>r;function Jg(e){return e?.id}var It=e=>{var t=We(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},$o=e=>e.tooltip.settings.axisId,Nt=e=>{var t=It(e),r=$o(e);return bs(e,t,r)},nE=ee([Nt],e=>e?.dataKey);function iE(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=r,s=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:n;if(!(d==null||d.length===0)){var u=Jg(l);d.forEach((f,h)=>{var g=a==null||i?h:String(ht(f,a,null)),v=ht(f,l.dataKey,0),x;s.has(g)?x=s.get(g):x={},Object.assign(x,{[u]:v}),s.set(g,x)})}}),Array.from(s.values())}function au(e){return e.stackId!=null&&e.dataKey!=null}var su=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function lu(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Ib(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ib(Object(r),!0).forEach(function(n){A8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ib(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A8(e,t,r){return(t=I8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I8(e){var t=N8(e,"string");return typeof t=="symbol"?t:t+""}function N8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ph=[0,"auto"],gr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},oE=(e,t)=>e.cartesianAxis.xAxis[t],zn=(e,t)=>{var r=oE(e,t);return r??gr},mr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:ph,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:hs},aE=(e,t)=>e.cartesianAxis.yAxis[t],Fn=(e,t)=>{var r=aE(e,t);return r??mr},D8={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},em=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??D8},gt=(e,t,r)=>{switch(t){case"xAxis":return zn(e,r);case"yAxis":return Fn(e,r);case"zAxis":return em(e,r);case"angleAxis":return Xg(e,r);case"radiusAxis":return Zg(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},_8=(e,t,r)=>{switch(t){case"xAxis":return zn(e,r);case"yAxis":return Fn(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},bs=(e,t,r)=>{switch(t){case"xAxis":return zn(e,r);case"yAxis":return Fn(e,r);case"angleAxis":return Xg(e,r);case"radiusAxis":return Zg(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},sE=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function tm(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var rm=e=>e.graphicalItems.cartesianItems,B8=ee([ft,xs],tm),nm=(e,t,r)=>e.filter(r).filter(n=>t?.includeHidden===!0?!0:!n.hide),ws=ee([rm,gt,B8],nm,{memoizeOptions:{resultEqualityCheck:lu}}),lE=ee([ws],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(au)),cE=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),$8=ee([ws],cE),im=e=>e.map(t=>t.data).filter(Boolean).flat(1),L8=ee([ws],im,{memoizeOptions:{resultEqualityCheck:lu}}),om=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},am=ee([L8,Ug],om),sm=(e,t,r)=>t?.dataKey!=null?e.map(n=>({value:ht(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:ht(i,n)}))):e.map(n=>({value:n})),cu=ee([am,gt,ws],sm);function uE(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function kl(e){if(hn(e)||e instanceof Date){var t=Number(e);if(Qt(t))return t}}function Nb(e){if(Array.isArray(e)){var t=[kl(e[0]),kl(e[1])];return Li(t)?t:void 0}var r=kl(e);if(r!=null)return[r,r]}function Lo(e){return e.map(kl).filter(l5)}function z8(e,t,r){return!r||typeof t!="number"||_r(t)?[]:r.length?Lo(r.flatMap(n=>{var i=ht(e,n.dataKey),a,s;if(Array.isArray(i)?[a,s]=i:a=s=i,!(!Qt(a)||!Qt(s)))return[t-a,t+s]})):[]}var F8=ee([lE,Ug,Nt],iE),dE=(e,t,r)=>{var n={},i=t.reduce((a,s)=>(s.stackId==null||(a[s.stackId]==null&&(a[s.stackId]=[]),a[s.stackId].push(s)),a),n);return Object.fromEntries(Object.entries(i).map(a=>{var[s,l]=a,c=l.map(Jg);return[s,{stackedData:MB(e,c,r),graphicalItems:l}]}))},hh=ee([F8,lE,ys],dE),fE=(e,t,r,n)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var s=DB(e,i,a);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},V8=ee([gt],e=>e.allowDataOverflow),lm=e=>{var t;if(e==null||!("domain"in e))return ph;if(e.domain!=null)return e.domain;if(e.ticks!=null){if(e.type==="number"){var r=Lo(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:ph},cm=ee([gt],lm),um=ee([cm,V8],N2),H8=ee([hh,gi,ft,um],fE,{memoizeOptions:{resultEqualityCheck:su}}),uu=e=>e.errorBars,U8=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>uE(r,n)),hc=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.filter(Boolean);if(i.length!==0){var a=i.flat(),s=Math.min(...a),l=Math.max(...a);return[s,l]}},dm=(e,t,r,n,i)=>{var a,s;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var d,u,f=(d=n[c.id])===null||d===void 0?void 0:d.filter(w=>uE(i,w)),h=ht(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),g=z8(l,h,f);if(g.length>=2){var v=Math.min(...g),x=Math.max(...g);(a==null||v<a)&&(a=v),(s==null||x>s)&&(s=x)}var y=Nb(h);y!=null&&(a=a==null?y[0]:Math.min(a,y[0]),s=s==null?y[1]:Math.max(s,y[1]))})}),t?.dataKey!=null&&e.forEach(l=>{var c=Nb(ht(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),s=s==null?c[1]:Math.max(s,c[1]))}),Qt(a)&&Qt(s))return[a,s]},W8=ee([am,gt,$8,uu,ft],dm,{memoizeOptions:{resultEqualityCheck:su}});function K8(e){var{value:t}=e;if(hn(t)||t instanceof Date)return t}var q8=(e,t,r)=>{var n=e.map(K8).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&MS(n))?Yj(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},pE=e=>e.referenceElements.dots,zo=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),Y8=ee([pE,ft,xs],zo),hE=e=>e.referenceElements.areas,G8=ee([hE,ft,xs],zo),gE=e=>e.referenceElements.lines,X8=ee([gE,ft,xs],zo),mE=(e,t)=>{var r=Lo(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},Z8=ee(Y8,ft,mE),vE=(e,t)=>{var r=Lo(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},Q8=ee([G8,ft],vE),yE=(e,t)=>{var r=Lo(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},J8=ee(X8,ft,yE),eL=ee(Z8,J8,Q8,(e,t,r)=>hc(e,r,t)),fm=(e,t,r,n,i,a,s,l)=>{if(r!=null)return r;var c=s==="vertical"&&l==="xAxis"||s==="horizontal"&&l==="yAxis",d=c?hc(n,a,i):hc(a,i);return f8(t,d,e.allowDataOverflow)},tL=ee([gt,cm,um,H8,W8,eL,We,ft],fm,{memoizeOptions:{resultEqualityCheck:su}}),rL=[0,1],pm=(e,t,r,n,i,a,s)=>{if(!((e==null||r==null||r.length===0)&&s===void 0)){var{dataKey:l,type:c}=e,d=Ui(t,a);return d&&l==null?Yj(0,r.length):c==="category"?q8(n,e,d):i==="expand"?rL:s}},hm=ee([gt,We,am,cu,ys,ft,tL],pm),xE=(e,t,r,n,i)=>{if(e!=null){var{scale:a,type:s}=e;if(a==="auto")return t==="radial"&&i==="radiusAxis"?"band":t==="radial"&&i==="angleAxis"?"linear":s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?"point":s==="category"?"band":"linear";if(typeof a=="string"){var l="scale".concat(ls(a));return l in ba?l:"point"}}},Fo=ee([gt,We,sE,qg,ft],xE);function nL(e){if(e!=null){if(e in ba)return ba[e]();var t="scale".concat(ls(e));if(t in ba)return ba[t]()}}function gm(e,t,r,n){if(!(r==null||n==null)){if(typeof e.scale=="function")return e.scale.copy().domain(r).range(n);var i=nL(t);if(i!=null){var a=i.domain(r).range(n);return EB(a),a}}}var mm=(e,t,r)=>{var n=lm(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&Li(e))return S8(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Li(e))return j8(e,t.tickCount,t.allowDecimals)}},vm=ee([hm,bs,Fo],mm),ym=(e,t,r,n)=>{if(n!=="angleAxis"&&e?.type==="number"&&Li(t)&&Array.isArray(r)&&r.length>0){var i=t[0],a=r[0],s=t[1],l=r[r.length-1];return[Math.min(i,a),Math.max(s,l)]}return t},iL=ee([gt,hm,vm,ft],ym),oL=ee(cu,gt,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Lo(e.map(l=>l.value))).sort((l,c)=>l-c);if(n.length<2)return 1/0;var i=n[n.length-1]-n[0];if(i===0)return 1/0;for(var a=0;a<n.length-1;a++){var s=n[a+1]-n[a];r=Math.min(r,s)}return r/i}}),bE=ee(oL,We,X2,Rt,(e,t,r,n)=>n,(e,t,r,n,i)=>{if(!Qt(e))return 0;var a=t==="vertical"?n.height:n.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=Zt(r,e*a),l=e*a/2;return l-s-(l-s)/a*s}return 0}),aL=(e,t)=>{var r=zn(e,t);return r==null||typeof r.padding!="string"?0:bE(e,"xAxis",t,r.padding)},sL=(e,t)=>{var r=Fn(e,t);return r==null||typeof r.padding!="string"?0:bE(e,"yAxis",t,r.padding)},lL=ee(zn,aL,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),cL=ee(Fn,sL,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),uL=ee([Rt,lL,Yc,qc,(e,t,r)=>r],(e,t,r,n,i)=>{var{padding:a}=n;return i?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),dL=ee([Rt,We,cL,Yc,qc,(e,t,r)=>r],(e,t,r,n,i,a)=>{var{padding:s}=i;return a?[n.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Cs=(e,t,r,n)=>{var i;switch(t){case"xAxis":return uL(e,r,n);case"yAxis":return dL(e,r,n);case"zAxis":return(i=em(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return eE(e);case"radiusAxis":return tE(e,r);default:return}},wE=ee([gt,Cs],iu),Vo=ee([gt,Fo,iL,wE],gm);ee([ws,uu,ft],U8);function CE(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var du=(e,t)=>t,fu=(e,t,r)=>r,fL=ee(Wc,du,fu,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(CE)),pL=ee(Kc,du,fu,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(CE)),SE=(e,t)=>({width:e.width,height:t.height}),hL=(e,t)=>{var r=typeof t.width=="number"?t.width:hs;return{width:r,height:e.height}},jE=ee(Rt,zn,SE),gL=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},mL=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},vL=ee($n,Rt,fL,du,fu,(e,t,r,n,i)=>{var a={},s;return r.forEach(l=>{var c=SE(t,l);s==null&&(s=gL(t,n,e));var d=n==="top"&&!i||n==="bottom"&&i;a[l.id]=s-Number(d)*c.height,s+=(d?-1:1)*c.height}),a}),yL=ee(Bn,Rt,pL,du,fu,(e,t,r,n,i)=>{var a={},s;return r.forEach(l=>{var c=hL(t,l);s==null&&(s=mL(t,n,e));var d=n==="left"&&!i||n==="right"&&i;a[l.id]=s-Number(d)*c.width,s+=(d?-1:1)*c.width}),a}),xL=(e,t)=>{var r=zn(e,t);if(r!=null)return vL(e,r.orientation,r.mirror)},bL=ee([Rt,zn,xL,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r?.[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),wL=(e,t)=>{var r=Fn(e,t);if(r!=null)return yL(e,r.orientation,r.mirror)},CL=ee([Rt,Fn,wL,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r?.[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),EE=ee(Rt,Fn,(e,t)=>{var r=typeof t.width=="number"?t.width:hs;return{width:r,height:e.height}}),Db=(e,t,r)=>{switch(t){case"xAxis":return jE(e,r).width;case"yAxis":return EE(e,r).height;default:return}},PE=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:i,type:a,dataKey:s}=r,l=Ui(e,n),c=t.map(d=>d.value);if(s&&l&&a==="category"&&i&&MS(c))return c}},xm=ee([We,cu,gt,ft],PE),OE=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:i,scale:a}=r,s=Ui(e,n);if(s&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},bm=ee([We,cu,bs,ft],OE),_b=ee([We,_8,Fo,Vo,xm,bm,Cs,vm,ft],(e,t,r,n,i,a,s,l,c)=>{if(t==null)return null;var d=Ui(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:d,niceTicks:l,range:s,realScaleType:r,scale:n}}),SL=(e,t,r,n,i,a,s,l,c)=>{if(!(t==null||n==null)){var d=Ui(e,c),{type:u,ticks:f,tickCount:h}=t,g=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,v=u==="category"&&n.bandwidth?n.bandwidth()/g:0;v=c==="angleAxis"&&a!=null&&a.length>=2?Lt(a[0]-a[1])*2*v:v;var x=f||i;if(x){var y=x.map((w,b)=>{var j=s?s.indexOf(w):w;return{index:b,coordinate:n(j)+v,value:w,offset:v}});return y.filter(w=>!_r(w.coordinate))}return d&&l?l.map((w,b)=>({coordinate:n(w)+v,value:w,index:b,offset:v})):n.ticks?n.ticks(h).map(w=>({coordinate:n(w)+v,value:w,offset:v})):n.domain().map((w,b)=>({coordinate:n(w)+v,value:s?s[w]:w,index:b,offset:v}))}},kE=ee([We,bs,Fo,Vo,vm,Cs,xm,bm,ft],SL),jL=(e,t,r,n,i,a,s)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=Ui(e,s),{tickCount:c}=t,d=0;return d=s==="angleAxis"&&n?.length>=2?Lt(n[0]-n[1])*2*d:d,l&&a?a.map((u,f)=>({coordinate:r(u)+d,value:u,index:f,offset:d})):r.ticks?r.ticks(c).map(u=>({coordinate:r(u)+d,value:u,offset:d})):r.domain().map((u,f)=>({coordinate:r(u)+d,value:i?i[u]:u,index:f,offset:d}))}},Eo=ee([We,bs,Vo,Cs,xm,bm,ft],jL),Po=ee(gt,Vo,(e,t)=>{if(!(e==null||t==null))return pc(pc({},e),{},{scale:t})}),EL=ee([gt,Fo,hm,wE],gm);ee((e,t,r)=>em(e,r),EL,(e,t)=>{if(!(e==null||t==null))return pc(pc({},e),{},{scale:t})});var PL=ee([We,Wc,Kc],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),TE=e=>e.options.defaultTooltipEventType,ME=e=>e.options.validateTooltipEventTypes;function RE(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function wm(e,t){var r=TE(e),n=ME(e);return RE(t,r,n)}function OL(e){return Re(t=>wm(t,e))}var AE=(e,t)=>{var r,n=Number(t);if(!(_r(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},kL=e=>e.tooltip.settings,ni={active:!1,index:null,dataKey:void 0,coordinate:void 0},TL={itemInteraction:{click:ni,hover:ni},axisInteraction:{click:ni,hover:ni},keyboardInteraction:ni,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},IE=Cr({name:"tooltip",initialState:TL,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:er()},removeTooltipEntrySettings:{reducer(e,t){var r=kn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:er()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate,e.keyboardInteraction.dataKey=t.payload.activeDataKey}}}),{addTooltipEntrySettings:ML,removeTooltipEntrySettings:RL,setTooltipSettingsState:AL,setActiveMouseOverItemIndex:NE,mouseLeaveItem:IL,mouseLeaveChart:DE,setActiveClickItemIndex:NL,setMouseOverAxisIndex:_E,setMouseClickAxisIndex:DL,setSyncInteraction:gh,setKeyboardInteraction:mh}=IE.actions,_L=IE.reducer;function Bb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Bb(Object(r),!0).forEach(function(n){BL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Bb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BL(e,t,r){return(t=$L(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $L(e){var t=LL(e,"string");return typeof t=="symbol"?t:t+""}function LL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zL(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function FL(e){return e.index!=null}var BE=(e,t,r,n)=>{if(t==null)return ni;var i=zL(e,t,r);if(i==null)return ni;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(FL(i)){if(a)return gl(gl({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n};return gl(gl({},ni),{},{coordinate:i.coordinate})},Cm=(e,t)=>{var r=e?.index;if(r==null)return null;var n=Number(r);if(!Qt(n))return r;var i=0,a=1/0;return t.length>0&&(a=t.length-1),String(Math.max(i,Math.min(n,a)))},$E=(e,t,r,n,i,a,s,l)=>{if(!(a==null||l==null)){var c=s[0],d=c==null?void 0:l(c.positions,a);if(d!=null)return d;var u=i?.[Number(a)];if(u)switch(r){case"horizontal":return{x:u.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:u.coordinate}}}},LE=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;return r==="hover"?i=e.itemInteraction.hover.dataKey:i=e.itemInteraction.click.dataKey,i==null&&n!=null?[e.tooltipItemPayloads[0]]:e.tooltipItemPayloads.filter(a=>{var s;return((s=a.settings)===null||s===void 0?void 0:s.dataKey)===i})},Ss=e=>e.options.tooltipPayloadSearcher,Ho=e=>e.tooltip;function $b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Lb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$b(Object(r),!0).forEach(function(n){VL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$b(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VL(e,t,r){return(t=HL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HL(e){var t=UL(e,"string");return typeof t=="symbol"?t:t+""}function UL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WL(e,t){return e??t}var zE=(e,t,r,n,i,a,s)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:u}=r,f=[];return e.reduce((h,g)=>{var v,{dataDefinedOnItem:x,settings:y}=g,w=WL(x,l),b=Array.isArray(w)?Ej(w,d,u):w,j=(v=y?.dataKey)!==null&&v!==void 0?v:n,P=y?.nameKey,E;if(n&&Array.isArray(b)&&!Array.isArray(b[0])&&s==="axis"?E=VD(b,n,i):E=a(b,t,c,P),Array.isArray(E))E.forEach(O=>{var k=Lb(Lb({},y),{},{name:O.name,unit:O.unit,color:void 0,fill:void 0});h.push(hx({tooltipEntrySettings:k,dataKey:O.dataKey,payload:O.payload,value:ht(O.payload,O.dataKey),name:O.name}))});else{var C;h.push(hx({tooltipEntrySettings:y,dataKey:j,payload:E,value:ht(E,j),name:(C=ht(E,P))!==null&&C!==void 0?C:y?.name}))}return h},f)}},Sm=ee([Nt,We,sE,qg,It],xE),KL=ee([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),qL=ee([It,$o],tm),js=ee([KL,Nt,qL],nm,{memoizeOptions:{resultEqualityCheck:lu}}),YL=ee([js],e=>e.filter(au)),GL=ee([js],im,{memoizeOptions:{resultEqualityCheck:lu}}),Uo=ee([GL,gi],om),XL=ee([YL,gi,Nt],iE),jm=ee([Uo,Nt,js],sm),FE=ee([Nt],lm),ZL=ee([Nt],e=>e.allowDataOverflow),VE=ee([FE,ZL],N2),QL=ee([js],e=>e.filter(au)),JL=ee([XL,QL,ys],dE),ez=ee([JL,gi,It,VE],fE),tz=ee([js],cE),rz=ee([Uo,Nt,tz,uu,It],dm,{memoizeOptions:{resultEqualityCheck:su}}),nz=ee([pE,It,$o],zo),iz=ee([nz,It],mE),oz=ee([hE,It,$o],zo),az=ee([oz,It],vE),sz=ee([gE,It,$o],zo),lz=ee([sz,It],yE),cz=ee([iz,lz,az],hc),uz=ee([Nt,FE,VE,ez,rz,cz,We,It],fm),HE=ee([Nt,We,Uo,jm,ys,It,uz],pm),dz=ee([HE,Nt,Sm],mm),fz=ee([Nt,HE,dz,It],ym),UE=e=>{var t=It(e),r=$o(e),n=!1;return Cs(e,t,r,n)},WE=ee([Nt,UE],iu),KE=ee([Nt,Sm,fz,WE],gm),pz=ee([We,jm,Nt,It],PE),hz=ee([We,jm,Nt,It],OE),gz=(e,t,r,n,i,a,s,l)=>{if(t){var{type:c}=t,d=Ui(e,l);if(n){var u=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/u:0;return f=l==="angleAxis"&&i!=null&&i?.length>=2?Lt(i[0]-i[1])*2*f:f,d&&s?s.map((h,g)=>({coordinate:n(h)+f,value:h,index:g,offset:f})):n.domain().map((h,g)=>({coordinate:n(h)+f,value:a?a[h]:h,index:g,offset:f}))}}},Vn=ee([We,Nt,Sm,KE,UE,pz,hz,It],gz),Em=ee([TE,ME,kL],(e,t,r)=>RE(r.shared,e,t)),qE=e=>e.tooltip.settings.trigger,Pm=e=>e.tooltip.settings.defaultIndex,pu=ee([Ho,Em,qE,Pm],BE),Fi=ee([pu,Uo],Cm),YE=ee([Vn,Fi],AE),GE=ee([pu],e=>{if(e)return e.dataKey}),XE=ee([Ho,Em,qE,Pm],LE),mz=ee([Bn,$n,We,Rt,Vn,Pm,XE,Ss],$E),vz=ee([pu,mz],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),yz=ee([pu],e=>e.active),xz=ee([XE,Fi,gi,nE,YE,Ss,Em],zE);ee([xz],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function zb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zb(Object(r),!0).forEach(function(n){bz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bz(e,t,r){return(t=wz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wz(e){var t=Cz(e,"string");return typeof t=="symbol"?t:t+""}function Cz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sz=()=>Re(Nt),jz=()=>{var e=Sz(),t=Re(Vn),r=Re(KE);return mg(Fb(Fb({},e),{},{scale:r}),t)},Ez=()=>Re(qg),Om=(e,t)=>t,ZE=(e,t,r)=>r,km=(e,t,r,n)=>n,Pz=ee(Vn,e=>Lc(e,t=>t.coordinate)),Tm=ee([Ho,Om,ZE,km],BE),QE=ee([Tm,Uo],Cm),Oz=(e,t,r)=>{if(t!=null){var n=Ho(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},JE=ee([Ho,Om,ZE,km],LE),gc=ee([Bn,$n,We,Rt,Vn,km,JE,Ss],$E),kz=ee([Tm,gc],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),eP=ee(Vn,QE,AE),Tz=ee([JE,QE,gi,nE,eP,Ss,Om],zE),Mz=ee([Tm],e=>({isActive:e.active,activeIndex:e.index})),Rz=(e,t,r,n,i,a,s,l)=>{if(!(!e||!t||!n||!i||!a)){var c=_B(e.chartX,e.chartY,t,r,l);if(c){var d=$B(c,t),u=SB(d,s,a,n,i),f=BB(t,a,u,c);return{activeIndex:String(u),activeCoordinate:f}}}};function vh(){return vh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vh.apply(null,arguments)}function Vb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ml(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vb(Object(r),!0).forEach(function(n){Az(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Az(e,t,r){return(t=Iz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Iz(e){var t=Nz(e,"string");return typeof t=="symbol"?t:t+""}function Nz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dz(e){var{coordinate:t,payload:r,index:n,offset:i,tooltipAxisBandSize:a,layout:s,cursor:l,tooltipEventType:c,chartName:d}=e,u=t,f=r,h=n;if(!l||!u||d!=="ScatterChart"&&c!=="axis")return null;var g,v;if(d==="ScatterChart")g=u,v=t5;else if(d==="BarChart")g=r5(s,u,i,a),v=Uj;else if(s==="radial"){var{cx:x,cy:y,radius:w,startAngle:b,endAngle:j}=Wj(u);g={cx:x,cy:y,startAngle:b,endAngle:j,innerRadius:w,outerRadius:w},v=qj}else g={points:L5(s,u,i)},v=Lj;var P=typeof l=="object"&&"className"in l?l.className:void 0,E=ml(ml(ml(ml({stroke:"#ccc",pointerEvents:"none"},i),g),za(l)),{},{payload:f,payloadIndex:h,className:Je("recharts-tooltip-cursor",P)});return m.isValidElement(l)?m.cloneElement(l,E):m.createElement(v,E)}function _z(e){var t=jz(),r=Nj(),n=wg(),i=Ez();return S.createElement(Dz,vh({},e,{coordinate:e.coordinate,index:e.index,payload:e.payload,offset:r,layout:n,tooltipAxisBandSize:t,chartName:i}))}var tP=m.createContext(null),Bz=()=>m.useContext(tP),Mf={exports:{}},Hb;function $z(){return Hb||(Hb=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function a(c,d,u,f,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var g=new i(u,f||c,h),v=r?r+d:d;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],g]:c._events[v].push(g):(c._events[v]=g,c._eventsCount++),c}function s(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,f;if(this._eventsCount===0)return d;for(f in u=this._events)t.call(u,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=r?r+d:d,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,g=f.length,v=new Array(g);h<g;h++)v[h]=f[h].fn;return v},l.prototype.listenerCount=function(d){var u=r?r+d:d,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,u,f,h,g,v){var x=r?r+d:d;if(!this._events[x])return!1;var y=this._events[x],w=arguments.length,b,j;if(y.fn){switch(y.once&&this.removeListener(d,y.fn,void 0,!0),w){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,u),!0;case 3:return y.fn.call(y.context,u,f),!0;case 4:return y.fn.call(y.context,u,f,h),!0;case 5:return y.fn.call(y.context,u,f,h,g),!0;case 6:return y.fn.call(y.context,u,f,h,g,v),!0}for(j=1,b=new Array(w-1);j<w;j++)b[j-1]=arguments[j];y.fn.apply(y.context,b)}else{var P=y.length,E;for(j=0;j<P;j++)switch(y[j].once&&this.removeListener(d,y[j].fn,void 0,!0),w){case 1:y[j].fn.call(y[j].context);break;case 2:y[j].fn.call(y[j].context,u);break;case 3:y[j].fn.call(y[j].context,u,f);break;case 4:y[j].fn.call(y[j].context,u,f,h);break;default:if(!b)for(E=1,b=new Array(w-1);E<w;E++)b[E-1]=arguments[E];y[j].fn.apply(y[j].context,b)}}return!0},l.prototype.on=function(d,u,f){return a(this,d,u,f,!1)},l.prototype.once=function(d,u,f){return a(this,d,u,f,!0)},l.prototype.removeListener=function(d,u,f,h){var g=r?r+d:d;if(!this._events[g])return this;if(!u)return s(this,g),this;var v=this._events[g];if(v.fn)v.fn===u&&(!h||v.once)&&(!f||v.context===f)&&s(this,g);else{for(var x=0,y=[],w=v.length;x<w;x++)(v[x].fn!==u||h&&!v[x].once||f&&v[x].context!==f)&&y.push(v[x]);y.length?this._events[g]=y.length===1?y[0]:y:s(this,g)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=r?r+d:d,this._events[u]&&s(this,u)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(Mf)),Mf.exports}var Lz=$z();const zz=wr(Lz);var Ja=new zz,yh="recharts.syncEvent.tooltip",Ub="recharts.syncEvent.brush";function rP(e,t){if(t){var r=Number.parseInt(t,10);if(!_r(r))return e?.[r]}}var Fz={chartName:"",tooltipPayloadSearcher:void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},nP=Cr({name:"options",initialState:Fz,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Vz=nP.reducer,{createEventEmitter:Hz}=nP.actions;function Uz(e){return e.tooltip.syncInteraction}var Wz={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},iP=Cr({name:"chartData",initialState:Wz,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:Wb,setDataStartEndIndexes:Kz}=iP.actions,qz=iP.reducer,Yz=["x","y"];function Kb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function no(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kb(Object(r),!0).forEach(function(n){Gz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gz(e,t,r){return(t=Xz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xz(e){var t=Zz(e,"string");return typeof t=="symbol"?t:t+""}function Zz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qz(e,t){if(e==null)return{};var r,n,i=Jz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Jz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var oP=()=>{};function eF(){var e=Re(Yg),t=Re(Gg),r=dt(),n=Re(Z2),i=Re(Vn),a=wg(),s=Gc(),l=Re(c=>c.rootProps.className);m.useEffect(()=>{if(e==null)return oP;var c=(d,u,f)=>{if(t!==f&&e===d){if(n==="index"){var h;if(s&&u!==null&&u!==void 0&&(h=u.payload)!==null&&h!==void 0&&h.coordinate&&u.payload.sourceViewBox){var g=u.payload.coordinate,{x:v,y:x}=g,y=Qz(g,Yz),{x:w,y:b,width:j,height:P}=u.payload.sourceViewBox,E=no(no({},y),{},{x:s.x+(j?(v-w)/j:0)*s.width,y:s.y+(P?(x-b)/P:0)*s.height});r(no(no({},u),{},{payload:no(no({},u.payload),{},{coordinate:E})}))}else r(u);return}if(i!=null){var C;if(typeof n=="function"){var O={activeTooltipIndex:u.payload.index==null?void 0:Number(u.payload.index),isTooltipActive:u.payload.active,activeIndex:u.payload.index==null?void 0:Number(u.payload.index),activeLabel:u.payload.label,activeDataKey:u.payload.dataKey,activeCoordinate:u.payload.coordinate},k=n(i,O);C=i[k]}else n==="value"&&(C=i.find(R=>String(R.value)===u.payload.label));var{coordinate:T}=u.payload;if(C==null||u.payload.active===!1||T==null||s==null){r(gh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0}));return}var{x:D,y:L}=T,A=Math.min(D,s.x+s.width),B=Math.min(L,s.y+s.height),z={x:a==="horizontal"?C.coordinate:A,y:a==="horizontal"?B:C.coordinate},F=gh({active:u.payload.active,coordinate:z,dataKey:u.payload.dataKey,index:String(C.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox});r(F)}}};return Ja.on(yh,c),()=>{Ja.off(yh,c)}},[l,r,t,e,n,i,a,s])}function tF(){var e=Re(Yg),t=Re(Gg),r=dt();m.useEffect(()=>{if(e==null)return oP;var n=(i,a,s)=>{t!==s&&e===i&&r(Kz(a))};return Ja.on(Ub,n),()=>{Ja.off(Ub,n)}},[r,t,e])}function rF(){var e=dt();m.useEffect(()=>{e(Hz())},[e]),eF(),tF()}function nF(e,t,r,n,i,a){var s=Re(g=>Oz(g,e,t)),l=Re(Gg),c=Re(Yg),d=Re(Z2),u=Re(Uz),f=u?.active,h=Gc();m.useEffect(()=>{if(!f&&c!=null&&l!=null){var g=gh({active:a,coordinate:r,dataKey:s,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:h});Ja.emit(yh,c,g,l)}},[f,r,s,i,n,l,c,d,a,h])}function qb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qb(Object(r),!0).forEach(function(n){iF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iF(e,t,r){return(t=oF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oF(e){var t=aF(e,"string");return typeof t=="symbol"?t:t+""}function aF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sF(e){return e.dataKey}function lF(e,t){return S.isValidElement(e)?S.cloneElement(e,t):typeof e=="function"?S.createElement(e,t):S.createElement(I3,t)}var Gb=[],cF={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,isAnimationActive:!Wi.isSsr,itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function vl(e){var t=ir(e,cF),{active:r,allowEscapeViewBox:n,animationDuration:i,animationEasing:a,content:s,filterNull:l,isAnimationActive:c,offset:d,payloadUniqBy:u,position:f,reverseDirection:h,useTranslate3d:g,wrapperStyle:v,cursor:x,shared:y,trigger:w,defaultIndex:b,portal:j,axisId:P}=t,E=dt(),C=typeof b=="number"?String(b):b;m.useEffect(()=>{E(AL({shared:y,trigger:w,axisId:P,active:r,defaultIndex:C}))},[E,y,w,P,r,C]);var O=Gc(),k=$j(),T=OL(y),{activeIndex:D,isActive:L}=Re(fe=>Mz(fe,T,w,C)),A=Re(fe=>Tz(fe,T,w,C)),B=Re(fe=>eP(fe,T,w,C)),z=Re(fe=>kz(fe,T,w,C)),F=A,R=Bz(),N=r??L,[I,M]=qS([F,N]),W=T==="axis"?B:void 0;nF(T,w,z,W,D,N);var $=j??R;if($==null)return null;var H=F??Gb;N||(H=Gb),l&&H.length&&(H=FS(F.filter(fe=>fe.value!=null&&(fe.hide!==!0||t.includeHidden)),u,sF));var X=H.length>0,ue=S.createElement(z3,{allowEscapeViewBox:n,animationDuration:i,animationEasing:a,isAnimationActive:c,active:N,coordinate:z,hasPayload:X,offset:d,position:f,reverseDirection:h,useTranslate3d:g,viewBox:O,wrapperStyle:v,lastBoundingBox:I,innerRef:M,hasPortalFromProps:!!j},lF(s,Yb(Yb({},t),{},{payload:H,label:W,active:N,coordinate:z,accessibilityLayer:k})));return S.createElement(S.Fragment,null,Oa.createPortal(ue,$),N&&S.createElement(_z,{cursor:x,tooltipEventType:T,coordinate:z,payload:F,index:D}))}var ai=e=>null;ai.displayName="Cell";function uF(e,t,r){return(t=dF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dF(e){var t=fF(e,"string");return typeof t=="symbol"?t:t+""}function fF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class pF{constructor(t){uF(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function Xb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xb(Object(r),!0).forEach(function(n){gF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gF(e,t,r){return(t=mF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mF(e){var t=vF(e,"string");return typeof t=="symbol"?t:t+""}function vF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yF={cacheSize:2e3,enableCache:!0},aP=hF({},yF),Zb=new pF(aP.cacheSize),xF={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Qb="recharts_measurement_span";function bF(e,t){var r=t.fontSize||"",n=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",s=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(i,"|").concat(a,"|").concat(s,"|").concat(l)}var Jb=(e,t)=>{try{var r=document.getElementById(Qb);r||(r=document.createElement("span"),r.setAttribute("id",Qb),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,xF,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},ja=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Wi.isSsr)return{width:0,height:0};if(!aP.enableCache)return Jb(t,r);var n=bF(t,r),i=Zb.get(n);if(i)return i;var a=Jb(t,r);return Zb.set(n,a),a},e1=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,t1=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,wF=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,CF=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,sP={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},SF=Object.keys(sP),lo="NaN";function jF(e,t){return e*sP[t]}class sr{static parse(t){var r,[,n,i]=(r=CF.exec(t))!==null&&r!==void 0?r:[];return new sr(parseFloat(n),i??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,_r(t)&&(this.unit=""),r!==""&&!wF.test(r)&&(this.num=NaN,this.unit=""),SF.includes(r)&&(this.num=jF(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new sr(NaN,""):new sr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new sr(NaN,""):new sr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new sr(NaN,""):new sr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new sr(NaN,""):new sr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return _r(this.num)}}function lP(e){if(e.includes(lo))return lo;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,a]=(r=e1.exec(t))!==null&&r!==void 0?r:[],s=sr.parse(n??""),l=sr.parse(a??""),c=i==="*"?s.multiply(l):s.divide(l);if(c.isNaN())return lo;t=t.replace(e1,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,h]=(d=t1.exec(t))!==null&&d!==void 0?d:[],g=sr.parse(u??""),v=sr.parse(h??""),x=f==="+"?g.add(v):g.subtract(v);if(x.isNaN())return lo;t=t.replace(t1,x.toString())}return t}var r1=/\(([^()]*)\)/;function EF(e){for(var t=e,r;(r=r1.exec(t))!=null;){var[,n]=r;t=t.replace(r1,lP(n))}return t}function PF(e){var t=e.replace(/\s+/g,"");return t=EF(t),t=lP(t),t}function OF(e){try{return PF(e)}catch{return lo}}function Rf(e){var t=OF(e.slice(5,-1));return t===lo?"":t}var kF=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],TF=["dx","dy","angle","className","breakAll"];function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xh.apply(null,arguments)}function n1(e,t){if(e==null)return{};var r,n,i=MF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function MF(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var cP=/[ \f\n\r\t\v\u2028\u2029]+/,uP=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];Ft(t)||(r?i=t.toString().split(""):i=t.toString().split(cP));var a=i.map(l=>({word:l,width:ja(l,n).width})),s=r?0:ja(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}},RF=(e,t,r,n,i)=>{var{maxLines:a,children:s,style:l,breakAll:c}=e,d=Ae(a),u=s,f=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce((A,B)=>{var{word:z,width:F}=B,R=A[A.length-1];if(R&&(n==null||i||R.width+F+r<Number(n)))R.words.push(z),R.width+=F+r;else{var N={words:[z],width:F};A.push(N)}return A},[])},h=f(t),g=D=>D.reduce((L,A)=>L.width>A.width?L:A);if(!d||i)return h;var v=h.length>a||g(h).width>Number(n);if(!v)return h;for(var x="…",y=D=>{var L=u.slice(0,D),A=uP({breakAll:c,style:l,children:L+x}).wordsWithComputedWidth,B=f(A),z=B.length>a||g(B).width>Number(n);return[z,B]},w=0,b=u.length-1,j=0,P;w<=b&&j<=u.length-1;){var E=Math.floor((w+b)/2),C=E-1,[O,k]=y(C),[T]=y(E);if(!O&&!T&&(w=E+1),O&&T&&(b=E-1),!O&&T){P=k;break}j++}return P||h},i1=e=>{var t=Ft(e)?[]:e.toString().split(cP);return[{words:t}]},AF=e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:a,maxLines:s}=e;if((t||r)&&!Wi.isSsr){var l,c,d=uP({breakAll:a,children:n,style:i});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return i1(n);return RF({breakAll:a,children:n,maxLines:s,style:i},l,c,t,r)}return i1(n)},o1="#808080",hu=m.forwardRef((e,t)=>{var{x:r=0,y:n=0,lineHeight:i="1em",capHeight:a="0.71em",scaleToFit:s=!1,textAnchor:l="start",verticalAnchor:c="end",fill:d=o1}=e,u=n1(e,kF),f=m.useMemo(()=>AF({breakAll:u.breakAll,children:u.children,maxLines:u.maxLines,scaleToFit:s,style:u.style,width:u.width}),[u.breakAll,u.children,u.maxLines,s,u.style,u.width]),{dx:h,dy:g,angle:v,className:x,breakAll:y}=u,w=n1(u,TF);if(!hn(r)||!hn(n)||f.length===0)return null;var b=r+(Ae(h)?h:0),j=n+(Ae(g)?g:0),P;switch(c){case"start":P=Rf("calc(".concat(a,")"));break;case"middle":P=Rf("calc(".concat((f.length-1)/2," * -").concat(i," + (").concat(a," / 2))"));break;default:P=Rf("calc(".concat(f.length-1," * -").concat(i,")"));break}var E=[];if(s){var C=f[0].width,{width:O}=u;E.push("scale(".concat(Ae(O)?O/C:1,")"))}return v&&E.push("rotate(".concat(v,", ").concat(b,", ").concat(j,")")),E.length&&(w.transform=E.join(" ")),S.createElement("text",xh({},Dr(w),{ref:t,x:b,y:j,className:Je("recharts-text",x),textAnchor:l,fill:d.includes("url")?o1:d}),f.map((k,T)=>{var D=k.words.join(y?"":" ");return S.createElement("tspan",{x:b,dy:T===0?P:i,key:"".concat(D,"-").concat(T)},D)}))});hu.displayName="Text";var IF=["labelRef"];function NF(e,t){if(e==null)return{};var r,n,i=DF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function DF(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function a1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?a1(Object(r),!0).forEach(function(n){_F(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _F(e,t,r){return(t=BF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BF(e){var t=$F(e,"string");return typeof t=="symbol"?t:t+""}function $F(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sn(){return Sn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sn.apply(null,arguments)}var dP=m.createContext(null),LF=e=>{var{x:t,y:r,width:n,height:i,children:a}=e,s=m.useMemo(()=>({x:t,y:r,width:n,height:i}),[t,r,n,i]);return S.createElement(dP.Provider,{value:s},a)},fP=()=>{var e=m.useContext(dP),t=Gc();return e||t},zF=m.createContext(null),FF=()=>{var e=m.useContext(zF),t=Re(rE);return e||t},VF=e=>{var{value:t,formatter:r}=e,n=Ft(e.children)?t:e.children;return typeof r=="function"?r(n):n},Mm=e=>e!=null&&typeof e=="function",HF=(e,t)=>{var r=Lt(t-e),n=Math.min(Math.abs(t-e),360);return r*n},UF=(e,t,r,n,i)=>{var{offset:a,className:s}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:h,clockWise:g}=i,v=(d+u)/2,x=HF(f,h),y=x>=0?1:-1,w,b;switch(t){case"insideStart":w=f+y*a,b=g;break;case"insideEnd":w=h-y*a,b=!g;break;case"end":w=h+y*a,b=g;break;default:throw new Error("Unsupported position ".concat(t))}b=x<=0?b:!b;var j=jt(l,c,v,w),P=jt(l,c,v,w+(b?1:-1)*359),E="M".concat(j.x,",").concat(j.y,`
1108
1108
  A`).concat(v,",").concat(v,",0,1,").concat(b?0:1,`,
1109
- `).concat(P.x,",").concat(P.y),C=Ft(e.id)?Fa("recharts-radial-line-"):e.id;return S.createElement("text",Sn({},n,{dominantBaseline:"central",className:Je("recharts-radial-bar-label",s)}),S.createElement("defs",null,S.createElement("path",{id:C,d:E})),S.createElement("textPath",{xlinkHref:"#".concat(C)},r))},WF=(e,t,r)=>{var{cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=jt(n,i,s+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var h=(a+s)/2,{x:g,y:v}=jt(n,i,h,d);return{x:g,y:v,textAnchor:"middle",verticalAnchor:"middle"}},pP=e=>"cx"in e&&Ae(e.cx),KF=(e,t)=>{var{parentViewBox:r,offset:n,position:i}=e,a;r!=null&&!pP(r)&&(a=r);var{x:s,y:l,width:c,height:d}=t,u=d>=0?1:-1,f=u*n,h=u>0?"end":"start",g=u>0?"start":"end",v=c>=0?1:-1,x=v*n,y=v>0?"end":"start",w=v>0?"start":"end";if(i==="top"){var b={x:s+c/2,y:l-u*n,textAnchor:"middle",verticalAnchor:h};return bt(bt({},b),a?{height:Math.max(l-a.y,0),width:c}:{})}if(i==="bottom"){var j={x:s+c/2,y:l+d+f,textAnchor:"middle",verticalAnchor:g};return bt(bt({},j),a?{height:Math.max(a.y+a.height-(l+d),0),width:c}:{})}if(i==="left"){var P={x:s-x,y:l+d/2,textAnchor:y,verticalAnchor:"middle"};return bt(bt({},P),a?{width:Math.max(P.x-a.x,0),height:d}:{})}if(i==="right"){var E={x:s+c+x,y:l+d/2,textAnchor:w,verticalAnchor:"middle"};return bt(bt({},E),a?{width:Math.max(a.x+a.width-E.x,0),height:d}:{})}var C=a?{width:c,height:d}:{};return i==="insideLeft"?bt({x:s+x,y:l+d/2,textAnchor:w,verticalAnchor:"middle"},C):i==="insideRight"?bt({x:s+c-x,y:l+d/2,textAnchor:y,verticalAnchor:"middle"},C):i==="insideTop"?bt({x:s+c/2,y:l+f,textAnchor:"middle",verticalAnchor:g},C):i==="insideBottom"?bt({x:s+c/2,y:l+d-f,textAnchor:"middle",verticalAnchor:h},C):i==="insideTopLeft"?bt({x:s+x,y:l+f,textAnchor:w,verticalAnchor:g},C):i==="insideTopRight"?bt({x:s+c-x,y:l+f,textAnchor:y,verticalAnchor:g},C):i==="insideBottomLeft"?bt({x:s+x,y:l+d-f,textAnchor:w,verticalAnchor:h},C):i==="insideBottomRight"?bt({x:s+c-x,y:l+d-f,textAnchor:y,verticalAnchor:h},C):i&&typeof i=="object"&&(Ae(i.x)||Rn(i.x))&&(Ae(i.y)||Rn(i.y))?bt({x:s+Zt(i.x,c),y:l+Zt(i.y,d),textAnchor:"end",verticalAnchor:"end"},C):bt({x:s+c/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},C)},qF={offset:5};function ri(e){var t=ir(e,qF),{viewBox:r,position:n,value:i,children:a,content:s,className:l="",textBreakAll:c,labelRef:d}=t,u=FF(),f=fP(),h=n==="center"?f:u??f,g=r||h;if(!g||Ft(i)&&Ft(a)&&!m.isValidElement(s)&&typeof s!="function")return null;var v=bt(bt({},t),{},{viewBox:g});if(m.isValidElement(s)){var x=NF(v,IF);return m.cloneElement(s,x)}var y;if(typeof s=="function"){if(y=m.createElement(s,v),m.isValidElement(y))return y}else y=VF(t);var w=pP(g),b=Dr(t);if(w&&(n==="insideStart"||n==="insideEnd"||n==="end"))return UF(t,n,y,b,g);var j=w?WF(g,t.offset,t.position):KF(t,g);return S.createElement(hu,Sn({ref:d,className:Je("recharts-label",l)},b,j,{breakAll:c}),y)}ri.displayName="Label";var YF=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?S.createElement(ri,Sn({key:"label-implicit"},n)):hn(e)?S.createElement(ri,Sn({key:"label-implicit",value:e},n)):m.isValidElement(e)?e.type===ri?m.cloneElement(e,bt({key:"label-implicit"},n)):S.createElement(ri,Sn({key:"label-implicit",content:e},n)):Mm(e)?S.createElement(ri,Sn({key:"label-implicit",content:e},n)):e&&typeof e=="object"?S.createElement(ri,Sn({},e,{key:"label-implicit"},n)):null};function GF(e){var{label:t,labelRef:r}=e,n=fP();return YF(t,n,r)||null}var Af={},If={},s1;function XF(){return s1||(s1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(If)),If}var Nf={},l1;function ZF(){return l1||(l1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(Nf)),Nf}var c1;function QF(){return c1||(c1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XF(),r=ZF(),n=cg();function i(a){if(n.isArrayLike(a))return t.last(r.toArray(a))}e.last=i})(Af)),Af}var Df,u1;function JF(){return u1||(u1=1,Df=QF().last),Df}var e9=JF();const t9=wr(e9);var r9=["valueAccessor"],n9=["dataKey","clockWise","id","textBreakAll"];function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mc.apply(null,arguments)}function d1(e,t){if(e==null)return{};var r,n,i=i9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var o9=e=>Array.isArray(e.value)?t9(e.value):e.value,hP=m.createContext(void 0),a9=hP.Provider,gP=m.createContext(void 0),s9=gP.Provider;function l9(){return m.useContext(hP)}function c9(){return m.useContext(gP)}function Tl(e){var{valueAccessor:t=o9}=e,r=d1(e,r9),{dataKey:n,id:i,textBreakAll:a}=r,s=d1(r,n9),l=l9(),c=c9(),d=l||c;return!d||!d.length?null:S.createElement(ur,{className:"recharts-label-list"},d.map((u,f)=>{var h,g=Ft(n)?t(u,f):ht(u&&u.payload,n),v=Ft(i)?{}:{id:"".concat(i,"-").concat(f)};return S.createElement(ri,mc({key:"label-".concat(f)},Dr(u),s,v,{fill:(h=r.fill)!==null&&h!==void 0?h:u.fill,parentViewBox:u.parentViewBox,value:g,textBreakAll:a,viewBox:u.viewBox,index:f}))}))}Tl.displayName="LabelList";function mP(e){var{label:t}=e;return t?t===!0?S.createElement(Tl,{key:"labelList-implicit"}):S.isValidElement(t)||Mm(t)?S.createElement(Tl,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Tl,mc({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var vP=e=>e.graphicalItems.polarItems,u9=ee([ft,xs],tm),gu=ee([vP,gt,u9],nm),d9=ee([gu],im),mu=ee([d9,Hg],om),f9=ee([mu,gt,gu],sm);ee([mu,gt,gu],(e,t,r)=>r.length>0?e.flatMap(n=>r.flatMap(i=>{var a,s=ht(n,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(n=>({value:ht(n,t.dataKey),errorDomain:[]})):e.map(n=>({value:n,errorDomain:[]})));var f1=()=>{},p9=ee([mu,gt,gu,uu,ft],dm),h9=ee([gt,cm,um,f1,p9,f1,We,ft],fm),yP=ee([gt,We,mu,f9,ys,ft,h9],pm),g9=ee([yP,gt,Fo],mm);ee([gt,yP,g9,ft],ym);var m9={radiusAxis:{},angleAxis:{}},v9=Cr({name:"polarAxis",initialState:m9,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),y9=v9.reducer;function p1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function h1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p1(Object(r),!0).forEach(function(n){x9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x9(e,t,r){return(t=b9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b9(e){var t=w9(e,"string");return typeof t=="symbol"?t:t+""}function w9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var C9=(e,t)=>t,Rm=ee([vP,C9],(e,t)=>e.filter(r=>r.type==="pie").find(r=>r.id===t)),S9=[],Am=(e,t,r)=>r?.length===0?S9:r,xP=ee([Hg,Rm,Am],(e,t,r)=>{var{chartData:n}=e;if(t!=null){var i;if(t?.data!=null&&t.data.length>0?i=t.data:i=n,(!i||!i.length)&&r!=null&&(i=r.map(a=>h1(h1({},t.presentationProps),a.props))),i!=null)return i}}),j9=ee([xP,Rm,Am],(e,t,r)=>{if(!(e==null||t==null))return e.map((n,i)=>{var a,s=ht(n,t.nameKey,t.name),l;return r!=null&&(a=r[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=r[i].props.fill:typeof n=="object"&&n!=null&&"fill"in n?l=n.fill:l=t.fill,{value:Uc(s,t.dataKey),color:l,payload:n,type:t.legendType}})}),E9=ee([xP,Rm,Am,Rt],(e,t,r,n)=>{if(!(t==null||e==null))return j7({offset:n,pieSettings:t,displayedData:e,cells:r})}),g1=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",m1=null,_f=null,bP=e=>{if(e===m1&&Array.isArray(_f))return _f;var t=[];return m.Children.forEach(e,r=>{Ft(r)||(wl.isFragment(r)?t=t.concat(bP(r.props.children)):t.push(r))}),_f=t,m1=e,t};function Im(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(i=>g1(i)):n=[g1(t)],bP(e).forEach(i=>{var a=_i(i,"type.displayName")||_i(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}var Bf={},v1;function P9(){return v1||(v1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${i}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(Bf)),Bf}var $f,y1;function O9(){return y1||(y1=1,$f=P9().isPlainObject),$f}var k9=O9();const T9=wr(k9);function x1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function b1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(r),!0).forEach(function(n){M9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M9(e,t,r){return(t=R9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R9(e){var t=A9(e,"string");return typeof t=="symbol"?t:t+""}function A9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vc.apply(null,arguments)}var w1=(e,t,r,n,i)=>{var a=r-n,s;return s="M ".concat(e,",").concat(t),s+="L ".concat(e+r,",").concat(t),s+="L ".concat(e+r-a/2,",").concat(t+i),s+="L ".concat(e+r-a/2-n,",").concat(t+i),s+="L ".concat(e,",").concat(t," Z"),s},I9={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},N9=e=>{var t=ir(e,I9),{x:r,y:n,upperWidth:i,lowerWidth:a,height:s,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,h=m.useRef(null),[g,v]=m.useState(-1),x=m.useRef(i),y=m.useRef(a),w=m.useRef(s),b=m.useRef(r),j=m.useRef(n),P=Jc(e,"trapezoid-");if(m.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var z=h.current.getTotalLength();z&&v(z)}catch{}},[]),r!==+r||n!==+n||i!==+i||a!==+a||s!==+s||i===0&&a===0||s===0)return null;var E=Je("recharts-trapezoid",l);if(!f)return S.createElement("g",null,S.createElement("path",vc({},Dr(t),{className:E,d:w1(r,n,i,a,s)})));var C=x.current,O=y.current,k=w.current,T=b.current,D=j.current,L="0px ".concat(g===-1?1:g,"px"),A="".concat(g,"px 0px"),B=zj(["strokeDasharray"],d,c);return S.createElement(Qc,{animationId:P,key:P,canBegin:g>0,duration:d,easing:c,isActive:f,begin:u},z=>{var F=Yt(C,i,z),R=Yt(O,a,z),N=Yt(k,s,z),I=Yt(T,r,z),M=Yt(D,n,z);h.current&&(x.current=F,y.current=R,w.current=N,b.current=I,j.current=M);var W=z>0?{transition:B,strokeDasharray:A}:{strokeDasharray:L};return S.createElement("path",vc({},Dr(t),{className:E,d:w1(I,M,F,R,N),ref:h,style:b1(b1({},W),t.style)}))})},D9=["option","shapeType","propTransformer","activeClassName","isActive"];function _9(e,t){if(e==null)return{};var r,n,i=B9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function B9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function C1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?C1(Object(r),!0).forEach(function(n){$9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $9(e,t,r){return(t=L9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L9(e){var t=z9(e,"string");return typeof t=="symbol"?t:t+""}function z9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F9(e,t){return yc(yc({},t),e)}function V9(e,t){return e==="symbols"}function S1(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return S.createElement(Uj,r);case"trapezoid":return S.createElement(N9,r);case"sector":return S.createElement(qj,r);case"symbols":if(V9(t))return S.createElement(ag,r);break;default:return null}}function H9(e){return m.isValidElement(e)?e.props:e}function wP(e){var{option:t,shapeType:r,propTransformer:n=F9,activeClassName:i="recharts-active-shape",isActive:a}=e,s=_9(e,D9),l;if(m.isValidElement(t))l=m.cloneElement(t,yc(yc({},s),H9(t)));else if(typeof t=="function")l=t(s);else if(T9(t)&&typeof t!="boolean"){var c=n(t,s);l=S.createElement(S1,{shapeType:r,elementProps:c})}else{var d=s;l=S.createElement(S1,{shapeType:r,elementProps:d})}return a?S.createElement(ur,{className:i},l):l}var Nm=(e,t)=>{var r=dt();return(n,i)=>a=>{e?.(n,i,a),r(NE({activeIndex:String(i),activeDataKey:t,activeCoordinate:n.tooltipPosition}))}},Dm=e=>{var t=dt();return(r,n)=>i=>{e?.(r,n,i),t(IL())}},_m=(e,t)=>{var r=dt();return(n,i)=>a=>{e?.(n,i,a),r(NL({activeIndex:String(i),activeDataKey:t,activeCoordinate:n.tooltipPosition}))}};function CP(e){var{fn:t,args:r}=e,n=dt(),i=Sr();return m.useLayoutEffect(()=>{if(!i){var a=t(r);return n(ML(a)),()=>{n(RL(a))}}},[t,r,n,i]),null}var SP=()=>{};function U9(e){var{legendPayload:t}=e,r=dt(),n=Sr();return m.useLayoutEffect(()=>n?SP:(r(_j(t)),()=>{r(Bj(t))}),[r,n,t]),null}function W9(e){var{legendPayload:t}=e,r=dt(),n=Re(We);return m.useLayoutEffect(()=>n!=="centric"&&n!=="radial"?SP:(r(_j(t)),()=>{r(Bj(t))}),[r,n,t]),null}var Lf,K9=()=>{var[e]=S.useState(()=>Fa("uid-"));return e},q9=(Lf=S.useId)!==null&&Lf!==void 0?Lf:K9;function Y9(e,t){var r=q9();return t||(e?"".concat(e,"-").concat(r):r)}var G9=m.createContext(void 0),jP=e=>{var{id:t,type:r,children:n}=e,i=Y9("recharts-".concat(r),t);return S.createElement(G9.Provider,{value:i},n(i))},X9={cartesianItems:[],polarItems:[]},EP=Cr({name:"graphicalItems",initialState:X9,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:er()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=kn(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:er()},removeCartesianGraphicalItem:{reducer(e,t){var r=kn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:er()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:er()},removePolarGraphicalItem:{reducer(e,t){var r=kn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:er()}}}),{addCartesianGraphicalItem:Z9,replaceCartesianGraphicalItem:Q9,removeCartesianGraphicalItem:J9,addPolarGraphicalItem:e7,removePolarGraphicalItem:t7}=EP.actions,r7=EP.reducer;function n7(e){var t=dt(),r=m.useRef(null);return m.useLayoutEffect(()=>{r.current===null?t(Z9(e)):r.current!==e&&t(Q9({prev:r.current,next:e})),r.current=e},[t,e]),m.useLayoutEffect(()=>()=>{r.current&&(t(J9(r.current)),r.current=null)},[t]),null}function i7(e){var t=dt();return m.useLayoutEffect(()=>(t(e7(e)),()=>{t(t7(e))}),[t,e]),null}var o7=["onMouseEnter","onClick","onMouseLeave"],a7=["id"],s7=["id"];function Bm(e,t){if(e==null)return{};var r,n,i=l7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function l7(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function j1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j1(Object(r),!0).forEach(function(n){c7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c7(e,t,r){return(t=u7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u7(e){var t=d7(e,"string");return typeof t=="symbol"?t:t+""}function d7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ui.apply(null,arguments)}function f7(e){var t=m.useMemo(()=>Im(e.children,ai),[e.children]),r=Re(n=>j9(n,e.id,t));return r==null?null:S.createElement(W9,{legendPayload:r})}function p7(e){var{dataKey:t,nameKey:r,sectors:n,stroke:i,strokeWidth:a,fill:s,name:l,hide:c,tooltipType:d}=e;return{dataDefinedOnItem:n.map(u=>u.tooltipPayload),positions:n.map(u=>u.tooltipPosition),settings:{stroke:i,strokeWidth:a,fill:s,dataKey:t,nameKey:r,name:Uc(l,t),hide:c,type:d,color:s,unit:""}}}var h7=(e,t)=>e>t?"start":e<t?"end":"middle",g7=(e,t,r)=>Zt(typeof t=="function"?t(e):t,r,r*.8),m7=(e,t,r)=>{var{top:n,left:i,width:a,height:s}=t,l=jj(a,s),c=i+Zt(e.cx,a,a/2),d=n+Zt(e.cy,s,s/2),u=Zt(e.innerRadius,l,0),f=g7(r,e.outerRadius,l),h=e.maxRadius||Math.sqrt(a*a+s*s)/2;return{cx:c,cy:d,innerRadius:u,outerRadius:f,maxRadius:h}},v7=(e,t)=>{var r=Lt(t-e),n=Math.min(Math.abs(t-e),360);return r*n};function y7(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var x7=(e,t)=>{if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var r=Je("recharts-pie-label-line",typeof e!="boolean"?e.className:"");return S.createElement(Lj,ui({},t,{type:"linear",className:r}))},b7=(e,t,r)=>{if(S.isValidElement(e))return S.cloneElement(e,t);var n=r;if(typeof e=="function"&&(n=e(t),S.isValidElement(n)))return n;var i=Je("recharts-pie-label-text",y7(e));return S.createElement(hu,ui({},t,{alignmentBaseline:"middle",className:i}),n)};function w7(e){var{sectors:t,props:r,showLabels:n}=e,{label:i,labelLine:a,dataKey:s}=r;if(!n||!i||!t)return null;var l=Qr(r),c=za(i),d=za(a),u=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,f=t.map((h,g)=>{var v=(h.startAngle+h.endAngle)/2,x=jt(h.cx,h.cy,h.outerRadius+u,v),y=ct(ct(ct(ct({},l),h),{},{stroke:"none"},c),{},{index:g,textAnchor:h7(x.x,h.cx)},x),w=ct(ct(ct(ct({},l),h),{},{fill:"none",stroke:h.fill},d),{},{index:g,points:[jt(h.cx,h.cy,h.outerRadius,v),x],key:"line"});return S.createElement(ur,{key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(g)},a&&x7(a,w),b7(i,y,ht(h,s)))});return S.createElement(ur,{className:"recharts-pie-labels"},f)}function C7(e){var{sectors:t,props:r,showLabels:n}=e,{label:i}=r;return typeof i=="object"&&i!=null&&"position"in i?S.createElement(mP,{label:i}):S.createElement(w7,{sectors:t,props:r,showLabels:n})}function S7(e){var{sectors:t,activeShape:r,inactiveShape:n,allOtherPieProps:i}=e,a=Re(Fi),{onMouseEnter:s,onClick:l,onMouseLeave:c}=i,d=Bm(i,o7),u=Nm(s,i.dataKey),f=Dm(c),h=_m(l,i.dataKey);return t==null||t.length===0?null:S.createElement(S.Fragment,null,t.map((g,v)=>{if(g?.startAngle===0&&g?.endAngle===0&&t.length!==1)return null;var x=r&&String(v)===a,y=a?n:null,w=x?r:y,b=ct(ct({},g),{},{stroke:g.stroke,tabIndex:-1,[Tj]:v,[Mj]:i.dataKey});return S.createElement(ur,ui({key:"sector-".concat(g?.startAngle,"-").concat(g?.endAngle,"-").concat(g.midAngle,"-").concat(v),tabIndex:-1,className:"recharts-pie-sector"},cs(d,g,v),{onMouseEnter:u(g,v),onMouseLeave:f(g,v),onClick:h(g,v)}),S.createElement(wP,ui({option:w,isActive:x,shapeType:"sector"},b)))}))}function j7(e){var t,{pieSettings:r,displayedData:n,cells:i,offset:a}=e,{cornerRadius:s,startAngle:l,endAngle:c,dataKey:d,nameKey:u,tooltipType:f}=r,h=Math.abs(r.minAngle),g=v7(l,c),v=Math.abs(g),x=n.length<=1?0:(t=r.paddingAngle)!==null&&t!==void 0?t:0,y=n.filter(C=>ht(C,d,0)!==0).length,w=(v>=360?y:y-1)*x,b=v-y*h-w,j=n.reduce((C,O)=>{var k=ht(O,d,0);return C+(Ae(k)?k:0)},0),P;if(j>0){var E;P=n.map((C,O)=>{var k=ht(C,d,0),T=ht(C,u,O),D=m7(r,a,C),L=(Ae(k)?k:0)/j,A,B=ct(ct({},C),i&&i[O]&&i[O].props);O?A=E.endAngle+Lt(g)*x*(k!==0?1:0):A=l;var z=A+Lt(g)*((k!==0?h:0)+L*b),F=(A+z)/2,R=(D.innerRadius+D.outerRadius)/2,N=[{name:T,value:k,payload:B,dataKey:d,type:f}],I=jt(D.cx,D.cy,R,F);return E=ct(ct(ct(ct({},r.presentationProps),{},{percent:L,cornerRadius:s,name:T,tooltipPayload:N,midAngle:F,middleRadius:R,tooltipPosition:I},B),D),{},{value:k,startAngle:A,endAngle:z,payload:B,paddingAngle:Lt(g)*x}),E})}return P}function E7(e){var{showLabels:t,sectors:r,children:n}=e,i=m.useMemo(()=>!t||!r?[]:r.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[r,t]);return S.createElement(s9,{value:t?i:void 0},n)}function P7(e){var{props:t,previousSectorsRef:r}=e,{sectors:n,isAnimationActive:i,animationBegin:a,animationDuration:s,animationEasing:l,activeShape:c,inactiveShape:d,onAnimationStart:u,onAnimationEnd:f}=t,h=Jc(t,"recharts-pie-"),g=r.current,[v,x]=m.useState(!1),y=m.useCallback(()=>{typeof f=="function"&&f(),x(!1)},[f]),w=m.useCallback(()=>{typeof u=="function"&&u(),x(!0)},[u]);return S.createElement(E7,{showLabels:!v,sectors:n},S.createElement(Qc,{animationId:h,begin:a,duration:s,isActive:i,easing:l,onAnimationStart:w,onAnimationEnd:y,key:h},b=>{var j=[],P=n&&n[0],E=P?.startAngle;return n?.forEach((C,O)=>{var k=g&&g[O],T=O>0?_i(C,"paddingAngle",0):0;if(k){var D=Yt(k.endAngle-k.startAngle,C.endAngle-C.startAngle,b),L=ct(ct({},C),{},{startAngle:E+T,endAngle:E+D+T});j.push(L),E=L.endAngle}else{var{endAngle:A,startAngle:B}=C,z=Yt(0,A-B,b),F=ct(ct({},C),{},{startAngle:E+T,endAngle:E+z+T});j.push(F),E=F.endAngle}}),r.current=j,S.createElement(ur,null,S.createElement(S7,{sectors:j,activeShape:c,inactiveShape:d,allOtherPieProps:t}))}),S.createElement(C7,{showLabels:!v,sectors:n,props:t}),t.children)}var O7={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:!Wi.isSsr,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff"};function k7(e){var{id:t}=e,r=Bm(e,a7),{hide:n,className:i,rootTabIndex:a}=e,s=m.useMemo(()=>Im(e.children,ai),[e.children]),l=Re(u=>E9(u,t,s)),c=m.useRef(null),d=Je("recharts-pie",i);return n||l==null?(c.current=null,S.createElement(ur,{tabIndex:a,className:d})):S.createElement(S.Fragment,null,S.createElement(CP,{fn:p7,args:ct(ct({},e),{},{sectors:l})}),S.createElement(ur,{tabIndex:a,className:d},S.createElement(P7,{props:ct(ct({},r),{},{sectors:l}),previousSectorsRef:c})))}function PP(e){var t=ir(e,O7),{id:r}=t,n=Bm(t,s7),i=Qr(n);return S.createElement(jP,{id:r,type:"pie"},a=>S.createElement(S.Fragment,null,S.createElement(i7,{type:"pie",id:a,data:n.data,dataKey:n.dataKey,hide:n.hide,angleAxisId:0,radiusAxisId:0,name:n.name,nameKey:n.nameKey,tooltipType:n.tooltipType,legendType:n.legendType,fill:n.fill,cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,paddingAngle:n.paddingAngle,minAngle:n.minAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius,cornerRadius:n.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),S.createElement(f7,ui({},n,{id:a})),S.createElement(k7,ui({},n,{id:a}))))}PP.displayName="Pie";function E1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E1(Object(r),!0).forEach(function(n){T7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T7(e,t,r){return(t=M7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M7(e){var t=R7(e,"string");return typeof t=="symbol"?t:t+""}function R7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var A7={xAxis:{},yAxis:{},zAxis:{}},OP=Cr({name:"cartesianAxis",initialState:A7,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:er()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:er()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:er()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:er()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:er()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:er()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,i=e.yAxis[r];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&n===a[1]&&n!==i.width&&Math.abs(n-a[0])<=1)return;var s=[...a,n].slice(-3);e.yAxis[r]=P1(P1({},e.yAxis[r]),{},{width:n,widthHistory:s})}}}}),{addXAxis:I7,removeXAxis:N7,addYAxis:D7,removeYAxis:_7,updateYAxisWidth:B7}=OP.actions,$7=OP.reducer,L7=ee([Rt],e=>{if(e)return{top:e.top,bottom:e.bottom,left:e.left,right:e.right}}),z7=ee([L7,Bn,$n],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),kP=()=>Re(z7),F7=process.env.NODE_ENV==="production",zf="Invariant failed";function O1(e,t){if(F7)throw new Error(zf);var r=typeof t=="function"?t():t,n=r?"".concat(zf,": ").concat(r):zf;throw new Error(n)}var V7=["x","y"];function bh(){return bh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bh.apply(null,arguments)}function k1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(r),!0).forEach(function(n){H7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H7(e,t,r){return(t=U7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U7(e){var t=W7(e,"string");return typeof t=="symbol"?t:t+""}function W7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K7(e,t){if(e==null)return{};var r,n,i=q7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function q7(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Y7(e,t){var{x:r,y:n}=e,i=K7(e,V7),a="".concat(r),s=parseInt(a,10),l="".concat(n),c=parseInt(l,10),d="".concat(t.height||i.height),u=parseInt(d,10),f="".concat(t.width||i.width),h=parseInt(f,10);return ya(ya(ya(ya(ya({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:u,width:h,name:t.name,radius:t.radius})}function $m(e){return S.createElement(wP,bh({shapeType:"rectangle",propTransformer:Y7,activeClassName:"recharts-active-bar"},e))}var G7=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,i)=>{if(Ae(t))return t;var a=Ae(n)||Ft(n);return a?t(n,i):(a||(process.env.NODE_ENV!=="production"?O1(!1,"minPointSize callback function received a value with type of ".concat(typeof n,". Currently only numbers or null/undefined are supported.")):O1()),r)}},X7={},Z7=Cr({name:"errorBars",initialState:X7,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(i=>i.dataKey!==n.dataKey||i.direction!==n.direction))}}}),Q7=Z7.reducer,J7=["children"];function eV(e,t){if(e==null)return{};var r,n,i=tV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function tV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var rV={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},nV=m.createContext(rV);function iV(e){var{children:t}=e,r=eV(e,J7);return S.createElement(nV.Provider,{value:r},t)}function TP(e,t){var r,n,i=Re(d=>zn(d,e)),a=Re(d=>Fn(d,t)),s=(r=i?.allowDataOverflow)!==null&&r!==void 0?r:gr.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:mr.allowDataOverflow,c=s||l;return{needClip:c,needClipX:s,needClipY:l}}function oV(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=kP(),{needClipX:a,needClipY:s,needClip:l}=TP(t,r);if(!l)return null;var{x:c,y:d,width:u,height:f}=i;return S.createElement("clipPath",{id:"clipPath-".concat(n)},S.createElement("rect",{x:a?c:c-u/2,y:s?d:d-f/2,width:a?u:u*2,height:s?f:f*2}))}var aV=["onMouseEnter","onMouseLeave","onClick"],sV=["value","background","tooltipPosition"],lV=["id"],cV=["onMouseEnter","onClick","onMouseLeave"];function di(){return di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},di.apply(null,arguments)}function T1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T1(Object(r),!0).forEach(function(n){uV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uV(e,t,r){return(t=dV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dV(e){var t=fV(e,"string");return typeof t=="symbol"?t:t+""}function fV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xc(e,t){if(e==null)return{};var r,n,i=pV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function pV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var hV=e=>{var{dataKey:t,name:r,fill:n,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:n,value:Uc(r,t),payload:e}]};function gV(e){var{dataKey:t,stroke:r,strokeWidth:n,fill:i,name:a,hide:s,unit:l}=e;return{dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:Uc(a,t),hide:s,type:e.tooltipType,color:e.fill,unit:l}}}function mV(e){var t=Re(Fi),{data:r,dataKey:n,background:i,allOtherBarProps:a}=e,{onMouseEnter:s,onMouseLeave:l,onClick:c}=a,d=xc(a,aV),u=Nm(s,n),f=Dm(l),h=_m(c,n);if(!i||r==null)return null;var g=za(i);return S.createElement(S.Fragment,null,r.map((v,x)=>{var{background:y}=v,w=xc(v,sV);if(!y)return null;var b=u(v,x),j=f(v,x),P=h(v,x),E=tr(tr(tr(tr(tr({option:i,isActive:String(x)===t},w),{},{fill:"#eee"},y),g),cs(d,v,x)),{},{onMouseEnter:b,onMouseLeave:j,onClick:P,dataKey:n,index:x,className:"recharts-bar-background-rectangle"});return S.createElement($m,di({key:"background-bar-".concat(x)},E))}))}function vV(e){var{showLabels:t,children:r,rects:n}=e,i=n?.map(a=>{var s={x:a.x,y:a.y,width:a.width,height:a.height};return tr(tr({},s),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:s,fill:a.fill})});return S.createElement(a9,{value:t?i:void 0},r)}function yV(e){var{shape:t,activeBar:r,baseProps:n,entry:i,index:a,dataKey:s}=e,l=Re(Fi),c=Re(GE),d=r&&String(a)===l&&(c==null||s===c),u=d?r:t;return S.createElement($m,di({},n,{name:String(n.name)},i,{isActive:d,option:u,index:a,dataKey:s}))}function xV(e){var{shape:t,baseProps:r,entry:n,index:i,dataKey:a}=e;return S.createElement($m,di({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a}))}function bV(e){var{data:t,props:r}=e,n=Qr(r),i=xc(n,lV),{shape:a,dataKey:s,activeBar:l}=r,{onMouseEnter:c,onClick:d,onMouseLeave:u}=r,f=xc(r,cV),h=Nm(c,s),g=Dm(u),v=_m(d,s);return t?S.createElement(S.Fragment,null,t.map((x,y)=>S.createElement(ur,di({key:"rectangle-".concat(x?.x,"-").concat(x?.y,"-").concat(x?.value,"-").concat(y),className:"recharts-bar-rectangle"},cs(f,x,y),{onMouseEnter:h(x,y),onMouseLeave:g(x,y),onClick:v(x,y)}),l?S.createElement(yV,{shape:a,activeBar:l,baseProps:i,entry:x,index:y,dataKey:s}):S.createElement(xV,{shape:a,baseProps:i,entry:x,index:y,dataKey:s})))):null}function wV(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:i,isAnimationActive:a,animationBegin:s,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:u}=t,f=r.current,h=Jc(t,"recharts-bar-"),[g,v]=m.useState(!1),x=!g,y=m.useCallback(()=>{typeof d=="function"&&d(),v(!1)},[d]),w=m.useCallback(()=>{typeof u=="function"&&u(),v(!0)},[u]);return S.createElement(vV,{showLabels:x,rects:n},S.createElement(Qc,{animationId:h,begin:s,duration:l,isActive:a,easing:c,onAnimationEnd:y,onAnimationStart:w,key:h},b=>{var j=b===1?n:n?.map((P,E)=>{var C=f&&f[E];if(C)return tr(tr({},P),{},{x:Yt(C.x,P.x,b),y:Yt(C.y,P.y,b),width:Yt(C.width,P.width,b),height:Yt(C.height,P.height,b)});if(i==="horizontal"){var O=Yt(0,P.height,b);return tr(tr({},P),{},{y:P.y+P.height-O,height:O})}var k=Yt(0,P.width,b);return tr(tr({},P),{},{width:k})});return b>0&&(r.current=j??null),j==null?null:S.createElement(ur,null,S.createElement(bV,{props:t,data:j}))}),S.createElement(mP,{label:t.label}),t.children)}function CV(e){var t=m.useRef(null);return S.createElement(wV,{previousRectanglesRef:t,props:e})}var MP=0,SV=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:ht(e,t)}};class jV extends m.PureComponent{render(){var{hide:t,data:r,dataKey:n,className:i,xAxisId:a,yAxisId:s,needClip:l,background:c,id:d}=this.props;if(t||r==null)return null;var u=Je("recharts-bar",i),f=d;return S.createElement(ur,{className:u,id:d},l&&S.createElement("defs",null,S.createElement(oV,{clipPathId:f,xAxisId:a,yAxisId:s})),S.createElement(ur,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},S.createElement(mV,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),S.createElement(CV,this.props)))}}var EV={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",hide:!1,isAnimationActive:!Wi.isSsr,legendType:"rect",minPointSize:MP,xAxisId:0,yAxisId:0};function PV(e){var{xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=e,{needClip:f}=TP(t,r),h=wg(),g=Sr(),v=Im(e.children,ai),x=Re(b=>eH(b,t,r,g,e.id,v));if(h!=="vertical"&&h!=="horizontal")return null;var y,w=x?.[0];return w==null||w.height==null||w.width==null?y=0:y=h==="vertical"?w.height/2:w.width/2,S.createElement(iV,{xAxisId:t,yAxisId:r,data:x,dataPointFormatter:SV,errorBarOffset:y},S.createElement(jV,di({},e,{layout:h,needClip:f,data:x,xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function OV(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:i,bandSize:a,xAxis:s,yAxis:l,xAxisTicks:c,yAxisTicks:d,stackedData:u,displayedData:f,offset:h,cells:g,parentViewBox:v}=e,x=t==="horizontal"?l:s,y=u?x.scale.domain():null,w=AB({numericAxis:x});return f.map((b,j)=>{var P,E,C,O,k,T;u?P=PB(u[j],y):(P=ht(b,r),Array.isArray(P)||(P=[w,P]));var D=G7(n,MP)(P[1],j);if(t==="horizontal"){var L,[A,B]=[l.scale(P[0]),l.scale(P[1])];E=dx({axis:s,ticks:c,bandSize:a,offset:i.offset,entry:b,index:j}),C=(L=B??A)!==null&&L!==void 0?L:void 0,O=i.size;var z=A-B;if(k=_r(z)?0:z,T={x:E,y:h.top,width:O,height:h.height},Math.abs(D)>0&&Math.abs(k)<Math.abs(D)){var F=Lt(k||D)*(Math.abs(D)-Math.abs(k));C-=F,k+=F}}else{var[R,N]=[s.scale(P[0]),s.scale(P[1])];if(E=R,C=dx({axis:l,ticks:d,bandSize:a,offset:i.offset,entry:b,index:j}),O=N-R,k=i.size,T={x:h.left,y:C,width:h.width,height:k},Math.abs(D)>0&&Math.abs(O)<Math.abs(D)){var I=Lt(O||D)*(Math.abs(D)-Math.abs(O));O+=I}}if(E==null||C==null||O==null||k==null)return null;var M=tr(tr({},b),{},{x:E,y:C,width:O,height:k,value:u?P:P[1],payload:b,background:T,tooltipPosition:{x:E+O/2,y:C+k/2},parentViewBox:v},g&&g[j]&&g[j].props);return M}).filter(Boolean)}function kV(e){var t=ir(e,EV),r=Sr();return S.createElement(jP,{id:t.id,type:"bar"},n=>S.createElement(S.Fragment,null,S.createElement(U9,{legendPayload:hV(t)}),S.createElement(CP,{fn:gV,args:t}),S.createElement(n7,{type:"bar",id:n,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:RB(t.stackId),hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r}),S.createElement(PV,di({},t,{id:n}))))}var Ml=S.memo(kV);Ml.displayName="Bar";function M1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M1(Object(r),!0).forEach(function(n){TV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TV(e,t,r){return(t=MV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MV(e){var t=RV(e,"string");return typeof t=="symbol"?t:t+""}function RV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AV=(e,t)=>t,IV=(e,t,r)=>r,NV=(e,t,r,n)=>n,DV=(e,t,r,n,i)=>i,Es=ee([rm,DV],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),_V=ee([Es],e=>e?.maxBarSize),BV=(e,t,r,n,i,a)=>a,R1=(e,t,r)=>{var n=r??e;if(!Ft(n))return Zt(n,t,0)},$V=ee([We,rm,AV,IV,NV],(e,t,r,n,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===r:a.yAxisId===n).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),LV=(e,t,r,n)=>{var i=We(e);return i==="horizontal"?hh(e,"yAxis",r,n):hh(e,"xAxis",t,n)},zV=(e,t,r)=>{var n=We(e);return n==="horizontal"?Db(e,"xAxis",t):Db(e,"yAxis",r)},FV=(e,t,r)=>{var n={},i=e.filter(au),a=e.filter(d=>d.stackId==null),s=i.reduce((d,u)=>(d[u.stackId]||(d[u.stackId]=[]),d[u.stackId].push(u),d),n),l=Object.entries(s).map(d=>{var[u,f]=d,h=f.map(v=>v.dataKey),g=R1(t,r,f[0].barSize);return{stackId:u,dataKeys:h,barSize:g}}),c=a.map(d=>{var u=[d.dataKey].filter(h=>h!=null),f=R1(t,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:f}});return[...l,...c]},VV=ee([$V,P8,zV],FV),HV=(e,t,r,n,i)=>{var a,s,l=Es(e,t,r,n,i);if(l!=null){var c=We(e),d=G2(e),{maxBarSize:u}=l,f=Ft(u)?d:u,h,g;return c==="horizontal"?(h=Po(e,"xAxis",t,n),g=Eo(e,"xAxis",t,n)):(h=Po(e,"yAxis",r,n),g=Eo(e,"yAxis",r,n)),(a=(s=mg(h,g,!0))!==null&&s!==void 0?s:f)!==null&&a!==void 0?a:0}},RP=(e,t,r,n)=>{var i=We(e),a,s;return i==="horizontal"?(a=Po(e,"xAxis",t,n),s=Eo(e,"xAxis",t,n)):(a=Po(e,"yAxis",r,n),s=Eo(e,"yAxis",r,n)),mg(a,s)};function UV(e,t,r,n,i){var a=n.length;if(!(a<1)){var s=Zt(e,r,0,!0),l,c=[];if(Qt(n[0].barSize)){var d=!1,u=r/a,f=n.reduce((w,b)=>w+(b.barSize||0),0);f+=(a-1)*s,f>=r&&(f-=(a-1)*s,s=0),f>=r&&u>0&&(d=!0,u*=.9,f=a*u);var h=(r-f)/2>>0,g={offset:h-s,size:0};l=n.reduce((w,b)=>{var j,P={stackId:b.stackId,dataKeys:b.dataKeys,position:{offset:g.offset+g.size+s,size:d?u:(j=b.barSize)!==null&&j!==void 0?j:0}},E=[...w,P];return g=E[E.length-1].position,E},c)}else{var v=Zt(t,r,0,!0);r-2*v-(a-1)*s<=0&&(s=0);var x=(r-2*v-(a-1)*s)/a;x>1&&(x>>=0);var y=Qt(i)?Math.min(x,i):x;l=n.reduce((w,b,j)=>[...w,{stackId:b.stackId,dataKeys:b.dataKeys,position:{offset:v+(x+s)*j+(x-y)/2,size:y}}],c)}return l}}var WV=(e,t,r,n,i,a,s)=>{var l=Ft(s)?t:s,c=UV(r,n,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(d=>yl(yl({},d),{},{position:yl(yl({},d.position),{},{offset:d.position.offset-i/2})}))),c},KV=ee([VV,G2,E8,X2,HV,RP,_V],WV),qV=(e,t,r,n)=>Po(e,"xAxis",t,n),YV=(e,t,r,n)=>Po(e,"yAxis",r,n),GV=(e,t,r,n)=>Eo(e,"xAxis",t,n),XV=(e,t,r,n)=>Eo(e,"yAxis",r,n),ZV=ee([KV,Es],(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}}),QV=(e,t)=>{var r=Jg(t);if(!(!e||r==null||t==null)){var{stackId:n}=t;if(n!=null){var i=e[n];if(i){var{stackedData:a}=i;if(a)return a.find(s=>s.key===r)}}}},JV=ee([LV,Es],QV),eH=ee([Rt,vg,qV,YV,GV,XV,ZV,We,Ug,RP,JV,Es,BV],(e,t,r,n,i,a,s,l,c,d,u,f,h)=>{var{chartData:g,dataStartIndex:v,dataEndIndex:x}=c;if(!(f==null||s==null||t==null||l!=="horizontal"&&l!=="vertical"||r==null||n==null||i==null||a==null||d==null)){var{data:y}=f,w;if(y!=null&&y.length>0?w=y:w=g?.slice(v,x+1),w!=null)return OV({layout:l,barSettings:f,pos:s,parentViewBox:t,bandSize:d,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:w,offset:e,cells:h})}}),AP=e=>{var{chartData:t}=e,r=dt(),n=Sr();return m.useEffect(()=>n?()=>{}:(r(Wb(t)),()=>{r(Wb(void 0))}),[t,r,n]),null},A1={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},tH=Cr({name:"brush",initialState:A1,reducers:{setBrushSettings(e,t){return t.payload==null?A1:t.payload}}}),rH=tH.reducer;function nH(e,t,r){return(t=iH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iH(e){var t=oH(e,"string");return typeof t=="symbol"?t:t+""}function oH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Lm{static create(t){return new Lm(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:r,position:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(n)switch(n){case"start":return this.scale(t);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+i}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(t)+a}default:return this.scale(t)}if(r){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+s}return this.scale(t)}}isInRange(t){var r=this.range(),n=r[0],i=r[r.length-1];return n<=i?t>=n&&t<=i:t>=i&&t<=n}}nH(Lm,"EPS",1e-4);function aH(e){return(e%180+180)%180}var sH=function(t){var{width:r,height:n}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=aH(i),s=a*Math.PI/180,l=Math.atan(n/r),c=s>l&&s<Math.PI-l?n/Math.sin(s):r/Math.cos(s);return Math.abs(c)},lH={dots:[],areas:[],lines:[]},cH=Cr({name:"referenceElements",initialState:lH,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=kn(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=kn(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=kn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),uH=cH.reducer,dH=m.createContext(void 0),fH=e=>{var{children:t}=e,[r]=m.useState("".concat(Fa("recharts"),"-clip")),n=kP();if(n==null)return null;var{x:i,y:a,width:s,height:l}=n;return S.createElement(dH.Provider,{value:r},S.createElement("defs",null,S.createElement("clipPath",{id:r},S.createElement("rect",{x:i,y:a,height:l,width:s}))),t)};function Oo(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function IP(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function pH(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return sH(n,r)}function hH(e,t,r){var n=r==="width",{x:i,y:a,width:s,height:l}=e;return t===1?{start:n?i:a,end:n?i+s:a+l}:{start:n?i+s:a+l,end:n?i:a}}function bc(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function gH(e,t){return IP(e,t+1)}function mH(e,t,r,n,i){for(var a=(n||[]).slice(),{start:s,end:l}=t,c=0,d=1,u=s,f=function(){var v=n?.[c];if(v===void 0)return{v:IP(n,d)};var x=c,y,w=()=>(y===void 0&&(y=r(v,x)),y),b=v.coordinate,j=c===0||bc(e,b,w,u,l);j||(c=0,u=s,d+=1),j&&(u=b+e*(w()/2+i),c+=d)},h;d<=a.length;)if(h=f(),h)return h.v;return[]}function I1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I1(Object(r),!0).forEach(function(n){vH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vH(e,t,r){return(t=yH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yH(e){var t=xH(e,"string");return typeof t=="symbol"?t:t+""}function xH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bH(e,t,r,n,i){for(var a=(n||[]).slice(),s=a.length,{start:l}=t,{end:c}=t,d=function(h){var g=a[h],v,x=()=>(v===void 0&&(v=r(g,h)),v);if(h===s-1){var y=e*(g.coordinate+e*x()/2-c);a[h]=g=Gt(Gt({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else a[h]=g=Gt(Gt({},g),{},{tickCoord:g.coordinate});var w=bc(e,g.tickCoord,x,l,c);w&&(c=g.tickCoord-e*(x()/2+i),a[h]=Gt(Gt({},g),{},{isShow:!0}))},u=s-1;u>=0;u--)d(u);return a}function wH(e,t,r,n,i,a){var s=(n||[]).slice(),l=s.length,{start:c,end:d}=t;if(a){var u=n[l-1],f=r(u,l-1),h=e*(u.coordinate+e*f/2-d);s[l-1]=u=Gt(Gt({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate});var g=bc(e,u.tickCoord,()=>f,c,d);g&&(d=u.tickCoord-e*(f/2+i),s[l-1]=Gt(Gt({},u),{},{isShow:!0}))}for(var v=a?l-1:l,x=function(b){var j=s[b],P,E=()=>(P===void 0&&(P=r(j,b)),P);if(b===0){var C=e*(j.coordinate-e*E()/2-c);s[b]=j=Gt(Gt({},j),{},{tickCoord:C<0?j.coordinate-C*e:j.coordinate})}else s[b]=j=Gt(Gt({},j),{},{tickCoord:j.coordinate});var O=bc(e,j.tickCoord,E,c,d);O&&(c=j.tickCoord+e*(E()/2+i),s[b]=Gt(Gt({},j),{},{isShow:!0}))},y=0;y<v;y++)x(y);return s}function zm(e,t,r){var{tick:n,ticks:i,viewBox:a,minTickGap:s,orientation:l,interval:c,tickFormatter:d,unit:u,angle:f}=e;if(!i||!i.length||!n)return[];if(Ae(c)||Wi.isSsr){var h;return(h=gH(i,Ae(c)?c:0))!==null&&h!==void 0?h:[]}var g=[],v=l==="top"||l==="bottom"?"width":"height",x=u&&v==="width"?ja(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(j,P)=>{var E=typeof d=="function"?d(j.value,P):j.value;return v==="width"?pH(ja(E,{fontSize:t,letterSpacing:r}),x,f):ja(E,{fontSize:t,letterSpacing:r})[v]},w=i.length>=2?Lt(i[1].coordinate-i[0].coordinate):1,b=hH(a,w,v);return c==="equidistantPreserveStart"?mH(w,b,y,i,s):(c==="preserveStart"||c==="preserveStartEnd"?g=wH(w,b,y,i,s,c==="preserveStartEnd"):g=bH(w,b,y,i,s),g.filter(j=>j.isShow))}var CH=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:i=0,tickMargin:a=0}=e,s=0;if(t){Array.from(t).forEach(u=>{if(u){var f=u.getBoundingClientRect();f.width>s&&(s=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=i+a,d=s+c+l+(r?n:0);return Math.round(d)}return 0},SH=["axisLine","width","height","className","hide","ticks"],jH=["viewBox"],EH=["viewBox"];function wh(e,t){if(e==null)return{};var r,n,i=PH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function PH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vi.apply(null,arguments)}function N1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N1(Object(r),!0).forEach(function(n){OH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OH(e,t,r){return(t=kH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kH(e){var t=TH(e,"string");return typeof t=="symbol"?t:t+""}function TH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fm={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"};function MH(e){var{x:t,y:r,width:n,height:i,orientation:a,mirror:s,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=Ot(Ot(Ot({},c),Qr(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var u=+(a==="top"&&!s||a==="bottom"&&s);d=Ot(Ot({},d),{},{x1:t,y1:r+u*i,x2:t+n,y2:r+u*i})}else{var f=+(a==="left"&&!s||a==="right"&&s);d=Ot(Ot({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+i})}return S.createElement("line",Vi({},d,{className:Je("recharts-cartesian-axis-line",_i(l,"className"))}))}function RH(e,t,r,n,i,a,s,l,c){var d,u,f,h,g,v,x=l?-1:1,y=e.tickSize||s,w=Ae(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":d=u=e.coordinate,h=r+ +!l*i,f=h-x*y,v=f-x*c,g=w;break;case"left":f=h=e.coordinate,u=t+ +!l*n,d=u-x*y,g=d-x*c,v=w;break;case"right":f=h=e.coordinate,u=t+ +l*n,d=u+x*y,g=d+x*c,v=w;break;default:d=u=e.coordinate,h=r+ +l*i,f=h+x*y,v=f+x*c,g=w;break}return{line:{x1:d,y1:f,x2:u,y2:h},tick:{x:g,y:v}}}function AH(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function IH(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function NH(e){var{option:t,tickProps:r,value:n}=e,i,a=Je(r.className,"recharts-cartesian-axis-tick-value");if(S.isValidElement(t))i=S.cloneElement(t,Ot(Ot({},r),{},{className:a}));else if(typeof t=="function")i=t(Ot(Ot({},r),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=Je(s,t?.className)),i=S.createElement(hu,Vi({},r,{className:s}),n)}return i}function DH(e){var{ticks:t=[],tick:r,tickLine:n,stroke:i,tickFormatter:a,unit:s,padding:l,tickTextProps:c,orientation:d,mirror:u,x:f,y:h,width:g,height:v,tickSize:x,tickMargin:y,fontSize:w,letterSpacing:b,getTicksConfig:j,events:P}=e,E=zm(Ot(Ot({},j),{},{ticks:t}),w,b),C=AH(d,u),O=IH(d,u),k=Qr(j),T=za(r),D={};typeof n=="object"&&(D=n);var L=Ot(Ot({},k),{},{fill:"none"},D),A=E.map((B,z)=>{var{line:F,tick:R}=RH(B,f,h,g,v,d,x,u,y),N=Ot(Ot(Ot(Ot({textAnchor:C,verticalAnchor:O},k),{},{stroke:"none",fill:i},T),R),{},{index:z,payload:B,visibleTicksCount:E.length,tickFormatter:a,padding:l},c);return S.createElement(ur,Vi({className:"recharts-cartesian-axis-tick",key:"tick-".concat(B.value,"-").concat(B.coordinate,"-").concat(B.tickCoord)},cs(P,B,z)),n&&S.createElement("line",Vi({},L,F,{className:Je("recharts-cartesian-axis-tick-line",_i(n,"className"))})),r&&S.createElement(NH,{option:r,tickProps:N,value:"".concat(typeof a=="function"?a(B.value,z):B.value).concat(s||"")}))});return A.length>0?S.createElement("g",{className:"recharts-cartesian-axis-ticks"},A):null}var _H=m.forwardRef((e,t)=>{var{axisLine:r,width:n,height:i,className:a,hide:s,ticks:l}=e,c=wh(e,SH),[d,u]=m.useState(""),[f,h]=m.useState(""),g=m.useRef(null);m.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return CH({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var v=m.useCallback(x=>{if(x){var y=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=y;var w=y[0];if(w){var b=window.getComputedStyle(w),j=b.fontSize,P=b.letterSpacing;(j!==d||P!==f)&&(u(j),h(P))}}},[d,f]);return s||n!=null&&n<=0||i!=null&&i<=0?null:S.createElement(ur,{className:Je("recharts-cartesian-axis",a),ref:v},S.createElement(MH,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Qr(e)}),S.createElement(DH,{ticks:l,tick:e.tick,tickLine:e.tickLine,stroke:e.stroke,tickFormatter:e.tickFormatter,unit:e.unit,padding:e.padding,tickTextProps:e.tickTextProps,orientation:e.orientation,mirror:e.mirror,x:e.x,y:e.y,width:e.width,height:e.height,tickSize:e.tickSize,tickMargin:e.tickMargin,fontSize:d,letterSpacing:f,getTicksConfig:e,events:c}),S.createElement(LF,{x:e.x,y:e.y,width:e.width,height:e.height},S.createElement(GF,{label:e.label,labelRef:e.labelRef}),e.children))}),BH=S.memo(_H,(e,t)=>{var{viewBox:r}=e,n=wh(e,jH),{viewBox:i}=t,a=wh(t,EH);return Oo(r,i)&&Oo(n,a)}),Vm=S.forwardRef((e,t)=>{var r=ir(e,Fm);return S.createElement(BH,Vi({},r,{ref:t}))});Vm.displayName="CartesianAxis";var $H=["x1","y1","x2","y2","key"],LH=["offset"],zH=["xAxisId","yAxisId"],FH=["xAxisId","yAxisId"];function D1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D1(Object(r),!0).forEach(function(n){VH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VH(e,t,r){return(t=HH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HH(e){var t=UH(e,"string");return typeof t=="symbol"?t:t+""}function UH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ki.apply(null,arguments)}function wc(e,t){if(e==null)return{};var r,n,i=WH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function WH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var KH=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:i,width:a,height:s,ry:l}=e;return S.createElement("rect",{x:n,y:i,ry:l,width:a,height:s,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function NP(e,t){var r;if(S.isValidElement(e))r=S.cloneElement(e,t);else if(typeof e=="function")r=e(t);else{var{x1:n,y1:i,x2:a,y2:s,key:l}=t,c=wc(t,$H),d=Qr(c),u=wc(d,LH);r=S.createElement("line",ki({},u,{x1:n,y1:i,x2:a,y2:s,fill:"none",key:l}))}return r}function qH(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:i}=e;if(!n||!i||!i.length)return null;var a=wc(e,zH),s=i.map((l,c)=>{var d=Xt(Xt({},a),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return NP(n,d)});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function YH(e){var{y:t,height:r,vertical:n=!0,verticalPoints:i}=e;if(!n||!i||!i.length)return null;var a=wc(e,FH),s=i.map((l,c)=>{var d=Xt(Xt({},a),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return NP(n,d)});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function GH(e){var{horizontalFill:t,fillOpacity:r,x:n,y:i,width:a,height:s,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length)return null;var d=l.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==d[0]&&d.unshift(0);var u=d.map((f,h)=>{var g=!d[h+1],v=g?i+s-f:d[h+1]-f;if(v<=0)return null;var x=h%t.length;return S.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:v,width:a,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function XH(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:i,y:a,width:s,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==d[0]&&d.unshift(0);var u=d.map((f,h)=>{var g=!d[h+1],v=g?i+s-f:d[h+1]-f;if(v<=0)return null;var x=h%r.length;return S.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:v,height:l,stroke:"none",fill:r[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var ZH=(e,t)=>{var{xAxis:r,width:n,height:i,offset:a}=e;return Pj(zm(Xt(Xt(Xt({},Fm),r),{},{ticks:Oj(r),viewBox:{x:0,y:0,width:n,height:i}})),a.left,a.left+a.width,t)},QH=(e,t)=>{var{yAxis:r,width:n,height:i,offset:a}=e;return Pj(zm(Xt(Xt(Xt({},Fm),r),{},{ticks:Oj(r),viewBox:{x:0,y:0,width:n,height:i}})),a.top,a.top+a.height,t)},JH={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0};function Rl(e){var t=xg(),r=bg(),n=Nj(),i=Xt(Xt({},ir(e,JH)),{},{x:Ae(e.x)?e.x:n.left,y:Ae(e.y)?e.y:n.top,width:Ae(e.width)?e.width:n.width,height:Ae(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:s,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:h,verticalValues:g}=i,v=Sr(),x=Re(T=>_b(T,"xAxis",a,v)),y=Re(T=>_b(T,"yAxis",s,v));if(!Ae(d)||d<=0||!Ae(u)||u<=0||!Ae(l)||l!==+l||!Ae(c)||c!==+c)return null;var w=i.verticalCoordinatesGenerator||ZH,b=i.horizontalCoordinatesGenerator||QH,{horizontalPoints:j,verticalPoints:P}=i;if((!j||!j.length)&&typeof b=="function"){var E=h&&h.length,C=b({yAxis:y?Xt(Xt({},y),{},{ticks:E?h:y.ticks}):void 0,width:t,height:r,offset:n},E?!0:f);rc(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(j=C)}if((!P||!P.length)&&typeof w=="function"){var O=g&&g.length,k=w({xAxis:x?Xt(Xt({},x),{},{ticks:O?g:x.ticks}):void 0,width:t,height:r,offset:n},O?!0:f);rc(Array.isArray(k),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(P=k)}return S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(KH,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),S.createElement(GH,ki({},i,{horizontalPoints:j})),S.createElement(XH,ki({},i,{verticalPoints:P})),S.createElement(qH,ki({},i,{offset:n,horizontalPoints:j,xAxis:x,yAxis:y})),S.createElement(YH,ki({},i,{offset:n,verticalPoints:P,xAxis:x,yAxis:y})))}Rl.displayName="CartesianGrid";var eU=["dangerouslySetInnerHTML","ticks"],tU=["id"],rU=["domain"],nU=["domain"];function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ch.apply(null,arguments)}function Cc(e,t){if(e==null)return{};var r,n,i=iU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function iU(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function oU(e){var t=dt();return m.useLayoutEffect(()=>(t(I7(e)),()=>{t(N7(e))}),[e,t]),null}var aU=e=>{var{xAxisId:t,className:r}=e,n=Re(vg),i=Sr(),a="xAxis",s=Re(g=>Vo(g,a,t,i)),l=Re(g=>kE(g,a,t,i)),c=Re(g=>jE(g,t)),d=Re(g=>bL(g,t)),u=Re(g=>oE(g,t));if(c==null||d==null||u==null)return null;var f=Cc(e,eU),h=Cc(u,tU);return S.createElement(Vm,Ch({},f,h,{scale:s,x:d.x,y:d.y,width:c.width,height:c.height,className:Je("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:l}))},sU={allowDataOverflow:gr.allowDataOverflow,allowDecimals:gr.allowDecimals,allowDuplicatedCategory:gr.allowDuplicatedCategory,height:gr.height,hide:!1,mirror:gr.mirror,orientation:gr.orientation,padding:gr.padding,reversed:gr.reversed,scale:gr.scale,tickCount:gr.tickCount,type:gr.type,xAxisId:0},lU=e=>{var t,r,n,i,a,s=ir(e,sU);return S.createElement(S.Fragment,null,S.createElement(oU,{interval:(t=s.interval)!==null&&t!==void 0?t:"preserveEnd",id:s.xAxisId,scale:s.scale,type:s.type,padding:s.padding,allowDataOverflow:s.allowDataOverflow,domain:s.domain,dataKey:s.dataKey,allowDuplicatedCategory:s.allowDuplicatedCategory,allowDecimals:s.allowDecimals,tickCount:s.tickCount,includeHidden:(r=s.includeHidden)!==null&&r!==void 0?r:!1,reversed:s.reversed,ticks:s.ticks,height:s.height,orientation:s.orientation,mirror:s.mirror,hide:s.hide,unit:s.unit,name:s.name,angle:(n=s.angle)!==null&&n!==void 0?n:0,minTickGap:(i=s.minTickGap)!==null&&i!==void 0?i:5,tick:(a=s.tick)!==null&&a!==void 0?a:!0,tickFormatter:s.tickFormatter}),S.createElement(aU,s))},cU=(e,t)=>{var{domain:r}=e,n=Cc(e,rU),{domain:i}=t,a=Cc(t,nU);return Oo(n,a)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:Oo({domain:r},{domain:i}):!1},Al=S.memo(lU,cU);Al.displayName="XAxis";var uU=["dangerouslySetInnerHTML","ticks"],dU=["id"],fU=["domain"],pU=["domain"];function Sh(){return Sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sh.apply(null,arguments)}function Sc(e,t){if(e==null)return{};var r,n,i=hU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function hU(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function gU(e){var t=dt();return m.useLayoutEffect(()=>(t(D7(e)),()=>{t(_7(e))}),[e,t]),null}var mU=e=>{var{yAxisId:t,className:r,width:n,label:i}=e,a=m.useRef(null),s=m.useRef(null),l=Re(vg),c=Sr(),d=dt(),u="yAxis",f=Re(b=>Vo(b,u,t,c)),h=Re(b=>EE(b,t)),g=Re(b=>CL(b,t)),v=Re(b=>kE(b,u,t,c)),x=Re(b=>aE(b,t));if(m.useLayoutEffect(()=>{if(!(n!=="auto"||!h||Mm(i)||m.isValidElement(i)||x==null)){var b=a.current;if(b){var j=b.getCalculatedWidth();Math.round(h.width)!==Math.round(j)&&d(B7({id:t,width:j}))}}},[v,h,d,i,t,n,x]),h==null||g==null||x==null)return null;var y=Sc(e,uU),w=Sc(x,dU);return S.createElement(Vm,Sh({},y,w,{ref:a,labelRef:s,scale:f,x:g.x,y:g.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:h.width,height:h.height,className:Je("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:v}))},vU={allowDataOverflow:mr.allowDataOverflow,allowDecimals:mr.allowDecimals,allowDuplicatedCategory:mr.allowDuplicatedCategory,hide:!1,mirror:mr.mirror,orientation:mr.orientation,padding:mr.padding,reversed:mr.reversed,scale:mr.scale,tickCount:mr.tickCount,type:mr.type,width:mr.width,yAxisId:0},yU=e=>{var t,r,n,i,a,s=ir(e,vU);return S.createElement(S.Fragment,null,S.createElement(gU,{interval:(t=s.interval)!==null&&t!==void 0?t:"preserveEnd",id:s.yAxisId,scale:s.scale,type:s.type,domain:s.domain,allowDataOverflow:s.allowDataOverflow,dataKey:s.dataKey,allowDuplicatedCategory:s.allowDuplicatedCategory,allowDecimals:s.allowDecimals,tickCount:s.tickCount,padding:s.padding,includeHidden:(r=s.includeHidden)!==null&&r!==void 0?r:!1,reversed:s.reversed,ticks:s.ticks,width:s.width,orientation:s.orientation,mirror:s.mirror,hide:s.hide,unit:s.unit,name:s.name,angle:(n=s.angle)!==null&&n!==void 0?n:0,minTickGap:(i=s.minTickGap)!==null&&i!==void 0?i:5,tick:(a=s.tick)!==null&&a!==void 0?a:!0,tickFormatter:s.tickFormatter}),S.createElement(mU,s))},xU=(e,t)=>{var{domain:r}=e,n=Sc(e,fU),{domain:i}=t,a=Sc(t,pU);return Oo(n,a)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:Oo({domain:r},{domain:i}):!1},Il=S.memo(yU,xU);Il.displayName="YAxis";function bU(e){e()}function wU(){let e=null,t=null;return{clear(){e=null,t=null},notify(){bU(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var _1={notify(){},get:()=>[]};function CU(e,t){let r,n=_1,i=0,a=!1;function s(x){u();const y=n.subscribe(x);let w=!1;return()=>{w||(w=!0,y(),f())}}function l(){n.notify()}function c(){v.onStateChange&&v.onStateChange()}function d(){return a}function u(){i++,r||(r=e.subscribe(c),n=wU())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=_1)}function h(){a||(a=!0,u())}function g(){a&&(a=!1,f())}const v={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:h,tryUnsubscribe:g,getListeners:()=>n};return v}var SU=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jU=SU(),EU=()=>typeof navigator<"u"&&navigator.product==="ReactNative",PU=EU(),OU=()=>jU||PU?S.useLayoutEffect:S.useEffect,kU=OU(),TU=Symbol.for("react-redux-context"),MU=typeof globalThis<"u"?globalThis:{};function RU(){if(!S.createContext)return{};const e=MU[TU]??=new Map;let t=e.get(S.createContext);return t||(t=S.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(S.createContext,t)),t}var AU=RU();function IU(e){const{children:t,context:r,serverState:n,store:i}=e,a=S.useMemo(()=>{const c=CU(i),d={store:i,subscription:c,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(d,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),s=S.useMemo(()=>i.getState(),[i]);kU(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,s]);const l=r||AU;return S.createElement(l.Provider,{value:a},t)}var NU=IU,DU=(e,t)=>t,Hm=ee([DU,We,rE,It,WE,Vn,Pz,Rt],Rz),Um=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},DP=Br("mouseClick"),_P=ps();_P.startListening({actionCreator:DP,effect:(e,t)=>{var r=e.payload,n=Hm(t.getState(),Um(r));n?.activeIndex!=null&&t.dispatch(DL({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var jh=Br("mouseMove"),BP=ps();BP.startListening({actionCreator:jh,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=wm(n,n.tooltip.settings.shared),a=Hm(n,Um(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(_E({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(DE()))}});var B1={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},$P=Cr({name:"rootProps",initialState:B1,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:B1.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),_U=$P.reducer,{updateOptions:BU}=$P.actions,LP=Cr({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:$U}=LP.actions,LU=LP.reducer,zP=Br("keyDown"),FP=Br("focus"),Wm=ps();Wm.startListening({actionCreator:zP,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var s=Number(Cm(i,Uo(r))),l=Vn(r);if(a==="Enter"){var c=gc(r,"axis","hover",String(i.index));t.dispatch(mh({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:c}));return}var d=PL(r),u=d==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,h=s+f*u;if(!(l==null||h>=l.length||h<0)){var g=gc(r,"axis","hover",String(h));t.dispatch(mh({active:!0,activeIndex:h.toString(),activeDataKey:void 0,activeCoordinate:g}))}}}}});Wm.startListening({actionCreator:FP,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",s=gc(r,"axis","hover",String(a));t.dispatch(mh({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:s}))}}}});var Rr=Br("externalEvent"),VP=ps();VP.startListening({actionCreator:Rr,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:vz(r),activeDataKey:GE(r),activeIndex:Fi(r),activeLabel:YE(r),activeTooltipIndex:Fi(r),isTooltipActive:yz(r)};e.payload.handler(n,e.payload.reactEvent)}}});var zU=ee([Ho],e=>e.tooltipItemPayloads),FU=ee([zU,Ss,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(l=>l.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var s=t(a,r);return s}}}),HP=Br("touchMove"),UP=ps();UP.startListening({actionCreator:HP,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=wm(n,n.tooltip.settings.shared);if(i==="axis"){var a=Hm(n,Um({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(_E({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var s,l=r.touches[0],c=document.elementFromPoint(l.clientX,l.clientY);if(!c||!c.getAttribute)return;var d=c.getAttribute(Tj),u=(s=c.getAttribute(Mj))!==null&&s!==void 0?s:void 0,f=FU(t.getState(),d,u);t.dispatch(NE({activeDataKey:u,activeIndex:d,activeCoordinate:f}))}}});var VU=GS({brush:rH,cartesianAxis:$7,chartData:qz,errorBars:Q7,graphicalItems:r7,layout:uB,legend:v3,options:Vz,polarAxis:y9,polarOptions:LU,referenceElements:uH,rootProps:_U,tooltip:_L}),HU=function(t){return D6({reducer:VU,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([_P.middleware,BP.middleware,Wm.middleware,VP.middleware,UP.middleware]),enhancers:r=>{var n=r;return typeof r=="function"&&(n=r()),n.concat(dj({type:"raf"}))},devTools:Wi.devToolsEnabled})};function WP(e){var{preloadedState:t,children:r}=e,n=Sr(),i=m.useRef(null);if(n)return r;i.current==null&&(i.current=HU(t));var a=ug;return S.createElement(NU,{context:a,store:i.current},r)}function KP(e){var{layout:t,margin:r}=e,n=dt(),i=Sr();return m.useEffect(()=>{i||(n(sB(t)),n(aB(r)))},[n,i,t,r]),null}function qP(e){var t=dt();return m.useEffect(()=>{t(BU(e))},[t,e]),null}var UU=["children"];function WU(e,t){if(e==null)return{};var r,n,i=KU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function KU(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jc.apply(null,arguments)}var qU={width:"100%",height:"100%",display:"block"},YU=m.forwardRef((e,t)=>{var r=xg(),n=bg(),i=$j();if(!Co(r)||!Co(n))return null;var{children:a,otherAttributes:s,title:l,desc:c}=e,d,u;return typeof s.tabIndex=="number"?d=s.tabIndex:d=i?0:void 0,typeof s.role=="string"?u=s.role:u=i?"application":void 0,S.createElement(Jh,jc({},s,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:qU,ref:t}),a)}),GU=e=>{var{children:t}=e,r=Re(Yc);if(!r)return null;var{width:n,height:i,y:a,x:s}=r;return S.createElement(Jh,{width:n,height:i,x:s,y:a},t)},$1=m.forwardRef((e,t)=>{var{children:r}=e,n=WU(e,UU),i=Sr();return i?S.createElement(GU,null,r):S.createElement(YU,jc({ref:t},n),r)});function XU(){var e=dt(),[t,r]=m.useState(null),n=Re(LB);return m.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Qt(a)&&a!==n&&e(cB(a))}},[t,e,n]),r}function L1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ZU(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L1(Object(r),!0).forEach(function(n){QU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QU(e,t,r){return(t=JU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JU(e){var t=eW(e,"string");return typeof t=="symbol"?t:t+""}function eW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hi.apply(null,arguments)}var tW=()=>(rF(),null);function Ec(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var rW=m.forwardRef((e,t)=>{var r,n,i=m.useRef(null),[a,s]=m.useState({containerWidth:Ec((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Ec((n=e.style)===null||n===void 0?void 0:n.height)}),l=m.useCallback((d,u)=>{s(f=>{var h=Math.round(d),g=Math.round(u);return f.containerWidth===h&&f.containerHeight===g?f:{containerWidth:h,containerHeight:g}})},[]),c=m.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:u,height:f}=d.getBoundingClientRect();l(u,f);var h=v=>{var{width:x,height:y}=v[0].contentRect;l(x,y)},g=new ResizeObserver(h);g.observe(d),i.current=g}},[t,l]);return m.useEffect(()=>()=>{var d=i.current;d?.disconnect()},[l]),S.createElement(S.Fragment,null,S.createElement(Xc,{width:a.containerWidth,height:a.containerHeight}),S.createElement("div",Hi({ref:c},e)))}),nW=m.forwardRef((e,t)=>{var{width:r,height:n}=e,[i,a]=m.useState({containerWidth:Ec(r),containerHeight:Ec(n)}),s=m.useCallback((c,d)=>{a(u=>{var f=Math.round(c),h=Math.round(d);return u.containerWidth===f&&u.containerHeight===h?u:{containerWidth:f,containerHeight:h}})},[]),l=m.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();s(d,u)}},[t,s]);return S.createElement(S.Fragment,null,S.createElement(Xc,{width:i.containerWidth,height:i.containerHeight}),S.createElement("div",Hi({ref:l},e)))}),iW=m.forwardRef((e,t)=>{var{width:r,height:n}=e;return S.createElement(S.Fragment,null,S.createElement(Xc,{width:r,height:n}),S.createElement("div",Hi({ref:t},e)))}),oW=m.forwardRef((e,t)=>{var{width:r,height:n}=e;return Rn(r)||Rn(n)?S.createElement(nW,Hi({},e,{ref:t})):S.createElement(iW,Hi({},e,{ref:t}))});function aW(e){return e===!0?rW:oW}var sW=m.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:s,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:h,onTouchEnd:g,onTouchMove:v,onTouchStart:x,style:y,width:w,responsive:b,dispatchTouchEvents:j=!0}=e,P=m.useRef(null),E=dt(),[C,O]=m.useState(null),[k,T]=m.useState(null),D=XU(),L=yg(),A=L?.width>0?L.width:w,B=L?.height>0?L.height:i,z=m.useCallback(J=>{D(J),typeof t=="function"&&t(J),O(J),T(J),J!=null&&(P.current=J)},[D,t,O,T]),F=m.useCallback(J=>{E(DP(J)),E(Rr({handler:a,reactEvent:J}))},[E,a]),R=m.useCallback(J=>{E(jh(J)),E(Rr({handler:d,reactEvent:J}))},[E,d]),N=m.useCallback(J=>{E(DE()),E(Rr({handler:u,reactEvent:J}))},[E,u]),I=m.useCallback(J=>{E(jh(J)),E(Rr({handler:f,reactEvent:J}))},[E,f]),M=m.useCallback(()=>{E(FP())},[E]),W=m.useCallback(J=>{E(zP(J.key))},[E]),$=m.useCallback(J=>{E(Rr({handler:s,reactEvent:J}))},[E,s]),H=m.useCallback(J=>{E(Rr({handler:l,reactEvent:J}))},[E,l]),X=m.useCallback(J=>{E(Rr({handler:c,reactEvent:J}))},[E,c]),ue=m.useCallback(J=>{E(Rr({handler:h,reactEvent:J}))},[E,h]),fe=m.useCallback(J=>{E(Rr({handler:x,reactEvent:J}))},[E,x]),me=m.useCallback(J=>{j&&E(HP(J)),E(Rr({handler:v,reactEvent:J}))},[E,j,v]),Pe=m.useCallback(J=>{E(Rr({handler:g,reactEvent:J}))},[E,g]),Ee=aW(b);return S.createElement(tP.Provider,{value:C},S.createElement(fS.Provider,{value:k},S.createElement(Ee,{width:A??y?.width,height:B??y?.height,className:Je("recharts-wrapper",n),style:ZU({position:"relative",cursor:"default",width:A,height:B},y),onClick:F,onContextMenu:$,onDoubleClick:H,onFocus:M,onKeyDown:W,onMouseDown:X,onMouseEnter:R,onMouseLeave:N,onMouseMove:I,onMouseUp:ue,onTouchEnd:Pe,onTouchMove:me,onTouchStart:fe,ref:z},S.createElement(tW,null),r)))}),lW=["width","height","responsive","children","className","style","compact","title","desc"];function cW(e,t){if(e==null)return{};var r,n,i=uW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function uW(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var YP=m.forwardRef((e,t)=>{var{width:r,height:n,responsive:i,children:a,className:s,style:l,compact:c,title:d,desc:u}=e,f=cW(e,lW),h=Qr(f);return c?S.createElement(S.Fragment,null,S.createElement(Xc,{width:r,height:n}),S.createElement($1,{otherAttributes:h,title:d,desc:u},a)):S.createElement(sW,{className:s,style:l,width:r,height:n,responsive:i,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},S.createElement($1,{otherAttributes:h,title:d,desc:u,ref:t},S.createElement(fH,null,a)))});function Eh(){return Eh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eh.apply(null,arguments)}var dW={top:5,right:5,bottom:5,left:5},fW={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:dW,reverseStackOrder:!1,syncMethod:"index",responsive:!1},pW=m.forwardRef(function(t,r){var n,i=ir(t.categoricalChartProps,fW),{chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return S.createElement(WP,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:a},S.createElement(AP,{chartData:d.data}),S.createElement(KP,{layout:i.layout,margin:i.margin}),S.createElement(qP,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),S.createElement(YP,Eh({},i,{ref:r})))}),hW=["axis","item"],Ff=m.forwardRef((e,t)=>S.createElement(pW,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:hW,tooltipPayloadSearcher:rP,categoricalChartProps:e,ref:t}));function gW(e){var t=dt();return m.useEffect(()=>{t($U(e))},[t,e]),null}var mW=["layout"];function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ph.apply(null,arguments)}function vW(e,t){if(e==null)return{};var r,n,i=yW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function yW(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var xW={top:5,right:5,bottom:5,left:5},bW={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:xW,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1},wW=m.forwardRef(function(t,r){var n,i=ir(t.categoricalChartProps,bW),{layout:a}=i,s=vW(i,mW),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:u}=t,f={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:u,eventEmitter:void 0};return S.createElement(WP,{preloadedState:{options:f},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:l},S.createElement(AP,{chartData:i.data}),S.createElement(KP,{layout:a,margin:i.margin}),S.createElement(qP,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),S.createElement(gW,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),S.createElement(YP,Ph({},s,{ref:r})))}),CW=["item"],SW={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},jW=m.forwardRef((e,t)=>{var r=ir(e,SW);return S.createElement(wW,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:CW,tooltipPayloadSearcher:rP,categoricalChartProps:r,ref:t})});const Qn=["#4285F4","#34A853","#FBBC05","#EA4335","#9C27B0","#00ACC1","#8D6E63"],z1="28%",EW=({sysCd:e,appItCd:t,appCd:r})=>{const{getFormData:n}=at.useSearchBox(),i=tt.useCodeStore(),a=tt.useSystemStore(),[s,l]=m.useState(""),[c,d]=m.useState(null),[u,f]=m.useState(!1),[h,g]=m.useState(!1),[v,x]=m.useState(!1),[y,w]=m.useState(!1),[b,j]=m.useState(null),[P,E]=m.useState([]),[C,O]=m.useState(null),[k,T]=m.useState(!1),[D,L]=m.useState({}),[A,B]=m.useState(!1),[z,F]=m.useState({}),R=m.useRef(null),N=m.useRef(null);m.useRef(null);const I=m.useRef(null),M=m.useRef(null),W=m.useRef(null),$=m.useRef({}),H=m.useMemo(()=>async q=>{const Q=q.target.value?.trim();h||!Q||(W.current&&clearTimeout(W.current),W.current=setTimeout(async()=>{T(!0),B(!1);try{const Z=I.current?.getFieldValue("sysCd"),le=I.current?.getFieldValue("appItCd"),ie=I.current?.getFieldValue("appCd");if(!Z||!le||!ie){T(!1);return}await de.SCMCODE00104({crprCd:I.current?.getFieldValue("crprCd")||"100",sysCd:Z,appItCd:le,appCd:ie,grpCd:Q})?(I.current?.setFields([{name:"grpCd",errors:["이미 사용중인 그룹코드입니다."]}]),p.message.error("이미 사용중인 그룹코드입니다."),B(!1)):(I.current?.setFields([{name:"grpCd",errors:[]}]),p.message.success("사용 가능한 그룹코드입니다."),B(!0))}catch(Z){console.error("그룹코드 중복 체크 실패:",Z),p.message.error("중복 체크 중 오류가 발생했습니다."),B(!1)}finally{T(!1)}},200))},[h]),X=m.useMemo(()=>async(q,Q)=>{const Z=q.target.value?.trim();if(y){const le=Z;if(!le)return;$.current[-1]&&clearTimeout($.current[-1]),$.current[-1]=setTimeout(async()=>{L(ie=>({...ie,[-1]:!0})),F(ie=>{const pe={...ie};return delete pe[-1],pe});try{await de.SCMCODE00105({crprCd:M.current?.getFieldValue("crprCd")||"100",sysCd:M.current?.getFieldValue("sysCd")||"",appItCd:M.current?.getFieldValue("appItCd")||b?.appItCd||"CM",appCd:M.current?.getFieldValue("appCd")||b?.appCd||"CM",grpCd:M.current?.getFieldValue("grpCd")||"",dtlCd:le})?(M.current?.setFields([{name:"dtlCd",errors:["이미 사용중인 상세코드입니다."]}]),p.message.error("이미 사용중인 상세코드입니다."),F(pe=>{const ve={...pe};return delete ve[-1],ve})):(M.current?.setFields([{name:"dtlCd",errors:[]}]),p.message.success("사용 가능한 상세코드입니다."),F(pe=>({...pe,[-1]:!0})))}catch(ie){console.error("상세코드 중복 체크 실패:",ie),p.message.error("중복 체크 중 오류가 발생했습니다."),F(pe=>{const ve={...pe};return delete ve[-1],ve})}finally{L(ie=>({...ie,[-1]:!1}))}},200);return}!Z||!b||($.current[Q]&&clearTimeout($.current[Q]),$.current[Q]=setTimeout(async()=>{L(le=>({...le,[Q]:!0})),F(le=>{const ie={...le};return delete ie[Q],ie});try{if((M.current?.getFieldValue("details")||[]).some((ve,be)=>be!==Q&&ve.dtlCd?.trim()===Z)){M.current?.setFields([{name:["details",Q,"dtlCd"],errors:["같은 상세코드가 이미 입력되었습니다."]}]),p.message.error("같은 상세코드가 이미 입력되었습니다."),F(ve=>{const be={...ve};return delete be[Q],be}),L(ve=>({...ve,[Q]:!1}));return}await de.SCMCODE00105({crprCd:b.crprCd||"100",sysCd:b.sysCd||"",appItCd:b.appItCd||"CM",appCd:b.appCd||"CM",grpCd:b.grpCd||"",dtlCd:Z})?(M.current?.setFields([{name:["details",Q,"dtlCd"],errors:["이미 사용중인 상세코드입니다."]}]),p.message.error("이미 사용중인 상세코드입니다."),F(ve=>{const be={...ve};return delete be[Q],be})):(M.current?.setFields([{name:["details",Q,"dtlCd"],errors:[]}]),p.message.success("사용 가능한 상세코드입니다."),F(ve=>({...ve,[Q]:!0})))}catch(le){console.error("상세코드 중복 체크 실패:",le),p.message.error("중복 체크 중 오류가 발생했습니다."),F(ie=>{const pe={...ie};return delete pe[Q],pe})}finally{L(le=>({...le,[Q]:!1}))}},500))},[y,b]),ue=m.useMemo(()=>ae.createBwgGridRenderer((q,Q,Z,le,ie)=>{const pe=Q.index?.itemIndex;if(q.getValue(pe,"metaYn")==="Y"){ie.render(o.jsx("div",{}));return}const be=()=>{if(pe===void 0||pe<0)return;const se=R.current?.dp?.getJsonRow(pe);se&&(g(!0),B(!1),f(!0),setTimeout(()=>{I.current?.setFieldsValue({crprCd:se.crprCd||"100",sysCd:se.sysCd||"",appItCd:se.appItCd||"CM",appCd:se.appCd||"CM",grpCd:se.grpCd||"",grpNm:se.grpNm||"",enblYn:se.enblYn||"N",sortOrd:se.sortOrd||0,rmrk:se.rmrk||""})},100))},Be=()=>{if(pe===void 0||pe<0)return;const se=R.current?.dp?.getJsonRow(pe);se&&p.Modal.confirm({title:"삭제 확인",content:`그룹코드 '${se.grpCd} - ${se.grpNm}'을(를) 삭제하시겠습니까?`,okText:"확인",cancelText:"취소",onOk(){const Me={crprCd:se.crprCd||"100",sysCd:se.sysCd||"",appItCd:se.appItCd||"CM",appCd:se.appCd||"CM",grpCd:se.grpCd||"",grpNm:se.grpNm||"",enblYn:se.enblYn||"N",sortOrd:se.sortOrd||0,rmrk:se.rmrk||""};de.SCMCODE00202(Me)}})};ie.render(o.jsxs(p.Flex,{style:{justifyContent:"center",alignItems:"center",gap:8},children:[o.jsx(_.BwgButton,{icon:o.jsx(Y.EditOutlined,{}),onClick:be}),o.jsx(_.BwgButton,{icon:o.jsx(Y.DeleteOutlined,{style:{color:"red"}}),onClick:Be})]}))}),[]),fe=m.useMemo(()=>ae.createBwgGridRenderer((q,Q,Z,le,ie)=>{const pe=Q.index?.itemIndex;if(q.getValue(pe,"sysLockYn")==="Y"){ie.render(o.jsx("div",{}));return}const be=()=>{if(pe===void 0||pe<0)return;const se=N.current?.dp?.getJsonRow(pe);se&&(w(!0),x(!0),F({}),setTimeout(()=>{M.current?.setFieldsValue({crprCd:se.crprCd||"100",sysCd:se.sysCd||"",appItCd:se.appItCd||"CM",appCd:se.appCd||"CM",grpCd:se.grpCd||"",dtlCd:se.dtlCd||"",cmmnCd:se.cmmnCd||"",cmmnCdNm:se.cmmnCdNm||"",cmmnCdClr:se.cmmnCdClr||"",cmmnAbrv:se.cmmnAbrv||"",sysLockYn:se.sysLockYn||"N",enblYn:se.enblYn||"N",sortOrd:se.sortOrd||0,rmrk:se.rmrk||""})},100))},Be=()=>{if(pe===void 0||pe<0)return;const se=N.current?.dp?.getJsonRow(pe);se&&p.Modal.confirm({title:"삭제 확인",content:o.jsxs("div",{children:[o.jsx("div",{children:`정말 "${se.cmmnCdNm} [${se.dtlCd}]" 을(를) 삭제하시겠습니까?`}),o.jsx("div",{style:{marginTop:8,fontSize:"12px",color:"#999"},children:"해당 작업이 진행되면 다시 되돌릴 수 없습니다."})]}),centered:!0,okText:"확인",cancelText:"취소",onOk(){const Me={crprCd:se.crprCd||"100",sysCd:se.sysCd||"",appItCd:se.appItCd||"CM",appCd:se.appCd||"CM",grpCd:se.grpCd||"",dtlCd:se.dtlCd||"",cmmnCd:se.cmmnCd||"",cmmnCdNm:se.cmmnCdNm||"",cmmnCdClr:se.cmmnCdClr||"",cmmnAbrv:se.cmmnAbrv||"",sysLockYn:se.sysLockYn||"N",enblYn:se.enblYn||"N",sortOrd:se.sortOrd||0,rmrk:se.rmrk||""};de.SCMCODE00204(Me)}})};ie.render(o.jsxs(p.Flex,{style:{justifyContent:"center",alignItems:"center",gap:8},children:[o.jsx(p.Button,{icon:o.jsx(Y.EditOutlined,{}),onClick:be}),o.jsx(p.Button,{icon:o.jsx(Y.DeleteOutlined,{style:{color:"red"}}),onClick:Be})]}))}),[]),me=m.useMemo(()=>ae.createBwgGridRenderer((q,Q,Z,le,ie)=>{q.getValue(Q.index?.itemIndex,"sysLockYn")==="Y"?ie.render(o.jsx(Y.LockOutlined,{})):ie.render(o.jsx(Y.UnlockOutlined,{}))}),[]),Pe=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"metaYn",header:{text:"메타"},width:80,styleName:"center"},{fieldName:"sysCd",header:{text:"시스템코드"},width:80},{fieldName:"appItCd",header:{text:"앱 통합코드"},width:80},{fieldName:"appCd",header:{text:"앱 코드"},width:120},{fieldName:"grpCd",header:{text:"그룹코드"},width:140},{fieldName:"grpNm",header:{text:"그룹명칭"},width:220,styleName:"left"},{fieldName:"enblYn",header:{text:"사용여부"},width:100,styleName:"center",renderer:ae.realFormat.checkYdisabled},{fieldName:"sortOrd",visible:!1},{fieldName:"rmrk",visible:!1},{fieldName:"inptDt",visible:!1},{fieldName:"inptId",visible:!1},{fieldName:"chngDt",visible:!1},{fieldName:"chngId",visible:!1},{fieldName:"moreActions",header:{text:"액션"},renderer:"moreActions"}],[]),Ee=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appItCd",visible:!1},{fieldName:"appCd",visible:!1},{fieldName:"grpCd",visible:!1},{fieldName:"dtlCd",header:{text:"상세코드"},width:140,styleName:"left",footer:{valueCallback:q=>{const Q=q.getDataSource();return Q?Q.getRowCount()+"건":"0"}}},{fieldName:"cmmnCd",header:{text:"공통코드"},width:160,styleName:"left"},{fieldName:"cmmnCdNm",header:{text:"공통코드명"},width:220,styleName:"left"},{fieldName:"cmmnCdClr",visible:!1},{fieldName:"cmmnAbrv",header:{text:"약어"},width:120,styleName:"left"},{fieldName:"sysLockYn",header:{text:"시스템잠금"},width:110,styleName:"center",renderer:"sysLockYn"},{fieldName:"enblYn",header:{text:"사용여부"},width:100,styleName:"center",renderer:ae.realFormat.checkYdisabled},{fieldName:"sortOrd",visible:!1},{fieldName:"rmrk",visible:!1},{fieldName:"inptDt",visible:!1},{fieldName:"inptId",visible:!1},{fieldName:"chngDt",visible:!1},{fieldName:"chngId",visible:!1},{fieldName:"moreActions",header:{text:"액션"},renderer:"moreActions"}],[]),J=m.useMemo(()=>({container:{indicator:!0,check:!0,page:!0},display:{rowHeight:30}}),[]),ye=m.useMemo(()=>({container:{indicator:!0,page:!0},display:{rowHeight:20}}),[]);m.useMemo(()=>[{fieldName:"crprCd",header:{text:"회사코드"},width:120,styleName:"left"},{fieldName:"sysCd",header:{text:"시스템코드"},width:120,styleName:"left"},{fieldName:"appItCd",header:{text:"앱 통합코드"},width:140,styleName:"left"},{fieldName:"appCd",header:{text:"앱 코드"},width:120,styleName:"left"},{fieldName:"cmmnCd",header:{text:"공통코드"},width:140,styleName:"left"},{fieldName:"optnCd",header:{text:"옵션코드"},width:140,styleName:"left"},{fieldName:"optnNm",header:{text:"옵션명"},width:200,styleName:"left"},{fieldName:"optnDesc",header:{text:"옵션설명"},width:250,styleName:"left"},{fieldName:"enblYn",header:{text:"사용여부"},width:100,styleName:"center"},{fieldName:"sortOrd",header:{text:"정렬순서"},width:100,styleName:"right"},{fieldName:"inptDt",header:{text:"입력일시"},width:150,styleName:"center"},{fieldName:"inptId",header:{text:"입력자"},width:120,styleName:"left"},{fieldName:"chngDt",header:{text:"변경일시"},width:150,styleName:"center"},{fieldName:"chngId",header:{text:"변경자"},width:120,styleName:"left"}],[]),m.useMemo(()=>({container:{indicator:!0,footer:!0}}),[]);const ge=q=>{const Q=i.getAvailableGroupCodes(),Z=[];Q.forEach(ie=>{const pe=i.getCodeList(ie,{enabledOnly:!1,systemCodeOnly:q==="Y",sortByOrder:!1});let ve=!1;if(q==="")ve=pe.length>0;else if(q==="Y")ve=pe.length>0;else if(q==="N"){const be=i.codeData;be&&be[ie]&&(ve=Object.values(be[ie]).some(Be=>Be.systemCodeYn!=="Y"))}ve&&Z.push({grpCd:ie,grpNm:""})});const le=s?Z.filter(ie=>ie.grpCd.toLowerCase().includes(s.toLowerCase())):Z;R.current?.addAllData(le)},V=(q,Q)=>{if(!q){N.current?.addAllData([]);return}const Z=i.codeData;if(!Z||!Z[q]){N.current?.addAllData([]);return}const pe=Object.values(Z[q]).filter(ve=>!(Q==="Y"&&ve.systemCodeYn!=="Y"||Q==="N"&&ve.systemCodeYn==="Y")).sort((ve,be)=>ve.sortOrder!==be.sortOrder?ve.sortOrder-be.sortOrder:ve.codeValue.localeCompare(be.codeValue)).map(ve=>({commonCode:ve.commonCode,codeNm:ve.codeNm,codeValue:ve.codeValue,labelColor:ve.labelColor,sortOrder:ve.sortOrder,enblYn:ve.enabled?"Y":"N",systemCodeYn:ve.systemCodeYn,rmrk:ve.originalData?.rmrk??null}));N.current?.addAllData(pe)};m.useRef(!1),m.useEffect(()=>{console.log("SystemCodeManage useEffect"),de.SCMCODE00101()},[]),m.useEffect(()=>{const q=n()?.sysLockYn||"";ge(q),V(c,q)},[s]);const oe=async()=>{de.SCMCODE00101()},K=m.useMemo(()=>Array.from(new Set(a.systemMap.map(q=>q.sysCd))).slice(0,6),[a.systemMap]),ce=m.useMemo(()=>Array.from(new Set(a.systemMap.map(q=>q.appItCd))).slice(0,8),[a.systemMap]),he=m.useMemo(()=>Array.from(new Set(a.systemMap.map(q=>q.appCd))).slice(0,8),[a.systemMap]),we=q=>{let Q=0;for(let Z=0;Z<q.length;Z++){const le=q.charCodeAt(Z);Q=(Q<<5)-Q+le,Q=Q&Q}return Math.abs(Q)},Se=q=>{if(q.length===0)return[];const Q=q.reduce((Z,le)=>Z+le.count,0);return Q===0?q.map((Z,le)=>we((Z.label||"")+le.toString())%30+20):q.map(Z=>Math.round(Z.count/Q*100))},Te=m.useMemo(()=>{const q=i.codeData;if(!q){const be=we("systemCode")%40+30;return[{name:"시스템코드",value:be},{name:"사용자코드",value:100-be}]}let Q=0,Z=0;Object.values(q).forEach(ve=>{Object.values(ve).forEach(be=>{be.systemCodeYn==="Y"?Q++:Z++})});const le=Q+Z;if(le===0){const be=we("systemCode")%40+30;return[{name:"시스템코드",value:be},{name:"사용자코드",value:100-be}]}const ie=Math.round(Q/le*100),pe=100-ie;return[{name:"시스템코드",value:ie},{name:"사용자코드",value:pe}]},[i]),Ne=m.useMemo(()=>{const q=i.codeData,Q={};q&&Object.values(q).forEach(ie=>{Object.values(ie).forEach(pe=>{const ve=pe.commonCode?.substring(0,2)||"";ve&&(Q[ve]=(Q[ve]||0)+1)})});const Z=K.filter(ie=>ie!=null).map(ie=>({label:ie,count:Q[ie]||0})),le=Se(Z);return K.filter(ie=>ie!=null).map((ie,pe)=>({name:ie,value:le[pe]||0}))},[K,i]),U=m.useMemo(()=>{const q=i.codeData,Q={};q&&Object.values(q).forEach(ie=>{Object.values(ie).forEach(pe=>{const be=(pe.commonCode||"").substring(0,2)||"";if(be&&ce.length>0){const Be=we(be+pe.groupCode),se=ce[Be%ce.length];se&&(Q[se]=(Q[se]||0)+1)}})});const Z=ce.filter(ie=>ie!=null).map(ie=>({label:ie,count:Q[ie]||0})),le=Se(Z);return ce.filter(ie=>ie!=null).map((ie,pe)=>({name:ie,value:le[pe]||0}))},[ce,i]),ne=m.useMemo(()=>{const q=i.codeData,Q={};q&&Object.values(q).forEach(ie=>{Object.values(ie).forEach(pe=>{const be=(pe.commonCode||"").substring(0,2)||"";if(be&&he.length>0){const Be=we(be+pe.groupCode),se=he[Be%he.length];se&&(Q[se]=(Q[se]||0)+1)}})});const Z=he.filter(ie=>ie!=null).map(ie=>({label:ie,count:Q[ie]||0})),le=Se(Z);return he.filter(ie=>ie!=null).map((ie,pe)=>({name:ie,value:le[pe]||0}))},[he,i]),re=m.useMemo(()=>{const Q=[{sysCd:"KE",sysNm:"K-ERP"},{sysCd:"CH",sysNm:"파트너관리"},{sysCd:"HR",sysNm:"K-HR"},{sysCd:"YT",sysNm:"연말정산"},{sysCd:"CM",sysNm:"공통"},{sysCd:"PA",sysNm:"평정"},{sysCd:"KS",sysNm:"K-업무지원"},{sysCd:"DE",sysNm:"온통"}].map(Z=>({label:Z.sysNm,value:Z.sysCd}));return[{label:"전체",value:""},...Q]},[]),G=m.useMemo(()=>{const Q=[{code:"KERP",name:""},{code:"KHR",name:"인사"},{code:"KHYT",name:"연말정산"},{code:"KCM",name:"공통"},{code:"KHPE",name:"평정"},{code:"EAUD",name:"감사 01"},{code:"INR",name:"감사 02"},{code:"ITAM",name:"자산 01"},{code:"CMM",name:"자산 02"},{code:"OAM",name:"자산 03"},{code:"KSGA",name:"총무"},{code:"HIS",name:"문헌"},{code:"WFAX",name:"IT서비스 0"},{code:"SMS",name:"IT서비스 0"},{code:"BID",name:"기타업무서비스 01"},{code:"PAM",name:"기타업무서비스 02"},{code:"DAC",name:"기타업무서비스 03"},{code:"IPR",name:"기타업무서비스 04"},{code:"ISB",name:"정보공유게시판"},{code:"ITSM",name:"ITSM"},{code:"BCOM",name:"소통"}].map(Z=>({label:Z.name?`${Z.code} (${Z.name})`:Z.code,value:Z.code}));return[{label:"전체",value:""},...Q]},[]),te=m.useMemo(()=>{const Q=[{code:"FI",name:"재무회계"},{code:"FM",name:"예산관리"},{code:"MM",name:"구매계약"},{code:"SD",name:"영업관리"},{code:"PMN",name:"파트너관리"},{code:"HR",name:"HR 솔루션"},{code:"YT",name:"연말정산"},{code:"CM",name:"프레임워크 공통"},{code:"PE",name:"평정"},{code:"EAUD",name:"e-감사"},{code:"INR",name:"청렴신고"},{code:"ITAM",name:"ITAM"},{code:"CMM",name:"차량/회의실"},{code:"OAM",name:"OA전산물품 관리"},{code:"GAM",name:"총무관리"},{code:"ACM",name:"출입관리"},{code:"IVM",name:"비품관리"},{code:"SGS",name:"인장서비스"},{code:"HIS",name:"사료관리"},{code:"ITSM",name:"ITSM"},{code:"WFAX",name:"웹펙스서비스"},{code:"SMS",name:"메시지서비스"},{code:"BID",name:"경영공시"},{code:"PAM",name:"언론미디어"},{code:"DAC",name:"심의자문위원회"},{code:"IPR",name:"지식재산권 신청"},{code:"ISB",name:"정보공유게시판"},{code:"BCOM",name:"온통"}].map(Z=>({label:`${Z.code} (${Z.name})`,value:Z.code}));return[{label:"전체",value:""},...Q]},[]),de=m.useMemo(()=>({SCMCODE00101:()=>{const q=n(),Q={crprCd:q?.crprCd||"100",sysCd:q?.sysCd||"",appItCd:q?.appItCd||"",appCd:q?.appCd||"",sysLockYn:q?.sysLockYn||"",keyword:q?.keyword||""};ae.callService("SCMCODE00101",Q).then(Z=>{R.current?.addAllData(Z.data||[])}).catch(Z=>{p.message.error("그룹코드 조회에 실패했습니다.")})},SCMCODE00102:q=>{ae.callService("SCMCODE00102",q,{showLoading:!1}).then(Q=>{N.current?.addAllData(Q.data||[])}).catch(Q=>{p.message.error("상세코드 조회에 실패했습니다.")})},SCMCODE00104:q=>{const Q={grp:q};return ae.callService("SCMCODE00104",Q,{showLoading:!1}).then(Z=>Z.dup===!0).catch(Z=>(console.error("그룹코드 중복 체크 실패:",Z),!1))},SCMCODE00105:q=>{const Q={dtl:q};return ae.callService("SCMCODE00105",Q,{showLoading:!1}).then(Z=>Z.dup===!0).catch(Z=>(console.error("상세코드 중복 체크 실패:",Z),!1))},SCMCODE00201:(q,Q)=>{const Z={flag:q,grp:Q};return ae.callService("SCMCODE00201",Z).then(le=>(p.message.success(q==="I"?"그룹코드가 등록되었습니다.":"그룹코드가 수정되었습니다."),de.SCMCODE00101(),le)).catch(le=>{throw console.error("그룹코드 저장 실패:",le),le})},SCMCODE00202:q=>{const Q={grp:q};return ae.callService("SCMCODE00202",Q).then(Z=>(p.message.success("그룹코드가 삭제되었습니다."),de.SCMCODE00101(),Z)).catch(Z=>{throw p.message.error("그룹코드 삭제에 실패했습니다."),Z})},SCMCODE00203:(q,Q,Z)=>{const le={flag:q,dtlCnt:Q,dtl:Z};return ae.callService("SCMCODE00203",le).then(ie=>(p.message.success(q==="I"?"상세코드가 등록되었습니다.":"상세코드가 수정되었습니다."),b&&de.SCMCODE00102({sysCd:b.sysCd,appItCd:b.appItCd,appCd:b.appCd,grpCd:b.grpCd}),ie)).catch(ie=>{throw console.error("상세코드 저장 실패:",ie),p.message.error(q==="I"?"상세코드 등록에 실패했습니다.":"상세코드 수정에 실패했습니다."),ie})},SCMCODE00204:q=>{const Q={dtl:q};return ae.callService("SCMCODE00204",Q).then(Z=>(p.message.success("상세코드가 삭제되었습니다."),b&&de.SCMCODE00102({sysCd:b.sysCd,appItCd:b.appItCd,appCd:b.appCd,grpCd:b.grpCd}),Z)).catch(Z=>{throw p.message.error("상세코드 삭제에 실패했습니다."),Z})}}),[]);return o.jsxs(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:oe}]},searchBox:{reqRows:o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:[16,8],style:{marginBottom:8},children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템코드",name:"sysCd",initialValue:""},selectProps:{placeholder:"시스템코드를 선택하세요",options:re}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"통합코드",name:"appItCd",initialValue:""},selectProps:{placeholder:"통합코드를 선택하세요",options:G}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"앱코드",name:"appCd",initialValue:""},selectProps:{placeholder:"앱코드를 선택하세요",options:te}})})]}),o.jsxs(p.Row,{gutter:[16,8],children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"코드구분",name:"sysLockYn",initialValue:""},selectProps:{options:[{label:"전체",value:""},{label:"시스템코드",value:"Y"},{label:"업무코드",value:"N"}]}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgInput,{itemProps:{label:"검색어",name:"keyword",initialValue:""},inputProps:{placeholder:"검색어를 입력하세요."}})})]})]})},children:[o.jsxs(ze,{type:"horizontal",style:{height:"calc(100vh - 120px)",gap:12,overflow:"hidden"},children:[o.jsxs(Ie,{border:!0,style:{flex:`0 0 ${z1}`,maxWidth:z1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[o.jsx(Le,{title:"공통코드 현황"}),o.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%",padding:"8px 0"},size:12,children:[o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"시스템코드 대비 사용자코드"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(jW,{children:[o.jsx(PP,{data:Te,dataKey:"value",nameKey:"name",outerRadius:65,label:!0,children:Te.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c1-${Q}`))}),o.jsx(vl,{}),o.jsx(Zc,{})]})})]}),o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"시스템코드별 백분율"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(Ff,{data:Ne,margin:{top:10,right:10,left:0,bottom:0},children:[o.jsx(Rl,{strokeDasharray:"3 3"}),o.jsx(Al,{dataKey:"name",hide:!0}),o.jsx(Il,{hide:!0,domain:[0,100]}),o.jsx(vl,{}),o.jsx(Ml,{dataKey:"value",children:Ne.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c2-${Q}`))})]})})]}),o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"통합코드별 백분율"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(Ff,{data:U,margin:{top:10,right:10,left:0,bottom:0},children:[o.jsx(Rl,{strokeDasharray:"3 3"}),o.jsx(Al,{dataKey:"name",hide:!0}),o.jsx(Il,{hide:!0,domain:[0,100]}),o.jsx(vl,{}),o.jsx(Ml,{dataKey:"value",children:U.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c3-${Q}`))})]})})]}),o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"앱별 백분율"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(Ff,{data:ne,margin:{top:10,right:10,left:0,bottom:0},children:[o.jsx(Rl,{strokeDasharray:"3 3"}),o.jsx(Al,{dataKey:"name",hide:!0}),o.jsx(Il,{hide:!0,domain:[0,100]}),o.jsx(vl,{}),o.jsx(Ml,{dataKey:"value",children:ne.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c4-${Q}`))})]})})]})]})})]}),o.jsxs(Ie,{border:!0,style:{flex:"1 1 auto",height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"},children:[o.jsx(Le,{title:"그룹코드",children:o.jsx(_.BwgButton,{type:"primary",onClick:()=>{g(!1),B(!1),f(!0),setTimeout(()=>{I.current?.resetFields(),I.current?.setFieldsValue({crprCd:"100",sysCd:__SYS_CD__||"",appItCd:"CM",appCd:"CM",enblYn:"Y",sortOrd:0})},100)},children:"그룹코드 등록"})}),o.jsx("div",{style:{flex:"0 0 45%",overflow:"hidden",display:"flex",flexDirection:"column"},children:o.jsx(Ve,{ref:R,gridColumns:Pe,gridOptions:J,gridEvents:m.useMemo(()=>({onCurrentRowChanged:(q,Q,Z)=>{if(Z<0){j(null);return}const le=R.current?.dp?.getValue(Z,"sysCd")||"",ie=R.current?.dp?.getValue(Z,"appItCd")||"",pe=R.current?.dp?.getValue(Z,"appCd")||"",ve=R.current?.dp?.getValue(Z,"grpCd")||"",be=R.current?.dp?.getJsonRow(Z);j(be),ve&&de.SCMCODE00102({sysCd:le,appItCd:ie,appCd:pe,grpCd:ve})}}),[de]),renderers:[{name:"moreActions",renderer:ue}]})}),o.jsxs("div",{style:{flex:"1 1 auto",overflow:"hidden",display:"flex",flexDirection:"column",marginTop:12},children:[o.jsx(Le,{title:"상세코드",children:o.jsx(_.BwgButton,{type:"primary",onClick:()=>{if(!b){p.message.warning("그룹코드를 먼저 선택하세요.");return}w(!1),x(!0),O(null),F({}),E([{dtlCd:"",cmmnCd:"",cmmnCdNm:"",cmmnCdClr:"",cmmnAbrv:"",enblYn:"Y",sortOrd:0,rmrk:""}])},disabled:!b,children:"상세코드 등록"})}),o.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:o.jsx(Ve,{ref:N,gridColumns:Ee,gridOptions:ye,renderers:[{name:"moreActions",renderer:fe},{name:"sysLockYn",renderer:me}]})})]})]})]}),o.jsx(dn,{title:h?"그룹코드 수정":"그룹코드 등록",open:u,placement:"right",width:"40%",onClose:()=>{f(!1),g(!1),B(!1),I.current?.resetFields()},footer:o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[o.jsx(p.Button,{onClick:()=>{f(!1),g(!1),B(!1),I.current?.resetFields()},children:"취소"}),o.jsx(p.Button,{type:"primary",disabled:!h&&!A,onClick:async()=>{try{const q=await I.current?.validateFields();if(!q)return;const Q={crprCd:q.crprCd||"100",sysCd:q.sysCd||"",appItCd:q.appItCd||"CM",appCd:q.appCd||"CM",grpCd:q.grpCd||"",grpNm:q.grpNm||"",enblYn:q.enblYn==="Y"?"Y":"N",sortOrd:q.sortOrd||0,rmrk:q.rmrk||""};if(!h&&!A){p.message.warning("그룹코드 중복체크를 먼저 완료해주세요.");return}await de.SCMCODE00201(h?"U":"I",Q),f(!1),g(!1),B(!1),I.current?.resetFields()}catch(q){console.error(h?"그룹코드 수정 실패:":"그룹코드 등록 실패:",q)}},children:"저장"})]}),children:o.jsxs(_.BwgForm,{ref:I,style:{padding:"10px 20px"},initialValues:{crprCd:"100",sysCd:__SYS_CD__||"",appItCd:"CM",appCd:"CM",enblYn:"Y",sortOrd:0},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템코드",name:"sysCd",rules:[{required:!0,message:"시스템코드를 선택하세요."}]},selectProps:{placeholder:"시스템코드를 선택하세요",options:re.filter(q=>q.value!==""),disabled:h}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"앱 통합코드",name:"appItCd",rules:[{required:!0,message:"앱 통합코드를 선택하세요."}]},selectProps:{placeholder:"앱 통합코드를 선택하세요",options:G.filter(q=>q.value!==""),disabled:h}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"앱 코드",name:"appCd",rules:[{required:!0,message:"앱 코드를 선택하세요."}]},selectProps:{placeholder:"앱 코드를 선택하세요",options:te.filter(q=>q.value!==""),disabled:h}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"그룹코드",name:"grpCd",rules:[{required:!0,message:"그룹코드를 입력하세요."},{max:5,message:"그룹코드는 5자 이하여야 합니다."}]},inputProps:{placeholder:"그룹코드를 입력하세요",maxLength:5,showCount:!0,count:{max:5},disabled:h,suffix:k?o.jsx(Y.ReloadOutlined,{spin:!0,style:{color:"#1890ff"}}):A&&!h?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):void 0,onKeyDown:q=>{if(h){q.preventDefault();return}q.target.value.length>=5&&!["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter"].includes(q.key)&&(q.preventDefault(),p.message.warning("입력은 다섯글자까지입니다."))},onChange:q=>{if(h){q.preventDefault();return}q.target.value.length>5&&(p.message.warning("입력은 다섯글자까지입니다."),q.target.value=q.target.value.slice(0,5)),A&&B(!1),I.current?.getFieldError("grpCd")?.length&&I.current?.setFields([{name:"grpCd",errors:[]}])},onBlur:H}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgInput,{itemProps:{label:"그룹명칭",name:"grpNm",rules:[{required:!0,message:"그룹명칭을 입력하세요."}]},inputProps:{placeholder:"그룹명칭을 입력하세요"}})})}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgCheck,{itemProps:{label:"사용여부",name:"enblYn",getValueProps:q=>({checked:q==="Y"})},inputProps:{title:"사용",format:"YN"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgNumber,{itemProps:{label:"정렬순서",name:"sortOrd"},inputProps:{placeholder:"정렬순서를 입력하세요",min:0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgTextArea,{itemProps:{label:"비고",name:"rmrk"},inputProps:{placeholder:"비고를 입력하세요",rows:3}})})})]})}),o.jsx(dn,{title:y?"상세코드 수정":"상세코드 등록",open:v,placement:"right",width:"50%",onClose:()=>{x(!1),w(!1),E([]),O(null),F({}),M.current?.resetFields()},footer:o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[o.jsx(p.Button,{onClick:()=>{x(!1),w(!1),E([]),O(null),F({}),M.current?.resetFields()},children:"취소"}),o.jsx(p.Form.Item,{shouldUpdate:!0,children:()=>{const q=M.current?.getFieldValue("details")||[];let Q=!1;if(y)Q=!0;else if(q.length>0){const Z=q.every(ie=>ie?.dtlCd?.trim()),le=q.every((ie,pe)=>ie?.dtlCd?.trim()&&z[pe]===!0);Q=Z&&le}return o.jsx(p.Button,{type:"primary",disabled:!Q,onClick:async()=>{try{const Z=await M.current?.validateFields();if(!Z)return;if(!y&&Z.details){if(!Z.details.every((pe,ve)=>!pe.dtlCd?.trim()||z[ve]===!0)){p.message.warning("모든 상세코드의 중복체크를 완료해주세요.");return}for(let pe=0;pe<Z.details.length;pe++){const be=Z.details[pe].dtlCd?.trim();if(!be)continue;if(Z.details.some((se,Me)=>Me!==pe&&se.dtlCd?.trim()===be)){M.current?.setFields([{name:["details",pe,"dtlCd"],errors:["같은 상세코드가 이미 입력되었습니다."]}]),p.message.error("중복된 상세코드가 있습니다.");return}}}const le=y?[{...Z,crprCd:Z.crprCd||"100",sysCd:Z.sysCd||"",appItCd:Z.appItCd||b?.appItCd||"CM",appCd:Z.appCd||b?.appCd||"CM",grpCd:Z.grpCd||"",enblYn:Z.enblYn==="Y"?"Y":"N",sysLockYn:Z.sysLockYn==="Y"?"Y":"N"}]:(Z.details||[]).map(ie=>{const pe=b?.sysCd||"",ve=b?.grpCd||"",be=ie.dtlCd||"",Be=`${pe}${ve}${be}`;return{...ie,crprCd:b?.crprCd||"100",sysCd:pe,appItCd:b?.appItCd||"CM",appCd:b?.appCd||"CM",grpCd:ve,cmmnCd:Be,enblYn:ie.enblYn==="Y"?"Y":"N",sysLockYn:ie.sysLockYn==="Y"?"Y":"N",sortOrd:ie.sortOrd||0}});await de.SCMCODE00203(y?"U":"I",le.length,le),x(!1),w(!1),E([]),O(null),F({}),M.current?.resetFields()}catch(Z){console.error(y?"상세코드 수정 실패:":"상세코드 등록 실패:",Z)}},children:"저장"})}})]}),children:o.jsxs(_.BwgForm,{ref:M,style:{padding:"10px 20px"},children:[b&&o.jsx(p.Card,{style:{marginBottom:16,background:"#f5f5f5"},children:o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:8,children:o.jsxs("div",{children:[o.jsx("strong",{children:"시스템코드:"})," ",b.sysCd||""]})}),o.jsx(p.Col,{span:8,children:o.jsxs("div",{children:[o.jsx("strong",{children:"그룹코드:"})," ",b.grpCd||""]})}),o.jsx(p.Col,{span:8,children:o.jsxs("div",{children:[o.jsx("strong",{children:"그룹명칭:"})," ",b.grpNm||""]})})]})}),y?o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"시스템코드",name:"sysCd"},inputProps:{disabled:!0}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"그룹코드",name:"grpCd"},inputProps:{disabled:!0}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"상세코드",name:"dtlCd",rules:[{required:!0,message:"상세코드를 입력하세요."}]},inputProps:{placeholder:"상세코드를 입력하세요",disabled:!0,suffix:D[-1]?o.jsx(Y.ReloadOutlined,{spin:!0,style:{color:"#1890ff"}}):z[-1]?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):void 0}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드",name:"cmmnCd",rules:[{required:!0,message:"공통코드를 입력하세요."}]},inputProps:{placeholder:"공통코드를 입력하세요",disabled:!0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드명",name:"cmmnCdNm",rules:[{required:!0,message:"공통코드명을 입력하세요."}]},inputProps:{placeholder:"공통코드명을 입력하세요"}})})}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"색상",name:"cmmnCdClr",getValueFromEvent:q=>q&&typeof q.toHexString=="function"?q.toHexString():q||"",children:o.jsx(p.ColorPicker,{format:"hex",showText:!0,presets:[{label:"추천 색상",colors:["#FF4D4F","#FF7A45","#FFA940","#FFC53D","#FFEC3D","#BAE637","#73D13D","#36CFC9","#40A9FF","#1890FF","#2F54EB","#722ED1","#EB2F96","#F5222D","#FA541C","#FA8C16","#FADB14","#A0D911","#13C2C2","#096DD9","#0050B3","#531DAB","#C41D7F","#CF1322","#D4380D","#D46B08","#D4B106","#7CB305","#08979C","#0050B3"]}]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"약어",name:"cmmnAbrv"},inputProps:{placeholder:"약어를 입력하세요"}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgCheck,{itemProps:{label:"사용여부",name:"enblYn",getValueProps:q=>({checked:q==="Y"})},inputProps:{title:"사용",format:"YN"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgNumber,{itemProps:{label:"정렬순서",name:"sortOrd"},inputProps:{placeholder:"정렬순서를 입력하세요",min:0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgTextArea,{itemProps:{label:"비고",name:"rmrk"},inputProps:{placeholder:"비고를 입력하세요",rows:3}})})})]}):o.jsx(p.Form.List,{name:"details",initialValue:P,children:(q,{add:Q,remove:Z})=>o.jsxs(o.Fragment,{children:[q.map((le,ie)=>{const pe=C===ie,ve=b?.sysCd||"",be=b?.grpCd||"";return o.jsx(p.Card,{style:{marginBottom:16},children:o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:20,children:o.jsx(p.Form.Item,{noStyle:!0,shouldUpdate:(Be,se)=>{const Me=Be?.details?.[le.name]?.dtlCd,Fe=se?.details?.[le.name]?.dtlCd;return Me!==Fe},children:({getFieldValue:Be})=>{const se=Be(["details",le.name,"dtlCd"])||"",Me=`${ve}${be}${se}`;return se&&M.current&&Be(["details",le.name,"cmmnCd"])!==Me&&setTimeout(()=>{M.current?.setFieldValue(["details",le.name,"cmmnCd"],Me)},0),o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"상세코드",name:[le.name,"dtlCd"],rules:[{required:!0,message:"상세코드를 입력하세요."}]},inputProps:{placeholder:"상세코드를 입력하세요",suffix:D[ie]?o.jsx(Y.ReloadOutlined,{spin:!0,style:{color:"#1890ff"}}):z[ie]?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):void 0,onChange:Fe=>{z[ie]&&F(Hr=>{const tn={...Hr};return delete tn[ie],tn}),M.current?.getFieldError(["details",ie,"dtlCd"])?.length&&M.current?.setFields([{name:["details",ie,"dtlCd"],errors:[]}])},onBlur:Fe=>X(Fe,ie)}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드",name:[le.name,"cmmnCd"]},inputProps:{disabled:!0,placeholder:"자동 생성됩니다",value:Me}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드명",name:[le.name,"cmmnCdNm"],rules:[{required:!0,message:"공통코드명을 입력하세요."}]},inputProps:{placeholder:"공통코드명을 입력하세요"}})})}),pe&&o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"색상",name:[le.name,"cmmnCdClr"],getValueFromEvent:Fe=>Fe&&typeof Fe.toHexString=="function"?Fe.toHexString():Fe||"",children:o.jsx(p.ColorPicker,{format:"hex",showText:!0,presets:[{label:"추천 색상",colors:["#FF4D4F","#FF7A45","#FFA940","#FFC53D","#FFEC3D","#BAE637","#73D13D","#36CFC9","#40A9FF","#1890FF","#2F54EB","#722ED1","#EB2F96","#F5222D","#FA541C","#FA8C16","#FADB14","#A0D911","#13C2C2","#096DD9","#0050B3","#531DAB","#C41D7F","#CF1322","#D4380D","#D46B08","#D4B106","#7CB305","#08979C","#0050B3"]}]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"약어",name:[le.name,"cmmnAbrv"]},inputProps:{placeholder:"약어를 입력하세요"}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgCheck,{itemProps:{label:"사용여부",name:[le.name,"enblYn"],getValueProps:Fe=>({checked:Fe==="Y"})},inputProps:{title:"사용",format:"YN"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgNumber,{itemProps:{label:"정렬순서",name:[le.name,"sortOrd"]},inputProps:{placeholder:"정렬순서를 입력하세요",min:0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgTextArea,{itemProps:{label:"비고",name:[le.name,"rmrk"]},inputProps:{placeholder:"비고를 입력하세요",rows:3}})})})]})]})}})}),o.jsx(p.Col,{span:4,style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-end",paddingTop:30},children:o.jsxs(p.Space,{size:"small",children:[o.jsx(p.Button,{type:"link",size:"small",icon:pe?o.jsx(Y.UpOutlined,{}):o.jsx(Y.DownOutlined,{}),onClick:()=>{O(pe?null:ie)},style:{fontSize:"12px",padding:0},children:pe?"간단입력":"추가입력"}),q.length>1&&o.jsx(p.Button,{type:"link",danger:!0,size:"small",icon:o.jsx(Y.DeleteOutlined,{}),onClick:()=>{Z(le.name),C===ie&&O(null)},style:{fontSize:"12px",padding:0},children:"삭제"})]})})]})},le.key)}),o.jsx(p.Button,{type:"dashed",onClick:()=>{Q({dtlCd:"",cmmnCd:"",cmmnCdNm:"",cmmnCdClr:"",cmmnAbrv:"",enblYn:"Y",sortOrd:0,rmrk:""})},block:!0,style:{marginTop:16},children:"+ 행 추가"})]})})]})})]})},PW=e=>{const t=m.useRef(null),r=m.useMemo(()=>[{fieldName:"userId",header:{text:"아이디"}},{fieldName:"userName",header:{text:"이름"}},{fieldName:"email",header:{text:"이메일"}},{fieldName:"createdAt",header:{text:"생성일"}}],[]);return o.jsx(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:()=>{}}]},searchBox:{},children:o.jsx(ze,{children:o.jsx(Ie,{style:{height:"300px"},children:o.jsx(Ve,{ref:t,gridColumns:r})})})})},{TextArea:OW}=p.Input,Km=({boardMstrId:e,isCompleted:t=!1})=>{const{user:r}=tt.useUserStore(),[n,i]=m.useState(!1),[a,s]=m.useState(!1),[l,c]=m.useState(15),[d,u]=m.useState([]),[f,h]=m.useState(""),g=m.useRef(null),v=b=>{i(!0),ae.callService("SCMBoardDtls0001",{boardMstrId:b},{isPopup:!0,showLoading:!1}).then(j=>{if(j&&j.subList){const P=j.subList.map(E=>({id:E.seq,author:E.userNm||E.regUserId,regUserId:E.regUserId,content:E.content,regDt:E.regDt}));u(P)}else u([])}).catch(j=>{console.error("게시글 댓글 목록 조회 실패:",j)}).finally(()=>{i(!1),c(15)})},x=()=>{e&&v(e)},y=()=>{if(!f.trim()){p.message.warning("댓글 상세내용 작성");return}if(!e){p.message.error("게시글 정보가 없습니다.");return}i(!0),ae.callService("SCMBoardDtls0002",{boardMstrId:e,content:f.trim()},{isPopup:!0,showLoading:!1}).then(b=>{b&&b.result===1?(console.log("댓글이 등록되었습니다."),h(""),v(e),setTimeout(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},100)):console.error("댓글 등록에 실패했습니다.",b)}).catch(b=>{console.error("댓글 등록 중 오류가 발생했습니다.",b)}).finally(()=>{i(!1)})},w=b=>{const j=d.find(P=>P.id===b);if(j&&j.regUserId!==r?.userId){p.message.error("본인이 작성한 댓글만 삭제할 수 있습니다.");return}if(!e){p.message.error("게시글 정보가 없습니다.");return}i(!0),ae.callService("SCMBoardDtls0003",{boardMstrId:e,seq:b},{isPopup:!0,showLoading:!1}).then(P=>{P&&P.result===1?(console.log("댓글이 삭제되었습니다."),v(e)):console.error("댓글 삭제에 실패했습니다.",P)}).catch(P=>{console.error("댓글 삭제 중 오류가 발생했습니다.",P)}).finally(()=>{i(!1)})};return m.useEffect(()=>{e?v(e):u([])},[e]),o.jsxs(Ie,{style:{flex:"0 0 400px",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{borderBottom:"1px solid #e8e8e8",paddingBottom:"12px",marginBottom:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("span",{style:{fontSize:"14px",fontWeight:"600",color:"#262626"},children:"댓글"}),o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[o.jsx(p.Button,{type:"text",icon:o.jsx(Y.ReloadOutlined,{spin:a||n}),onClick:x,disabled:a||n,size:"small",style:{fontSize:"12px",color:t?"#d9d9d9":n?"#8c8c8c":"#595959",height:"24px",padding:"0 8px"}}),!t&&o.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",fontSize:"10px",fontWeight:"700",color:a?"#8c8c8c":"#1890ff",minWidth:"14px",height:"14px",lineHeight:"14px",textAlign:"center",borderRadius:"50%",pointerEvents:"none"},children:l})]})]}),o.jsx("div",{ref:g,style:{flex:1,overflowY:"auto",marginBottom:"16px",minHeight:0,position:"relative"},children:n?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:[o.jsx("div",{style:{marginBottom:"12px"},children:o.jsx(Y.ReloadOutlined,{spin:!0,style:{fontSize:"24px"}})}),o.jsx("div",{style:{fontSize:"13px"},children:"댓글을 불러오는 중..."})]}):d.length===0?o.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:o.jsx("div",{style:{fontSize:"13px"},children:"등록된 댓글이 없습니다."})}):o.jsx(p.List,{dataSource:d,renderItem:b=>o.jsxs(p.List.Item,{style:{position:"relative",paddingRight:"20px",padding:"12px 20px 12px 12px",borderBottom:"1px solid #f0f0f0"},children:[o.jsx(p.List.Item.Meta,{avatar:o.jsx(p.Avatar,{size:32,style:{backgroundColor:"#1890ff",fontSize:"13px"},children:b.author[0]}),title:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[o.jsx("span",{style:{fontWeight:"500",fontSize:"13px",color:"#262626"},children:b.author}),o.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:b.regDt})]}),description:o.jsx("span",{style:{fontSize:"13px",color:"#595959",lineHeight:"1.5"},children:b.content})}),b.regUserId===r?.userId&&o.jsx(p.Button,{type:"text",danger:!0,icon:o.jsx(Y.DeleteOutlined,{style:{fontSize:"12px"}}),size:"small",onClick:()=>w(b.id),disabled:n,style:{position:"absolute",right:"8px",top:"62%",transform:"translateY(-50%)",opacity:n?.3:.5,height:"24px",width:"24px",padding:0},onMouseEnter:j=>{n||(j.currentTarget.style.opacity="1")},onMouseLeave:j=>{j.currentTarget.style.opacity=n?"0.3":"0.5"}})]},b.id)})}),o.jsx("div",{style:{padding:"12px",borderTop:"1px solid #e8e8e8",backgroundColor:t?"#f5f5f5":"#fafafa",flexShrink:0,marginTop:"auto"},children:t?o.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"#8c8c8c",fontSize:"13px",backgroundColor:"#ffffff",borderRadius:"6px",border:"1px solid #e8e8e8"},children:[o.jsx("div",{style:{marginBottom:"8px"},children:o.jsx(Y.AlertTwoTone,{twoToneColor:"#faad14"})}),o.jsx("div",{children:"이미 완료처리된 게시글입니다."}),o.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"댓글을 작성할 수 없습니다."})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{marginBottom:"8px"},children:o.jsx(OW,{rows:2,placeholder:n?"댓글 처리 중...":"댓글을 입력하세요...",value:f,onChange:b=>h(b.target.value),maxLength:300,disabled:n,style:{borderRadius:"6px",border:"1px solid #d9d9d9",resize:"none",fontSize:"13px",backgroundColor:n?"#f5f5f5":"#ffffff",color:n?"#8c8c8c":"#000000"},onFocus:b=>{n||(b.currentTarget.style.borderColor="#1890ff",b.currentTarget.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.05)")},onBlur:b=>{b.target.style.borderColor="#d9d9d9",b.target.style.boxShadow="none"}})}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:n?"처리 중...":`${f.length} / 300자`}),o.jsx(p.Button,{type:"primary",onClick:y,size:"small",loading:n,style:{borderRadius:"4px",fontSize:"12px",height:"28px",padding:"0 16px",fontWeight:"500"},disabled:!f.trim()||n,children:n?"등록 중...":"등록"})]})]})})]})},Vf=[{label:"전체",value:""},{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],F1=[{label:"전체",value:""},{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],kW={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},V1={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},TW={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},MW=({sysCd:e=__SYS_CD__,appCd:t=__APP_CD__})=>{const r=m.useRef(null),[n]=p.Form.useForm(),[i,a]=m.useState(!1),{searchBoxRef:s}=at.useSearchBox(),{openTabByMenuId:l}=tt.useMenuViewStore(),{openCorePopup:c}=at.usePopup(),[d,u]=m.useState(!1),f=m.useRef(null),[h,g]=m.useState(n.getFieldValue("status")),v=h==="COMPLETED",x=m.useMemo(()=>[{fieldName:"boardMstrId",header:{text:"번호"},width:80},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,button:!0,styleName:"left"},{fieldName:"menuNm",header:{text:"메뉴명"},width:120,styleName:"left"},{fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType",styleName:"center"},{fieldName:"title",header:{text:"제목"},width:200,styleName:"left"},{fieldName:"content",header:{text:"내용"},width:200,visible:!1},{fieldName:"status",header:{text:"상태"},width:90,renderer:"statusTag",styleName:"center"},{fieldName:"rgstUserId",visible:!1},{fieldName:"rgstUserNm",header:{text:"작성자"},width:60,styleName:"left"},{fieldName:"rgstUserDeptNm",header:{text:"작성자 부서"},visible:!1},{fieldName:"rgstDt",header:{text:"등록일자"},width:100,textFormat:ae.realFormat.formatYmd,styleName:"right"},{fieldName:"dueDt",header:{text:"마감요청일자"},width:100,textFormat:ae.realFormat.formatYmd,styleName:"right"},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert",styleName:"center"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:60,styleName:"left"},{fieldName:"prcsUserDeptNm",header:{text:"처리담당자 부서"},visible:!1},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,textFormat:ae.realFormat.formatYmd,styleName:"right",visible:!1}],[]),y=m.useMemo(()=>({container:{indicator:!1}}),[]),w={onCellDblClicked(A,B){const z=B.itemIndex??-1;if(z<0)return;const F=A.getValues(z);n.setFieldsValue(F),g(F.status),a(!0)},onCellClicked(A,B){if(B.fieldName==="menuId"){if((B.itemIndex??-1)<0)return;B.value&&l(B.value)}}},b=m.useMemo(()=>({SCMBoardMstr0001:async(A,B)=>{const z=A||f.current?.currentPage||1,F=B||f.current?.pageSize||20,R={...s?.current?.getFormData(),sysCd:e,appCd:t,pageNum:z,pageCount:F};console.log("🔍 서버 모드 페이징 요청:",R);try{const N=await ae.callService("SCMBoardMstr0001",R,{isPopup:!0});if(N&&N.pageList){const I=N.pageCnt||0;f.current?.setTotalData(I),r.current?.addAllData(N.pageList)}else f.current?.setTotalData(0),r.current?.addAllData([])}catch(N){console.error("❌ SCMBoardMstr0001 호출 실패:",N)}},SCMBoardMstr0004:A=>{ae.callService("SCMBoardMstr0004",{...A,boardMstrId:n.getFieldValue("boardMstrId"),sysCd:e,appCd:t},{isPopup:!0}).then(B=>{n.resetFields(),b.SCMBoardMstr0001()}).catch(B=>{console.error("문의/신고 변경 실패:",B)})}}),[s,n]),j=m.useMemo(()=>ae.createBwgGridRenderer((A,B,z,F,R)=>{const N=A.getValue(B.index?.itemIndex,"type");R.render(o.jsx(p.Tag,{color:TW[N],children:Vf.find(I=>I.value===N)?.label}))}),[]),P=m.useMemo(()=>ae.createBwgGridRenderer((A,B,z,F,R)=>{const N=A.getValue(B.index?.itemIndex,"status");R.render(o.jsx(p.Tag,{color:kW[N],children:F1.find(I=>I.value===N)?.label}))}),[]),E=m.useMemo(()=>ae.createBwgGridRenderer((A,B,z,F,R)=>{A.getValue(B.index?.itemIndex,"urgentYn")==="Y"?R.render(o.jsx(Y.AlertTwoTone,{twoToneColor:"red"})):R.render(o.jsx(o.Fragment,{}))}),[]),C=()=>{try{n.validateFields().then(A=>{p.Modal.confirm({title:"변경 확인",content:"게시물 정보를 변경하시겠습니까?",okText:"변경",cancelText:"취소",onOk:()=>{b.SCMBoardMstr0004({...A,prcsUserId:n.getFieldValue("prcsUserId")}),a(!1)}})})}catch(A){console.error("게시물 정보 변경 실패:",A)}},O=A=>{console.log("처리담당자 선택:",A),n.setFieldsValue({prcsUserId:A.empNo,prcsUserNm:A.empNm,prcsUserDeptNm:A.deptNm,status:"ASSIGNED"}),g("ASSIGNED")},k=()=>{c("CORE_PRGR_02",{callback:A=>{s?.current?.setFormData({menuId:A.menuId,menuNm:A.menuNm})}})},T=A=>{if(n.setFieldValue("status",A),g(A),A==="COMPLETED"||A==="REJECTED"){const B=ae.format(ae.now(),"yyyy-mm-dd");n.setFieldsValue({prcsDt:B})}else n.setFieldsValue({prcsDt:""})};m.useEffect(()=>{setTimeout(()=>{b.SCMBoardMstr0001()},100)},[b]);const D={ref:s,reqRows:o.jsxs(o.Fragment,{children:[o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:7,children:o.jsx(_.BwgMaskedRange,{itemProps:{label:"등록일자",name:"rgstDt"},pickerProps:{allowEmpty:!0}})}),o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type"},selectProps:{options:Vf,placeholder:"전체"}})}),o.jsx($e,{span:6,children:o.jsx(_.BwgEmpSearch,{label:"작성자",empNoFieldName:"rgstUserId",field1:{value:"deptNm",fieldName:"rgstUserDeptNm",placeholder:"부서명"},field2:{value:"empNm",fieldName:"rgstUserNm",placeholder:"사원명 입력"}})}),o.jsx($e,{span:6,style:{marginLeft:"12px"},children:o.jsx(_.BwgSwitch,{itemProps:{name:"myPrcs",label:"나의 처리건만"},inputProps:{format:"YN"}})})]}),o.jsxs(wt,{gutter:[12,8],children:[o.jsx($e,{span:7,children:o.jsx(_.BwgSearch,{itemProps:{label:"메뉴",name:["menuId","menuNm"]},onSearch:k})}),o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"상태",name:"status"},selectProps:{options:F1,placeholder:"전체"}})}),o.jsx($e,{span:8,children:o.jsx(_.BwgInput,{itemProps:{label:"제목 및 내용",name:"keyword"}})})]})]})},L=m.useMemo(()=>({grant:[{id:"search",label:"조회",onClick:()=>{b.SCMBoardMstr0001(f.current?.currentPage,f.current?.pageSize)}},{id:"edit",label:"변경",onClick:()=>{const A=r.current?.getCurrentIndex?.()??-1;if(A<0)return;const B=r.current?.vw?.getValues(A);B&&(n.setFieldsValue(B),g(n.getFieldValue("status")),a(!0))}}]}),[f,b,n,r]);return o.jsx(kt,{searchBox:D,buttons:L,children:o.jsx(ze,{children:o.jsxs(Ie,{children:[o.jsx(Ve,{gridId:"CMAdminBoardM0101",ref:r,type:"nrml",gridColumns:x,gridOptions:y,gridEvents:w,renderers:[{name:"tagType",renderer:j},{name:"statusTag",renderer:P},{name:"alert",renderer:E}]}),o.jsx(dn,{title:"게시물 상세",open:i,onClose:()=>{a(!1),n.resetFields(),b.SCMBoardMstr0001()},showCloseButton:!0,showEyesButton:!0,size:"large",placement:"right",width:1200,maskClosable:!0,extra:o.jsx(p.ConfigProvider,{children:o.jsx(p.Space,{children:o.jsx(p.Button,{className:"btn-primary .btn-primary:hover",onClick:C,children:"변경"})})}),children:o.jsxs(p.Splitter,{children:[o.jsx(p.Splitter.Panel,{defaultSize:"70%",min:"60%",max:"80%",style:{paddingRight:"15px",overflowX:"hidden"},children:o.jsx(Ie,{style:{overflowY:"auto"},children:o.jsxs(_.BwgForm,{form:n,children:[o.jsx(wt,{gutter:[12,8],style:{marginBottom:"20px"},children:o.jsx($e,{span:24,children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"0 5px"},children:[o.jsx(p.Avatar,{size:40,style:{backgroundColor:ae.colorFormat.site.purple04,fontSize:"13px"},children:n.getFieldValue("rgstUserNm")?.[0]??""}),o.jsx("div",{style:{flex:1},children:o.jsxs("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px",marginTop:"2px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{fontWeight:500,fontSize:"16px",color:"#262626"},children:n.getFieldValue("rgstUserNm")??n.getFieldValue("rgstUserDeptNm")??""}),o.jsx("span",{style:{fontSize:"13px",color:"#8c8c8c",marginTop:"3px",marginLeft:"4px"},children:n.getFieldValue("rgstDt")?ae.format(n.getFieldValue("rgstDt"),"YYYY-MM-DD"):""})]}),o.jsx("span",{style:{fontSize:"12px",color:"#8c8c8c",marginLeft:"1px"},children:n.getFieldValue("rgstUserDeptNm")??""})]})})]})})}),o.jsx(wt,{gutter:[12,8],children:o.jsx($e,{span:24,children:o.jsx(_.BwgInput,{itemProps:{name:"title"},inputProps:{size:"large",placeholder:"제목을 입력하세요",style:{fontWeight:"bold"},variant:"borderless"}})})}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"15px"},children:o.jsx($e,{span:24,children:o.jsx("div",{style:{borderBottom:"1px solid #d9d9d9",marginBottom:"8px"}})})}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"10px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type"},selectProps:{disabled:!0,options:Vf}})}),o.jsx($e,{span:10,children:o.jsx(_.BwgFormItem,{label:"메뉴 정보",children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:o.jsx(p.Input,{disabled:!0})}),o.jsx(p.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:o.jsx(p.Input,{disabled:!0})})]})})}),o.jsx($e,{span:6,children:o.jsx(_.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"},inputProps:{disabled:!0}})})]}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"10px"},children:o.jsx($e,{span:24,children:o.jsx(_.BwgFormItem,{label:"상태",name:"status",children:o.jsxs(p.Space,{children:[o.jsx(_.BwgButton,{icon:o.jsx(Y.ReloadOutlined,{}),type:h==="READY"?"primary":"default",onClick:()=>T("READY"),children:"대기"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.UserAddOutlined,{}),onClick:O,type:h==="ASSIGNED"?"primary":"default",children:"담당자 지정"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.ClockCircleOutlined,{}),type:h==="PROCESSING"?"primary":"default",onClick:()=>T("PROCESSING"),children:"처리중"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.CheckOutlined,{}),onClick:()=>T("COMPLETED"),type:h==="COMPLETED"?"primary":"default",children:"처리완료"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.CloseOutlined,{}),onClick:()=>T("REJECTED"),type:h==="REJECTED"?"primary":"default",children:"반려"})]})})})}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:12,children:o.jsx(_.BwgMaskedDate,{itemProps:{label:"마감요청일자",name:"dueDt"},inputProps:{disabled:!0}})}),o.jsx($e,{span:12,children:o.jsxs(p.Flex,{vertical:!0,gap:3,children:[o.jsx("span",{style:{fontSize:"12px",color:"#000000E0"},children:"진척률"}),o.jsx(p.Progress,{percent:V1[n.getFieldValue("status")],status:V1[n.getFieldValue("status")]>0?"active":"normal",size:"small",format:A=>`${A}%`})]})})]}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:12,children:o.jsx(_.BwgEmpSearch,{label:"처리담당자",empNoFieldName:"prcsUserId",field1:{value:"deptNm",fieldName:"prcsUserDeptNm",placeholder:"부서명"},field2:{value:"empNm",fieldName:"prcsUserNm",placeholder:"사원명 입력"},onFinish:()=>{n.setFieldValue("status","ASSIGNED"),g("ASSIGNED")}})}),o.jsx($e,{span:12,children:o.jsx(_.BwgMaskedDate,{itemProps:{label:"처리일자",name:"prcsDt"},inputProps:{disabled:!0}})})]}),o.jsx(p.Divider,{}),o.jsx(wt,{gutter:[12,8],children:o.jsx($e,{span:24,children:o.jsx(kh,{itemProps:{label:"내용",name:"content"},editorProps:{isEditing:!d,title:{title:o.jsxs(o.Fragment,{children:[o.jsx(Y.EditOutlined,{style:{marginRight:"5px"}})," ","상세내용"]}),children:o.jsx(_.BwgButton,{icon:o.jsx(Y.EyeFilled,{}),onClick:()=>u(!d),children:"미리보기"})}}})})})]})})}),o.jsx(p.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:o.jsx(Km,{boardMstrId:n.getFieldValue("boardMstrId"),isCompleted:v})})]})}),o.jsx(To,{ref:f,mode:"server",onServerPageChange:(A,B)=>{b.SCMBoardMstr0001(A,B)},pageSizeOptions:[10,20,50]})]})})})},Hf=[{label:"전체",value:""},{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],Uf=[{label:"전체",value:""},{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],H1={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},U1={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},RW={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},AW=({sysCd:e=__SYS_CD__,appCd:t=__APP_CD__})=>{const r=m.useRef(null),[n,i]=m.useState(!1),{searchBoxRef:a}=at.useSearchBox(),{user:s,hrInfo:l}=tt.useUserStore(),[c]=p.Form.useForm(),{openCorePopup:d}=at.usePopup(),u=m.useRef(null),[f,h]=m.useState(!1),v=p.Form.useWatch("status",c)??c.getFieldValue("status")??"READY",x=f||v==="READY",[y,w]=m.useState(!1),b=v==="COMPLETED"||v==="REJECTED",j=m.useMemo(()=>[{fieldName:"boardMstrId",header:{text:"글 번호"},width:80},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,styleName:"left"},{fieldName:"menuNm",header:{text:"메뉴명"},width:100,styleName:"left"},{fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType",styleName:"center"},{fieldName:"title",header:{text:"제목"},width:200,styleName:"left"},{fieldName:"content",header:{text:"내용"},width:200,visible:!1},{fieldName:"status",header:{text:"상태"},width:80,renderer:"statusTag",styleName:"center"},{fieldName:"rgstUserId",header:{text:"작성자ID"},visible:!1},{fieldName:"rgstUserDeptNm",header:{text:"작성자 부서"},visible:!1},{fieldName:"rgstDt",header:{text:"작성일자"},width:120,textFormat:ae.realFormat.formatYmd,styleName:"right"},{fieldName:"dueDt",header:{text:"마감요청일자"},width:120,textFormat:ae.realFormat.formatYmd,styleName:"right"},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert",styleName:"center"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:100,styleName:"left"},{fieldName:"prcsUserDeptNm",header:{text:"처리담당자 부서"},visible:!1},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,textFormat:ae.realFormat.formatYmd,styleName:"center"}],[]),P=m.useMemo(()=>({container:{indicator:!1}}),[]),E={onCellDblClicked(z,F){const R=F.itemIndex??-1;if(R<0)return;const N=z.getValues(R);N&&(c.setFieldsValue({...N}),h(!1),i(!0))}},C=m.useMemo(()=>({SCMBoardMstr0001:async(z,F)=>{const R=z||u.current?.currentPage||1,N=F||u.current?.pageSize||20,I={...a?.current?.getFormData(),sysCd:e,appCd:t,myArticle:"Y",pageNum:R,pageCount:N},M=await ae.callService("SCMBoardMstr0001",I,{isPopup:!0});M&&M.pageList&&(u.current?.setTotalData(M.pageCnt||0),r.current?.addAllData(M.pageList))},SCMBoardMstr0003:z=>{ae.callService("SCMBoardMstr0003",{sysCd:e,appCd:t,...z,status:"READY",rgstUserId:s?.userId,rgstUserNm:s?.userNm},{isPopup:!0}).then(F=>{c.resetFields(),C.SCMBoardMstr0001()}).catch(F=>{console.error("게시물 제출 실패:",F)})},SCMBoardMstr0004:z=>{ae.callService("SCMBoardMstr0004",{sysCd:e,appCd:t,boardMstrId:c.getFieldValue("boardMstrId"),...z},{isPopup:!0}).then(()=>{c.resetFields(),C.SCMBoardMstr0001()}).catch(F=>{console.error("게시물 변경 실패:",F)})}}),[a,c]),O=m.useMemo(()=>ae.createBwgGridRenderer((z,F,R,N,I)=>{const M=z.getValue(F.index?.itemIndex,"type");I.render(o.jsx(p.Tag,{color:RW[M],children:Hf.find(W=>W.value===M)?.label}))}),[]),k=m.useMemo(()=>ae.createBwgGridRenderer((z,F,R,N,I)=>{const M=z.getValue(F.index?.itemIndex,"status");I.render(o.jsx(p.Tag,{color:H1[M],children:Uf.find(W=>W.value===M)?.label}))}),[]),T=m.useMemo(()=>ae.createBwgGridRenderer((z,F,R,N,I)=>{z.getValue(F.index?.itemIndex,"urgentYn")==="Y"?I.render(o.jsx(Y.AlertTwoTone,{twoToneColor:"red"})):I.render(o.jsx(o.Fragment,{}))}),[]),D=()=>{try{c.validateFields().then(z=>{p.Modal.confirm({title:f?"등록 확인":"변경 확인",content:f?"게시물 내용 등록하시겠습니까?":"게시물 내용 변경하시겠습니까?",okText:f?"등록":"변경",cancelText:"취소",onOk:()=>{f?C.SCMBoardMstr0003(z):C.SCMBoardMstr0004(z),i(!1)}})})}catch(z){console.error("게시물 제출 실패:",z)}},L=()=>{d("CORE_PRGR_02",{callback:z=>{c.setFieldsValue({menuId:z.menuId,menuNm:z.menuNm})}})};m.useEffect(()=>{setTimeout(()=>{C.SCMBoardMstr0001()},100)},[C]);const A={ref:a,reqRows:o.jsxs(o.Fragment,{children:[o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgMaskedRange,{itemProps:{label:"작성일자",name:"rgstDt"},pickerProps:{allowEmpty:!0}})}),o.jsx($e,{span:8,children:o.jsx(_.BwgSearch,{itemProps:{label:"메뉴",name:["menuId","menuNm"]},onSearch:()=>{d("CORE_PRGR_02",{callback:z=>{a?.current?.setFormData({menuId:z.menuId,menuNm:z.menuNm})}})}})})]}),o.jsxs(wt,{gutter:[12,8],children:[o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type"},selectProps:{options:Hf,placeholder:"전체"}})}),o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"상태",name:"status"},selectProps:{options:Uf,placeholder:"전체"}})}),o.jsx($e,{span:8,children:o.jsx(_.BwgInput,{itemProps:{label:"제목 및 내용",name:"keyword"}})})]})]})},B=m.useMemo(()=>({grant:[{id:"search",label:"조회",onClick:()=>{C.SCMBoardMstr0001()}},{id:"new",label:"등록",onClick:()=>{h(!0),c.resetFields(),c.setFieldsValue({rgstUserId:s?.userId,rgstUserNm:s?.userNm,rgstDt:ae.now().format(),status:"READY"}),i(!0)}},{id:"edit",label:"변경",onClick:()=>{const z=r.current?.getCurrentIndex?.()??-1;if(z<0)return;const F=r.current?.vw?.getValues(z);F&&(c.setFieldsValue({...F}),h(!1),i(!0))}}]}),[C,c,r,s]);return o.jsx(kt,{searchBox:A,buttons:B,children:o.jsx(ze,{children:o.jsxs(Ie,{children:[o.jsx(Ve,{gridId:"CMMyBoardM0101",ref:r,type:"nrml",gridColumns:j,gridOptions:P,gridEvents:E,renderers:[{name:"tagType",renderer:O},{name:"statusTag",renderer:k},{name:"alert",renderer:T}]}),o.jsx(dn,{title:`게시물 ${f?"등록":"변경"}`,open:n,onClose:()=>i(!1),showCloseButton:!0,size:"large",placement:"right",width:f?800:1200,extra:o.jsx(p.ConfigProvider,{children:o.jsx(p.Space,{children:f||c.getFieldValue("status")==="READY"?o.jsx(p.Button,{className:"btn-primary .btn-primary:hover",onClick:D,children:f?"등록":"변경"}):null})}),children:o.jsxs(p.Splitter,{children:[o.jsx(p.Splitter.Panel,{defaultSize:f?"100%":"70%",min:f?"100%":"60%",max:f?"100%":"80%",style:{paddingRight:f?"0px":"15px",overflowX:"hidden"},children:o.jsx(Ie,{style:{overflowY:"auto"},children:o.jsxs(_.BwgForm,{form:c,onFinish:D,initialValues:{rgstUserNm:s?.userNm||"",rgstUserDeptNm:l?.deptNm||""},children:[o.jsx(wt,{gutter:[12,8],children:o.jsx($e,{span:24,children:o.jsx(_.BwgInput,{itemProps:{name:"title",rules:[{required:!0,message:"제목을 입력해주세요."}]},inputProps:{size:"large",placeholder:"제목을 입력하세요",style:{fontWeight:"bold"},variant:"borderless"}})})}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"15px"},children:o.jsx($e,{span:24,children:o.jsx("div",{style:{borderBottom:"1px solid #d9d9d9",marginBottom:"8px"}})})}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type",rules:[{required:!0,message:"구분을 선택해주세요."}]},selectProps:{options:[...Hf].filter(z=>z.value!==""),disabled:!x}})}),o.jsx($e,{span:16,children:o.jsx(_.BwgSearch,{itemProps:{label:"메뉴",name:["menuId","menuNm"],rules:[{required:!0,message:"메뉴를 선택해주세요."}]},onSearch:L,readOnly:!x})})]}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[!f&&o.jsx($e,{span:12,children:o.jsx(_.BwgFormItem,{label:"상태",children:o.jsx("div",{style:{marginBottom:4},children:c.getFieldValue("status")&&o.jsx(p.Tag,{color:H1[c.getFieldValue("status")],children:Uf.find(z=>z.value===c.getFieldValue("status"))?.label})})})}),!f&&o.jsx($e,{span:12,children:o.jsxs(p.Flex,{vertical:!0,gap:3,children:[o.jsx("span",{style:{fontSize:"12px",color:"#000000E0"},children:"진척률"}),o.jsx(p.Progress,{percent:U1[c.getFieldValue("status")],status:U1[c.getFieldValue("status")]>0?"active":"normal",size:"small",format:z=>`${z}%`})]})})]}),!f&&o.jsx(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:o.jsx($e,{span:12,children:o.jsx(_.BwgEmpSearch,{label:"처리담당자",empNoFieldName:"prcsUserId",field1:{value:"deptNm",fieldName:"prcsUserDeptNm",placeholder:"부서명"},field2:{value:"empNm",fieldName:"prcsUserNm",placeholder:"사원명"},readOnly:!0})})}),o.jsx(p.Divider,{}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:o.jsx($e,{span:24,children:o.jsx(kh,{border:!1,itemProps:{name:"content",rules:[{required:!0,message:"내용을 입력해주세요."}]},editorProps:{isEditing:x&&!y,title:{title:o.jsxs(o.Fragment,{children:[o.jsx(Y.EditOutlined,{style:{marginRight:"5px"}})," ","상세내용 작성"]}),children:x&&o.jsx(p.Button,{icon:o.jsx(Y.EyeFilled,{}),onClick:()=>w(!y),children:"미리보기"})}}})})})]})})}),!f&&o.jsx(p.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:o.jsx(Km,{boardMstrId:c.getFieldValue("boardMstrId"),isCompleted:b})})]})}),o.jsx(To,{ref:u,mode:"server",onServerPageChange:(z,F)=>{C.SCMBoardMstr0001(z,F)},pageSizeOptions:[10,20,50]})]})})})},IW=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},Wf=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function Ea(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:IW(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:Wf(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:Wf(e.orgSortOrd,0),orgOtptOrd:Wf(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function NW(e){const t=new Set,r=e.map(Ea).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>t.has(l.deptCd)?!1:(t.add(l.deptCd),!0));r.sort((l,c)=>(l.deptLvl||0)-(c.deptLvl||0)||(l.orgSortOrd||0)-(c.orgSortOrd||0)||l.deptCd.localeCompare(c.deptCd));const n=new Map;for(const l of r)n.set(l.deptCd,{...l,children:[]});const i=[];for(const l of r){const c=n.get(l.deptCd),d=l.hrnkDeptCd;d&&n.has(d)?n.get(d).children.push(c):i.push(c)}const a=l=>{!l||l.length===0||(l.sort((c,d)=>c.deptCd.localeCompare(d.deptCd)),l.forEach(c=>a(c.children)))};a(i);const s=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(s)};if(i.forEach(s),i.length>1){const l=i.find(c=>c.deptCd==="D00");if(l)return[l]}return i}function DW(e){const t=e.map(Ea),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const GP=({popup:e,onClose:t})=>{const[r,n]=m.useState(""),[i,a]=m.useState([]),[s,l]=m.useState([]),[c,d]=m.useState([]),[u,f]=m.useState(!1),h=m.useCallback(async C=>{try{f(!0);const O=await ae.callService("SCMUTIL00103",{...e?.popupParams,...C}),k=Array.isArray(O?.data)?O.data:Array.isArray(O?.deptList)?O.deptList:Array.isArray(O)?O:[],T=NW(k);d(T);const D=DW(k);a(D);const L=T[0]?.deptCd||Ea(k.find(A=>Ea(A).deptLvl===1)||{}).deptCd||Ea(k[0]||{}).deptCd||"";l(L?[L]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{f(!1)}},[e?.popupParams]);m.useEffect(()=>{h()},[h]);const g=m.useCallback((C,O)=>{for(const k of C){if(k.deptCd===O)return k;if(k.children){const T=g(k.children,O);if(T)return T}}return null},[]),v=m.useMemo(()=>{const C=s[0];return C?g(c,C):null},[s,c,g]),x=m.useMemo(()=>{const C=k=>k.map(T=>({title:T.deptNm,key:T.deptCd,meta:T,children:T.children?C(T.children):void 0}));return C(c)},[c]),y=m.useMemo(()=>{const C=r.trim().toLowerCase();if(!C)return x;const O=k=>k.map(T=>{const D=T.meta,L=(D?.deptNm||"").toLowerCase().includes(C)||(D?.deptCd||"").toLowerCase().includes(C),A=T.children?O(T.children):void 0;return L||A&&A.length?{...T,children:A}:null}).filter(Boolean);return O(x)},[x,r]),w=m.useCallback(C=>{l(C.slice(0,1).map(String))},[]),b=m.useCallback(C=>a(C.map(String)),[]),j=m.useCallback((C,O)=>{if(C.stopPropagation(),!O.children||O.children.length===0)return;const k=i.includes(O.key);a(T=>k?T.filter(D=>D!==O.key):[...T,O.key])},[i]),P=m.useCallback(()=>l([]),[]),E={confirm:()=>{if(!v){p.message.error("부서를 선택해주세요.");return}const C={deptCd:v.deptCd,deptNm:v.deptNm,hrnkDeptCd:v.hrnkDeptCd,hrnkDeptNm:v.hrnkDeptNm,deptLvl:v.deptLvl,orgSortOrd:v.orgSortOrd},O=e?.config;O?.onSelect?O.onSelect(C):e?.config?.callback&&e.config.callback(JSON.stringify(C)),O?.onClose&&O.onClose(),e?.close?.()},cancel:()=>{const C=e?.config;C?.onCancel&&C.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{E.confirm()}}],popupEvent:E,onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"70%",min:"70%",max:"75%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:o.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[o.jsx(Le,{title:"조직도"}),o.jsx(p.Row,{gutter:[16,16],children:o.jsx(p.Col,{span:24,children:o.jsx(p.Input,{placeholder:"부서명, 부서코드 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,onChange:C=>n(C.target.value)})})})]})}),o.jsx("div",{style:{padding:16,overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:u,children:o.jsx(p.Tree,{treeData:y,expandedKeys:i,selectedKeys:s,onSelect:w,onExpand:b,onDoubleClick:j,showLine:!0,showIcon:!1,selectable:!0,style:{overflow:"hidden"},titleRender:C=>{const O=C.meta;return o.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%",fontWeight:s.includes(C.key)?"bold":"normal"},children:[o.jsx("span",{children:O.deptNm}),o.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:O.deptCd})]})}})})})]}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:16,overflowY:"hidden",height:"100%"},children:[o.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:16,fontWeight:700},children:"선택된 부서"}),v?o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:14,border:"1px solid #e0e0e0",borderRadius:12,background:"#fafafa"},children:[o.jsx("div",{style:{width:42,height:42,borderRadius:"50%",border:"1px solid #e6e6e6",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:18,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:o.jsx(Y.TeamOutlined,{})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsxs("div",{style:{fontSize:15,fontWeight:700,marginBottom:4},children:[v.deptNm," ",o.jsxs("span",{style:{color:"#8c8c8c",fontSize:12},children:["(",v.deptCd,")"]})]}),o.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:2},children:["상위부서: ",v.hrnkDeptNm||"-"]})]}),o.jsx(p.Button,{type:"text",onClick:P,icon:o.jsx(Y.RestOutlined,{style:{fontSize:24,color:"#FF6363"}})})]}):o.jsx("div",{style:{color:"#999",fontSize:14},children:"부서를 선택해주세요."})]})})]})})})})},_W=Object.freeze(Object.defineProperty({__proto__:null,default:GP},Symbol.toStringTag,{value:"Module"})),BW=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},Kf=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function Pa(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:BW(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:Kf(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:Kf(e.orgSortOrd,0),orgOtptOrd:Kf(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function $W(e){const t=new Set,r=e.map(Pa).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>t.has(l.deptCd)?!1:(t.add(l.deptCd),!0));r.sort((l,c)=>(l.deptLvl||0)-(c.deptLvl||0)||(l.orgSortOrd||0)-(c.orgSortOrd||0)||l.deptCd.localeCompare(c.deptCd));const n=new Map;for(const l of r)n.set(l.deptCd,{...l,children:[]});const i=[];for(const l of r){const c=n.get(l.deptCd),d=l.hrnkDeptCd;d&&n.has(d)?n.get(d).children.push(c):i.push(c)}const a=l=>{!l||l.length===0||(l.sort((c,d)=>c.deptCd.localeCompare(d.deptCd)),l.forEach(c=>a(c.children)))};a(i);const s=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(s)};if(i.forEach(s),i.length>1){const l=i.find(c=>c.deptCd==="D00");if(l)return[l]}return i}function LW(e){const t=e.map(Pa),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const XP=({popup:e,onClose:t})=>{const[r,n]=m.useState(""),[i,a]=m.useState(""),[s,l]=m.useState([]),[c,d]=m.useState([]),[u,f]=m.useState([]),[h,g]=m.useState(!1),[v,x]=m.useState([]),[y,w]=m.useState(!1),b=m.useCallback(async F=>{try{w(!0);const R=await ae.callService("SCMUTIL00103",{...e?.popupParams,...F}),N=Array.isArray(R?.data)?R.data:Array.isArray(R?.deptList)?R.deptList:Array.isArray(R)?R:[],I=$W(N);x(I);const M=LW(N);l(M);const W=I[0]?.deptCd||Pa(N.find($=>Pa($).deptLvl===1)||{}).deptCd||Pa(N[0]||{}).deptCd||"";d(W?[W]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{w(!1)}},[e?.popupParams]);m.useEffect(()=>{b()},[b]);const j=m.useCallback((F,R)=>{for(const N of F){if(N.deptCd===R)return N;if(N.children){const I=j(N.children,R);if(I)return I}}return null},[v]),P=m.useMemo(()=>u.map(F=>{const R=j(v,F);if(!R)return null;const{children:N,...I}=R;return I}).filter(Boolean),[u,v,j]),E=m.useMemo(()=>{const F=R=>R.map(N=>({title:N.deptNm,key:N.deptCd,meta:N,children:N.children?F(N.children):void 0,isLeaf:!N.children||N.children.length===0}));return F(v)},[v]),C=m.useMemo(()=>{const F=r.trim().toLowerCase();if(!F)return E;const R=N=>N.map(I=>{const M=I.meta,W=(M?.deptNm||"").toLowerCase().includes(F)||(M?.deptCd||"").toLowerCase().includes(F),$=I.children?R(I.children):void 0;return W||$&&$.length>0?{...I,children:$}:null}).filter(Boolean);return R(E)},[E,r]),O=m.useCallback(F=>{const R=[],N=I=>{for(const M of I)if(M.deptCd===F&&M.children){const W=$=>{for(const H of $)R.push(H.deptCd),H.children&&W(H.children)};W(M.children)}else M.children&&N(M.children)};return N(v),R},[v]),k=m.useCallback((F,R)=>{let N=Array.isArray(F)?F:F?.checked??[];if(h&&R?.node?.key){const I=R.node.key,M=O(I);if(R.checked){const W=new Set(N);for(const $ of M)W.add($);N=Array.from(W)}else{const W=new Set([I,...M]);N=N.filter($=>!W.has($))}}f(N)},[h,O]),T=m.useCallback(F=>{const R=F.map(String);if(d(R),R.length>0){const N=R[0],I=(W,$)=>{for(const H of W){if(H.deptCd===$)return H.deptNm;if(H.children){const X=I(H.children,$);if(X)return X}}return null},M=I(v,N);M&&a(M)}},[v]),D=m.useCallback(F=>l(F.map(String)),[]),L=m.useCallback((F,R)=>{if(F.stopPropagation(),R.children&&R.children.length>0){const N=s.includes(R.key);l(I=>N?I.filter(M=>M!==R.key):[...I,R.key])}},[s]),A=m.useCallback(F=>{f(R=>R.filter(N=>N!==F))},[]),B=m.useCallback(()=>{f([])},[]),z={confirm:()=>{if(u.length===0){p.message.error("부서를 선택해주세요.");return}const R=Array.from(new Set(u)).map(I=>{const M=j(v,I);return M?{deptCd:M.deptCd,deptNm:M.deptNm,hrnkDeptCd:M.hrnkDeptCd,hrnkDeptNm:M.hrnkDeptNm}:null}).filter(Boolean),N=e?.config;N?.onSelect?N.onSelect(R):e?.config?.callback&&e.config.callback(JSON.stringify(R)),N?.onClose&&N.onClose(),e?.close?.()},cancel:()=>{const F=e?.config;F?.onCancel&&F.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{z.confirm()}}],popupEvent:z,onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:o.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[o.jsx(Le,{title:"조직도"}),o.jsx("div",{style:{fontSize:14,color:"#666",padding:8,backgroundColor:"#f8f8f8",borderRadius:4},children:i}),o.jsxs(p.Row,{gutter:[16,16],children:[o.jsx(p.Col,{span:18,children:o.jsx(p.Input,{placeholder:"부서명, 부서장명, 부서코드 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,onChange:F=>n(F.target.value)})}),o.jsx(p.Col,{span:6,style:{justifyContent:"center",display:"flex",alignItems:"center"},children:o.jsx(p.Checkbox,{checked:h,onChange:F=>g(F.target.checked),children:"하위까지 선택"})})]})]})}),o.jsx("div",{style:{padding:16,overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:y,children:o.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:C,expandedKeys:s,selectedKeys:c,checkedKeys:u,checkable:!0,checkStrictly:!0,showLine:!0,showIcon:!1,selectable:!0,onSelect:T,onExpand:D,onCheck:k,onDoubleClick:L,style:{overflow:"hidden"},titleRender:F=>{const R=F.meta;return o.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%"},children:[o.jsx("span",{style:{fontWeight:c.includes(F.key)?"bold":"normal"},children:R.deptNm}),o.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:R.deptCd})]})}})})})]}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:16,overflowY:"hidden"},children:[o.jsxs("div",{style:{marginBottom:12,display:"flex",alignItems:"center",gap:8},children:[o.jsxs("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:["선택된 부서 (",P.length,"개)"]}),P.length>0&&o.jsx("button",{onClick:B,style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",fontSize:12,padding:4},title:"전체 해제",children:"전체 해제"})]}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"flex-start",minHeight:48},children:P.length===0?o.jsx("div",{style:{color:"#999",fontSize:14},children:"선택된 부서가 없습니다."}):P.map(F=>o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:999,border:"1px solid #e6e6e6",background:"#fafafa",lineHeight:1.1,cursor:"default",maxWidth:260},title:`${F.deptNm}`,children:[o.jsx("span",{style:{width:18,height:18,borderRadius:"50%",border:"1px solid #e6e6e6",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:o.jsx(Y.TeamOutlined,{})}),o.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:2,overflow:"hidden"},children:[o.jsx("span",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:F.deptNm}),o.jsx("span",{style:{fontSize:11,color:"#8c8c8c",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:F.deptCd})]}),o.jsx("button",{onClick:()=>A(F.deptCd),style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",padding:2,lineHeight:0},"aria-label":`${F.deptNm} 선택 해제`,title:"선택 해제",children:"×"})]},F.deptCd))})]})})]})})})})},zW=Object.freeze(Object.defineProperty({__proto__:null,default:XP},Symbol.toStringTag,{value:"Module"})),FW=e=>{const t=[...e].sort((a,s)=>a.deptLvl-s.deptLvl||a.orgSortOrd-s.orgSortOrd||a.deptCd.localeCompare(s.deptCd)),r=new Map;t.forEach(a=>r.set(a.deptCd,{...a,children:[]}));const n=[];t.forEach(a=>{const s=r.get(a.deptCd),l=a.hrnkDeptCd;l&&r.has(l)?r.get(l).children.push(s):n.push(s)});const i=a=>{!a.children||a.children.length===0?delete a.children:a.children.forEach(i)};return n.forEach(i),n},ZP=({popup:e,onClose:t})=>{const[r,n]=m.useState([]),[i,a]=m.useState([]),[s,l]=m.useState([]),[c,d]=m.useState(!1),[u,f]=m.useState([]),[h,g]=m.useState(null),[v,x]=m.useState(""),[y,w]=m.useState(!1),[b,j]=m.useState([]),[P,E]=m.useState(!1),C=m.useCallback(async R=>{if(R)try{const N=await ae.callService("SCMUTIL00106",{deptCds:R},{showLoading:!1}),I=Array.isArray(N?.empList)&&N.empList||[];f(I)}catch(N){console.error("직원 목록 로딩 실패:",N),p.message.error("직원 목록을 불러오는 중 오류가 발생했습니다.")}},[]),O=m.useCallback(async(R,N)=>{try{const I={keyword:R,deptCds:N},M=await ae.callService("SCMUTIL00106",I,{showLoading:!1});f(M?.empList||[]),M?.empCnt===0?E(!0):E(!1)}catch(I){console.error("검색 실패:",I),p.message.error("검색 중 오류가 발생했습니다."),f([]),E(!1)}},[]),k=m.useCallback(async()=>{d(!0);try{const R=await ae.callService("SCMUTIL00103",{...e?.popupParams},{showLoading:!1}),N=Array.isArray(R?.deptList)&&R.deptList||[];if(N.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const I=FW(N);l(I);const M=N.filter($=>Number($.deptLvl)<=2).map($=>String($.deptCd));if(n(M),e?.popupParams?.keyword){const $=e.popupParams.keyword;await O($,[]);return}const W=I[1];W&&C&&(a([W.deptCd]),C([W.deptCd]))}catch(R){console.error("부서 목록 로딩 실패:",R),p.message.error("부서 목록을 불러오는 중 오류가 발생했습니다.")}finally{d(!1)}},[C]);m.useEffect(()=>{k()},[k]);const T=m.useMemo(()=>{const R=N=>N.map(I=>({title:o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{marginRight:4},children:[I.deptNm," "]}),o.jsx(p.Tag,{color:"default",icon:o.jsx(Y.UserOutlined,{}),style:{borderRadius:"7px",fontSize:"11px"},children:I.empCnt},I.deptCd)]}),key:I.deptCd,children:I.children?R(I.children):void 0,isLeaf:!I.children||I.children.length===0}));return R(s)},[s]),D=m.useCallback(R=>{h&&h.empNo===R.empNo?g(null):g(R)},[]),L=m.useCallback(R=>{const N=R.map(String);a(N);const I=(W,$)=>{for(const H of W){if(H.deptCd===$)return{deptCd:H.deptCd,deptNm:H.deptNm};if(H.children){const X=I(H.children,$);if(X)return X}}return null};if(!N[0])return;const M=I(s,N[0]);if(M){if(y){if(b.some($=>$.deptCd===M.deptCd))return;if(b.length>=5){p.message.warning("부서는 최대 5개까지 선택할 수 있습니다.");return}j($=>[...$,M])}else j([M]);x(""),C([M.deptCd])}},[s,C,y,b]),A=m.useCallback(R=>{n(R.map(String))},[]),B=m.useCallback(async R=>{const N=R.trim(),I=y&&b.length>0?b.map(M=>M.deptCd):[];await O(N,I)},[O,y,b]),z=m.useCallback(R=>{j(N=>N.filter(I=>I.deptCd!==R))},[]),F={confirm:()=>{if(h){const R=e?.config;R?.onSelect?R.onSelect(h):e?.popupParams?.onSelect?e.popupParams.onSelect(h):e?.config?.callback&&e.config.callback(JSON.stringify(h,null,2)),R?.onClose&&R.onClose(),e?.close?.()}else p.message.error("사원을 선택해주세요.")},cancel:()=>{const R=e?.config;R?.onCancel&&R.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{F.confirm()}}],onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:o.jsxs(p.Flex,{gap:12,vertical:!0,children:[o.jsx(Le,{title:"조직도",marginBottom:0}),o.jsx(p.Input.Search,{placeholder:"이름, 소속, 전화번호 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:v,allowClear:!0,enterButton:o.jsx(p.Button,{children:"검색"}),onChange:R=>{x(R.target.value),j([]),g(null),f([]),E(!1),!R.target.value.trim()&&i.length>0&&C([i[0]])},onSearch:B}),o.jsx(p.Flex,{gap:8,align:"center",style:{marginLeft:6},children:o.jsxs(Oh,{children:[o.jsx(p.Switch,{checked:y,onChange:R=>{w(R),R||j([])}}),o.jsx("span",{style:{fontSize:"14px"},children:"부서 안에서 검색하기"})]})}),y&&o.jsx(p.Flex,{gap:4,wrap:"wrap",style:{margin:4},children:b.length>0?o.jsx(o.Fragment,{children:b.slice(0,5).map(R=>o.jsx(p.Tag,{closable:!0,onClose:()=>z(R.deptCd),children:R.deptNm},R.deptCd))}):o.jsx("span",{style:{fontSize:"12px",color:"#999"},children:"트리에서 부서를 선택하면 조건에 추가됩니다."})})]})}),o.jsx("div",{style:{padding:"16px",overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:c,children:o.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:T,expandedKeys:r,selectedKeys:i,onSelect:L,onExpand:A,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:R=>o.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontWeight:i.includes(R.key)?"bold":"normal",display:"inline-block",width:"100%"},children:R.title})})})})]}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:"16px",overflowY:"hidden"},children:[o.jsx("div",{style:{marginBottom:"16px"},children:o.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"bold"},children:v?"검색 결과":b[0]?.deptNm})}),o.jsxs("div",{style:{overflow:"hidden",height:"100%"},children:[u.map(R=>o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:h&&h.crprCd===R.crprCd&&h.wkplCd===R.wkplCd&&h.empNo===R.empNo?"#efebff":"white"},onClick:()=>D(R),children:[o.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px"},onClick:N=>{N.stopPropagation(),D(R)},children:h&&h.crprCd===R.crprCd&&h.wkplCd===R.wkplCd&&h.empNo===R.empNo?o.jsx(Y.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):o.jsx(Y.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),o.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",fontSize:"18px",color:"#666"},children:o.jsx(Y.UserOutlined,{})}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px"},children:R.empNm}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"2px"},children:[R.deptNm," (",R.deptCd,") | 직급:"," ",R.jbpsCd," | 등급: ",R.jbgdCd]})]})]},`emp-${R.crprCd}-${R.wkplCd}-${R.empNo}-${R.jbpsCd}-${R.jbgdCd}-${R.empMarkOrd}`)),u.length===0&&o.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:b.length>0?"해당 부서에 직원이 없습니다.":v&&P?"검색 결과가 없습니다.":v&&!P?"검색 버튼을 누르거나 엔터키를 눌러 검색해주세요.":"검색어를 입력하거나 부서를 눌러 직원을 조회해주세요."})]})]})})]})})})})},VW=Object.freeze(Object.defineProperty({__proto__:null,default:ZP},Symbol.toStringTag,{value:"Module"})),HW=e=>{const t=[...e].sort((a,s)=>a.deptLvl-s.deptLvl||a.orgSortOrd-s.orgSortOrd||a.deptCd.localeCompare(s.deptCd)),r=new Map;t.forEach(a=>r.set(a.deptCd,{...a,children:[]}));const n=[];t.forEach(a=>{const s=r.get(a.deptCd),l=a.hrnkDeptCd;l&&r.has(l)?r.get(l).children.push(s):n.push(s)});const i=a=>{!a.children||a.children.length===0?delete a.children:a.children.forEach(i)};return n.forEach(i),n},QP=({popup:e,onClose:t})=>{const[r,n]=m.useState(""),[i,a]=m.useState(""),[s,l]=m.useState([]),[c,d]=m.useState([]),[u,f]=m.useState([]),[h,g]=m.useState([]),[v,x]=m.useState(!1),[y,w]=m.useState(!1),[b,j]=m.useState({}),P=m.useCallback(async M=>{if(M)try{const W=await ae.callService("SCMUTIL00106",{deptCds:M},{showLoading:!1}),$=Array.isArray(W?.empList)&&W.empList||[];g($)}catch(W){console.error("직원 목록 로딩 실패:",W),p.message.error("직원 목록을 불러오는 중 오류가 발생했습니다.")}},[]),E=m.useCallback(async(M,W)=>{try{const $={keyword:M,deptCds:W},H=await ae.callService("SCMUTIL00106",$,{showLoading:!1});g(H?.empList||[]),H?.empCnt===0?w(!0):w(!1)}catch($){console.error("검색 실패:",$),p.message.error("검색 중 오류가 발생했습니다."),g([]),w(!1)}},[]),C=m.useCallback(async()=>{try{x(!0);const M=await ae.callService("SCMUTIL00105",{...e?.popupParams}),W=Array.isArray(M?.data)?M.data:Array.isArray(M?.orgnList)?M.orgnList:Array.isArray(M)?M:[];if(W.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const $=HW(W);f($);const H=W.filter(X=>X.deptLvl<=2).map(X=>X.deptCd);if(l(H),$.length>0){const X=$[0];d([X.deptCd]),a(X.deptNm),P([X.deptCd])}}catch(M){console.error("❌ 조직도 데이터 로딩 실패:",M),p.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{x(!1)}},[e?.popupParams,P]);m.useEffect(()=>{C()},[C]);const O=m.useMemo(()=>{const M=W=>W.map($=>({title:$.deptNm,key:$.deptCd,children:$.children?M($.children):void 0,isLeaf:!$.children||$.children.length===0}));return M(u)},[u]),k=m.useCallback(async M=>{const W=M.trim();n(W),W?await E(W,[]):c.length>0&&P([c[0]])},[E,P,c]),T=m.useMemo(()=>h,[h]),D=m.useCallback(M=>{j(W=>{const $={...W};return $[M.empNo]?delete $[M.empNo]:$[M.empNo]=M,$})},[]),L=m.useCallback(M=>{j(W=>{const $={...W};return delete $[M],$})},[]),A=m.useCallback(()=>j({}),[]),B=m.useCallback(()=>{j(M=>{const W={...M};for(const $ of T)W[$.empNo]=$;return W})},[T]),z=m.useCallback(()=>{j(M=>{const W={...M};for(const $ of T)delete W[$.empNo];return W})},[T]),F=m.useCallback(M=>{const W=M.map(String);if(d(W),n(""),W.length>0){const $=W[0],H=(ue,fe)=>{for(const me of ue){if(me.deptCd===fe)return me.deptNm;if(me.children){const Pe=H(me.children,fe);if(Pe)return Pe}}return null},X=H(u,$);X&&a(X),n(""),P([$])}},[u,P]),R=m.useCallback(M=>{l(M.map(String))},[]),N=m.useCallback((M,W)=>{if(M.stopPropagation(),!W.children||!W.children.length)return;const $=s.includes(W.key);l(H=>$?H.filter(X=>X!==W.key):[...H,W.key])},[s]),I={confirm:()=>{const M=Object.values(b).map($=>({crprCd:$.crprCd,wkplCd:$.wkplCd,empNo:$.empNo,deptCd:$.deptCd,deptNm:$.deptNm,empNm:$.empNm,jbpsCd:$.jbpsCd,jbgdCd:$.jbgdCd,empMarkOrd:$.empMarkOrd,emplyStCd:$.emplyStCd}));if(M.length===0){p.message.error("직원을 선택해주세요.");return}const W=e?.config;W?.onSelect?W.onSelect(M):e?.config?.callback&&e.config.callback(JSON.stringify(M)),W?.onClose&&W.onClose(),e?.close?.()},cancel:()=>{const M=e?.config;M?.onCancel&&M.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{I.confirm()}}],onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{style:{height:"100%"},children:[o.jsx(p.Splitter.Panel,{defaultSize:"50%",min:"50%",max:"70%",children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"35%",max:"75%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:o.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[o.jsx(Le,{title:"조직도"}),o.jsx(p.Input.Search,{placeholder:"이름, 소속, 직급/직위, 전화번호 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,enterButton:o.jsx(p.Button,{children:"검색"}),onChange:M=>{n(M.target.value),w(!1),g([]),!M.target.value.trim()&&c.length>0&&P([c[0]])},onSearch:k})]})}),o.jsx("div",{style:{padding:16,overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:v,children:o.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:O,expandedKeys:s,selectedKeys:c,onSelect:F,onExpand:R,onDoubleClick:N,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:M=>o.jsx("span",{style:{padding:"4px 8px",borderRadius:4,fontWeight:c.includes(M.key)?"bold":"normal",display:"inline-block",width:"100%"},children:M.title})})})})]}),o.jsx(p.Splitter.Panel,{children:o.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:r?"검색 결과":`${i} 사용자`}),o.jsxs("div",{style:{display:"flex",gap:8},children:[o.jsx(p.Button,{size:"small",onClick:B,children:"현재 목록 전체 선택"}),o.jsx(p.Button,{size:"small",onClick:z,children:"현재 목록 전체 해제"})]})]}),o.jsx(p.Divider,{style:{margin:"8px 0"}}),o.jsxs("div",{style:{overflowY:"auto"},children:[T.map(M=>{const W=!!b[M.empNo];return o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,cursor:"pointer",background:W?"#efebff":"#fff"},onClick:()=>D(M),children:[o.jsx("div",{style:{marginRight:12,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center"},onClick:$=>{$.stopPropagation(),D(M)},children:W?o.jsx(Y.CheckCircleFilled,{style:{fontSize:20,color:"#6449fc"}}):o.jsx(Y.CheckCircleOutlined,{style:{fontSize:20,color:"#d9d9d9"}})}),o.jsx("div",{style:{width:36,height:36,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:16,color:"#666",flex:"0 0 auto"},children:o.jsx(Y.UserOutlined,{})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:600,marginBottom:2},children:M.empNm}),o.jsxs("div",{style:{fontSize:12,color:"#666"},children:[M.deptNm," (",M.deptCd,") | 직급: ",M.jbpsCd," ","| 등급: ",M.jbgdCd]})]})]},`emp-${M.crprCd}-${M.wkplCd}-${M.empNo}-${M.jbpsCd}-${M.jbgdCd}-${M.empMarkOrd}`)}),T.length===0&&o.jsx("div",{style:{textAlign:"center",padding:32,color:"#999",fontSize:14},children:!r&&c.length>0?"해당 부서에 직원이 없습니다.":r&&y?"검색 결과가 없습니다.":r&&!y?"검색 버튼을 누르거나 엔터키를 눌러 검색해주세요.":"검색어를 입력하거나 부서를 눌러 직원을 조회해주세요."})]})]})})]})}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx(Le,{title:`선택된 사용자 (${Object.keys(b).length})`}),o.jsx(p.Button,{type:"link",size:"small",onClick:A,children:"전체 해제"})]}),o.jsx(p.Divider,{style:{margin:"8px 0"}}),o.jsxs("div",{style:{overflowY:"auto",flex:1},children:[Object.values(b).map(M=>o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,background:"#fafafa"},children:[o.jsx("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:10,color:"#666"},children:o.jsx(Y.UserOutlined,{})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{fontSize:13,fontWeight:600,marginBottom:2},children:M.empNm}),o.jsxs("div",{style:{fontSize:12,color:"#666"},children:[M.deptNm," (",M.deptCd,") | 직급: ",M.jbpsCd," | 등급: ",M.jbgdCd]})]}),o.jsx(p.Button,{type:"text",shape:"circle",icon:o.jsx(Y.CloseOutlined,{}),onClick:()=>L(M.empNo)})]},`selected-${M.crprCd}-${M.wkplCd}-${M.empNo}-${M.jbpsCd}-${M.jbgdCd}-${M.empMarkOrd}`)),Object.keys(b).length===0&&o.jsx("div",{style:{color:"#999",fontSize:14,textAlign:"center",padding:24},children:"선택된 사용자가 없습니다."})]})]})})]})})})})},UW=Object.freeze(Object.defineProperty({__proto__:null,default:QP},Symbol.toStringTag,{value:"Module"})),{Text:W1,Title:WW}=p.Typography,JP=({popup:e})=>{const[t,r]=m.useState(xl()),[n,i]=m.useState(xl()),[a,s]=m.useState([]),[l,c]=m.useState([]),[d,u]=m.useState("month");tt.useCodeStore();const{token:f}=p.theme.useToken(),h=(w,b,j=d)=>{const P=b.filter(E=>{if(j==="year"){const C=E.stndYmd.substring(0,6),O=w.format("YYYYMM");return C===O}else{const C=w.format("YYYYMMDD");return E.stndYmd===C}});s(P)},g=w=>{r(w),h(w,l,d)},v=(w,b)=>{i(w),u(b),y.SCMHLDY00101(b,w)};m.useEffect(()=>{y.SCMHLDY00101()},[]);const x=w=>{const b=l.filter(j=>{if(d==="year"){const P=j.stndYmd.substring(0,6),E=w.format("YYYYMM");return P===E}else{const P=w.format("YYYYMMDD");return j.stndYmd===P}});return b.length>0?o.jsx("div",{style:{position:"absolute",bottom:"1px",left:"1px",right:"1px",height:"3px",display:"flex",gap:"1px"},children:b.map((j,P)=>o.jsx("div",{style:{flex:1,height:"3px",background:j.hldyYn==="Y"?f.colorError:f.colorSuccess,borderRadius:"1px"}},P))}):null},y={SCMHLDY00101:async(w=d,b=t)=>{try{let j;w==="year"?j=b.format("YYYY"):j=b.format("YYYYMM");const P=await ae.callService("SCMHLDY00101",{crprCd:ae.getUserInfo()?.crprCd||"",sysCd:__SYS_CD__,stndYmd:j});c(P.sub||[]),h(b,P.sub||[],w)}catch(j){console.error("휴일 데이터 로드 실패:",j),p.message.error("휴일 데이터를 불러오는데 실패했습니다.")}}};return o.jsx(fi,{popup:e,children:o.jsx(ze,{children:o.jsx(Ie,{children:o.jsxs(p.Row,{gutter:f.padding,style:{marginTop:f.padding},children:[o.jsx(p.Col,{span:12,children:o.jsx(p.Card,{title:o.jsxs(p.Space,{children:[o.jsx(Y.CalendarOutlined,{}),o.jsx("span",{children:"휴일 달력"})]}),style:{height:"500px"},children:o.jsx(p.Calendar,{fullscreen:!1,value:t,onSelect:g,onPanelChange:v,cellRender:x,style:{height:"400px"},mode:d})})}),o.jsx(p.Col,{span:12,children:o.jsx(p.Card,{title:o.jsxs(p.Space,{children:[o.jsx(Y.CalendarOutlined,{}),o.jsx("span",{children:d==="year"?`${t.format("YYYY년 MM월")} 휴일 목록`:`${t.format("YYYY년 MM월 DD일")} 휴일 목록`})]}),style:{height:"500px"},children:o.jsx("div",{style:{height:"400px",overflowY:"auto"},children:a.length>0?o.jsx(p.Space,{direction:"vertical",style:{width:"100%"},size:"small",children:a.map((w,b)=>o.jsx(p.Card,{size:"small",style:{border:`${f.lineWidth}px solid ${f.colorBorder}`,borderRadius:f.borderRadiusLG},children:o.jsxs("div",{style:{padding:`${f.paddingXS}px 0`},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:f.paddingXS},children:[o.jsx(WW,{level:5,style:{margin:0,color:f.colorPrimary},children:w.hldyDscr||"휴일명 미입력"}),w.hldyYn==="Y"&&o.jsx(p.Tag,{color:f.colorSuccess,children:"휴일"})]}),o.jsx("div",{style:{marginBottom:f.paddingXXS},children:o.jsx(W1,{type:"secondary",style:{fontSize:f.fontSizeSM},children:xl(w.stndYmd).format("YYYY년 MM월 DD일 dddd")})}),w.hldyDscr&&o.jsx("div",{children:o.jsx(W1,{style:{fontSize:f.fontSizeSM+1},children:w.hldyDscr})})]})},b))}):o.jsx(p.Empty,{description:"선택된 날짜에 등록된 휴일이 없습니다.",style:{marginTop:"100px"}})})})})]})})})})},KW=Object.freeze(Object.defineProperty({__proto__:null,default:JP},Symbol.toStringTag,{value:"Module"})),eO=({popup:e})=>{const t=m.useRef(null),[r,n]=m.useState(""),{menuList:i}=tt.useMenuModelStore(),[a,s]=m.useState(void 0),[l,c]=m.useState(null),d=m.useCallback(b=>{const j=[],P=E=>{E.forEach(C=>{C.children&&C.children.length>0&&(j.push(C.menuId),P(C.children))})};return P(b),j},[]),[u,f]=m.useState(()=>d([])),h=m.useCallback((b,j,P)=>{const E=(j||"").trim().toLowerCase(),C=k=>{const T=!E||k.menuNm?.toLowerCase().includes(E)||k.menuId?.toLowerCase().includes(E),D=!P||k.sysCd===P;return T&&D},O=k=>k.map(T=>{const D=T.children?O(T.children):[];return C(T)||D.length>0?{...T,children:D}:null}).filter(Boolean);return O(b||[])},[]),g=m.useMemo(()=>h(i,r,a),[i,r,a,h]),v=m.useCallback(b=>b.map(j=>({key:j.menuId,label:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(!j.children||j.children.length===0)&&o.jsx(p.Tag,{color:"blue",style:{margin:0},children:j.menuId}),o.jsx("span",{children:j.menuNm})]}),children:j.children&&j.children.length>0?v(j.children):void 0,icon:x(j.iconCd,j.menuGbCd)})),[]),x=(b,j)=>{if(b){const P=Ti[b];if(P)return o.jsx(P,{})}if(j)switch(j){case"CMPRGRM":return o.jsx(Ti.HomeOutlined,{});case"CMPRGRS":return null;case"CMPRGRP":return null;default:return null}return null},y=m.useCallback((b,j)=>{for(const P of b){if(P.menuId===j)return P;if(P.children&&P.children.length>0){const E=y(P.children,j);if(E)return E}}return null},[]);m.useEffect(()=>{r&&f(d(g))},[r,g,d]);const w=[{id:"confirm",label:"확인",onClick:()=>{if(!l)return;const b=y(g,l);b&&(e?.config?.callback?.({menuId:b.menuId,menuNm:b.menuNm}),e?.close?.())}}];return o.jsx(fi,{popup:e,buttons:w,children:o.jsx(ze,{children:o.jsxs(Ie,{border:!1,children:[o.jsx(ko,{ref:t,reqRows:o.jsx(o.Fragment,{children:o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템 코드"},selectProps:{options:[{label:"공통",value:"CM"},{label:"K-ERP",value:"KE"},{label:"K-HR",value:"HR"},{label:"K-업무지원",value:"KS"}],onChange:b=>s(b),placeholder:"전체"}})}),o.jsx($e,{span:8,children:o.jsx(p.Input,{placeholder:"메뉴 이름, ID 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,onChange:b=>{n(b.target.value)}})})]})})}),o.jsx(p.Menu,{mode:"inline",theme:"light",items:v(g),openKeys:u,onOpenChange:f,onClick:({key:b})=>{c(String(b))},style:{overflow:"auto"}})]})})})},qW=Object.freeze(Object.defineProperty({__proto__:null,default:eO},Symbol.toStringTag,{value:"Module"})),YW=[{label:"정확도 우선",value:"none"},{label:"도로명 포함",value:"road"},{label:"지번 포함",value:"location"}],GW=["SELECT","INSERT","UPDATE","DELETE","DROP","CREATE","ALTER","TRUNCATE","EXEC","EXECUTE","UNION","OR","AND","WHERE","FROM","JOIN","INNER","OUTER","LEFT","RIGHT","FULL","ON","AS","IS","NULL","NOT","IN","LIKE","BETWEEN","EXISTS","HAVING","GROUP","BY","ORDER","ASC","DESC","DISTINCT","TOP","LIMIT","OFFSET","CASE","WHEN","THEN","ELSE","END","IF","WHILE","FOR","DECLARE","SET","BEGIN","COMMIT","ROLLBACK","TRANSACTION","GRANT","REVOKE","DENY","TABLE","VIEW","INDEX","PROCEDURE","FUNCTION","TRIGGER","DATABASE","SCHEMA","USER","ROLE","BACKUP","RESTORE"],tO=({popup:e,onClose:t})=>{const r=m.useRef(null),n=m.useRef(null),[i,a]=m.useState(""),[s,l]=m.useState([]),[c,d]=m.useState(null),[u,f]=m.useState(!1),[h,g]=m.useState(0),[v,x]=m.useState("none"),[y,w]=m.useState(!1),b=m.useMemo(()=>o.jsxs("div",{style:{maxWidth:"400px"},children:[o.jsx(p.Typography.Title,{level:5,style:{marginTop:0,marginBottom:12},children:"검색 가이드"}),o.jsxs(p.Space,{direction:"vertical",size:"small",style:{width:"100%"},children:[o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 검색 방법"}),o.jsx("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:"도로명, 지번, 건물명, 우편번호로 검색할 수 있습니다."})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 검색 예시"}),o.jsxs("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:['- 도로명: "논현로", "강남대로"',o.jsx("br",{}),'- 지번: "논현동 234", "역삼동 123"',o.jsx("br",{}),'- 건물명: "태성빌딩", "강남역"',o.jsx("br",{}),'- 우편번호: "06234", "12345"']})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 정렬 옵션"}),o.jsxs("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:["- 정확도 우선: 검색어와 가장 유사한 결과 우선",o.jsx("br",{}),"- 도로명 포함: 도로명 주소를 포함한 결과 우선",o.jsx("br",{}),"- 지번 포함: 지번 주소를 포함한 결과 우선"]})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 검색 팁"}),o.jsxs("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:["- 검색어는 최소 2글자 이상 입력해주세요.",o.jsx("br",{}),"- 공백은 자동으로 제거됩니다.",o.jsx("br",{}),"- 검색 결과를 클릭하여 주소를 선택하세요.",o.jsx("br",{}),"- 검색하기 위해 검색 버튼이나 엔터키를 눌러주세요."]})]})]})]}),[]),j=m.useMemo(()=>o.jsxs("div",{style:{maxWidth:"420px",maxHeight:"600px",overflowY:"auto"},children:[o.jsx(p.Typography.Title,{level:5,style:{marginTop:0,marginBottom:12},children:"에러 메시지 안내"}),o.jsxs(p.Space,{direction:"vertical",size:"small",style:{width:"100%"},children:[o.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:[o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0005"}),": 검색어가 입력되지 않았습니다."]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0006"}),": 주소를 상세히 입력해 주시기 바랍니다.",o.jsx("div",{style:{marginLeft:40,fontSize:"11px",color:"#999"},children:"(예시: 여의나루로 76, 문현금융로 40)"})]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0008"}),": 검색어는 한글자 이상 입력되어야 합니다."]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0009"}),": 검색어는 문자와 숫자 같이 입력되어야 합니다. (숫자만 검색 불가)"]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0010"}),": 검색어가 너무 깁니다. (한글40자, 영문,숫자 80자 이하)"]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0011"}),": 검색어에 너무 긴 숫자가 포함되어 있습니다. (숫자10자 이하)"]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0012"}),": 특수문자+숫자만으로는 검색이 불가능 합니다."]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0013"}),": SQL 예약어 또는 특수문자( %,=,",">",",","<",",[,] )는 검색이 불가능 합니다."]})]}),o.jsxs("div",{style:{marginTop:12,paddingTop:8,borderTop:"1px solid #f0f0f0"},children:[o.jsx(p.Typography.Text,{type:"warning",style:{fontSize:"12px",fontWeight:"bold"},children:"관리자 문의 바랍니다"}),o.jsxs("div",{style:{marginTop:6,fontSize:"11px",color:"#999"},children:["-999: 시스템에러",o.jsx("br",{}),"E0001: 승인되지 않은 KEY 입니다.",o.jsx("br",{}),"E0002: 승인되지 않은 사이트 입니다.",o.jsx("br",{}),"E0003: 정상적인 경로로 접속하시기 바랍니다.",o.jsx("br",{}),"E0014: 개발승인키 기간이 만료되어 서비스를 이용하실 수 없습니다."]})]})]})]}),[]);m.useEffect(()=>{(async()=>{try{const T=await ae.callService("SCMUTIL00202",{},{showLoading:!1});w(T?.result===1)}catch{w(!1)}})()},[]);const P=m.useCallback(async(k,T)=>{if(i.trim().length<2){p.message.warning("검색어는 2글자 이상 입력해주세요.");return}const D=i.replace(/(시|도|구|군)(?=[가-힣0-9])/g,"$1 ").replace(/\s+/g," ").trim(),L=D.split(/\s+/).filter(R=>R.length>0);if(L.length===1&&/[시도구군]$/.test(L[0])){p.message.warning("주소를 상세히 입력해 주시기 바랍니다.");return}const B=/[가-힣]/.test(D)?40:80,z=/^\d+$/.test(D);if(D.length>B){p.message.warning("검색어가 너무 깁니다. (한글 40자, 영문/숫자 80자 이하)");return}if(/\d{11,}/.test(D)){p.message.warning("검색어에 너무 긴 숫자가 포함되어 있습니다. (숫자 10자 이하)");return}if(z&&D.length!==5||/^[0-9\W_]+$/.test(D)&&/\d/.test(D)&&!/[A-Za-z가-힣]/.test(D)&&!z){p.message.warning("특수문자+숫자만으로는 검색이 불가능 합니다.");return}if(GW.some(R=>new RegExp(`\\b${R}\\b`,"i").test(D))||/[[\]%=><]/.test(D)){p.message.warning("SQL 예약어 또는 특수문자( %,=,>,<,[,] )는 검색이 불가능 합니다.");return}f(!0);try{const R=k||r.current?.currentPage||1,N=T||r.current?.pageSize||10,I={keyword:D,currentPage:R,countPerPage:N,firstSort:v,...e?.popupParams},M=await ae.callService("SCMUTIL00201",I,{showLoading:!1});if(M.errorCode!=="0"){p.message.error(M.errorCode+" : "+M.errorMessage);return}const W=M?.pageList&&Array.isArray(M.pageList)&&M.pageList||[],$=M?.pageCnt||0;l(W),g($),r.current?.setTotalData($),setTimeout(()=>{n.current&&(n.current.scrollTop=0)},0),(W.length===0||$===0)&&p.message.info("검색 결과가 없습니다.")}catch(R){console.error("주소 검색 실패:",R),p.message.error("주소 검색 중 오류가 발생했습니다."),l([]),g(0),r.current?.setTotalData(0)}finally{f(!1)}},[i,v,e?.popupParams]),E=m.useCallback(()=>{r.current?r.current.setPage(1):P(1,10)},[P]),C=m.useCallback(k=>{c&&c.bdMgtSn===k.bdMgtSn?d(null):d(k)},[c]),O=m.useMemo(()=>({confirm:()=>{if(!c){p.message.error("주소를 선택해주세요.");return}const k={...c},T=e?.config;T?.onSelect?T.onSelect(k):e?.popupParams?.onSelect?e.popupParams.onSelect(k):e?.config?.callback&&e.config.callback(k),T?.onClose&&T.onClose(),e?.close?.()}}),[c,e]);return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{O.confirm()}}],onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsxs(Ie,{border:!1,style:{paddingBottom:10},children:[o.jsx("div",{style:{paddingInline:"16px"},children:o.jsxs(p.Flex,{gap:12,vertical:!0,style:{marginBottom:"6px"},children:[o.jsxs(p.Flex,{gap:16,align:"center",justify:"space-between",wrap:!0,style:{width:"100%"},children:[y&&o.jsx(p.Radio.Group,{value:v,onChange:k=>{x(k.target.value)},children:YW.map(k=>o.jsx(p.Radio,{value:k.value,children:k.label},k.value))}),o.jsxs(p.Flex,{gap:16,wrap:!0,align:"center",justify:"flex-end",children:[o.jsx(p.Popover,{content:b,title:null,trigger:"click",placement:"right",children:o.jsxs("span",{style:{display:"inline-flex",gap:4,alignItems:"center",color:"#1890ff",cursor:"pointer",fontSize:"13px"},children:[o.jsx(Y.QuestionCircleOutlined,{style:{fontSize:"18px"}}),"검색 가이드"]})}),o.jsx(p.Popover,{content:j,title:null,trigger:"click",placement:"right",children:o.jsxs("span",{style:{display:"inline-flex",gap:4,alignItems:"center",color:"#fa8c16",cursor:"pointer",fontSize:"13px"},children:[o.jsx(Y.QuestionCircleOutlined,{style:{fontSize:"18px"}}),"에러 메시지 안내"]})})]})]}),o.jsx(p.Input.Search,{placeholder:"도로명, 지번, 건물명, 우편번호로 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:i,allowClear:!0,enterButton:"검색",onChange:k=>{a(k.target.value)},onSearch:E,style:{flex:1}})]})}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[s.length>0&&o.jsx("div",{style:{padding:"16px 16px 12px 16px"},children:o.jsxs("h3",{style:{fontSize:"16px",fontWeight:"bold"},children:["검색 결과 (",h,"개)"]})}),o.jsx("div",{ref:n,style:{paddingInline:"15px",overflowY:"auto",flex:1},children:o.jsx(p.Spin,{spinning:u,children:s.length>0?o.jsx("div",{children:s.map((k,T)=>{const D=c?.bdMgtSn===k.bdMgtSn;return o.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"12px",border:D?"2px solid #6449fc":"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:D?"#efebff":"white",transition:"all 0.2s ease"},onClick:()=>C(k),children:[o.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginTop:"2px"},onClick:L=>{L.stopPropagation(),C(k)},children:D?o.jsx(Y.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):o.jsx(Y.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"4px"},children:["[",k.zipNo,"]"]}),o.jsx("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px",lineHeight:"1.4",color:"#333"},children:k.roadAddr}),k.detBdNmList&&o.jsx("div",{style:{fontSize:"12px",color:"#666",marginBottom:"4px"},children:k.detBdNmList}),o.jsx("div",{style:{fontSize:"12px",color:"#999",lineHeight:"1.3"},children:k.jibunAddr})]})]},`addr-${k.bdMgtSn}-${T}`)})}):o.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:i?"검색 버튼이나 엔터키를 눌러 검색해주세요.":"주소를 검색해주세요."})})}),o.jsx(To,{ref:r,mode:"server",onServerPageChange:(k,T)=>{P(k,T)},pageSizeOptions:[10,20,50]})]})]})})})},XW=Object.freeze(Object.defineProperty({__proto__:null,default:tO},Symbol.toStringTag,{value:"Module"}));exports.ButtonAccessController=qf;exports.BwgButtonGroup=Yf;exports.BwgCmptArea=lO;exports.BwgCol=$e;exports.BwgComponentGuideM01=TN;exports.BwgConfigProvider=Oh;exports.BwgDetail=bO;exports.BwgDeveloperGuideM01=AN;exports.BwgDrawer=dn;exports.BwgEditor=kh;exports.BwgGrid=Ve;exports.BwgInfoArea=fn;exports.BwgPagination=To;exports.BwgPopup=fi;exports.BwgReactGuideM01=BN;exports.BwgRow=wt;exports.BwgSpace=Oc;exports.BwgTable=NO;exports.BwgTabs=ar;exports.BwgTitleBox=Le;exports.BwgView=kt;exports.CMAdminBoardM01=MW;exports.CMAuthMstrM01=jN;exports.CMBoardCommentS01=Km;exports.CMFileMstrM01=$N;exports.CMHldyCfg=KN;exports.CMMenuMstrM01=zN;exports.CMMenuPrgrSelectModal=sS;exports.CMMenuPrntSelectModal=lS;exports.CMMyBoardM01=AW;exports.CMPopuMstrM01=FN;exports.CMPrgrMstrM01=WN;exports.CMPrgrMstrP02=eO;exports.CMPrgrMstrP02$1=qW;exports.CMRoleMstrM01=EN;exports.CMSystCfgM01=qN;exports.CMSystCodeM01=YN;exports.CMUserMstrM01=PW;exports.ContentBox=Ie;exports.ContentLayOut=ze;exports.GlobalConfigProvider=yN;exports.QuickServiceToggle=CN;exports.SSOHandler=SN;exports.SearchAddressP01=tO;exports.SearchAddressP01$1=XW;exports.SearchBox=ko;exports.SearchDepartmentP01=GP;exports.SearchDepartmentP01$1=_W;exports.SearchDepartmentP02=XP;exports.SearchDepartmentP02$1=zW;exports.SearchHolidayP01=JP;exports.SearchHolidayP01$1=KW;exports.SearchOrganizationP01=ZP;exports.SearchOrganizationP01$1=VW;exports.SearchOrganizationP02=QP;exports.SearchOrganizationP02$1=UW;exports.SystemCodeManage=EW;exports.commonjsGlobal=aO;exports.getAugmentedNamespace=sO;exports.getDefaultExportFromCjs=wr;
1109
+ `).concat(P.x,",").concat(P.y),C=Ft(e.id)?Fa("recharts-radial-line-"):e.id;return S.createElement("text",Sn({},n,{dominantBaseline:"central",className:Je("recharts-radial-bar-label",s)}),S.createElement("defs",null,S.createElement("path",{id:C,d:E})),S.createElement("textPath",{xlinkHref:"#".concat(C)},r))},WF=(e,t,r)=>{var{cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=jt(n,i,s+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var h=(a+s)/2,{x:g,y:v}=jt(n,i,h,d);return{x:g,y:v,textAnchor:"middle",verticalAnchor:"middle"}},pP=e=>"cx"in e&&Ae(e.cx),KF=(e,t)=>{var{parentViewBox:r,offset:n,position:i}=e,a;r!=null&&!pP(r)&&(a=r);var{x:s,y:l,width:c,height:d}=t,u=d>=0?1:-1,f=u*n,h=u>0?"end":"start",g=u>0?"start":"end",v=c>=0?1:-1,x=v*n,y=v>0?"end":"start",w=v>0?"start":"end";if(i==="top"){var b={x:s+c/2,y:l-u*n,textAnchor:"middle",verticalAnchor:h};return bt(bt({},b),a?{height:Math.max(l-a.y,0),width:c}:{})}if(i==="bottom"){var j={x:s+c/2,y:l+d+f,textAnchor:"middle",verticalAnchor:g};return bt(bt({},j),a?{height:Math.max(a.y+a.height-(l+d),0),width:c}:{})}if(i==="left"){var P={x:s-x,y:l+d/2,textAnchor:y,verticalAnchor:"middle"};return bt(bt({},P),a?{width:Math.max(P.x-a.x,0),height:d}:{})}if(i==="right"){var E={x:s+c+x,y:l+d/2,textAnchor:w,verticalAnchor:"middle"};return bt(bt({},E),a?{width:Math.max(a.x+a.width-E.x,0),height:d}:{})}var C=a?{width:c,height:d}:{};return i==="insideLeft"?bt({x:s+x,y:l+d/2,textAnchor:w,verticalAnchor:"middle"},C):i==="insideRight"?bt({x:s+c-x,y:l+d/2,textAnchor:y,verticalAnchor:"middle"},C):i==="insideTop"?bt({x:s+c/2,y:l+f,textAnchor:"middle",verticalAnchor:g},C):i==="insideBottom"?bt({x:s+c/2,y:l+d-f,textAnchor:"middle",verticalAnchor:h},C):i==="insideTopLeft"?bt({x:s+x,y:l+f,textAnchor:w,verticalAnchor:g},C):i==="insideTopRight"?bt({x:s+c-x,y:l+f,textAnchor:y,verticalAnchor:g},C):i==="insideBottomLeft"?bt({x:s+x,y:l+d-f,textAnchor:w,verticalAnchor:h},C):i==="insideBottomRight"?bt({x:s+c-x,y:l+d-f,textAnchor:y,verticalAnchor:h},C):i&&typeof i=="object"&&(Ae(i.x)||Rn(i.x))&&(Ae(i.y)||Rn(i.y))?bt({x:s+Zt(i.x,c),y:l+Zt(i.y,d),textAnchor:"end",verticalAnchor:"end"},C):bt({x:s+c/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},C)},qF={offset:5};function ri(e){var t=ir(e,qF),{viewBox:r,position:n,value:i,children:a,content:s,className:l="",textBreakAll:c,labelRef:d}=t,u=FF(),f=fP(),h=n==="center"?f:u??f,g=r||h;if(!g||Ft(i)&&Ft(a)&&!m.isValidElement(s)&&typeof s!="function")return null;var v=bt(bt({},t),{},{viewBox:g});if(m.isValidElement(s)){var x=NF(v,IF);return m.cloneElement(s,x)}var y;if(typeof s=="function"){if(y=m.createElement(s,v),m.isValidElement(y))return y}else y=VF(t);var w=pP(g),b=Dr(t);if(w&&(n==="insideStart"||n==="insideEnd"||n==="end"))return UF(t,n,y,b,g);var j=w?WF(g,t.offset,t.position):KF(t,g);return S.createElement(hu,Sn({ref:d,className:Je("recharts-label",l)},b,j,{breakAll:c}),y)}ri.displayName="Label";var YF=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?S.createElement(ri,Sn({key:"label-implicit"},n)):hn(e)?S.createElement(ri,Sn({key:"label-implicit",value:e},n)):m.isValidElement(e)?e.type===ri?m.cloneElement(e,bt({key:"label-implicit"},n)):S.createElement(ri,Sn({key:"label-implicit",content:e},n)):Mm(e)?S.createElement(ri,Sn({key:"label-implicit",content:e},n)):e&&typeof e=="object"?S.createElement(ri,Sn({},e,{key:"label-implicit"},n)):null};function GF(e){var{label:t,labelRef:r}=e,n=fP();return YF(t,n,r)||null}var Af={},If={},s1;function XF(){return s1||(s1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(If)),If}var Nf={},l1;function ZF(){return l1||(l1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(Nf)),Nf}var c1;function QF(){return c1||(c1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XF(),r=ZF(),n=cg();function i(a){if(n.isArrayLike(a))return t.last(r.toArray(a))}e.last=i})(Af)),Af}var Df,u1;function JF(){return u1||(u1=1,Df=QF().last),Df}var e9=JF();const t9=wr(e9);var r9=["valueAccessor"],n9=["dataKey","clockWise","id","textBreakAll"];function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mc.apply(null,arguments)}function d1(e,t){if(e==null)return{};var r,n,i=i9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var o9=e=>Array.isArray(e.value)?t9(e.value):e.value,hP=m.createContext(void 0),a9=hP.Provider,gP=m.createContext(void 0),s9=gP.Provider;function l9(){return m.useContext(hP)}function c9(){return m.useContext(gP)}function Tl(e){var{valueAccessor:t=o9}=e,r=d1(e,r9),{dataKey:n,id:i,textBreakAll:a}=r,s=d1(r,n9),l=l9(),c=c9(),d=l||c;return!d||!d.length?null:S.createElement(ur,{className:"recharts-label-list"},d.map((u,f)=>{var h,g=Ft(n)?t(u,f):ht(u&&u.payload,n),v=Ft(i)?{}:{id:"".concat(i,"-").concat(f)};return S.createElement(ri,mc({key:"label-".concat(f)},Dr(u),s,v,{fill:(h=r.fill)!==null&&h!==void 0?h:u.fill,parentViewBox:u.parentViewBox,value:g,textBreakAll:a,viewBox:u.viewBox,index:f}))}))}Tl.displayName="LabelList";function mP(e){var{label:t}=e;return t?t===!0?S.createElement(Tl,{key:"labelList-implicit"}):S.isValidElement(t)||Mm(t)?S.createElement(Tl,{key:"labelList-implicit",content:t}):typeof t=="object"?S.createElement(Tl,mc({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var vP=e=>e.graphicalItems.polarItems,u9=ee([ft,xs],tm),gu=ee([vP,gt,u9],nm),d9=ee([gu],im),mu=ee([d9,Hg],om),f9=ee([mu,gt,gu],sm);ee([mu,gt,gu],(e,t,r)=>r.length>0?e.flatMap(n=>r.flatMap(i=>{var a,s=ht(n,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):t?.dataKey!=null?e.map(n=>({value:ht(n,t.dataKey),errorDomain:[]})):e.map(n=>({value:n,errorDomain:[]})));var f1=()=>{},p9=ee([mu,gt,gu,uu,ft],dm),h9=ee([gt,cm,um,f1,p9,f1,We,ft],fm),yP=ee([gt,We,mu,f9,ys,ft,h9],pm),g9=ee([yP,gt,Fo],mm);ee([gt,yP,g9,ft],ym);var m9={radiusAxis:{},angleAxis:{}},v9=Cr({name:"polarAxis",initialState:m9,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),y9=v9.reducer;function p1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function h1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p1(Object(r),!0).forEach(function(n){x9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x9(e,t,r){return(t=b9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b9(e){var t=w9(e,"string");return typeof t=="symbol"?t:t+""}function w9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var C9=(e,t)=>t,Rm=ee([vP,C9],(e,t)=>e.filter(r=>r.type==="pie").find(r=>r.id===t)),S9=[],Am=(e,t,r)=>r?.length===0?S9:r,xP=ee([Hg,Rm,Am],(e,t,r)=>{var{chartData:n}=e;if(t!=null){var i;if(t?.data!=null&&t.data.length>0?i=t.data:i=n,(!i||!i.length)&&r!=null&&(i=r.map(a=>h1(h1({},t.presentationProps),a.props))),i!=null)return i}}),j9=ee([xP,Rm,Am],(e,t,r)=>{if(!(e==null||t==null))return e.map((n,i)=>{var a,s=ht(n,t.nameKey,t.name),l;return r!=null&&(a=r[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=r[i].props.fill:typeof n=="object"&&n!=null&&"fill"in n?l=n.fill:l=t.fill,{value:Uc(s,t.dataKey),color:l,payload:n,type:t.legendType}})}),E9=ee([xP,Rm,Am,Rt],(e,t,r,n)=>{if(!(t==null||e==null))return j7({offset:n,pieSettings:t,displayedData:e,cells:r})}),g1=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",m1=null,_f=null,bP=e=>{if(e===m1&&Array.isArray(_f))return _f;var t=[];return m.Children.forEach(e,r=>{Ft(r)||(wl.isFragment(r)?t=t.concat(bP(r.props.children)):t.push(r))}),_f=t,m1=e,t};function Im(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(i=>g1(i)):n=[g1(t)],bP(e).forEach(i=>{var a=_i(i,"type.displayName")||_i(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}var Bf={},v1;function P9(){return v1||(v1=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${i}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(Bf)),Bf}var $f,y1;function O9(){return y1||(y1=1,$f=P9().isPlainObject),$f}var k9=O9();const T9=wr(k9);function x1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function b1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x1(Object(r),!0).forEach(function(n){M9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M9(e,t,r){return(t=R9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R9(e){var t=A9(e,"string");return typeof t=="symbol"?t:t+""}function A9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vc.apply(null,arguments)}var w1=(e,t,r,n,i)=>{var a=r-n,s;return s="M ".concat(e,",").concat(t),s+="L ".concat(e+r,",").concat(t),s+="L ".concat(e+r-a/2,",").concat(t+i),s+="L ".concat(e+r-a/2-n,",").concat(t+i),s+="L ".concat(e,",").concat(t," Z"),s},I9={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},N9=e=>{var t=ir(e,I9),{x:r,y:n,upperWidth:i,lowerWidth:a,height:s,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,h=m.useRef(null),[g,v]=m.useState(-1),x=m.useRef(i),y=m.useRef(a),w=m.useRef(s),b=m.useRef(r),j=m.useRef(n),P=Jc(e,"trapezoid-");if(m.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var z=h.current.getTotalLength();z&&v(z)}catch{}},[]),r!==+r||n!==+n||i!==+i||a!==+a||s!==+s||i===0&&a===0||s===0)return null;var E=Je("recharts-trapezoid",l);if(!f)return S.createElement("g",null,S.createElement("path",vc({},Dr(t),{className:E,d:w1(r,n,i,a,s)})));var C=x.current,O=y.current,k=w.current,T=b.current,D=j.current,L="0px ".concat(g===-1?1:g,"px"),A="".concat(g,"px 0px"),B=zj(["strokeDasharray"],d,c);return S.createElement(Qc,{animationId:P,key:P,canBegin:g>0,duration:d,easing:c,isActive:f,begin:u},z=>{var F=Yt(C,i,z),R=Yt(O,a,z),N=Yt(k,s,z),I=Yt(T,r,z),M=Yt(D,n,z);h.current&&(x.current=F,y.current=R,w.current=N,b.current=I,j.current=M);var W=z>0?{transition:B,strokeDasharray:A}:{strokeDasharray:L};return S.createElement("path",vc({},Dr(t),{className:E,d:w1(I,M,F,R,N),ref:h,style:b1(b1({},W),t.style)}))})},D9=["option","shapeType","propTransformer","activeClassName","isActive"];function _9(e,t){if(e==null)return{};var r,n,i=B9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function B9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function C1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?C1(Object(r),!0).forEach(function(n){$9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $9(e,t,r){return(t=L9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L9(e){var t=z9(e,"string");return typeof t=="symbol"?t:t+""}function z9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F9(e,t){return yc(yc({},t),e)}function V9(e,t){return e==="symbols"}function S1(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return S.createElement(Uj,r);case"trapezoid":return S.createElement(N9,r);case"sector":return S.createElement(qj,r);case"symbols":if(V9(t))return S.createElement(ag,r);break;default:return null}}function H9(e){return m.isValidElement(e)?e.props:e}function wP(e){var{option:t,shapeType:r,propTransformer:n=F9,activeClassName:i="recharts-active-shape",isActive:a}=e,s=_9(e,D9),l;if(m.isValidElement(t))l=m.cloneElement(t,yc(yc({},s),H9(t)));else if(typeof t=="function")l=t(s);else if(T9(t)&&typeof t!="boolean"){var c=n(t,s);l=S.createElement(S1,{shapeType:r,elementProps:c})}else{var d=s;l=S.createElement(S1,{shapeType:r,elementProps:d})}return a?S.createElement(ur,{className:i},l):l}var Nm=(e,t)=>{var r=dt();return(n,i)=>a=>{e?.(n,i,a),r(NE({activeIndex:String(i),activeDataKey:t,activeCoordinate:n.tooltipPosition}))}},Dm=e=>{var t=dt();return(r,n)=>i=>{e?.(r,n,i),t(IL())}},_m=(e,t)=>{var r=dt();return(n,i)=>a=>{e?.(n,i,a),r(NL({activeIndex:String(i),activeDataKey:t,activeCoordinate:n.tooltipPosition}))}};function CP(e){var{fn:t,args:r}=e,n=dt(),i=Sr();return m.useLayoutEffect(()=>{if(!i){var a=t(r);return n(ML(a)),()=>{n(RL(a))}}},[t,r,n,i]),null}var SP=()=>{};function U9(e){var{legendPayload:t}=e,r=dt(),n=Sr();return m.useLayoutEffect(()=>n?SP:(r(_j(t)),()=>{r(Bj(t))}),[r,n,t]),null}function W9(e){var{legendPayload:t}=e,r=dt(),n=Re(We);return m.useLayoutEffect(()=>n!=="centric"&&n!=="radial"?SP:(r(_j(t)),()=>{r(Bj(t))}),[r,n,t]),null}var Lf,K9=()=>{var[e]=S.useState(()=>Fa("uid-"));return e},q9=(Lf=S.useId)!==null&&Lf!==void 0?Lf:K9;function Y9(e,t){var r=q9();return t||(e?"".concat(e,"-").concat(r):r)}var G9=m.createContext(void 0),jP=e=>{var{id:t,type:r,children:n}=e,i=Y9("recharts-".concat(r),t);return S.createElement(G9.Provider,{value:i},n(i))},X9={cartesianItems:[],polarItems:[]},EP=Cr({name:"graphicalItems",initialState:X9,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:er()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=kn(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:er()},removeCartesianGraphicalItem:{reducer(e,t){var r=kn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:er()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:er()},removePolarGraphicalItem:{reducer(e,t){var r=kn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:er()}}}),{addCartesianGraphicalItem:Z9,replaceCartesianGraphicalItem:Q9,removeCartesianGraphicalItem:J9,addPolarGraphicalItem:e7,removePolarGraphicalItem:t7}=EP.actions,r7=EP.reducer;function n7(e){var t=dt(),r=m.useRef(null);return m.useLayoutEffect(()=>{r.current===null?t(Z9(e)):r.current!==e&&t(Q9({prev:r.current,next:e})),r.current=e},[t,e]),m.useLayoutEffect(()=>()=>{r.current&&(t(J9(r.current)),r.current=null)},[t]),null}function i7(e){var t=dt();return m.useLayoutEffect(()=>(t(e7(e)),()=>{t(t7(e))}),[t,e]),null}var o7=["onMouseEnter","onClick","onMouseLeave"],a7=["id"],s7=["id"];function Bm(e,t){if(e==null)return{};var r,n,i=l7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function l7(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function j1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j1(Object(r),!0).forEach(function(n){c7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c7(e,t,r){return(t=u7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u7(e){var t=d7(e,"string");return typeof t=="symbol"?t:t+""}function d7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ui.apply(null,arguments)}function f7(e){var t=m.useMemo(()=>Im(e.children,ai),[e.children]),r=Re(n=>j9(n,e.id,t));return r==null?null:S.createElement(W9,{legendPayload:r})}function p7(e){var{dataKey:t,nameKey:r,sectors:n,stroke:i,strokeWidth:a,fill:s,name:l,hide:c,tooltipType:d}=e;return{dataDefinedOnItem:n.map(u=>u.tooltipPayload),positions:n.map(u=>u.tooltipPosition),settings:{stroke:i,strokeWidth:a,fill:s,dataKey:t,nameKey:r,name:Uc(l,t),hide:c,type:d,color:s,unit:""}}}var h7=(e,t)=>e>t?"start":e<t?"end":"middle",g7=(e,t,r)=>Zt(typeof t=="function"?t(e):t,r,r*.8),m7=(e,t,r)=>{var{top:n,left:i,width:a,height:s}=t,l=jj(a,s),c=i+Zt(e.cx,a,a/2),d=n+Zt(e.cy,s,s/2),u=Zt(e.innerRadius,l,0),f=g7(r,e.outerRadius,l),h=e.maxRadius||Math.sqrt(a*a+s*s)/2;return{cx:c,cy:d,innerRadius:u,outerRadius:f,maxRadius:h}},v7=(e,t)=>{var r=Lt(t-e),n=Math.min(Math.abs(t-e),360);return r*n};function y7(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var x7=(e,t)=>{if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var r=Je("recharts-pie-label-line",typeof e!="boolean"?e.className:"");return S.createElement(Lj,ui({},t,{type:"linear",className:r}))},b7=(e,t,r)=>{if(S.isValidElement(e))return S.cloneElement(e,t);var n=r;if(typeof e=="function"&&(n=e(t),S.isValidElement(n)))return n;var i=Je("recharts-pie-label-text",y7(e));return S.createElement(hu,ui({},t,{alignmentBaseline:"middle",className:i}),n)};function w7(e){var{sectors:t,props:r,showLabels:n}=e,{label:i,labelLine:a,dataKey:s}=r;if(!n||!i||!t)return null;var l=Qr(r),c=za(i),d=za(a),u=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,f=t.map((h,g)=>{var v=(h.startAngle+h.endAngle)/2,x=jt(h.cx,h.cy,h.outerRadius+u,v),y=ct(ct(ct(ct({},l),h),{},{stroke:"none"},c),{},{index:g,textAnchor:h7(x.x,h.cx)},x),w=ct(ct(ct(ct({},l),h),{},{fill:"none",stroke:h.fill},d),{},{index:g,points:[jt(h.cx,h.cy,h.outerRadius,v),x],key:"line"});return S.createElement(ur,{key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(g)},a&&x7(a,w),b7(i,y,ht(h,s)))});return S.createElement(ur,{className:"recharts-pie-labels"},f)}function C7(e){var{sectors:t,props:r,showLabels:n}=e,{label:i}=r;return typeof i=="object"&&i!=null&&"position"in i?S.createElement(mP,{label:i}):S.createElement(w7,{sectors:t,props:r,showLabels:n})}function S7(e){var{sectors:t,activeShape:r,inactiveShape:n,allOtherPieProps:i}=e,a=Re(Fi),{onMouseEnter:s,onClick:l,onMouseLeave:c}=i,d=Bm(i,o7),u=Nm(s,i.dataKey),f=Dm(c),h=_m(l,i.dataKey);return t==null||t.length===0?null:S.createElement(S.Fragment,null,t.map((g,v)=>{if(g?.startAngle===0&&g?.endAngle===0&&t.length!==1)return null;var x=r&&String(v)===a,y=a?n:null,w=x?r:y,b=ct(ct({},g),{},{stroke:g.stroke,tabIndex:-1,[Tj]:v,[Mj]:i.dataKey});return S.createElement(ur,ui({key:"sector-".concat(g?.startAngle,"-").concat(g?.endAngle,"-").concat(g.midAngle,"-").concat(v),tabIndex:-1,className:"recharts-pie-sector"},cs(d,g,v),{onMouseEnter:u(g,v),onMouseLeave:f(g,v),onClick:h(g,v)}),S.createElement(wP,ui({option:w,isActive:x,shapeType:"sector"},b)))}))}function j7(e){var t,{pieSettings:r,displayedData:n,cells:i,offset:a}=e,{cornerRadius:s,startAngle:l,endAngle:c,dataKey:d,nameKey:u,tooltipType:f}=r,h=Math.abs(r.minAngle),g=v7(l,c),v=Math.abs(g),x=n.length<=1?0:(t=r.paddingAngle)!==null&&t!==void 0?t:0,y=n.filter(C=>ht(C,d,0)!==0).length,w=(v>=360?y:y-1)*x,b=v-y*h-w,j=n.reduce((C,O)=>{var k=ht(O,d,0);return C+(Ae(k)?k:0)},0),P;if(j>0){var E;P=n.map((C,O)=>{var k=ht(C,d,0),T=ht(C,u,O),D=m7(r,a,C),L=(Ae(k)?k:0)/j,A,B=ct(ct({},C),i&&i[O]&&i[O].props);O?A=E.endAngle+Lt(g)*x*(k!==0?1:0):A=l;var z=A+Lt(g)*((k!==0?h:0)+L*b),F=(A+z)/2,R=(D.innerRadius+D.outerRadius)/2,N=[{name:T,value:k,payload:B,dataKey:d,type:f}],I=jt(D.cx,D.cy,R,F);return E=ct(ct(ct(ct({},r.presentationProps),{},{percent:L,cornerRadius:s,name:T,tooltipPayload:N,midAngle:F,middleRadius:R,tooltipPosition:I},B),D),{},{value:k,startAngle:A,endAngle:z,payload:B,paddingAngle:Lt(g)*x}),E})}return P}function E7(e){var{showLabels:t,sectors:r,children:n}=e,i=m.useMemo(()=>!t||!r?[]:r.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[r,t]);return S.createElement(s9,{value:t?i:void 0},n)}function P7(e){var{props:t,previousSectorsRef:r}=e,{sectors:n,isAnimationActive:i,animationBegin:a,animationDuration:s,animationEasing:l,activeShape:c,inactiveShape:d,onAnimationStart:u,onAnimationEnd:f}=t,h=Jc(t,"recharts-pie-"),g=r.current,[v,x]=m.useState(!1),y=m.useCallback(()=>{typeof f=="function"&&f(),x(!1)},[f]),w=m.useCallback(()=>{typeof u=="function"&&u(),x(!0)},[u]);return S.createElement(E7,{showLabels:!v,sectors:n},S.createElement(Qc,{animationId:h,begin:a,duration:s,isActive:i,easing:l,onAnimationStart:w,onAnimationEnd:y,key:h},b=>{var j=[],P=n&&n[0],E=P?.startAngle;return n?.forEach((C,O)=>{var k=g&&g[O],T=O>0?_i(C,"paddingAngle",0):0;if(k){var D=Yt(k.endAngle-k.startAngle,C.endAngle-C.startAngle,b),L=ct(ct({},C),{},{startAngle:E+T,endAngle:E+D+T});j.push(L),E=L.endAngle}else{var{endAngle:A,startAngle:B}=C,z=Yt(0,A-B,b),F=ct(ct({},C),{},{startAngle:E+T,endAngle:E+z+T});j.push(F),E=F.endAngle}}),r.current=j,S.createElement(ur,null,S.createElement(S7,{sectors:j,activeShape:c,inactiveShape:d,allOtherPieProps:t}))}),S.createElement(C7,{showLabels:!v,sectors:n,props:t}),t.children)}var O7={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:!Wi.isSsr,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff"};function k7(e){var{id:t}=e,r=Bm(e,a7),{hide:n,className:i,rootTabIndex:a}=e,s=m.useMemo(()=>Im(e.children,ai),[e.children]),l=Re(u=>E9(u,t,s)),c=m.useRef(null),d=Je("recharts-pie",i);return n||l==null?(c.current=null,S.createElement(ur,{tabIndex:a,className:d})):S.createElement(S.Fragment,null,S.createElement(CP,{fn:p7,args:ct(ct({},e),{},{sectors:l})}),S.createElement(ur,{tabIndex:a,className:d},S.createElement(P7,{props:ct(ct({},r),{},{sectors:l}),previousSectorsRef:c})))}function PP(e){var t=ir(e,O7),{id:r}=t,n=Bm(t,s7),i=Qr(n);return S.createElement(jP,{id:r,type:"pie"},a=>S.createElement(S.Fragment,null,S.createElement(i7,{type:"pie",id:a,data:n.data,dataKey:n.dataKey,hide:n.hide,angleAxisId:0,radiusAxisId:0,name:n.name,nameKey:n.nameKey,tooltipType:n.tooltipType,legendType:n.legendType,fill:n.fill,cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,paddingAngle:n.paddingAngle,minAngle:n.minAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius,cornerRadius:n.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),S.createElement(f7,ui({},n,{id:a})),S.createElement(k7,ui({},n,{id:a}))))}PP.displayName="Pie";function E1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E1(Object(r),!0).forEach(function(n){T7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function T7(e,t,r){return(t=M7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M7(e){var t=R7(e,"string");return typeof t=="symbol"?t:t+""}function R7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var A7={xAxis:{},yAxis:{},zAxis:{}},OP=Cr({name:"cartesianAxis",initialState:A7,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:er()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:er()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:er()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:er()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:er()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:er()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,i=e.yAxis[r];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&n===a[1]&&n!==i.width&&Math.abs(n-a[0])<=1)return;var s=[...a,n].slice(-3);e.yAxis[r]=P1(P1({},e.yAxis[r]),{},{width:n,widthHistory:s})}}}}),{addXAxis:I7,removeXAxis:N7,addYAxis:D7,removeYAxis:_7,updateYAxisWidth:B7}=OP.actions,$7=OP.reducer,L7=ee([Rt],e=>{if(e)return{top:e.top,bottom:e.bottom,left:e.left,right:e.right}}),z7=ee([L7,Bn,$n],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),kP=()=>Re(z7),F7=process.env.NODE_ENV==="production",zf="Invariant failed";function O1(e,t){if(F7)throw new Error(zf);var r=typeof t=="function"?t():t,n=r?"".concat(zf,": ").concat(r):zf;throw new Error(n)}var V7=["x","y"];function bh(){return bh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bh.apply(null,arguments)}function k1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ya(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(r),!0).forEach(function(n){H7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H7(e,t,r){return(t=U7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U7(e){var t=W7(e,"string");return typeof t=="symbol"?t:t+""}function W7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K7(e,t){if(e==null)return{};var r,n,i=q7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function q7(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Y7(e,t){var{x:r,y:n}=e,i=K7(e,V7),a="".concat(r),s=parseInt(a,10),l="".concat(n),c=parseInt(l,10),d="".concat(t.height||i.height),u=parseInt(d,10),f="".concat(t.width||i.width),h=parseInt(f,10);return ya(ya(ya(ya(ya({},t),i),s?{x:s}:{}),c?{y:c}:{}),{},{height:u,width:h,name:t.name,radius:t.radius})}function $m(e){return S.createElement(wP,bh({shapeType:"rectangle",propTransformer:Y7,activeClassName:"recharts-active-bar"},e))}var G7=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,i)=>{if(Ae(t))return t;var a=Ae(n)||Ft(n);return a?t(n,i):(a||(process.env.NODE_ENV!=="production"?O1(!1,"minPointSize callback function received a value with type of ".concat(typeof n,". Currently only numbers or null/undefined are supported.")):O1()),r)}},X7={},Z7=Cr({name:"errorBars",initialState:X7,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(i=>i.dataKey!==n.dataKey||i.direction!==n.direction))}}}),Q7=Z7.reducer,J7=["children"];function eV(e,t){if(e==null)return{};var r,n,i=tV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function tV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var rV={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},nV=m.createContext(rV);function iV(e){var{children:t}=e,r=eV(e,J7);return S.createElement(nV.Provider,{value:r},t)}function TP(e,t){var r,n,i=Re(d=>zn(d,e)),a=Re(d=>Fn(d,t)),s=(r=i?.allowDataOverflow)!==null&&r!==void 0?r:gr.allowDataOverflow,l=(n=a?.allowDataOverflow)!==null&&n!==void 0?n:mr.allowDataOverflow,c=s||l;return{needClip:c,needClipX:s,needClipY:l}}function oV(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=kP(),{needClipX:a,needClipY:s,needClip:l}=TP(t,r);if(!l)return null;var{x:c,y:d,width:u,height:f}=i;return S.createElement("clipPath",{id:"clipPath-".concat(n)},S.createElement("rect",{x:a?c:c-u/2,y:s?d:d-f/2,width:a?u:u*2,height:s?f:f*2}))}var aV=["onMouseEnter","onMouseLeave","onClick"],sV=["value","background","tooltipPosition"],lV=["id"],cV=["onMouseEnter","onClick","onMouseLeave"];function di(){return di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},di.apply(null,arguments)}function T1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T1(Object(r),!0).forEach(function(n){uV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uV(e,t,r){return(t=dV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dV(e){var t=fV(e,"string");return typeof t=="symbol"?t:t+""}function fV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xc(e,t){if(e==null)return{};var r,n,i=pV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function pV(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var hV=e=>{var{dataKey:t,name:r,fill:n,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:n,value:Uc(r,t),payload:e}]};function gV(e){var{dataKey:t,stroke:r,strokeWidth:n,fill:i,name:a,hide:s,unit:l}=e;return{dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:Uc(a,t),hide:s,type:e.tooltipType,color:e.fill,unit:l}}}function mV(e){var t=Re(Fi),{data:r,dataKey:n,background:i,allOtherBarProps:a}=e,{onMouseEnter:s,onMouseLeave:l,onClick:c}=a,d=xc(a,aV),u=Nm(s,n),f=Dm(l),h=_m(c,n);if(!i||r==null)return null;var g=za(i);return S.createElement(S.Fragment,null,r.map((v,x)=>{var{background:y}=v,w=xc(v,sV);if(!y)return null;var b=u(v,x),j=f(v,x),P=h(v,x),E=tr(tr(tr(tr(tr({option:i,isActive:String(x)===t},w),{},{fill:"#eee"},y),g),cs(d,v,x)),{},{onMouseEnter:b,onMouseLeave:j,onClick:P,dataKey:n,index:x,className:"recharts-bar-background-rectangle"});return S.createElement($m,di({key:"background-bar-".concat(x)},E))}))}function vV(e){var{showLabels:t,children:r,rects:n}=e,i=n?.map(a=>{var s={x:a.x,y:a.y,width:a.width,height:a.height};return tr(tr({},s),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:s,fill:a.fill})});return S.createElement(a9,{value:t?i:void 0},r)}function yV(e){var{shape:t,activeBar:r,baseProps:n,entry:i,index:a,dataKey:s}=e,l=Re(Fi),c=Re(GE),d=r&&String(a)===l&&(c==null||s===c),u=d?r:t;return S.createElement($m,di({},n,{name:String(n.name)},i,{isActive:d,option:u,index:a,dataKey:s}))}function xV(e){var{shape:t,baseProps:r,entry:n,index:i,dataKey:a}=e;return S.createElement($m,di({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a}))}function bV(e){var{data:t,props:r}=e,n=Qr(r),i=xc(n,lV),{shape:a,dataKey:s,activeBar:l}=r,{onMouseEnter:c,onClick:d,onMouseLeave:u}=r,f=xc(r,cV),h=Nm(c,s),g=Dm(u),v=_m(d,s);return t?S.createElement(S.Fragment,null,t.map((x,y)=>S.createElement(ur,di({key:"rectangle-".concat(x?.x,"-").concat(x?.y,"-").concat(x?.value,"-").concat(y),className:"recharts-bar-rectangle"},cs(f,x,y),{onMouseEnter:h(x,y),onMouseLeave:g(x,y),onClick:v(x,y)}),l?S.createElement(yV,{shape:a,activeBar:l,baseProps:i,entry:x,index:y,dataKey:s}):S.createElement(xV,{shape:a,baseProps:i,entry:x,index:y,dataKey:s})))):null}function wV(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:i,isAnimationActive:a,animationBegin:s,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:u}=t,f=r.current,h=Jc(t,"recharts-bar-"),[g,v]=m.useState(!1),x=!g,y=m.useCallback(()=>{typeof d=="function"&&d(),v(!1)},[d]),w=m.useCallback(()=>{typeof u=="function"&&u(),v(!0)},[u]);return S.createElement(vV,{showLabels:x,rects:n},S.createElement(Qc,{animationId:h,begin:s,duration:l,isActive:a,easing:c,onAnimationEnd:y,onAnimationStart:w,key:h},b=>{var j=b===1?n:n?.map((P,E)=>{var C=f&&f[E];if(C)return tr(tr({},P),{},{x:Yt(C.x,P.x,b),y:Yt(C.y,P.y,b),width:Yt(C.width,P.width,b),height:Yt(C.height,P.height,b)});if(i==="horizontal"){var O=Yt(0,P.height,b);return tr(tr({},P),{},{y:P.y+P.height-O,height:O})}var k=Yt(0,P.width,b);return tr(tr({},P),{},{width:k})});return b>0&&(r.current=j??null),j==null?null:S.createElement(ur,null,S.createElement(bV,{props:t,data:j}))}),S.createElement(mP,{label:t.label}),t.children)}function CV(e){var t=m.useRef(null);return S.createElement(wV,{previousRectanglesRef:t,props:e})}var MP=0,SV=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:ht(e,t)}};class jV extends m.PureComponent{render(){var{hide:t,data:r,dataKey:n,className:i,xAxisId:a,yAxisId:s,needClip:l,background:c,id:d}=this.props;if(t||r==null)return null;var u=Je("recharts-bar",i),f=d;return S.createElement(ur,{className:u,id:d},l&&S.createElement("defs",null,S.createElement(oV,{clipPathId:f,xAxisId:a,yAxisId:s})),S.createElement(ur,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(f,")"):void 0},S.createElement(mV,{data:r,dataKey:n,background:c,allOtherBarProps:this.props}),S.createElement(CV,this.props)))}}var EV={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",hide:!1,isAnimationActive:!Wi.isSsr,legendType:"rect",minPointSize:MP,xAxisId:0,yAxisId:0};function PV(e){var{xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=e,{needClip:f}=TP(t,r),h=wg(),g=Sr(),v=Im(e.children,ai),x=Re(b=>eH(b,t,r,g,e.id,v));if(h!=="vertical"&&h!=="horizontal")return null;var y,w=x?.[0];return w==null||w.height==null||w.width==null?y=0:y=h==="vertical"?w.height/2:w.width/2,S.createElement(iV,{xAxisId:t,yAxisId:r,data:x,dataPointFormatter:SV,errorBarOffset:y},S.createElement(jV,di({},e,{layout:h,needClip:f,data:x,xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function OV(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:i,bandSize:a,xAxis:s,yAxis:l,xAxisTicks:c,yAxisTicks:d,stackedData:u,displayedData:f,offset:h,cells:g,parentViewBox:v}=e,x=t==="horizontal"?l:s,y=u?x.scale.domain():null,w=AB({numericAxis:x});return f.map((b,j)=>{var P,E,C,O,k,T;u?P=PB(u[j],y):(P=ht(b,r),Array.isArray(P)||(P=[w,P]));var D=G7(n,MP)(P[1],j);if(t==="horizontal"){var L,[A,B]=[l.scale(P[0]),l.scale(P[1])];E=dx({axis:s,ticks:c,bandSize:a,offset:i.offset,entry:b,index:j}),C=(L=B??A)!==null&&L!==void 0?L:void 0,O=i.size;var z=A-B;if(k=_r(z)?0:z,T={x:E,y:h.top,width:O,height:h.height},Math.abs(D)>0&&Math.abs(k)<Math.abs(D)){var F=Lt(k||D)*(Math.abs(D)-Math.abs(k));C-=F,k+=F}}else{var[R,N]=[s.scale(P[0]),s.scale(P[1])];if(E=R,C=dx({axis:l,ticks:d,bandSize:a,offset:i.offset,entry:b,index:j}),O=N-R,k=i.size,T={x:h.left,y:C,width:h.width,height:k},Math.abs(D)>0&&Math.abs(O)<Math.abs(D)){var I=Lt(O||D)*(Math.abs(D)-Math.abs(O));O+=I}}if(E==null||C==null||O==null||k==null)return null;var M=tr(tr({},b),{},{x:E,y:C,width:O,height:k,value:u?P:P[1],payload:b,background:T,tooltipPosition:{x:E+O/2,y:C+k/2},parentViewBox:v},g&&g[j]&&g[j].props);return M}).filter(Boolean)}function kV(e){var t=ir(e,EV),r=Sr();return S.createElement(jP,{id:t.id,type:"bar"},n=>S.createElement(S.Fragment,null,S.createElement(U9,{legendPayload:hV(t)}),S.createElement(CP,{fn:gV,args:t}),S.createElement(n7,{type:"bar",id:n,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:RB(t.stackId),hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r}),S.createElement(PV,di({},t,{id:n}))))}var Ml=S.memo(kV);Ml.displayName="Bar";function M1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M1(Object(r),!0).forEach(function(n){TV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TV(e,t,r){return(t=MV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MV(e){var t=RV(e,"string");return typeof t=="symbol"?t:t+""}function RV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AV=(e,t)=>t,IV=(e,t,r)=>r,NV=(e,t,r,n)=>n,DV=(e,t,r,n,i)=>i,Es=ee([rm,DV],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),_V=ee([Es],e=>e?.maxBarSize),BV=(e,t,r,n,i,a)=>a,R1=(e,t,r)=>{var n=r??e;if(!Ft(n))return Zt(n,t,0)},$V=ee([We,rm,AV,IV,NV],(e,t,r,n,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===r:a.yAxisId===n).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),LV=(e,t,r,n)=>{var i=We(e);return i==="horizontal"?hh(e,"yAxis",r,n):hh(e,"xAxis",t,n)},zV=(e,t,r)=>{var n=We(e);return n==="horizontal"?Db(e,"xAxis",t):Db(e,"yAxis",r)},FV=(e,t,r)=>{var n={},i=e.filter(au),a=e.filter(d=>d.stackId==null),s=i.reduce((d,u)=>(d[u.stackId]||(d[u.stackId]=[]),d[u.stackId].push(u),d),n),l=Object.entries(s).map(d=>{var[u,f]=d,h=f.map(v=>v.dataKey),g=R1(t,r,f[0].barSize);return{stackId:u,dataKeys:h,barSize:g}}),c=a.map(d=>{var u=[d.dataKey].filter(h=>h!=null),f=R1(t,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:f}});return[...l,...c]},VV=ee([$V,P8,zV],FV),HV=(e,t,r,n,i)=>{var a,s,l=Es(e,t,r,n,i);if(l!=null){var c=We(e),d=G2(e),{maxBarSize:u}=l,f=Ft(u)?d:u,h,g;return c==="horizontal"?(h=Po(e,"xAxis",t,n),g=Eo(e,"xAxis",t,n)):(h=Po(e,"yAxis",r,n),g=Eo(e,"yAxis",r,n)),(a=(s=mg(h,g,!0))!==null&&s!==void 0?s:f)!==null&&a!==void 0?a:0}},RP=(e,t,r,n)=>{var i=We(e),a,s;return i==="horizontal"?(a=Po(e,"xAxis",t,n),s=Eo(e,"xAxis",t,n)):(a=Po(e,"yAxis",r,n),s=Eo(e,"yAxis",r,n)),mg(a,s)};function UV(e,t,r,n,i){var a=n.length;if(!(a<1)){var s=Zt(e,r,0,!0),l,c=[];if(Qt(n[0].barSize)){var d=!1,u=r/a,f=n.reduce((w,b)=>w+(b.barSize||0),0);f+=(a-1)*s,f>=r&&(f-=(a-1)*s,s=0),f>=r&&u>0&&(d=!0,u*=.9,f=a*u);var h=(r-f)/2>>0,g={offset:h-s,size:0};l=n.reduce((w,b)=>{var j,P={stackId:b.stackId,dataKeys:b.dataKeys,position:{offset:g.offset+g.size+s,size:d?u:(j=b.barSize)!==null&&j!==void 0?j:0}},E=[...w,P];return g=E[E.length-1].position,E},c)}else{var v=Zt(t,r,0,!0);r-2*v-(a-1)*s<=0&&(s=0);var x=(r-2*v-(a-1)*s)/a;x>1&&(x>>=0);var y=Qt(i)?Math.min(x,i):x;l=n.reduce((w,b,j)=>[...w,{stackId:b.stackId,dataKeys:b.dataKeys,position:{offset:v+(x+s)*j+(x-y)/2,size:y}}],c)}return l}}var WV=(e,t,r,n,i,a,s)=>{var l=Ft(s)?t:s,c=UV(r,n,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(d=>yl(yl({},d),{},{position:yl(yl({},d.position),{},{offset:d.position.offset-i/2})}))),c},KV=ee([VV,G2,E8,X2,HV,RP,_V],WV),qV=(e,t,r,n)=>Po(e,"xAxis",t,n),YV=(e,t,r,n)=>Po(e,"yAxis",r,n),GV=(e,t,r,n)=>Eo(e,"xAxis",t,n),XV=(e,t,r,n)=>Eo(e,"yAxis",r,n),ZV=ee([KV,Es],(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}}),QV=(e,t)=>{var r=Jg(t);if(!(!e||r==null||t==null)){var{stackId:n}=t;if(n!=null){var i=e[n];if(i){var{stackedData:a}=i;if(a)return a.find(s=>s.key===r)}}}},JV=ee([LV,Es],QV),eH=ee([Rt,vg,qV,YV,GV,XV,ZV,We,Ug,RP,JV,Es,BV],(e,t,r,n,i,a,s,l,c,d,u,f,h)=>{var{chartData:g,dataStartIndex:v,dataEndIndex:x}=c;if(!(f==null||s==null||t==null||l!=="horizontal"&&l!=="vertical"||r==null||n==null||i==null||a==null||d==null)){var{data:y}=f,w;if(y!=null&&y.length>0?w=y:w=g?.slice(v,x+1),w!=null)return OV({layout:l,barSettings:f,pos:s,parentViewBox:t,bandSize:d,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:a,stackedData:u,displayedData:w,offset:e,cells:h})}}),AP=e=>{var{chartData:t}=e,r=dt(),n=Sr();return m.useEffect(()=>n?()=>{}:(r(Wb(t)),()=>{r(Wb(void 0))}),[t,r,n]),null},A1={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},tH=Cr({name:"brush",initialState:A1,reducers:{setBrushSettings(e,t){return t.payload==null?A1:t.payload}}}),rH=tH.reducer;function nH(e,t,r){return(t=iH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iH(e){var t=oH(e,"string");return typeof t=="symbol"?t:t+""}function oH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Lm{static create(t){return new Lm(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:r,position:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(n)switch(n){case"start":return this.scale(t);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+i}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(t)+a}default:return this.scale(t)}if(r){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+s}return this.scale(t)}}isInRange(t){var r=this.range(),n=r[0],i=r[r.length-1];return n<=i?t>=n&&t<=i:t>=i&&t<=n}}nH(Lm,"EPS",1e-4);function aH(e){return(e%180+180)%180}var sH=function(t){var{width:r,height:n}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=aH(i),s=a*Math.PI/180,l=Math.atan(n/r),c=s>l&&s<Math.PI-l?n/Math.sin(s):r/Math.cos(s);return Math.abs(c)},lH={dots:[],areas:[],lines:[]},cH=Cr({name:"referenceElements",initialState:lH,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=kn(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=kn(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=kn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),uH=cH.reducer,dH=m.createContext(void 0),fH=e=>{var{children:t}=e,[r]=m.useState("".concat(Fa("recharts"),"-clip")),n=kP();if(n==null)return null;var{x:i,y:a,width:s,height:l}=n;return S.createElement(dH.Provider,{value:r},S.createElement("defs",null,S.createElement("clipPath",{id:r},S.createElement("rect",{x:i,y:a,height:l,width:s}))),t)};function Oo(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function IP(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],i=0;i<e.length;i+=t)n.push(e[i]);return n}function pH(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return sH(n,r)}function hH(e,t,r){var n=r==="width",{x:i,y:a,width:s,height:l}=e;return t===1?{start:n?i:a,end:n?i+s:a+l}:{start:n?i+s:a+l,end:n?i:a}}function bc(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function gH(e,t){return IP(e,t+1)}function mH(e,t,r,n,i){for(var a=(n||[]).slice(),{start:s,end:l}=t,c=0,d=1,u=s,f=function(){var v=n?.[c];if(v===void 0)return{v:IP(n,d)};var x=c,y,w=()=>(y===void 0&&(y=r(v,x)),y),b=v.coordinate,j=c===0||bc(e,b,w,u,l);j||(c=0,u=s,d+=1),j&&(u=b+e*(w()/2+i),c+=d)},h;d<=a.length;)if(h=f(),h)return h.v;return[]}function I1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I1(Object(r),!0).forEach(function(n){vH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vH(e,t,r){return(t=yH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yH(e){var t=xH(e,"string");return typeof t=="symbol"?t:t+""}function xH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bH(e,t,r,n,i){for(var a=(n||[]).slice(),s=a.length,{start:l}=t,{end:c}=t,d=function(h){var g=a[h],v,x=()=>(v===void 0&&(v=r(g,h)),v);if(h===s-1){var y=e*(g.coordinate+e*x()/2-c);a[h]=g=Gt(Gt({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else a[h]=g=Gt(Gt({},g),{},{tickCoord:g.coordinate});var w=bc(e,g.tickCoord,x,l,c);w&&(c=g.tickCoord-e*(x()/2+i),a[h]=Gt(Gt({},g),{},{isShow:!0}))},u=s-1;u>=0;u--)d(u);return a}function wH(e,t,r,n,i,a){var s=(n||[]).slice(),l=s.length,{start:c,end:d}=t;if(a){var u=n[l-1],f=r(u,l-1),h=e*(u.coordinate+e*f/2-d);s[l-1]=u=Gt(Gt({},u),{},{tickCoord:h>0?u.coordinate-h*e:u.coordinate});var g=bc(e,u.tickCoord,()=>f,c,d);g&&(d=u.tickCoord-e*(f/2+i),s[l-1]=Gt(Gt({},u),{},{isShow:!0}))}for(var v=a?l-1:l,x=function(b){var j=s[b],P,E=()=>(P===void 0&&(P=r(j,b)),P);if(b===0){var C=e*(j.coordinate-e*E()/2-c);s[b]=j=Gt(Gt({},j),{},{tickCoord:C<0?j.coordinate-C*e:j.coordinate})}else s[b]=j=Gt(Gt({},j),{},{tickCoord:j.coordinate});var O=bc(e,j.tickCoord,E,c,d);O&&(c=j.tickCoord+e*(E()/2+i),s[b]=Gt(Gt({},j),{},{isShow:!0}))},y=0;y<v;y++)x(y);return s}function zm(e,t,r){var{tick:n,ticks:i,viewBox:a,minTickGap:s,orientation:l,interval:c,tickFormatter:d,unit:u,angle:f}=e;if(!i||!i.length||!n)return[];if(Ae(c)||Wi.isSsr){var h;return(h=gH(i,Ae(c)?c:0))!==null&&h!==void 0?h:[]}var g=[],v=l==="top"||l==="bottom"?"width":"height",x=u&&v==="width"?ja(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(j,P)=>{var E=typeof d=="function"?d(j.value,P):j.value;return v==="width"?pH(ja(E,{fontSize:t,letterSpacing:r}),x,f):ja(E,{fontSize:t,letterSpacing:r})[v]},w=i.length>=2?Lt(i[1].coordinate-i[0].coordinate):1,b=hH(a,w,v);return c==="equidistantPreserveStart"?mH(w,b,y,i,s):(c==="preserveStart"||c==="preserveStartEnd"?g=wH(w,b,y,i,s,c==="preserveStartEnd"):g=bH(w,b,y,i,s),g.filter(j=>j.isShow))}var CH=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:i=0,tickMargin:a=0}=e,s=0;if(t){Array.from(t).forEach(u=>{if(u){var f=u.getBoundingClientRect();f.width>s&&(s=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=i+a,d=s+c+l+(r?n:0);return Math.round(d)}return 0},SH=["axisLine","width","height","className","hide","ticks"],jH=["viewBox"],EH=["viewBox"];function wh(e,t){if(e==null)return{};var r,n,i=PH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function PH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Vi(){return Vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vi.apply(null,arguments)}function N1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N1(Object(r),!0).forEach(function(n){OH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OH(e,t,r){return(t=kH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kH(e){var t=TH(e,"string");return typeof t=="symbol"?t:t+""}function TH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fm={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"};function MH(e){var{x:t,y:r,width:n,height:i,orientation:a,mirror:s,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=Ot(Ot(Ot({},c),Qr(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var u=+(a==="top"&&!s||a==="bottom"&&s);d=Ot(Ot({},d),{},{x1:t,y1:r+u*i,x2:t+n,y2:r+u*i})}else{var f=+(a==="left"&&!s||a==="right"&&s);d=Ot(Ot({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+i})}return S.createElement("line",Vi({},d,{className:Je("recharts-cartesian-axis-line",_i(l,"className"))}))}function RH(e,t,r,n,i,a,s,l,c){var d,u,f,h,g,v,x=l?-1:1,y=e.tickSize||s,w=Ae(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":d=u=e.coordinate,h=r+ +!l*i,f=h-x*y,v=f-x*c,g=w;break;case"left":f=h=e.coordinate,u=t+ +!l*n,d=u-x*y,g=d-x*c,v=w;break;case"right":f=h=e.coordinate,u=t+ +l*n,d=u+x*y,g=d+x*c,v=w;break;default:d=u=e.coordinate,h=r+ +l*i,f=h+x*y,v=f+x*c,g=w;break}return{line:{x1:d,y1:f,x2:u,y2:h},tick:{x:g,y:v}}}function AH(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function IH(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function NH(e){var{option:t,tickProps:r,value:n}=e,i,a=Je(r.className,"recharts-cartesian-axis-tick-value");if(S.isValidElement(t))i=S.cloneElement(t,Ot(Ot({},r),{},{className:a}));else if(typeof t=="function")i=t(Ot(Ot({},r),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=Je(s,t?.className)),i=S.createElement(hu,Vi({},r,{className:s}),n)}return i}function DH(e){var{ticks:t=[],tick:r,tickLine:n,stroke:i,tickFormatter:a,unit:s,padding:l,tickTextProps:c,orientation:d,mirror:u,x:f,y:h,width:g,height:v,tickSize:x,tickMargin:y,fontSize:w,letterSpacing:b,getTicksConfig:j,events:P}=e,E=zm(Ot(Ot({},j),{},{ticks:t}),w,b),C=AH(d,u),O=IH(d,u),k=Qr(j),T=za(r),D={};typeof n=="object"&&(D=n);var L=Ot(Ot({},k),{},{fill:"none"},D),A=E.map((B,z)=>{var{line:F,tick:R}=RH(B,f,h,g,v,d,x,u,y),N=Ot(Ot(Ot(Ot({textAnchor:C,verticalAnchor:O},k),{},{stroke:"none",fill:i},T),R),{},{index:z,payload:B,visibleTicksCount:E.length,tickFormatter:a,padding:l},c);return S.createElement(ur,Vi({className:"recharts-cartesian-axis-tick",key:"tick-".concat(B.value,"-").concat(B.coordinate,"-").concat(B.tickCoord)},cs(P,B,z)),n&&S.createElement("line",Vi({},L,F,{className:Je("recharts-cartesian-axis-tick-line",_i(n,"className"))})),r&&S.createElement(NH,{option:r,tickProps:N,value:"".concat(typeof a=="function"?a(B.value,z):B.value).concat(s||"")}))});return A.length>0?S.createElement("g",{className:"recharts-cartesian-axis-ticks"},A):null}var _H=m.forwardRef((e,t)=>{var{axisLine:r,width:n,height:i,className:a,hide:s,ticks:l}=e,c=wh(e,SH),[d,u]=m.useState(""),[f,h]=m.useState(""),g=m.useRef(null);m.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return CH({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var v=m.useCallback(x=>{if(x){var y=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=y;var w=y[0];if(w){var b=window.getComputedStyle(w),j=b.fontSize,P=b.letterSpacing;(j!==d||P!==f)&&(u(j),h(P))}}},[d,f]);return s||n!=null&&n<=0||i!=null&&i<=0?null:S.createElement(ur,{className:Je("recharts-cartesian-axis",a),ref:v},S.createElement(MH,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Qr(e)}),S.createElement(DH,{ticks:l,tick:e.tick,tickLine:e.tickLine,stroke:e.stroke,tickFormatter:e.tickFormatter,unit:e.unit,padding:e.padding,tickTextProps:e.tickTextProps,orientation:e.orientation,mirror:e.mirror,x:e.x,y:e.y,width:e.width,height:e.height,tickSize:e.tickSize,tickMargin:e.tickMargin,fontSize:d,letterSpacing:f,getTicksConfig:e,events:c}),S.createElement(LF,{x:e.x,y:e.y,width:e.width,height:e.height},S.createElement(GF,{label:e.label,labelRef:e.labelRef}),e.children))}),BH=S.memo(_H,(e,t)=>{var{viewBox:r}=e,n=wh(e,jH),{viewBox:i}=t,a=wh(t,EH);return Oo(r,i)&&Oo(n,a)}),Vm=S.forwardRef((e,t)=>{var r=ir(e,Fm);return S.createElement(BH,Vi({},r,{ref:t}))});Vm.displayName="CartesianAxis";var $H=["x1","y1","x2","y2","key"],LH=["offset"],zH=["xAxisId","yAxisId"],FH=["xAxisId","yAxisId"];function D1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D1(Object(r),!0).forEach(function(n){VH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VH(e,t,r){return(t=HH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HH(e){var t=UH(e,"string");return typeof t=="symbol"?t:t+""}function UH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ki.apply(null,arguments)}function wc(e,t){if(e==null)return{};var r,n,i=WH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function WH(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var KH=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:i,width:a,height:s,ry:l}=e;return S.createElement("rect",{x:n,y:i,ry:l,width:a,height:s,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function NP(e,t){var r;if(S.isValidElement(e))r=S.cloneElement(e,t);else if(typeof e=="function")r=e(t);else{var{x1:n,y1:i,x2:a,y2:s,key:l}=t,c=wc(t,$H),d=Qr(c),u=wc(d,LH);r=S.createElement("line",ki({},u,{x1:n,y1:i,x2:a,y2:s,fill:"none",key:l}))}return r}function qH(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:i}=e;if(!n||!i||!i.length)return null;var a=wc(e,zH),s=i.map((l,c)=>{var d=Xt(Xt({},a),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return NP(n,d)});return S.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function YH(e){var{y:t,height:r,vertical:n=!0,verticalPoints:i}=e;if(!n||!i||!i.length)return null;var a=wc(e,FH),s=i.map((l,c)=>{var d=Xt(Xt({},a),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return NP(n,d)});return S.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function GH(e){var{horizontalFill:t,fillOpacity:r,x:n,y:i,width:a,height:s,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length)return null;var d=l.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==d[0]&&d.unshift(0);var u=d.map((f,h)=>{var g=!d[h+1],v=g?i+s-f:d[h+1]-f;if(v<=0)return null;var x=h%t.length;return S.createElement("rect",{key:"react-".concat(h),y:f,x:n,height:v,width:a,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function XH(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:i,y:a,width:s,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+i-i)).sort((f,h)=>f-h);i!==d[0]&&d.unshift(0);var u=d.map((f,h)=>{var g=!d[h+1],v=g?i+s-f:d[h+1]-f;if(v<=0)return null;var x=h%r.length;return S.createElement("rect",{key:"react-".concat(h),x:f,y:a,width:v,height:l,stroke:"none",fill:r[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return S.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var ZH=(e,t)=>{var{xAxis:r,width:n,height:i,offset:a}=e;return Pj(zm(Xt(Xt(Xt({},Fm),r),{},{ticks:Oj(r),viewBox:{x:0,y:0,width:n,height:i}})),a.left,a.left+a.width,t)},QH=(e,t)=>{var{yAxis:r,width:n,height:i,offset:a}=e;return Pj(zm(Xt(Xt(Xt({},Fm),r),{},{ticks:Oj(r),viewBox:{x:0,y:0,width:n,height:i}})),a.top,a.top+a.height,t)},JH={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0};function Rl(e){var t=xg(),r=bg(),n=Nj(),i=Xt(Xt({},ir(e,JH)),{},{x:Ae(e.x)?e.x:n.left,y:Ae(e.y)?e.y:n.top,width:Ae(e.width)?e.width:n.width,height:Ae(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:s,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:h,verticalValues:g}=i,v=Sr(),x=Re(T=>_b(T,"xAxis",a,v)),y=Re(T=>_b(T,"yAxis",s,v));if(!Ae(d)||d<=0||!Ae(u)||u<=0||!Ae(l)||l!==+l||!Ae(c)||c!==+c)return null;var w=i.verticalCoordinatesGenerator||ZH,b=i.horizontalCoordinatesGenerator||QH,{horizontalPoints:j,verticalPoints:P}=i;if((!j||!j.length)&&typeof b=="function"){var E=h&&h.length,C=b({yAxis:y?Xt(Xt({},y),{},{ticks:E?h:y.ticks}):void 0,width:t,height:r,offset:n},E?!0:f);rc(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof C,"]")),Array.isArray(C)&&(j=C)}if((!P||!P.length)&&typeof w=="function"){var O=g&&g.length,k=w({xAxis:x?Xt(Xt({},x),{},{ticks:O?g:x.ticks}):void 0,width:t,height:r,offset:n},O?!0:f);rc(Array.isArray(k),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof k,"]")),Array.isArray(k)&&(P=k)}return S.createElement("g",{className:"recharts-cartesian-grid"},S.createElement(KH,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),S.createElement(GH,ki({},i,{horizontalPoints:j})),S.createElement(XH,ki({},i,{verticalPoints:P})),S.createElement(qH,ki({},i,{offset:n,horizontalPoints:j,xAxis:x,yAxis:y})),S.createElement(YH,ki({},i,{offset:n,verticalPoints:P,xAxis:x,yAxis:y})))}Rl.displayName="CartesianGrid";var eU=["dangerouslySetInnerHTML","ticks"],tU=["id"],rU=["domain"],nU=["domain"];function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ch.apply(null,arguments)}function Cc(e,t){if(e==null)return{};var r,n,i=iU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function iU(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function oU(e){var t=dt();return m.useLayoutEffect(()=>(t(I7(e)),()=>{t(N7(e))}),[e,t]),null}var aU=e=>{var{xAxisId:t,className:r}=e,n=Re(vg),i=Sr(),a="xAxis",s=Re(g=>Vo(g,a,t,i)),l=Re(g=>kE(g,a,t,i)),c=Re(g=>jE(g,t)),d=Re(g=>bL(g,t)),u=Re(g=>oE(g,t));if(c==null||d==null||u==null)return null;var f=Cc(e,eU),h=Cc(u,tU);return S.createElement(Vm,Ch({},f,h,{scale:s,x:d.x,y:d.y,width:c.width,height:c.height,className:Je("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:l}))},sU={allowDataOverflow:gr.allowDataOverflow,allowDecimals:gr.allowDecimals,allowDuplicatedCategory:gr.allowDuplicatedCategory,height:gr.height,hide:!1,mirror:gr.mirror,orientation:gr.orientation,padding:gr.padding,reversed:gr.reversed,scale:gr.scale,tickCount:gr.tickCount,type:gr.type,xAxisId:0},lU=e=>{var t,r,n,i,a,s=ir(e,sU);return S.createElement(S.Fragment,null,S.createElement(oU,{interval:(t=s.interval)!==null&&t!==void 0?t:"preserveEnd",id:s.xAxisId,scale:s.scale,type:s.type,padding:s.padding,allowDataOverflow:s.allowDataOverflow,domain:s.domain,dataKey:s.dataKey,allowDuplicatedCategory:s.allowDuplicatedCategory,allowDecimals:s.allowDecimals,tickCount:s.tickCount,includeHidden:(r=s.includeHidden)!==null&&r!==void 0?r:!1,reversed:s.reversed,ticks:s.ticks,height:s.height,orientation:s.orientation,mirror:s.mirror,hide:s.hide,unit:s.unit,name:s.name,angle:(n=s.angle)!==null&&n!==void 0?n:0,minTickGap:(i=s.minTickGap)!==null&&i!==void 0?i:5,tick:(a=s.tick)!==null&&a!==void 0?a:!0,tickFormatter:s.tickFormatter}),S.createElement(aU,s))},cU=(e,t)=>{var{domain:r}=e,n=Cc(e,rU),{domain:i}=t,a=Cc(t,nU);return Oo(n,a)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:Oo({domain:r},{domain:i}):!1},Al=S.memo(lU,cU);Al.displayName="XAxis";var uU=["dangerouslySetInnerHTML","ticks"],dU=["id"],fU=["domain"],pU=["domain"];function Sh(){return Sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sh.apply(null,arguments)}function Sc(e,t){if(e==null)return{};var r,n,i=hU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function hU(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function gU(e){var t=dt();return m.useLayoutEffect(()=>(t(D7(e)),()=>{t(_7(e))}),[e,t]),null}var mU=e=>{var{yAxisId:t,className:r,width:n,label:i}=e,a=m.useRef(null),s=m.useRef(null),l=Re(vg),c=Sr(),d=dt(),u="yAxis",f=Re(b=>Vo(b,u,t,c)),h=Re(b=>EE(b,t)),g=Re(b=>CL(b,t)),v=Re(b=>kE(b,u,t,c)),x=Re(b=>aE(b,t));if(m.useLayoutEffect(()=>{if(!(n!=="auto"||!h||Mm(i)||m.isValidElement(i)||x==null)){var b=a.current;if(b){var j=b.getCalculatedWidth();Math.round(h.width)!==Math.round(j)&&d(B7({id:t,width:j}))}}},[v,h,d,i,t,n,x]),h==null||g==null||x==null)return null;var y=Sc(e,uU),w=Sc(x,dU);return S.createElement(Vm,Sh({},y,w,{ref:a,labelRef:s,scale:f,x:g.x,y:g.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:h.width,height:h.height,className:Je("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:v}))},vU={allowDataOverflow:mr.allowDataOverflow,allowDecimals:mr.allowDecimals,allowDuplicatedCategory:mr.allowDuplicatedCategory,hide:!1,mirror:mr.mirror,orientation:mr.orientation,padding:mr.padding,reversed:mr.reversed,scale:mr.scale,tickCount:mr.tickCount,type:mr.type,width:mr.width,yAxisId:0},yU=e=>{var t,r,n,i,a,s=ir(e,vU);return S.createElement(S.Fragment,null,S.createElement(gU,{interval:(t=s.interval)!==null&&t!==void 0?t:"preserveEnd",id:s.yAxisId,scale:s.scale,type:s.type,domain:s.domain,allowDataOverflow:s.allowDataOverflow,dataKey:s.dataKey,allowDuplicatedCategory:s.allowDuplicatedCategory,allowDecimals:s.allowDecimals,tickCount:s.tickCount,padding:s.padding,includeHidden:(r=s.includeHidden)!==null&&r!==void 0?r:!1,reversed:s.reversed,ticks:s.ticks,width:s.width,orientation:s.orientation,mirror:s.mirror,hide:s.hide,unit:s.unit,name:s.name,angle:(n=s.angle)!==null&&n!==void 0?n:0,minTickGap:(i=s.minTickGap)!==null&&i!==void 0?i:5,tick:(a=s.tick)!==null&&a!==void 0?a:!0,tickFormatter:s.tickFormatter}),S.createElement(mU,s))},xU=(e,t)=>{var{domain:r}=e,n=Sc(e,fU),{domain:i}=t,a=Sc(t,pU);return Oo(n,a)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:Oo({domain:r},{domain:i}):!1},Il=S.memo(yU,xU);Il.displayName="YAxis";function bU(e){e()}function wU(){let e=null,t=null;return{clear(){e=null,t=null},notify(){bU(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var _1={notify(){},get:()=>[]};function CU(e,t){let r,n=_1,i=0,a=!1;function s(x){u();const y=n.subscribe(x);let w=!1;return()=>{w||(w=!0,y(),f())}}function l(){n.notify()}function c(){v.onStateChange&&v.onStateChange()}function d(){return a}function u(){i++,r||(r=e.subscribe(c),n=wU())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=_1)}function h(){a||(a=!0,u())}function g(){a&&(a=!1,f())}const v={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:h,tryUnsubscribe:g,getListeners:()=>n};return v}var SU=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jU=SU(),EU=()=>typeof navigator<"u"&&navigator.product==="ReactNative",PU=EU(),OU=()=>jU||PU?S.useLayoutEffect:S.useEffect,kU=OU(),TU=Symbol.for("react-redux-context"),MU=typeof globalThis<"u"?globalThis:{};function RU(){if(!S.createContext)return{};const e=MU[TU]??=new Map;let t=e.get(S.createContext);return t||(t=S.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(S.createContext,t)),t}var AU=RU();function IU(e){const{children:t,context:r,serverState:n,store:i}=e,a=S.useMemo(()=>{const c=CU(i),d={store:i,subscription:c,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return d;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(d,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),s=S.useMemo(()=>i.getState(),[i]);kU(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,s]);const l=r||AU;return S.createElement(l.Provider,{value:a},t)}var NU=IU,DU=(e,t)=>t,Hm=ee([DU,We,rE,It,WE,Vn,Pz,Rt],Rz),Um=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},DP=Br("mouseClick"),_P=ps();_P.startListening({actionCreator:DP,effect:(e,t)=>{var r=e.payload,n=Hm(t.getState(),Um(r));n?.activeIndex!=null&&t.dispatch(DL({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var jh=Br("mouseMove"),BP=ps();BP.startListening({actionCreator:jh,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=wm(n,n.tooltip.settings.shared),a=Hm(n,Um(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(_E({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(DE()))}});var B1={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},$P=Cr({name:"rootProps",initialState:B1,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:B1.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),_U=$P.reducer,{updateOptions:BU}=$P.actions,LP=Cr({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:$U}=LP.actions,LU=LP.reducer,zP=Br("keyDown"),FP=Br("focus"),Wm=ps();Wm.startListening({actionCreator:zP,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var s=Number(Cm(i,Uo(r))),l=Vn(r);if(a==="Enter"){var c=gc(r,"axis","hover",String(i.index));t.dispatch(mh({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:c}));return}var d=PL(r),u=d==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,h=s+f*u;if(!(l==null||h>=l.length||h<0)){var g=gc(r,"axis","hover",String(h));t.dispatch(mh({active:!0,activeIndex:h.toString(),activeDataKey:void 0,activeCoordinate:g}))}}}}});Wm.startListening({actionCreator:FP,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",s=gc(r,"axis","hover",String(a));t.dispatch(mh({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:s}))}}}});var Rr=Br("externalEvent"),VP=ps();VP.startListening({actionCreator:Rr,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:vz(r),activeDataKey:GE(r),activeIndex:Fi(r),activeLabel:YE(r),activeTooltipIndex:Fi(r),isTooltipActive:yz(r)};e.payload.handler(n,e.payload.reactEvent)}}});var zU=ee([Ho],e=>e.tooltipItemPayloads),FU=ee([zU,Ss,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(l=>l.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var s=t(a,r);return s}}}),HP=Br("touchMove"),UP=ps();UP.startListening({actionCreator:HP,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=wm(n,n.tooltip.settings.shared);if(i==="axis"){var a=Hm(n,Um({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(_E({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var s,l=r.touches[0],c=document.elementFromPoint(l.clientX,l.clientY);if(!c||!c.getAttribute)return;var d=c.getAttribute(Tj),u=(s=c.getAttribute(Mj))!==null&&s!==void 0?s:void 0,f=FU(t.getState(),d,u);t.dispatch(NE({activeDataKey:u,activeIndex:d,activeCoordinate:f}))}}});var VU=GS({brush:rH,cartesianAxis:$7,chartData:qz,errorBars:Q7,graphicalItems:r7,layout:uB,legend:v3,options:Vz,polarAxis:y9,polarOptions:LU,referenceElements:uH,rootProps:_U,tooltip:_L}),HU=function(t){return D6({reducer:VU,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([_P.middleware,BP.middleware,Wm.middleware,VP.middleware,UP.middleware]),enhancers:r=>{var n=r;return typeof r=="function"&&(n=r()),n.concat(dj({type:"raf"}))},devTools:Wi.devToolsEnabled})};function WP(e){var{preloadedState:t,children:r}=e,n=Sr(),i=m.useRef(null);if(n)return r;i.current==null&&(i.current=HU(t));var a=ug;return S.createElement(NU,{context:a,store:i.current},r)}function KP(e){var{layout:t,margin:r}=e,n=dt(),i=Sr();return m.useEffect(()=>{i||(n(sB(t)),n(aB(r)))},[n,i,t,r]),null}function qP(e){var t=dt();return m.useEffect(()=>{t(BU(e))},[t,e]),null}var UU=["children"];function WU(e,t){if(e==null)return{};var r,n,i=KU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function KU(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jc.apply(null,arguments)}var qU={width:"100%",height:"100%",display:"block"},YU=m.forwardRef((e,t)=>{var r=xg(),n=bg(),i=$j();if(!Co(r)||!Co(n))return null;var{children:a,otherAttributes:s,title:l,desc:c}=e,d,u;return typeof s.tabIndex=="number"?d=s.tabIndex:d=i?0:void 0,typeof s.role=="string"?u=s.role:u=i?"application":void 0,S.createElement(Jh,jc({},s,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:qU,ref:t}),a)}),GU=e=>{var{children:t}=e,r=Re(Yc);if(!r)return null;var{width:n,height:i,y:a,x:s}=r;return S.createElement(Jh,{width:n,height:i,x:s,y:a},t)},$1=m.forwardRef((e,t)=>{var{children:r}=e,n=WU(e,UU),i=Sr();return i?S.createElement(GU,null,r):S.createElement(YU,jc({ref:t},n),r)});function XU(){var e=dt(),[t,r]=m.useState(null),n=Re(LB);return m.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Qt(a)&&a!==n&&e(cB(a))}},[t,e,n]),r}function L1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ZU(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L1(Object(r),!0).forEach(function(n){QU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QU(e,t,r){return(t=JU(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JU(e){var t=eW(e,"string");return typeof t=="symbol"?t:t+""}function eW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hi(){return Hi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hi.apply(null,arguments)}var tW=()=>(rF(),null);function Ec(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var rW=m.forwardRef((e,t)=>{var r,n,i=m.useRef(null),[a,s]=m.useState({containerWidth:Ec((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Ec((n=e.style)===null||n===void 0?void 0:n.height)}),l=m.useCallback((d,u)=>{s(f=>{var h=Math.round(d),g=Math.round(u);return f.containerWidth===h&&f.containerHeight===g?f:{containerWidth:h,containerHeight:g}})},[]),c=m.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:u,height:f}=d.getBoundingClientRect();l(u,f);var h=v=>{var{width:x,height:y}=v[0].contentRect;l(x,y)},g=new ResizeObserver(h);g.observe(d),i.current=g}},[t,l]);return m.useEffect(()=>()=>{var d=i.current;d?.disconnect()},[l]),S.createElement(S.Fragment,null,S.createElement(Xc,{width:a.containerWidth,height:a.containerHeight}),S.createElement("div",Hi({ref:c},e)))}),nW=m.forwardRef((e,t)=>{var{width:r,height:n}=e,[i,a]=m.useState({containerWidth:Ec(r),containerHeight:Ec(n)}),s=m.useCallback((c,d)=>{a(u=>{var f=Math.round(c),h=Math.round(d);return u.containerWidth===f&&u.containerHeight===h?u:{containerWidth:f,containerHeight:h}})},[]),l=m.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();s(d,u)}},[t,s]);return S.createElement(S.Fragment,null,S.createElement(Xc,{width:i.containerWidth,height:i.containerHeight}),S.createElement("div",Hi({ref:l},e)))}),iW=m.forwardRef((e,t)=>{var{width:r,height:n}=e;return S.createElement(S.Fragment,null,S.createElement(Xc,{width:r,height:n}),S.createElement("div",Hi({ref:t},e)))}),oW=m.forwardRef((e,t)=>{var{width:r,height:n}=e;return Rn(r)||Rn(n)?S.createElement(nW,Hi({},e,{ref:t})):S.createElement(iW,Hi({},e,{ref:t}))});function aW(e){return e===!0?rW:oW}var sW=m.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:s,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:h,onTouchEnd:g,onTouchMove:v,onTouchStart:x,style:y,width:w,responsive:b,dispatchTouchEvents:j=!0}=e,P=m.useRef(null),E=dt(),[C,O]=m.useState(null),[k,T]=m.useState(null),D=XU(),L=yg(),A=L?.width>0?L.width:w,B=L?.height>0?L.height:i,z=m.useCallback(J=>{D(J),typeof t=="function"&&t(J),O(J),T(J),J!=null&&(P.current=J)},[D,t,O,T]),F=m.useCallback(J=>{E(DP(J)),E(Rr({handler:a,reactEvent:J}))},[E,a]),R=m.useCallback(J=>{E(jh(J)),E(Rr({handler:d,reactEvent:J}))},[E,d]),N=m.useCallback(J=>{E(DE()),E(Rr({handler:u,reactEvent:J}))},[E,u]),I=m.useCallback(J=>{E(jh(J)),E(Rr({handler:f,reactEvent:J}))},[E,f]),M=m.useCallback(()=>{E(FP())},[E]),W=m.useCallback(J=>{E(zP(J.key))},[E]),$=m.useCallback(J=>{E(Rr({handler:s,reactEvent:J}))},[E,s]),H=m.useCallback(J=>{E(Rr({handler:l,reactEvent:J}))},[E,l]),X=m.useCallback(J=>{E(Rr({handler:c,reactEvent:J}))},[E,c]),ue=m.useCallback(J=>{E(Rr({handler:h,reactEvent:J}))},[E,h]),fe=m.useCallback(J=>{E(Rr({handler:x,reactEvent:J}))},[E,x]),me=m.useCallback(J=>{j&&E(HP(J)),E(Rr({handler:v,reactEvent:J}))},[E,j,v]),Pe=m.useCallback(J=>{E(Rr({handler:g,reactEvent:J}))},[E,g]),Ee=aW(b);return S.createElement(tP.Provider,{value:C},S.createElement(fS.Provider,{value:k},S.createElement(Ee,{width:A??y?.width,height:B??y?.height,className:Je("recharts-wrapper",n),style:ZU({position:"relative",cursor:"default",width:A,height:B},y),onClick:F,onContextMenu:$,onDoubleClick:H,onFocus:M,onKeyDown:W,onMouseDown:X,onMouseEnter:R,onMouseLeave:N,onMouseMove:I,onMouseUp:ue,onTouchEnd:Pe,onTouchMove:me,onTouchStart:fe,ref:z},S.createElement(tW,null),r)))}),lW=["width","height","responsive","children","className","style","compact","title","desc"];function cW(e,t){if(e==null)return{};var r,n,i=uW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function uW(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var YP=m.forwardRef((e,t)=>{var{width:r,height:n,responsive:i,children:a,className:s,style:l,compact:c,title:d,desc:u}=e,f=cW(e,lW),h=Qr(f);return c?S.createElement(S.Fragment,null,S.createElement(Xc,{width:r,height:n}),S.createElement($1,{otherAttributes:h,title:d,desc:u},a)):S.createElement(sW,{className:s,style:l,width:r,height:n,responsive:i,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},S.createElement($1,{otherAttributes:h,title:d,desc:u,ref:t},S.createElement(fH,null,a)))});function Eh(){return Eh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eh.apply(null,arguments)}var dW={top:5,right:5,bottom:5,left:5},fW={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:dW,reverseStackOrder:!1,syncMethod:"index",responsive:!1},pW=m.forwardRef(function(t,r){var n,i=ir(t.categoricalChartProps,fW),{chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return S.createElement(WP,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:a},S.createElement(AP,{chartData:d.data}),S.createElement(KP,{layout:i.layout,margin:i.margin}),S.createElement(qP,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),S.createElement(YP,Eh({},i,{ref:r})))}),hW=["axis","item"],Ff=m.forwardRef((e,t)=>S.createElement(pW,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:hW,tooltipPayloadSearcher:rP,categoricalChartProps:e,ref:t}));function gW(e){var t=dt();return m.useEffect(()=>{t($U(e))},[t,e]),null}var mW=["layout"];function Ph(){return Ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ph.apply(null,arguments)}function vW(e,t){if(e==null)return{};var r,n,i=yW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function yW(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var xW={top:5,right:5,bottom:5,left:5},bW={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:xW,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1},wW=m.forwardRef(function(t,r){var n,i=ir(t.categoricalChartProps,bW),{layout:a}=i,s=vW(i,mW),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:u}=t,f={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:u,eventEmitter:void 0};return S.createElement(WP,{preloadedState:{options:f},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:l},S.createElement(AP,{chartData:i.data}),S.createElement(KP,{layout:a,margin:i.margin}),S.createElement(qP,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),S.createElement(gW,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),S.createElement(YP,Ph({},s,{ref:r})))}),CW=["item"],SW={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},jW=m.forwardRef((e,t)=>{var r=ir(e,SW);return S.createElement(wW,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:CW,tooltipPayloadSearcher:rP,categoricalChartProps:r,ref:t})});const Qn=["#4285F4","#34A853","#FBBC05","#EA4335","#9C27B0","#00ACC1","#8D6E63"],z1="28%",EW=({sysCd:e,appItCd:t,appCd:r})=>{const{getFormData:n}=at.useSearchBox(),i=tt.useCodeStore(),a=tt.useSystemStore(),[s,l]=m.useState(""),[c,d]=m.useState(null),[u,f]=m.useState(!1),[h,g]=m.useState(!1),[v,x]=m.useState(!1),[y,w]=m.useState(!1),[b,j]=m.useState(null),[P,E]=m.useState([]),[C,O]=m.useState(null),[k,T]=m.useState(!1),[D,L]=m.useState({}),[A,B]=m.useState(!1),[z,F]=m.useState({}),R=m.useRef(null),N=m.useRef(null);m.useRef(null);const I=m.useRef(null),M=m.useRef(null),W=m.useRef(null),$=m.useRef({}),H=m.useMemo(()=>async q=>{const Q=q.target.value?.trim();h||!Q||(W.current&&clearTimeout(W.current),W.current=setTimeout(async()=>{T(!0),B(!1);try{const Z=I.current?.getFieldValue("sysCd"),le=I.current?.getFieldValue("appItCd"),ie=I.current?.getFieldValue("appCd");if(!Z||!le||!ie){T(!1);return}await de.SCMCODE00104({crprCd:I.current?.getFieldValue("crprCd")||"100",sysCd:Z,appItCd:le,appCd:ie,grpCd:Q})?(I.current?.setFields([{name:"grpCd",errors:["이미 사용중인 그룹코드입니다."]}]),p.message.error("이미 사용중인 그룹코드입니다."),B(!1)):(I.current?.setFields([{name:"grpCd",errors:[]}]),p.message.success("사용 가능한 그룹코드입니다."),B(!0))}catch(Z){console.error("그룹코드 중복 체크 실패:",Z),p.message.error("중복 체크 중 오류가 발생했습니다."),B(!1)}finally{T(!1)}},200))},[h]),X=m.useMemo(()=>async(q,Q)=>{const Z=q.target.value?.trim();if(y){const le=Z;if(!le)return;$.current[-1]&&clearTimeout($.current[-1]),$.current[-1]=setTimeout(async()=>{L(ie=>({...ie,[-1]:!0})),F(ie=>{const pe={...ie};return delete pe[-1],pe});try{await de.SCMCODE00105({crprCd:M.current?.getFieldValue("crprCd")||"100",sysCd:M.current?.getFieldValue("sysCd")||"",appItCd:M.current?.getFieldValue("appItCd")||b?.appItCd||"CM",appCd:M.current?.getFieldValue("appCd")||b?.appCd||"CM",grpCd:M.current?.getFieldValue("grpCd")||"",dtlCd:le})?(M.current?.setFields([{name:"dtlCd",errors:["이미 사용중인 상세코드입니다."]}]),p.message.error("이미 사용중인 상세코드입니다."),F(pe=>{const ve={...pe};return delete ve[-1],ve})):(M.current?.setFields([{name:"dtlCd",errors:[]}]),p.message.success("사용 가능한 상세코드입니다."),F(pe=>({...pe,[-1]:!0})))}catch(ie){console.error("상세코드 중복 체크 실패:",ie),p.message.error("중복 체크 중 오류가 발생했습니다."),F(pe=>{const ve={...pe};return delete ve[-1],ve})}finally{L(ie=>({...ie,[-1]:!1}))}},200);return}!Z||!b||($.current[Q]&&clearTimeout($.current[Q]),$.current[Q]=setTimeout(async()=>{L(le=>({...le,[Q]:!0})),F(le=>{const ie={...le};return delete ie[Q],ie});try{if((M.current?.getFieldValue("details")||[]).some((ve,be)=>be!==Q&&ve.dtlCd?.trim()===Z)){M.current?.setFields([{name:["details",Q,"dtlCd"],errors:["같은 상세코드가 이미 입력되었습니다."]}]),p.message.error("같은 상세코드가 이미 입력되었습니다."),F(ve=>{const be={...ve};return delete be[Q],be}),L(ve=>({...ve,[Q]:!1}));return}await de.SCMCODE00105({crprCd:b.crprCd||"100",sysCd:b.sysCd||"",appItCd:b.appItCd||"CM",appCd:b.appCd||"CM",grpCd:b.grpCd||"",dtlCd:Z})?(M.current?.setFields([{name:["details",Q,"dtlCd"],errors:["이미 사용중인 상세코드입니다."]}]),p.message.error("이미 사용중인 상세코드입니다."),F(ve=>{const be={...ve};return delete be[Q],be})):(M.current?.setFields([{name:["details",Q,"dtlCd"],errors:[]}]),p.message.success("사용 가능한 상세코드입니다."),F(ve=>({...ve,[Q]:!0})))}catch(le){console.error("상세코드 중복 체크 실패:",le),p.message.error("중복 체크 중 오류가 발생했습니다."),F(ie=>{const pe={...ie};return delete pe[Q],pe})}finally{L(le=>({...le,[Q]:!1}))}},500))},[y,b]),ue=m.useMemo(()=>se.createBwgGridRenderer((q,Q,Z,le,ie)=>{const pe=Q.index?.itemIndex;if(q.getValue(pe,"metaYn")==="Y"){ie.render(o.jsx("div",{}));return}const be=()=>{if(pe===void 0||pe<0)return;const ae=R.current?.dp?.getJsonRow(pe);ae&&(g(!0),B(!1),f(!0),setTimeout(()=>{I.current?.setFieldsValue({crprCd:ae.crprCd||"100",sysCd:ae.sysCd||"",appItCd:ae.appItCd||"CM",appCd:ae.appCd||"CM",grpCd:ae.grpCd||"",grpNm:ae.grpNm||"",enblYn:ae.enblYn||"N",sortOrd:ae.sortOrd||0,rmrk:ae.rmrk||""})},100))},Be=()=>{if(pe===void 0||pe<0)return;const ae=R.current?.dp?.getJsonRow(pe);ae&&p.Modal.confirm({title:"삭제 확인",content:`그룹코드 '${ae.grpCd} - ${ae.grpNm}'을(를) 삭제하시겠습니까?`,okText:"확인",cancelText:"취소",onOk(){const Me={crprCd:ae.crprCd||"100",sysCd:ae.sysCd||"",appItCd:ae.appItCd||"CM",appCd:ae.appCd||"CM",grpCd:ae.grpCd||"",grpNm:ae.grpNm||"",enblYn:ae.enblYn||"N",sortOrd:ae.sortOrd||0,rmrk:ae.rmrk||""};de.SCMCODE00202(Me)}})};ie.render(o.jsxs(p.Flex,{style:{justifyContent:"center",alignItems:"center",gap:8},children:[o.jsx(_.BwgButton,{icon:o.jsx(Y.EditOutlined,{}),onClick:be}),o.jsx(_.BwgButton,{icon:o.jsx(Y.DeleteOutlined,{style:{color:"red"}}),onClick:Be})]}))}),[]),fe=m.useMemo(()=>se.createBwgGridRenderer((q,Q,Z,le,ie)=>{const pe=Q.index?.itemIndex;if(q.getValue(pe,"sysLockYn")==="Y"){ie.render(o.jsx("div",{}));return}const be=()=>{if(pe===void 0||pe<0)return;const ae=N.current?.dp?.getJsonRow(pe);ae&&(w(!0),x(!0),F({}),setTimeout(()=>{M.current?.setFieldsValue({crprCd:ae.crprCd||"100",sysCd:ae.sysCd||"",appItCd:ae.appItCd||"CM",appCd:ae.appCd||"CM",grpCd:ae.grpCd||"",dtlCd:ae.dtlCd||"",cmmnCd:ae.cmmnCd||"",cmmnCdNm:ae.cmmnCdNm||"",cmmnCdClr:ae.cmmnCdClr||"",cmmnAbrv:ae.cmmnAbrv||"",sysLockYn:ae.sysLockYn||"N",enblYn:ae.enblYn||"N",sortOrd:ae.sortOrd||0,rmrk:ae.rmrk||""})},100))},Be=()=>{if(pe===void 0||pe<0)return;const ae=N.current?.dp?.getJsonRow(pe);ae&&p.Modal.confirm({title:"삭제 확인",content:o.jsxs("div",{children:[o.jsx("div",{children:`정말 "${ae.cmmnCdNm} [${ae.dtlCd}]" 을(를) 삭제하시겠습니까?`}),o.jsx("div",{style:{marginTop:8,fontSize:"12px",color:"#999"},children:"해당 작업이 진행되면 다시 되돌릴 수 없습니다."})]}),centered:!0,okText:"확인",cancelText:"취소",onOk(){const Me={crprCd:ae.crprCd||"100",sysCd:ae.sysCd||"",appItCd:ae.appItCd||"CM",appCd:ae.appCd||"CM",grpCd:ae.grpCd||"",dtlCd:ae.dtlCd||"",cmmnCd:ae.cmmnCd||"",cmmnCdNm:ae.cmmnCdNm||"",cmmnCdClr:ae.cmmnCdClr||"",cmmnAbrv:ae.cmmnAbrv||"",sysLockYn:ae.sysLockYn||"N",enblYn:ae.enblYn||"N",sortOrd:ae.sortOrd||0,rmrk:ae.rmrk||""};de.SCMCODE00204(Me)}})};ie.render(o.jsxs(p.Flex,{style:{justifyContent:"center",alignItems:"center",gap:8},children:[o.jsx(p.Button,{icon:o.jsx(Y.EditOutlined,{}),onClick:be}),o.jsx(p.Button,{icon:o.jsx(Y.DeleteOutlined,{style:{color:"red"}}),onClick:Be})]}))}),[]),me=m.useMemo(()=>se.createBwgGridRenderer((q,Q,Z,le,ie)=>{q.getValue(Q.index?.itemIndex,"sysLockYn")==="Y"?ie.render(o.jsx(Y.LockOutlined,{})):ie.render(o.jsx(Y.UnlockOutlined,{}))}),[]),Pe=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"metaYn",header:{text:"메타"},width:80,styleName:"center"},{fieldName:"sysCd",header:{text:"시스템코드"},width:80},{fieldName:"appItCd",header:{text:"앱 통합코드"},width:80},{fieldName:"appCd",header:{text:"앱 코드"},width:120},{fieldName:"grpCd",header:{text:"그룹코드"},width:140},{fieldName:"grpNm",header:{text:"그룹명칭"},width:220,styleName:"left"},{fieldName:"enblYn",header:{text:"사용여부"},width:100,styleName:"center",renderer:se.realFormat.checkYdisabled},{fieldName:"sortOrd",visible:!1},{fieldName:"rmrk",visible:!1},{fieldName:"inptDt",visible:!1},{fieldName:"inptId",visible:!1},{fieldName:"chngDt",visible:!1},{fieldName:"chngId",visible:!1},{fieldName:"moreActions",header:{text:"액션"},renderer:"moreActions"}],[]),Ee=m.useMemo(()=>[{fieldName:"crprCd",visible:!1},{fieldName:"sysCd",visible:!1},{fieldName:"appItCd",visible:!1},{fieldName:"appCd",visible:!1},{fieldName:"grpCd",visible:!1},{fieldName:"dtlCd",header:{text:"상세코드"},width:140,styleName:"left",footer:{valueCallback:q=>{const Q=q.getDataSource();return Q?Q.getRowCount()+"건":"0"}}},{fieldName:"cmmnCd",header:{text:"공통코드"},width:160,styleName:"left"},{fieldName:"cmmnCdNm",header:{text:"공통코드명"},width:220,styleName:"left"},{fieldName:"cmmnCdClr",visible:!1},{fieldName:"cmmnAbrv",header:{text:"약어"},width:120,styleName:"left"},{fieldName:"sysLockYn",header:{text:"시스템잠금"},width:110,styleName:"center",renderer:"sysLockYn"},{fieldName:"enblYn",header:{text:"사용여부"},width:100,styleName:"center",renderer:se.realFormat.checkYdisabled},{fieldName:"sortOrd",visible:!1},{fieldName:"rmrk",visible:!1},{fieldName:"inptDt",visible:!1},{fieldName:"inptId",visible:!1},{fieldName:"chngDt",visible:!1},{fieldName:"chngId",visible:!1},{fieldName:"moreActions",header:{text:"액션"},renderer:"moreActions"}],[]),J=m.useMemo(()=>({container:{indicator:!0,check:!0,page:!0},display:{rowHeight:30}}),[]),ye=m.useMemo(()=>({container:{indicator:!0,page:!0},display:{rowHeight:20}}),[]);m.useMemo(()=>[{fieldName:"crprCd",header:{text:"회사코드"},width:120,styleName:"left"},{fieldName:"sysCd",header:{text:"시스템코드"},width:120,styleName:"left"},{fieldName:"appItCd",header:{text:"앱 통합코드"},width:140,styleName:"left"},{fieldName:"appCd",header:{text:"앱 코드"},width:120,styleName:"left"},{fieldName:"cmmnCd",header:{text:"공통코드"},width:140,styleName:"left"},{fieldName:"optnCd",header:{text:"옵션코드"},width:140,styleName:"left"},{fieldName:"optnNm",header:{text:"옵션명"},width:200,styleName:"left"},{fieldName:"optnDesc",header:{text:"옵션설명"},width:250,styleName:"left"},{fieldName:"enblYn",header:{text:"사용여부"},width:100,styleName:"center"},{fieldName:"sortOrd",header:{text:"정렬순서"},width:100,styleName:"right"},{fieldName:"inptDt",header:{text:"입력일시"},width:150,styleName:"center"},{fieldName:"inptId",header:{text:"입력자"},width:120,styleName:"left"},{fieldName:"chngDt",header:{text:"변경일시"},width:150,styleName:"center"},{fieldName:"chngId",header:{text:"변경자"},width:120,styleName:"left"}],[]),m.useMemo(()=>({container:{indicator:!0,footer:!0}}),[]);const ge=q=>{const Q=i.getAvailableGroupCodes(),Z=[];Q.forEach(ie=>{const pe=i.getCodeList(ie,{enabledOnly:!1,systemCodeOnly:q==="Y",sortByOrder:!1});let ve=!1;if(q==="")ve=pe.length>0;else if(q==="Y")ve=pe.length>0;else if(q==="N"){const be=i.codeData;be&&be[ie]&&(ve=Object.values(be[ie]).some(Be=>Be.systemCodeYn!=="Y"))}ve&&Z.push({grpCd:ie,grpNm:""})});const le=s?Z.filter(ie=>ie.grpCd.toLowerCase().includes(s.toLowerCase())):Z;R.current?.addAllData(le)},V=(q,Q)=>{if(!q){N.current?.addAllData([]);return}const Z=i.codeData;if(!Z||!Z[q]){N.current?.addAllData([]);return}const pe=Object.values(Z[q]).filter(ve=>!(Q==="Y"&&ve.systemCodeYn!=="Y"||Q==="N"&&ve.systemCodeYn==="Y")).sort((ve,be)=>ve.sortOrder!==be.sortOrder?ve.sortOrder-be.sortOrder:ve.codeValue.localeCompare(be.codeValue)).map(ve=>({commonCode:ve.commonCode,codeNm:ve.codeNm,codeValue:ve.codeValue,labelColor:ve.labelColor,sortOrder:ve.sortOrder,enblYn:ve.enabled?"Y":"N",systemCodeYn:ve.systemCodeYn,rmrk:ve.originalData?.rmrk??null}));N.current?.addAllData(pe)};m.useRef(!1),m.useEffect(()=>{console.log("SystemCodeManage useEffect"),de.SCMCODE00101()},[]),m.useEffect(()=>{const q=n()?.sysLockYn||"";ge(q),V(c,q)},[s]);const oe=async()=>{de.SCMCODE00101()},K=m.useMemo(()=>Array.from(new Set(a.systemMap.map(q=>q.sysCd))).slice(0,6),[a.systemMap]),ce=m.useMemo(()=>Array.from(new Set(a.systemMap.map(q=>q.appItCd))).slice(0,8),[a.systemMap]),he=m.useMemo(()=>Array.from(new Set(a.systemMap.map(q=>q.appCd))).slice(0,8),[a.systemMap]),we=q=>{let Q=0;for(let Z=0;Z<q.length;Z++){const le=q.charCodeAt(Z);Q=(Q<<5)-Q+le,Q=Q&Q}return Math.abs(Q)},Se=q=>{if(q.length===0)return[];const Q=q.reduce((Z,le)=>Z+le.count,0);return Q===0?q.map((Z,le)=>we((Z.label||"")+le.toString())%30+20):q.map(Z=>Math.round(Z.count/Q*100))},Te=m.useMemo(()=>{const q=i.codeData;if(!q){const be=we("systemCode")%40+30;return[{name:"시스템코드",value:be},{name:"사용자코드",value:100-be}]}let Q=0,Z=0;Object.values(q).forEach(ve=>{Object.values(ve).forEach(be=>{be.systemCodeYn==="Y"?Q++:Z++})});const le=Q+Z;if(le===0){const be=we("systemCode")%40+30;return[{name:"시스템코드",value:be},{name:"사용자코드",value:100-be}]}const ie=Math.round(Q/le*100),pe=100-ie;return[{name:"시스템코드",value:ie},{name:"사용자코드",value:pe}]},[i]),Ne=m.useMemo(()=>{const q=i.codeData,Q={};q&&Object.values(q).forEach(ie=>{Object.values(ie).forEach(pe=>{const ve=pe.commonCode?.substring(0,2)||"";ve&&(Q[ve]=(Q[ve]||0)+1)})});const Z=K.filter(ie=>ie!=null).map(ie=>({label:ie,count:Q[ie]||0})),le=Se(Z);return K.filter(ie=>ie!=null).map((ie,pe)=>({name:ie,value:le[pe]||0}))},[K,i]),U=m.useMemo(()=>{const q=i.codeData,Q={};q&&Object.values(q).forEach(ie=>{Object.values(ie).forEach(pe=>{const be=(pe.commonCode||"").substring(0,2)||"";if(be&&ce.length>0){const Be=we(be+pe.groupCode),ae=ce[Be%ce.length];ae&&(Q[ae]=(Q[ae]||0)+1)}})});const Z=ce.filter(ie=>ie!=null).map(ie=>({label:ie,count:Q[ie]||0})),le=Se(Z);return ce.filter(ie=>ie!=null).map((ie,pe)=>({name:ie,value:le[pe]||0}))},[ce,i]),ne=m.useMemo(()=>{const q=i.codeData,Q={};q&&Object.values(q).forEach(ie=>{Object.values(ie).forEach(pe=>{const be=(pe.commonCode||"").substring(0,2)||"";if(be&&he.length>0){const Be=we(be+pe.groupCode),ae=he[Be%he.length];ae&&(Q[ae]=(Q[ae]||0)+1)}})});const Z=he.filter(ie=>ie!=null).map(ie=>({label:ie,count:Q[ie]||0})),le=Se(Z);return he.filter(ie=>ie!=null).map((ie,pe)=>({name:ie,value:le[pe]||0}))},[he,i]),re=m.useMemo(()=>{const Q=[{sysCd:"KE",sysNm:"K-ERP"},{sysCd:"CH",sysNm:"파트너관리"},{sysCd:"HR",sysNm:"K-HR"},{sysCd:"YT",sysNm:"연말정산"},{sysCd:"CM",sysNm:"공통"},{sysCd:"PA",sysNm:"평정"},{sysCd:"KS",sysNm:"K-업무지원"},{sysCd:"DE",sysNm:"온통"}].map(Z=>({label:Z.sysNm,value:Z.sysCd}));return[{label:"전체",value:""},...Q]},[]),G=m.useMemo(()=>{const Q=[{code:"KERP",name:""},{code:"KHR",name:"인사"},{code:"KHYT",name:"연말정산"},{code:"KCM",name:"공통"},{code:"KHPE",name:"평정"},{code:"EAUD",name:"감사 01"},{code:"INR",name:"감사 02"},{code:"ITAM",name:"자산 01"},{code:"CMM",name:"자산 02"},{code:"OAM",name:"자산 03"},{code:"KSGA",name:"총무"},{code:"HIS",name:"문헌"},{code:"WFAX",name:"IT서비스 0"},{code:"SMS",name:"IT서비스 0"},{code:"BID",name:"기타업무서비스 01"},{code:"PAM",name:"기타업무서비스 02"},{code:"DAC",name:"기타업무서비스 03"},{code:"IPR",name:"기타업무서비스 04"},{code:"ISB",name:"정보공유게시판"},{code:"ITSM",name:"ITSM"},{code:"BCOM",name:"소통"}].map(Z=>({label:Z.name?`${Z.code} (${Z.name})`:Z.code,value:Z.code}));return[{label:"전체",value:""},...Q]},[]),te=m.useMemo(()=>{const Q=[{code:"FI",name:"재무회계"},{code:"FM",name:"예산관리"},{code:"MM",name:"구매계약"},{code:"SD",name:"영업관리"},{code:"PMN",name:"파트너관리"},{code:"HR",name:"HR 솔루션"},{code:"YT",name:"연말정산"},{code:"CM",name:"프레임워크 공통"},{code:"PE",name:"평정"},{code:"EAUD",name:"e-감사"},{code:"INR",name:"청렴신고"},{code:"ITAM",name:"ITAM"},{code:"CMM",name:"차량/회의실"},{code:"OAM",name:"OA전산물품 관리"},{code:"GAM",name:"총무관리"},{code:"ACM",name:"출입관리"},{code:"IVM",name:"비품관리"},{code:"SGS",name:"인장서비스"},{code:"HIS",name:"사료관리"},{code:"ITSM",name:"ITSM"},{code:"WFAX",name:"웹펙스서비스"},{code:"SMS",name:"메시지서비스"},{code:"BID",name:"경영공시"},{code:"PAM",name:"언론미디어"},{code:"DAC",name:"심의자문위원회"},{code:"IPR",name:"지식재산권 신청"},{code:"ISB",name:"정보공유게시판"},{code:"BCOM",name:"온통"}].map(Z=>({label:`${Z.code} (${Z.name})`,value:Z.code}));return[{label:"전체",value:""},...Q]},[]),de=m.useMemo(()=>({SCMCODE00101:()=>{const q=n(),Q={crprCd:q?.crprCd||"100",sysCd:q?.sysCd||"",appItCd:q?.appItCd||"",appCd:q?.appCd||"",sysLockYn:q?.sysLockYn||"",keyword:q?.keyword||""};se.callService("SCMCODE00101",Q).then(Z=>{R.current?.addAllData(Z.data||[])}).catch(Z=>{p.message.error("그룹코드 조회에 실패했습니다.")})},SCMCODE00102:q=>{se.callService("SCMCODE00102",q,{showLoading:!1}).then(Q=>{N.current?.addAllData(Q.data||[])}).catch(Q=>{p.message.error("상세코드 조회에 실패했습니다.")})},SCMCODE00104:q=>{const Q={grp:q};return se.callService("SCMCODE00104",Q,{showLoading:!1}).then(Z=>Z.dup===!0).catch(Z=>(console.error("그룹코드 중복 체크 실패:",Z),!1))},SCMCODE00105:q=>{const Q={dtl:q};return se.callService("SCMCODE00105",Q,{showLoading:!1}).then(Z=>Z.dup===!0).catch(Z=>(console.error("상세코드 중복 체크 실패:",Z),!1))},SCMCODE00201:(q,Q)=>{const Z={flag:q,grp:Q};return se.callService("SCMCODE00201",Z).then(le=>(p.message.success(q==="I"?"그룹코드가 등록되었습니다.":"그룹코드가 수정되었습니다."),de.SCMCODE00101(),le)).catch(le=>{throw console.error("그룹코드 저장 실패:",le),le})},SCMCODE00202:q=>{const Q={grp:q};return se.callService("SCMCODE00202",Q).then(Z=>(p.message.success("그룹코드가 삭제되었습니다."),de.SCMCODE00101(),Z)).catch(Z=>{throw p.message.error("그룹코드 삭제에 실패했습니다."),Z})},SCMCODE00203:(q,Q,Z)=>{const le={flag:q,dtlCnt:Q,dtl:Z};return se.callService("SCMCODE00203",le).then(ie=>(p.message.success(q==="I"?"상세코드가 등록되었습니다.":"상세코드가 수정되었습니다."),b&&de.SCMCODE00102({sysCd:b.sysCd,appItCd:b.appItCd,appCd:b.appCd,grpCd:b.grpCd}),ie)).catch(ie=>{throw console.error("상세코드 저장 실패:",ie),p.message.error(q==="I"?"상세코드 등록에 실패했습니다.":"상세코드 수정에 실패했습니다."),ie})},SCMCODE00204:q=>{const Q={dtl:q};return se.callService("SCMCODE00204",Q).then(Z=>(p.message.success("상세코드가 삭제되었습니다."),b&&de.SCMCODE00102({sysCd:b.sysCd,appItCd:b.appItCd,appCd:b.appCd,grpCd:b.grpCd}),Z)).catch(Z=>{throw p.message.error("상세코드 삭제에 실패했습니다."),Z})}}),[]);return o.jsxs(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:oe}]},searchBox:{reqRows:o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:[16,8],style:{marginBottom:8},children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템코드",name:"sysCd",initialValue:""},selectProps:{placeholder:"시스템코드를 선택하세요",options:re}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"통합코드",name:"appItCd",initialValue:""},selectProps:{placeholder:"통합코드를 선택하세요",options:G}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"앱코드",name:"appCd",initialValue:""},selectProps:{placeholder:"앱코드를 선택하세요",options:te}})})]}),o.jsxs(p.Row,{gutter:[16,8],children:[o.jsx(p.Col,{span:6,children:o.jsx(_.BwgSelect,{itemProps:{label:"코드구분",name:"sysLockYn",initialValue:""},selectProps:{options:[{label:"전체",value:""},{label:"시스템코드",value:"Y"},{label:"업무코드",value:"N"}]}})}),o.jsx(p.Col,{span:6,children:o.jsx(_.BwgInput,{itemProps:{label:"검색어",name:"keyword",initialValue:""},inputProps:{placeholder:"검색어를 입력하세요."}})})]})]})},children:[o.jsxs(ze,{type:"horizontal",style:{height:"calc(100vh - 120px)",gap:12,overflow:"hidden"},children:[o.jsxs(Ie,{border:!0,style:{flex:`0 0 ${z1}`,maxWidth:z1,height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[o.jsx(Le,{title:"공통코드 현황"}),o.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden"},children:o.jsxs(p.Space,{direction:"vertical",style:{width:"100%",padding:"8px 0"},size:12,children:[o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"시스템코드 대비 사용자코드"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(jW,{children:[o.jsx(PP,{data:Te,dataKey:"value",nameKey:"name",outerRadius:65,label:!0,children:Te.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c1-${Q}`))}),o.jsx(vl,{}),o.jsx(Zc,{})]})})]}),o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"시스템코드별 백분율"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(Ff,{data:Ne,margin:{top:10,right:10,left:0,bottom:0},children:[o.jsx(Rl,{strokeDasharray:"3 3"}),o.jsx(Al,{dataKey:"name",hide:!0}),o.jsx(Il,{hide:!0,domain:[0,100]}),o.jsx(vl,{}),o.jsx(Ml,{dataKey:"value",children:Ne.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c2-${Q}`))})]})})]}),o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"통합코드별 백분율"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(Ff,{data:U,margin:{top:10,right:10,left:0,bottom:0},children:[o.jsx(Rl,{strokeDasharray:"3 3"}),o.jsx(Al,{dataKey:"name",hide:!0}),o.jsx(Il,{hide:!0,domain:[0,100]}),o.jsx(vl,{}),o.jsx(Ml,{dataKey:"value",children:U.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c3-${Q}`))})]})})]}),o.jsxs(p.Card,{bodyStyle:{height:200,padding:8,borderRadius:12},children:[o.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"앱별 백분율"}),o.jsx(sl,{width:"100%",height:160,children:o.jsxs(Ff,{data:ne,margin:{top:10,right:10,left:0,bottom:0},children:[o.jsx(Rl,{strokeDasharray:"3 3"}),o.jsx(Al,{dataKey:"name",hide:!0}),o.jsx(Il,{hide:!0,domain:[0,100]}),o.jsx(vl,{}),o.jsx(Ml,{dataKey:"value",children:ne.map((q,Q)=>o.jsx(ai,{fill:Qn[Q%Qn.length]},`c4-${Q}`))})]})})]})]})})]}),o.jsxs(Ie,{border:!0,style:{flex:"1 1 auto",height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"},children:[o.jsx(Le,{title:"그룹코드",children:o.jsx(_.BwgButton,{type:"primary",onClick:()=>{g(!1),B(!1),f(!0),setTimeout(()=>{I.current?.resetFields(),I.current?.setFieldsValue({crprCd:"100",sysCd:__SYS_CD__||"",appItCd:"CM",appCd:"CM",enblYn:"Y",sortOrd:0})},100)},children:"그룹코드 등록"})}),o.jsx("div",{style:{flex:"0 0 45%",overflow:"hidden",display:"flex",flexDirection:"column"},children:o.jsx(Ve,{ref:R,gridColumns:Pe,gridOptions:J,gridEvents:m.useMemo(()=>({onCurrentRowChanged:(q,Q,Z)=>{if(Z<0){j(null);return}const le=R.current?.dp?.getValue(Z,"sysCd")||"",ie=R.current?.dp?.getValue(Z,"appItCd")||"",pe=R.current?.dp?.getValue(Z,"appCd")||"",ve=R.current?.dp?.getValue(Z,"grpCd")||"",be=R.current?.dp?.getJsonRow(Z);j(be),ve&&de.SCMCODE00102({sysCd:le,appItCd:ie,appCd:pe,grpCd:ve})}}),[de]),renderers:[{name:"moreActions",renderer:ue}]})}),o.jsxs("div",{style:{flex:"1 1 auto",overflow:"hidden",display:"flex",flexDirection:"column",marginTop:12},children:[o.jsx(Le,{title:"상세코드",children:o.jsx(_.BwgButton,{type:"primary",onClick:()=>{if(!b){p.message.warning("그룹코드를 먼저 선택하세요.");return}w(!1),x(!0),O(null),F({}),E([{dtlCd:"",cmmnCd:"",cmmnCdNm:"",cmmnCdClr:"",cmmnAbrv:"",enblYn:"Y",sortOrd:0,rmrk:""}])},disabled:!b,children:"상세코드 등록"})}),o.jsx("div",{style:{flex:1,overflow:"hidden",display:"flex",flexDirection:"column"},children:o.jsx(Ve,{ref:N,gridColumns:Ee,gridOptions:ye,renderers:[{name:"moreActions",renderer:fe},{name:"sysLockYn",renderer:me}]})})]})]})]}),o.jsx(dn,{title:h?"그룹코드 수정":"그룹코드 등록",open:u,placement:"right",width:"40%",onClose:()=>{f(!1),g(!1),B(!1),I.current?.resetFields()},footer:o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[o.jsx(p.Button,{onClick:()=>{f(!1),g(!1),B(!1),I.current?.resetFields()},children:"취소"}),o.jsx(p.Button,{type:"primary",disabled:!h&&!A,onClick:async()=>{try{const q=await I.current?.validateFields();if(!q)return;const Q={crprCd:q.crprCd||"100",sysCd:q.sysCd||"",appItCd:q.appItCd||"CM",appCd:q.appCd||"CM",grpCd:q.grpCd||"",grpNm:q.grpNm||"",enblYn:q.enblYn==="Y"?"Y":"N",sortOrd:q.sortOrd||0,rmrk:q.rmrk||""};if(!h&&!A){p.message.warning("그룹코드 중복체크를 먼저 완료해주세요.");return}await de.SCMCODE00201(h?"U":"I",Q),f(!1),g(!1),B(!1),I.current?.resetFields()}catch(q){console.error(h?"그룹코드 수정 실패:":"그룹코드 등록 실패:",q)}},children:"저장"})]}),children:o.jsxs(_.BwgForm,{ref:I,style:{padding:"10px 20px"},initialValues:{crprCd:"100",sysCd:__SYS_CD__||"",appItCd:"CM",appCd:"CM",enblYn:"Y",sortOrd:0},children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"시스템코드",name:"sysCd",rules:[{required:!0,message:"시스템코드를 선택하세요."}]},selectProps:{placeholder:"시스템코드를 선택하세요",options:re.filter(q=>q.value!==""),disabled:h}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"앱 통합코드",name:"appItCd",rules:[{required:!0,message:"앱 통합코드를 선택하세요."}]},selectProps:{placeholder:"앱 통합코드를 선택하세요",options:G.filter(q=>q.value!==""),disabled:h}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgSelect,{itemProps:{label:"앱 코드",name:"appCd",rules:[{required:!0,message:"앱 코드를 선택하세요."}]},selectProps:{placeholder:"앱 코드를 선택하세요",options:te.filter(q=>q.value!==""),disabled:h}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"그룹코드",name:"grpCd",rules:[{required:!0,message:"그룹코드를 입력하세요."},{max:5,message:"그룹코드는 5자 이하여야 합니다."}]},inputProps:{placeholder:"그룹코드를 입력하세요",maxLength:5,showCount:!0,count:{max:5},disabled:h,suffix:k?o.jsx(Y.ReloadOutlined,{spin:!0,style:{color:"#1890ff"}}):A&&!h?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):void 0,onKeyDown:q=>{if(h){q.preventDefault();return}q.target.value.length>=5&&!["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Enter"].includes(q.key)&&(q.preventDefault(),p.message.warning("입력은 다섯글자까지입니다."))},onChange:q=>{if(h){q.preventDefault();return}q.target.value.length>5&&(p.message.warning("입력은 다섯글자까지입니다."),q.target.value=q.target.value.slice(0,5)),A&&B(!1),I.current?.getFieldError("grpCd")?.length&&I.current?.setFields([{name:"grpCd",errors:[]}])},onBlur:H}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgInput,{itemProps:{label:"그룹명칭",name:"grpNm",rules:[{required:!0,message:"그룹명칭을 입력하세요."}]},inputProps:{placeholder:"그룹명칭을 입력하세요"}})})}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgCheck,{itemProps:{label:"사용여부",name:"enblYn",getValueProps:q=>({checked:q==="Y"})},inputProps:{title:"사용",format:"YN"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgNumber,{itemProps:{label:"정렬순서",name:"sortOrd"},inputProps:{placeholder:"정렬순서를 입력하세요",min:0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgTextArea,{itemProps:{label:"비고",name:"rmrk"},inputProps:{placeholder:"비고를 입력하세요",rows:3}})})})]})}),o.jsx(dn,{title:y?"상세코드 수정":"상세코드 등록",open:v,placement:"right",width:"50%",onClose:()=>{x(!1),w(!1),E([]),O(null),F({}),M.current?.resetFields()},footer:o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[o.jsx(p.Button,{onClick:()=>{x(!1),w(!1),E([]),O(null),F({}),M.current?.resetFields()},children:"취소"}),o.jsx(p.Form.Item,{shouldUpdate:!0,children:()=>{const q=M.current?.getFieldValue("details")||[];let Q=!1;if(y)Q=!0;else if(q.length>0){const Z=q.every(ie=>ie?.dtlCd?.trim()),le=q.every((ie,pe)=>ie?.dtlCd?.trim()&&z[pe]===!0);Q=Z&&le}return o.jsx(p.Button,{type:"primary",disabled:!Q,onClick:async()=>{try{const Z=await M.current?.validateFields();if(!Z)return;if(!y&&Z.details){if(!Z.details.every((pe,ve)=>!pe.dtlCd?.trim()||z[ve]===!0)){p.message.warning("모든 상세코드의 중복체크를 완료해주세요.");return}for(let pe=0;pe<Z.details.length;pe++){const be=Z.details[pe].dtlCd?.trim();if(!be)continue;if(Z.details.some((ae,Me)=>Me!==pe&&ae.dtlCd?.trim()===be)){M.current?.setFields([{name:["details",pe,"dtlCd"],errors:["같은 상세코드가 이미 입력되었습니다."]}]),p.message.error("중복된 상세코드가 있습니다.");return}}}const le=y?[{...Z,crprCd:Z.crprCd||"100",sysCd:Z.sysCd||"",appItCd:Z.appItCd||b?.appItCd||"CM",appCd:Z.appCd||b?.appCd||"CM",grpCd:Z.grpCd||"",enblYn:Z.enblYn==="Y"?"Y":"N",sysLockYn:Z.sysLockYn==="Y"?"Y":"N"}]:(Z.details||[]).map(ie=>{const pe=b?.sysCd||"",ve=b?.grpCd||"",be=ie.dtlCd||"",Be=`${pe}${ve}${be}`;return{...ie,crprCd:b?.crprCd||"100",sysCd:pe,appItCd:b?.appItCd||"CM",appCd:b?.appCd||"CM",grpCd:ve,cmmnCd:Be,enblYn:ie.enblYn==="Y"?"Y":"N",sysLockYn:ie.sysLockYn==="Y"?"Y":"N",sortOrd:ie.sortOrd||0}});await de.SCMCODE00203(y?"U":"I",le.length,le),x(!1),w(!1),E([]),O(null),F({}),M.current?.resetFields()}catch(Z){console.error(y?"상세코드 수정 실패:":"상세코드 등록 실패:",Z)}},children:"저장"})}})]}),children:o.jsxs(_.BwgForm,{ref:M,style:{padding:"10px 20px"},children:[b&&o.jsx(p.Card,{style:{marginBottom:16,background:"#f5f5f5"},children:o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:8,children:o.jsxs("div",{children:[o.jsx("strong",{children:"시스템코드:"})," ",b.sysCd||""]})}),o.jsx(p.Col,{span:8,children:o.jsxs("div",{children:[o.jsx("strong",{children:"그룹코드:"})," ",b.grpCd||""]})}),o.jsx(p.Col,{span:8,children:o.jsxs("div",{children:[o.jsx("strong",{children:"그룹명칭:"})," ",b.grpNm||""]})})]})}),y?o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"시스템코드",name:"sysCd"},inputProps:{disabled:!0}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"그룹코드",name:"grpCd"},inputProps:{disabled:!0}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"상세코드",name:"dtlCd",rules:[{required:!0,message:"상세코드를 입력하세요."}]},inputProps:{placeholder:"상세코드를 입력하세요",disabled:!0,suffix:D[-1]?o.jsx(Y.ReloadOutlined,{spin:!0,style:{color:"#1890ff"}}):z[-1]?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):void 0}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드",name:"cmmnCd",rules:[{required:!0,message:"공통코드를 입력하세요."}]},inputProps:{placeholder:"공통코드를 입력하세요",disabled:!0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드명",name:"cmmnCdNm",rules:[{required:!0,message:"공통코드명을 입력하세요."}]},inputProps:{placeholder:"공통코드명을 입력하세요"}})})}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"색상",name:"cmmnCdClr",getValueFromEvent:q=>q&&typeof q.toHexString=="function"?q.toHexString():q||"",children:o.jsx(p.ColorPicker,{format:"hex",showText:!0,presets:[{label:"추천 색상",colors:["#FF4D4F","#FF7A45","#FFA940","#FFC53D","#FFEC3D","#BAE637","#73D13D","#36CFC9","#40A9FF","#1890FF","#2F54EB","#722ED1","#EB2F96","#F5222D","#FA541C","#FA8C16","#FADB14","#A0D911","#13C2C2","#096DD9","#0050B3","#531DAB","#C41D7F","#CF1322","#D4380D","#D46B08","#D4B106","#7CB305","#08979C","#0050B3"]}]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"약어",name:"cmmnAbrv"},inputProps:{placeholder:"약어를 입력하세요"}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgCheck,{itemProps:{label:"사용여부",name:"enblYn",getValueProps:q=>({checked:q==="Y"})},inputProps:{title:"사용",format:"YN"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgNumber,{itemProps:{label:"정렬순서",name:"sortOrd"},inputProps:{placeholder:"정렬순서를 입력하세요",min:0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgTextArea,{itemProps:{label:"비고",name:"rmrk"},inputProps:{placeholder:"비고를 입력하세요",rows:3}})})})]}):o.jsx(p.Form.List,{name:"details",initialValue:P,children:(q,{add:Q,remove:Z})=>o.jsxs(o.Fragment,{children:[q.map((le,ie)=>{const pe=C===ie,ve=b?.sysCd||"",be=b?.grpCd||"";return o.jsx(p.Card,{style:{marginBottom:16},children:o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:20,children:o.jsx(p.Form.Item,{noStyle:!0,shouldUpdate:(Be,ae)=>{const Me=Be?.details?.[le.name]?.dtlCd,Fe=ae?.details?.[le.name]?.dtlCd;return Me!==Fe},children:({getFieldValue:Be})=>{const ae=Be(["details",le.name,"dtlCd"])||"",Me=`${ve}${be}${ae}`;return ae&&M.current&&Be(["details",le.name,"cmmnCd"])!==Me&&setTimeout(()=>{M.current?.setFieldValue(["details",le.name,"cmmnCd"],Me)},0),o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"상세코드",name:[le.name,"dtlCd"],rules:[{required:!0,message:"상세코드를 입력하세요."}]},inputProps:{placeholder:"상세코드를 입력하세요",suffix:D[ie]?o.jsx(Y.ReloadOutlined,{spin:!0,style:{color:"#1890ff"}}):z[ie]?o.jsx(Y.CheckCircleOutlined,{style:{color:"#52c41a"}}):void 0,onChange:Fe=>{z[ie]&&F(Hr=>{const tn={...Hr};return delete tn[ie],tn}),M.current?.getFieldError(["details",ie,"dtlCd"])?.length&&M.current?.setFields([{name:["details",ie,"dtlCd"],errors:[]}])},onBlur:Fe=>X(Fe,ie)}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드",name:[le.name,"cmmnCd"]},inputProps:{disabled:!0,placeholder:"자동 생성됩니다",value:Me}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgInput,{itemProps:{label:"공통코드명",name:[le.name,"cmmnCdNm"],rules:[{required:!0,message:"공통코드명을 입력하세요."}]},inputProps:{placeholder:"공통코드명을 입력하세요"}})})}),pe&&o.jsxs(o.Fragment,{children:[o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgFormItem,{label:"색상",name:[le.name,"cmmnCdClr"],getValueFromEvent:Fe=>Fe&&typeof Fe.toHexString=="function"?Fe.toHexString():Fe||"",children:o.jsx(p.ColorPicker,{format:"hex",showText:!0,presets:[{label:"추천 색상",colors:["#FF4D4F","#FF7A45","#FFA940","#FFC53D","#FFEC3D","#BAE637","#73D13D","#36CFC9","#40A9FF","#1890FF","#2F54EB","#722ED1","#EB2F96","#F5222D","#FA541C","#FA8C16","#FADB14","#A0D911","#13C2C2","#096DD9","#0050B3","#531DAB","#C41D7F","#CF1322","#D4380D","#D46B08","#D4B106","#7CB305","#08979C","#0050B3"]}]})})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgInput,{itemProps:{label:"약어",name:[le.name,"cmmnAbrv"]},inputProps:{placeholder:"약어를 입력하세요"}})})]}),o.jsxs(p.Row,{gutter:16,children:[o.jsx(p.Col,{span:12,children:o.jsx(_.BwgCheck,{itemProps:{label:"사용여부",name:[le.name,"enblYn"],getValueProps:Fe=>({checked:Fe==="Y"})},inputProps:{title:"사용",format:"YN"}})}),o.jsx(p.Col,{span:12,children:o.jsx(_.BwgNumber,{itemProps:{label:"정렬순서",name:[le.name,"sortOrd"]},inputProps:{placeholder:"정렬순서를 입력하세요",min:0}})})]}),o.jsx(p.Row,{gutter:16,children:o.jsx(p.Col,{span:24,children:o.jsx(_.BwgTextArea,{itemProps:{label:"비고",name:[le.name,"rmrk"]},inputProps:{placeholder:"비고를 입력하세요",rows:3}})})})]})]})}})}),o.jsx(p.Col,{span:4,style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-end",paddingTop:30},children:o.jsxs(p.Space,{size:"small",children:[o.jsx(p.Button,{type:"link",size:"small",icon:pe?o.jsx(Y.UpOutlined,{}):o.jsx(Y.DownOutlined,{}),onClick:()=>{O(pe?null:ie)},style:{fontSize:"12px",padding:0},children:pe?"간단입력":"추가입력"}),q.length>1&&o.jsx(p.Button,{type:"link",danger:!0,size:"small",icon:o.jsx(Y.DeleteOutlined,{}),onClick:()=>{Z(le.name),C===ie&&O(null)},style:{fontSize:"12px",padding:0},children:"삭제"})]})})]})},le.key)}),o.jsx(p.Button,{type:"dashed",onClick:()=>{Q({dtlCd:"",cmmnCd:"",cmmnCdNm:"",cmmnCdClr:"",cmmnAbrv:"",enblYn:"Y",sortOrd:0,rmrk:""})},block:!0,style:{marginTop:16},children:"+ 행 추가"})]})})]})})]})},PW=e=>{const t=m.useRef(null),r=m.useMemo(()=>[{fieldName:"userId",header:{text:"아이디"}},{fieldName:"userName",header:{text:"이름"}},{fieldName:"email",header:{text:"이메일"}},{fieldName:"createdAt",header:{text:"생성일"}}],[]);return o.jsx(kt,{buttons:{grant:[{id:"search",label:"조회",onClick:()=>{}}]},searchBox:{},children:o.jsx(ze,{children:o.jsx(Ie,{style:{height:"300px"},children:o.jsx(Ve,{ref:t,gridColumns:r})})})})},{TextArea:OW}=p.Input,Km=({boardMstrId:e,isCompleted:t=!1})=>{const{user:r}=tt.useUserStore(),[n,i]=m.useState(!1),[a,s]=m.useState(!1),[l,c]=m.useState(15),[d,u]=m.useState([]),[f,h]=m.useState(""),g=m.useRef(null),v=b=>{i(!0),se.callService("SCMBoardDtls0001",{boardMstrId:b},{isPopup:!0,showLoading:!1}).then(j=>{if(j&&j.subList){const P=j.subList.map(E=>({id:E.seq,author:E.userNm||E.regUserId,regUserId:E.regUserId,content:E.content,regDt:E.regDt}));u(P)}else u([])}).catch(j=>{console.error("게시글 댓글 목록 조회 실패:",j)}).finally(()=>{i(!1),c(15)})},x=()=>{e&&v(e)},y=()=>{if(!f.trim()){p.message.warning("댓글 상세내용 작성");return}if(!e){p.message.error("게시글 정보가 없습니다.");return}i(!0),se.callService("SCMBoardDtls0002",{boardMstrId:e,content:f.trim()},{isPopup:!0,showLoading:!1}).then(b=>{b&&b.result===1?(console.log("댓글이 등록되었습니다."),h(""),v(e),setTimeout(()=>{g.current&&(g.current.scrollTop=g.current.scrollHeight)},100)):console.error("댓글 등록에 실패했습니다.",b)}).catch(b=>{console.error("댓글 등록 중 오류가 발생했습니다.",b)}).finally(()=>{i(!1)})},w=b=>{const j=d.find(P=>P.id===b);if(j&&j.regUserId!==r?.userId){p.message.error("본인이 작성한 댓글만 삭제할 수 있습니다.");return}if(!e){p.message.error("게시글 정보가 없습니다.");return}i(!0),se.callService("SCMBoardDtls0003",{boardMstrId:e,seq:b},{isPopup:!0,showLoading:!1}).then(P=>{P&&P.result===1?(console.log("댓글이 삭제되었습니다."),v(e)):console.error("댓글 삭제에 실패했습니다.",P)}).catch(P=>{console.error("댓글 삭제 중 오류가 발생했습니다.",P)}).finally(()=>{i(!1)})};return m.useEffect(()=>{e?v(e):u([])},[e]),o.jsxs(Ie,{style:{flex:"0 0 400px",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{borderBottom:"1px solid #e8e8e8",paddingBottom:"12px",marginBottom:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("span",{style:{fontSize:"14px",fontWeight:"600",color:"#262626"},children:"댓글"}),o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[o.jsx(p.Button,{type:"text",icon:o.jsx(Y.ReloadOutlined,{spin:a||n}),onClick:x,disabled:a||n,size:"small",style:{fontSize:"12px",color:t?"#d9d9d9":n?"#8c8c8c":"#595959",height:"24px",padding:"0 8px"}}),!t&&o.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",fontSize:"10px",fontWeight:"700",color:a?"#8c8c8c":"#1890ff",minWidth:"14px",height:"14px",lineHeight:"14px",textAlign:"center",borderRadius:"50%",pointerEvents:"none"},children:l})]})]}),o.jsx("div",{ref:g,style:{flex:1,overflowY:"auto",marginBottom:"16px",minHeight:0,position:"relative"},children:n?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:[o.jsx("div",{style:{marginBottom:"12px"},children:o.jsx(Y.ReloadOutlined,{spin:!0,style:{fontSize:"24px"}})}),o.jsx("div",{style:{fontSize:"13px"},children:"댓글을 불러오는 중..."})]}):d.length===0?o.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"200px",color:"#8c8c8c"},children:o.jsx("div",{style:{fontSize:"13px"},children:"등록된 댓글이 없습니다."})}):o.jsx(p.List,{dataSource:d,renderItem:b=>o.jsxs(p.List.Item,{style:{position:"relative",paddingRight:"20px",padding:"12px 20px 12px 12px",borderBottom:"1px solid #f0f0f0"},children:[o.jsx(p.List.Item.Meta,{avatar:o.jsx(p.Avatar,{size:32,style:{backgroundColor:"#1890ff",fontSize:"13px"},children:b.author[0]}),title:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"4px"},children:[o.jsx("span",{style:{fontWeight:"500",fontSize:"13px",color:"#262626"},children:b.author}),o.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:b.regDt})]}),description:o.jsx("span",{style:{fontSize:"13px",color:"#595959",lineHeight:"1.5"},children:b.content})}),b.regUserId===r?.userId&&o.jsx(p.Button,{type:"text",danger:!0,icon:o.jsx(Y.DeleteOutlined,{style:{fontSize:"12px"}}),size:"small",onClick:()=>w(b.id),disabled:n,style:{position:"absolute",right:"8px",top:"62%",transform:"translateY(-50%)",opacity:n?.3:.5,height:"24px",width:"24px",padding:0},onMouseEnter:j=>{n||(j.currentTarget.style.opacity="1")},onMouseLeave:j=>{j.currentTarget.style.opacity=n?"0.3":"0.5"}})]},b.id)})}),o.jsx("div",{style:{padding:"12px",borderTop:"1px solid #e8e8e8",backgroundColor:t?"#f5f5f5":"#fafafa",flexShrink:0,marginTop:"auto"},children:t?o.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"#8c8c8c",fontSize:"13px",backgroundColor:"#ffffff",borderRadius:"6px",border:"1px solid #e8e8e8"},children:[o.jsx("div",{style:{marginBottom:"8px"},children:o.jsx(Y.AlertTwoTone,{twoToneColor:"#faad14"})}),o.jsx("div",{children:"이미 완료처리된 게시글입니다."}),o.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"댓글을 작성할 수 없습니다."})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{marginBottom:"8px"},children:o.jsx(OW,{rows:2,placeholder:n?"댓글 처리 중...":"댓글을 입력하세요...",value:f,onChange:b=>h(b.target.value),maxLength:300,disabled:n,style:{borderRadius:"6px",border:"1px solid #d9d9d9",resize:"none",fontSize:"13px",backgroundColor:n?"#f5f5f5":"#ffffff",color:n?"#8c8c8c":"#000000"},onFocus:b=>{n||(b.currentTarget.style.borderColor="#1890ff",b.currentTarget.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.05)")},onBlur:b=>{b.target.style.borderColor="#d9d9d9",b.target.style.boxShadow="none"}})}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("span",{style:{fontSize:"11px",color:"#8c8c8c"},children:n?"처리 중...":`${f.length} / 300자`}),o.jsx(p.Button,{type:"primary",onClick:y,size:"small",loading:n,style:{borderRadius:"4px",fontSize:"12px",height:"28px",padding:"0 16px",fontWeight:"500"},disabled:!f.trim()||n,children:n?"등록 중...":"등록"})]})]})})]})},Vf=[{label:"전체",value:""},{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],F1=[{label:"전체",value:""},{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],kW={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},V1={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},TW={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},MW=({sysCd:e=__SYS_CD__,appCd:t=__APP_CD__})=>{const r=m.useRef(null),[n]=p.Form.useForm(),[i,a]=m.useState(!1),{searchBoxRef:s}=at.useSearchBox(),{openTabByMenuId:l}=tt.useMenuViewStore(),{openCorePopup:c}=at.usePopup(),[d,u]=m.useState(!1),f=m.useRef(null),[h,g]=m.useState(n.getFieldValue("status")),v=h==="COMPLETED",x=m.useMemo(()=>[{fieldName:"boardMstrId",header:{text:"번호"},width:80},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,button:!0,styleName:"left"},{fieldName:"menuNm",header:{text:"메뉴명"},width:120,styleName:"left"},{fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType",styleName:"center"},{fieldName:"title",header:{text:"제목"},width:200,styleName:"left"},{fieldName:"content",header:{text:"내용"},width:200,visible:!1},{fieldName:"status",header:{text:"상태"},width:90,renderer:"statusTag",styleName:"center"},{fieldName:"rgstUserId",visible:!1},{fieldName:"rgstUserNm",header:{text:"작성자"},width:60,styleName:"left"},{fieldName:"rgstUserDeptNm",header:{text:"작성자 부서"},visible:!1},{fieldName:"rgstDt",header:{text:"등록일자"},width:100,textFormat:se.realFormat.formatYmd,styleName:"right"},{fieldName:"dueDt",header:{text:"마감요청일자"},width:100,textFormat:se.realFormat.formatYmd,styleName:"right"},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert",styleName:"center"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:60,styleName:"left"},{fieldName:"prcsUserDeptNm",header:{text:"처리담당자 부서"},visible:!1},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,textFormat:se.realFormat.formatYmd,styleName:"right",visible:!1}],[]),y=m.useMemo(()=>({container:{indicator:!1}}),[]),w={onCellDblClicked(A,B){const z=B.itemIndex??-1;if(z<0)return;const F=A.getValues(z);n.setFieldsValue(F),g(F.status),a(!0)},onCellClicked(A,B){if(B.fieldName==="menuId"){if((B.itemIndex??-1)<0)return;B.value&&l(B.value)}}},b=m.useMemo(()=>({SCMBoardMstr0001:async(A,B)=>{const z=A||f.current?.currentPage||1,F=B||f.current?.pageSize||20,R={...s?.current?.getFormData(),sysCd:e,appCd:t,pageNum:z,pageCount:F};console.log("🔍 서버 모드 페이징 요청:",R);try{const N=await se.callService("SCMBoardMstr0001",R,{isPopup:!0});if(N&&N.pageList){const I=N.pageCnt||0;f.current?.setTotalData(I),r.current?.addAllData(N.pageList)}else f.current?.setTotalData(0),r.current?.addAllData([])}catch(N){console.error("❌ SCMBoardMstr0001 호출 실패:",N)}},SCMBoardMstr0004:A=>{se.callService("SCMBoardMstr0004",{...A,boardMstrId:n.getFieldValue("boardMstrId"),sysCd:e,appCd:t},{isPopup:!0}).then(B=>{n.resetFields(),b.SCMBoardMstr0001()}).catch(B=>{console.error("문의/신고 변경 실패:",B)})}}),[s,n]),j=m.useMemo(()=>se.createBwgGridRenderer((A,B,z,F,R)=>{const N=A.getValue(B.index?.itemIndex,"type");R.render(o.jsx(p.Tag,{color:TW[N],children:Vf.find(I=>I.value===N)?.label}))}),[]),P=m.useMemo(()=>se.createBwgGridRenderer((A,B,z,F,R)=>{const N=A.getValue(B.index?.itemIndex,"status");R.render(o.jsx(p.Tag,{color:kW[N],children:F1.find(I=>I.value===N)?.label}))}),[]),E=m.useMemo(()=>se.createBwgGridRenderer((A,B,z,F,R)=>{A.getValue(B.index?.itemIndex,"urgentYn")==="Y"?R.render(o.jsx(Y.AlertTwoTone,{twoToneColor:"red"})):R.render(o.jsx(o.Fragment,{}))}),[]),C=()=>{try{n.validateFields().then(A=>{p.Modal.confirm({title:"변경 확인",content:"게시물 정보를 변경하시겠습니까?",okText:"변경",cancelText:"취소",onOk:()=>{b.SCMBoardMstr0004({...A,prcsUserId:n.getFieldValue("prcsUserId")}),a(!1)}})})}catch(A){console.error("게시물 정보 변경 실패:",A)}},O=A=>{console.log("처리담당자 선택:",A),n.setFieldsValue({prcsUserId:A.empNo,prcsUserNm:A.empNm,prcsUserDeptNm:A.deptNm,status:"ASSIGNED"}),g("ASSIGNED")},k=()=>{c("CORE_PRGR_02",{callback:A=>{s?.current?.setFormData({menuId:A.menuId,menuNm:A.menuNm})}})},T=A=>{if(n.setFieldValue("status",A),g(A),A==="COMPLETED"||A==="REJECTED"){const B=se.format(se.now(),"yyyy-mm-dd");n.setFieldsValue({prcsDt:B})}else n.setFieldsValue({prcsDt:""})};m.useEffect(()=>{setTimeout(()=>{b.SCMBoardMstr0001()},100)},[b]);const D={ref:s,reqRows:o.jsxs(o.Fragment,{children:[o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:7,children:o.jsx(_.BwgMaskedRange,{itemProps:{label:"등록일자",name:"rgstDt"},pickerProps:{allowEmpty:!0}})}),o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type"},selectProps:{options:Vf,placeholder:"전체"}})}),o.jsx($e,{span:6,children:o.jsx(_.BwgEmpSearch,{label:"작성자",empNoFieldName:"rgstUserId",field1:{value:"deptNm",fieldName:"rgstUserDeptNm",placeholder:"부서명"},field2:{value:"empNm",fieldName:"rgstUserNm",placeholder:"사원명 입력"}})}),o.jsx($e,{span:6,style:{marginLeft:"12px"},children:o.jsx(_.BwgSwitch,{itemProps:{name:"myPrcs",label:"나의 처리건만"},inputProps:{format:"YN"}})})]}),o.jsxs(wt,{gutter:[12,8],children:[o.jsx($e,{span:7,children:o.jsx(_.BwgSearch,{itemProps:{label:"메뉴",name:["menuId","menuNm"]},onSearch:k})}),o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"상태",name:"status"},selectProps:{options:F1,placeholder:"전체"}})}),o.jsx($e,{span:8,children:o.jsx(_.BwgInput,{itemProps:{label:"제목 및 내용",name:"keyword"}})})]})]})},L=m.useMemo(()=>({grant:[{id:"search",label:"조회",onClick:()=>{b.SCMBoardMstr0001(f.current?.currentPage,f.current?.pageSize)}},{id:"edit",label:"변경",onClick:()=>{const A=r.current?.getCurrentIndex?.()??-1;if(A<0)return;const B=r.current?.vw?.getValues(A);B&&(n.setFieldsValue(B),g(n.getFieldValue("status")),a(!0))}}]}),[f,b,n,r]);return o.jsx(kt,{searchBox:D,buttons:L,children:o.jsx(ze,{children:o.jsxs(Ie,{children:[o.jsx(Ve,{gridId:"CMAdminBoardM0101",ref:r,type:"nrml",gridColumns:x,gridOptions:y,gridEvents:w,renderers:[{name:"tagType",renderer:j},{name:"statusTag",renderer:P},{name:"alert",renderer:E}]}),o.jsx(dn,{title:"게시물 상세",open:i,onClose:()=>{a(!1),n.resetFields(),b.SCMBoardMstr0001()},showCloseButton:!0,showEyesButton:!0,size:"large",placement:"right",width:1200,maskClosable:!0,extra:o.jsx(p.ConfigProvider,{children:o.jsx(p.Space,{children:o.jsx(p.Button,{className:"btn-primary .btn-primary:hover",onClick:C,children:"변경"})})}),children:o.jsxs(p.Splitter,{children:[o.jsx(p.Splitter.Panel,{defaultSize:"70%",min:"60%",max:"80%",style:{paddingRight:"15px",overflowX:"hidden"},children:o.jsx(Ie,{style:{overflowY:"auto"},children:o.jsxs(_.BwgForm,{form:n,children:[o.jsx(wt,{gutter:[12,8],style:{marginBottom:"20px"},children:o.jsx($e,{span:24,children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"0 5px"},children:[o.jsx(p.Avatar,{size:40,style:{backgroundColor:se.colorFormat.site.purple04,fontSize:"13px"},children:n.getFieldValue("rgstUserNm")?.[0]??""}),o.jsx("div",{style:{flex:1},children:o.jsxs("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px",marginTop:"2px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{fontWeight:500,fontSize:"16px",color:"#262626"},children:n.getFieldValue("rgstUserNm")??n.getFieldValue("rgstUserDeptNm")??""}),o.jsx("span",{style:{fontSize:"13px",color:"#8c8c8c",marginTop:"3px",marginLeft:"4px"},children:n.getFieldValue("rgstDt")?se.format(n.getFieldValue("rgstDt"),"YYYY-MM-DD"):""})]}),o.jsx("span",{style:{fontSize:"12px",color:"#8c8c8c",marginLeft:"1px"},children:n.getFieldValue("rgstUserDeptNm")??""})]})})]})})}),o.jsx(wt,{gutter:[12,8],children:o.jsx($e,{span:24,children:o.jsx(_.BwgInput,{itemProps:{name:"title"},inputProps:{size:"large",placeholder:"제목을 입력하세요",style:{fontWeight:"bold"},variant:"borderless"}})})}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"15px"},children:o.jsx($e,{span:24,children:o.jsx("div",{style:{borderBottom:"1px solid #d9d9d9",marginBottom:"8px"}})})}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"10px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type"},selectProps:{disabled:!0,options:Vf}})}),o.jsx($e,{span:10,children:o.jsx(_.BwgFormItem,{label:"메뉴 정보",children:o.jsxs(p.Space.Compact,{style:{width:"100%"},children:[o.jsx(p.Form.Item,{name:"menuId",style:{width:"40%",marginBottom:0,marginInlineEnd:0},validateStatus:"",help:"",children:o.jsx(p.Input,{disabled:!0})}),o.jsx(p.Form.Item,{name:"menuNm",style:{width:"60%",marginBottom:0},children:o.jsx(p.Input,{disabled:!0})})]})})}),o.jsx($e,{span:6,children:o.jsx(_.BwgCheck,{itemProps:{name:"urgentYn",label:"긴급여부"},inputProps:{disabled:!0}})})]}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"10px"},children:o.jsx($e,{span:24,children:o.jsx(_.BwgFormItem,{label:"상태",name:"status",children:o.jsxs(p.Space,{children:[o.jsx(_.BwgButton,{icon:o.jsx(Y.ReloadOutlined,{}),type:h==="READY"?"primary":"default",onClick:()=>T("READY"),children:"대기"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.UserAddOutlined,{}),onClick:O,type:h==="ASSIGNED"?"primary":"default",children:"담당자 지정"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.ClockCircleOutlined,{}),type:h==="PROCESSING"?"primary":"default",onClick:()=>T("PROCESSING"),children:"처리중"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.CheckOutlined,{}),onClick:()=>T("COMPLETED"),type:h==="COMPLETED"?"primary":"default",children:"처리완료"}),o.jsx(_.BwgButton,{icon:o.jsx(Y.CloseOutlined,{}),onClick:()=>T("REJECTED"),type:h==="REJECTED"?"primary":"default",children:"반려"})]})})})}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:12,children:o.jsx(_.BwgMaskedDate,{itemProps:{label:"마감요청일자",name:"dueDt"},inputProps:{disabled:!0}})}),o.jsx($e,{span:12,children:o.jsxs(p.Flex,{vertical:!0,gap:3,children:[o.jsx("span",{style:{fontSize:"12px",color:"#000000E0"},children:"진척률"}),o.jsx(p.Progress,{percent:V1[n.getFieldValue("status")],status:V1[n.getFieldValue("status")]>0?"active":"normal",size:"small",format:A=>`${A}%`})]})})]}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:12,children:o.jsx(_.BwgEmpSearch,{label:"처리담당자",empNoFieldName:"prcsUserId",field1:{value:"deptNm",fieldName:"prcsUserDeptNm",placeholder:"부서명"},field2:{value:"empNm",fieldName:"prcsUserNm",placeholder:"사원명 입력"},onFinish:()=>{n.setFieldValue("status","ASSIGNED"),g("ASSIGNED")}})}),o.jsx($e,{span:12,children:o.jsx(_.BwgMaskedDate,{itemProps:{label:"처리일자",name:"prcsDt"},inputProps:{disabled:!0}})})]}),o.jsx(p.Divider,{}),o.jsx(wt,{gutter:[12,8],children:o.jsx($e,{span:24,children:o.jsx(kh,{itemProps:{label:"내용",name:"content"},editorProps:{isEditing:!d,title:{title:o.jsxs(o.Fragment,{children:[o.jsx(Y.EditOutlined,{style:{marginRight:"5px"}})," ","상세내용"]}),children:o.jsx(_.BwgButton,{icon:o.jsx(Y.EyeFilled,{}),onClick:()=>u(!d),children:"미리보기"})}}})})})]})})}),o.jsx(p.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:o.jsx(Km,{boardMstrId:n.getFieldValue("boardMstrId"),isCompleted:v})})]})}),o.jsx(To,{ref:f,mode:"server",onServerPageChange:(A,B)=>{b.SCMBoardMstr0001(A,B)},pageSizeOptions:[10,20,50]})]})})})},Hf=[{label:"전체",value:""},{label:"요청",value:"RQST"},{label:"문의",value:"INQR"}],Uf=[{label:"전체",value:""},{label:"대기",value:"READY"},{label:"담당자 지정",value:"ASSIGNED"},{label:"처리중",value:"PROCESSING"},{label:"처리완료",value:"COMPLETED"},{label:"반려",value:"REJECTED"}],H1={READY:"gray",ASSIGNED:"blue",PROCESSING:"yellow",COMPLETED:"green",REJECTED:"red"},U1={READY:0,ASSIGNED:25,PROCESSING:50,COMPLETED:100,REJECTED:100},RW={INQR:"blue",RQST:"green",RPRT:"red",SGSN:"purple"},AW=({sysCd:e=__SYS_CD__,appCd:t=__APP_CD__})=>{const r=m.useRef(null),[n,i]=m.useState(!1),{searchBoxRef:a}=at.useSearchBox(),{user:s,hrInfo:l}=tt.useUserStore(),[c]=p.Form.useForm(),{openCorePopup:d}=at.usePopup(),u=m.useRef(null),[f,h]=m.useState(!1),v=p.Form.useWatch("status",c)??c.getFieldValue("status")??"READY",x=f||v==="READY",[y,w]=m.useState(!1),b=v==="COMPLETED"||v==="REJECTED",j=m.useMemo(()=>[{fieldName:"boardMstrId",header:{text:"글 번호"},width:80},{fieldName:"menuId",header:{text:"메뉴ID"},width:100,styleName:"left"},{fieldName:"menuNm",header:{text:"메뉴명"},width:100,styleName:"left"},{fieldName:"type",header:{text:"등록구분"},width:80,renderer:"tagType",styleName:"center"},{fieldName:"title",header:{text:"제목"},width:200,styleName:"left"},{fieldName:"content",header:{text:"내용"},width:200,visible:!1},{fieldName:"status",header:{text:"상태"},width:80,renderer:"statusTag",styleName:"center"},{fieldName:"rgstUserId",header:{text:"작성자ID"},visible:!1},{fieldName:"rgstUserDeptNm",header:{text:"작성자 부서"},visible:!1},{fieldName:"rgstDt",header:{text:"작성일자"},width:120,textFormat:se.realFormat.formatYmd,styleName:"right"},{fieldName:"dueDt",header:{text:"마감요청일자"},width:120,textFormat:se.realFormat.formatYmd,styleName:"right"},{fieldName:"urgentYn",header:{text:"긴급여부"},width:80,renderer:"alert",styleName:"center"},{fieldName:"prcsUserId",visible:!1},{fieldName:"prcsUserNm",header:{text:"처리담당자"},width:100,styleName:"left"},{fieldName:"prcsUserDeptNm",header:{text:"처리담당자 부서"},visible:!1},{fieldName:"prcsDt",header:{text:"처리일자"},width:120,textFormat:se.realFormat.formatYmd,styleName:"center"}],[]),P=m.useMemo(()=>({container:{indicator:!1}}),[]),E={onCellDblClicked(z,F){const R=F.itemIndex??-1;if(R<0)return;const N=z.getValues(R);N&&(c.setFieldsValue({...N}),h(!1),i(!0))}},C=m.useMemo(()=>({SCMBoardMstr0001:async(z,F)=>{const R=z||u.current?.currentPage||1,N=F||u.current?.pageSize||20,I={...a?.current?.getFormData(),sysCd:e,appCd:t,myArticle:"Y",pageNum:R,pageCount:N},M=await se.callService("SCMBoardMstr0001",I,{isPopup:!0});M&&M.pageList&&(u.current?.setTotalData(M.pageCnt||0),r.current?.addAllData(M.pageList))},SCMBoardMstr0003:z=>{se.callService("SCMBoardMstr0003",{sysCd:e,appCd:t,...z,status:"READY",rgstUserId:s?.userId,rgstUserNm:s?.userNm},{isPopup:!0}).then(F=>{c.resetFields(),C.SCMBoardMstr0001()}).catch(F=>{console.error("게시물 제출 실패:",F)})},SCMBoardMstr0004:z=>{se.callService("SCMBoardMstr0004",{sysCd:e,appCd:t,boardMstrId:c.getFieldValue("boardMstrId"),...z},{isPopup:!0}).then(()=>{c.resetFields(),C.SCMBoardMstr0001()}).catch(F=>{console.error("게시물 변경 실패:",F)})}}),[a,c]),O=m.useMemo(()=>se.createBwgGridRenderer((z,F,R,N,I)=>{const M=z.getValue(F.index?.itemIndex,"type");I.render(o.jsx(p.Tag,{color:RW[M],children:Hf.find(W=>W.value===M)?.label}))}),[]),k=m.useMemo(()=>se.createBwgGridRenderer((z,F,R,N,I)=>{const M=z.getValue(F.index?.itemIndex,"status");I.render(o.jsx(p.Tag,{color:H1[M],children:Uf.find(W=>W.value===M)?.label}))}),[]),T=m.useMemo(()=>se.createBwgGridRenderer((z,F,R,N,I)=>{z.getValue(F.index?.itemIndex,"urgentYn")==="Y"?I.render(o.jsx(Y.AlertTwoTone,{twoToneColor:"red"})):I.render(o.jsx(o.Fragment,{}))}),[]),D=()=>{try{c.validateFields().then(z=>{p.Modal.confirm({title:f?"등록 확인":"변경 확인",content:f?"게시물 내용 등록하시겠습니까?":"게시물 내용 변경하시겠습니까?",okText:f?"등록":"변경",cancelText:"취소",onOk:()=>{f?C.SCMBoardMstr0003(z):C.SCMBoardMstr0004(z),i(!1)}})})}catch(z){console.error("게시물 제출 실패:",z)}},L=()=>{d("CORE_PRGR_02",{callback:z=>{c.setFieldsValue({menuId:z.menuId,menuNm:z.menuNm})}})};m.useEffect(()=>{setTimeout(()=>{C.SCMBoardMstr0001()},100)},[C]);const A={ref:a,reqRows:o.jsxs(o.Fragment,{children:[o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgMaskedRange,{itemProps:{label:"작성일자",name:"rgstDt"},pickerProps:{allowEmpty:!0}})}),o.jsx($e,{span:8,children:o.jsx(_.BwgSearch,{itemProps:{label:"메뉴",name:["menuId","menuNm"]},onSearch:()=>{d("CORE_PRGR_02",{callback:z=>{a?.current?.setFormData({menuId:z.menuId,menuNm:z.menuNm})}})}})})]}),o.jsxs(wt,{gutter:[12,8],children:[o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type"},selectProps:{options:Hf,placeholder:"전체"}})}),o.jsx($e,{span:4,children:o.jsx(_.BwgSelect,{itemProps:{label:"상태",name:"status"},selectProps:{options:Uf,placeholder:"전체"}})}),o.jsx($e,{span:8,children:o.jsx(_.BwgInput,{itemProps:{label:"제목 및 내용",name:"keyword"}})})]})]})},B=m.useMemo(()=>({grant:[{id:"search",label:"조회",onClick:()=>{C.SCMBoardMstr0001()}},{id:"new",label:"등록",onClick:()=>{h(!0),c.resetFields(),c.setFieldsValue({rgstUserId:s?.userId,rgstUserNm:s?.userNm,rgstDt:se.now().format(),status:"READY"}),i(!0)}},{id:"edit",label:"변경",onClick:()=>{const z=r.current?.getCurrentIndex?.()??-1;if(z<0)return;const F=r.current?.vw?.getValues(z);F&&(c.setFieldsValue({...F}),h(!1),i(!0))}}]}),[C,c,r,s]);return o.jsx(kt,{searchBox:A,buttons:B,children:o.jsx(ze,{children:o.jsxs(Ie,{children:[o.jsx(Ve,{gridId:"CMMyBoardM0101",ref:r,type:"nrml",gridColumns:j,gridOptions:P,gridEvents:E,renderers:[{name:"tagType",renderer:O},{name:"statusTag",renderer:k},{name:"alert",renderer:T}]}),o.jsx(dn,{title:`게시물 ${f?"등록":"변경"}`,open:n,onClose:()=>i(!1),showCloseButton:!0,size:"large",placement:"right",width:f?800:1200,extra:o.jsx(p.ConfigProvider,{children:o.jsx(p.Space,{children:f||c.getFieldValue("status")==="READY"?o.jsx(p.Button,{className:"btn-primary .btn-primary:hover",onClick:D,children:f?"등록":"변경"}):null})}),children:o.jsxs(p.Splitter,{children:[o.jsx(p.Splitter.Panel,{defaultSize:f?"100%":"70%",min:f?"100%":"60%",max:f?"100%":"80%",style:{paddingRight:f?"0px":"15px",overflowX:"hidden"},children:o.jsx(Ie,{style:{overflowY:"auto"},children:o.jsxs(_.BwgForm,{form:c,onFinish:D,initialValues:{rgstUserNm:s?.userNm||"",rgstUserDeptNm:l?.deptNm||""},children:[o.jsx(wt,{gutter:[12,8],children:o.jsx($e,{span:24,children:o.jsx(_.BwgInput,{itemProps:{name:"title",rules:[{required:!0,message:"제목을 입력해주세요."}]},inputProps:{size:"large",placeholder:"제목을 입력하세요",style:{fontWeight:"bold"},variant:"borderless"}})})}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"15px"},children:o.jsx($e,{span:24,children:o.jsx("div",{style:{borderBottom:"1px solid #d9d9d9",marginBottom:"8px"}})})}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{label:"구분",name:"type",rules:[{required:!0,message:"구분을 선택해주세요."}]},selectProps:{options:[...Hf].filter(z=>z.value!==""),disabled:!x}})}),o.jsx($e,{span:16,children:o.jsx(_.BwgSearch,{itemProps:{label:"메뉴",name:["menuId","menuNm"],rules:[{required:!0,message:"메뉴를 선택해주세요."}]},onSearch:L,readOnly:!x})})]}),o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[!f&&o.jsx($e,{span:12,children:o.jsx(_.BwgFormItem,{label:"상태",children:o.jsx("div",{style:{marginBottom:4},children:c.getFieldValue("status")&&o.jsx(p.Tag,{color:H1[c.getFieldValue("status")],children:Uf.find(z=>z.value===c.getFieldValue("status"))?.label})})})}),!f&&o.jsx($e,{span:12,children:o.jsxs(p.Flex,{vertical:!0,gap:3,children:[o.jsx("span",{style:{fontSize:"12px",color:"#000000E0"},children:"진척률"}),o.jsx(p.Progress,{percent:U1[c.getFieldValue("status")],status:U1[c.getFieldValue("status")]>0?"active":"normal",size:"small",format:z=>`${z}%`})]})})]}),!f&&o.jsx(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:o.jsx($e,{span:12,children:o.jsx(_.BwgEmpSearch,{label:"처리담당자",empNoFieldName:"prcsUserId",field1:{value:"deptNm",fieldName:"prcsUserDeptNm",placeholder:"부서명"},field2:{value:"empNm",fieldName:"prcsUserNm",placeholder:"사원명"},readOnly:!0})})}),o.jsx(p.Divider,{}),o.jsx(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:o.jsx($e,{span:24,children:o.jsx(kh,{border:!1,itemProps:{name:"content",rules:[{required:!0,message:"내용을 입력해주세요."}]},editorProps:{isEditing:x&&!y,title:{title:o.jsxs(o.Fragment,{children:[o.jsx(Y.EditOutlined,{style:{marginRight:"5px"}})," ","상세내용 작성"]}),children:x&&o.jsx(p.Button,{icon:o.jsx(Y.EyeFilled,{}),onClick:()=>w(!y),children:"미리보기"})}}})})})]})})}),!f&&o.jsx(p.Splitter.Panel,{collapsible:!0,style:{paddingLeft:"15px"},children:o.jsx(Km,{boardMstrId:c.getFieldValue("boardMstrId"),isCompleted:b})})]})}),o.jsx(To,{ref:u,mode:"server",onServerPageChange:(z,F)=>{C.SCMBoardMstr0001(z,F)},pageSizeOptions:[10,20,50]})]})})})},IW=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},Wf=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function Ea(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:IW(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:Wf(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:Wf(e.orgSortOrd,0),orgOtptOrd:Wf(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function NW(e){const t=new Set,r=e.map(Ea).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>t.has(l.deptCd)?!1:(t.add(l.deptCd),!0));r.sort((l,c)=>(l.deptLvl||0)-(c.deptLvl||0)||(l.orgSortOrd||0)-(c.orgSortOrd||0)||l.deptCd.localeCompare(c.deptCd));const n=new Map;for(const l of r)n.set(l.deptCd,{...l,children:[]});const i=[];for(const l of r){const c=n.get(l.deptCd),d=l.hrnkDeptCd;d&&n.has(d)?n.get(d).children.push(c):i.push(c)}const a=l=>{!l||l.length===0||(l.sort((c,d)=>c.deptCd.localeCompare(d.deptCd)),l.forEach(c=>a(c.children)))};a(i);const s=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(s)};if(i.forEach(s),i.length>1){const l=i.find(c=>c.deptCd==="D00");if(l)return[l]}return i}function DW(e){const t=e.map(Ea),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const GP=({popup:e,onClose:t})=>{const[r,n]=m.useState(""),[i,a]=m.useState([]),[s,l]=m.useState([]),[c,d]=m.useState([]),[u,f]=m.useState(!1),h=m.useCallback(async C=>{try{f(!0);const O=await se.callService("SCMUTIL00103",{...e?.popupParams,...C}),k=Array.isArray(O?.data)?O.data:Array.isArray(O?.deptList)?O.deptList:Array.isArray(O)?O:[],T=NW(k);d(T);const D=DW(k);a(D);const L=T[0]?.deptCd||Ea(k.find(A=>Ea(A).deptLvl===1)||{}).deptCd||Ea(k[0]||{}).deptCd||"";l(L?[L]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{f(!1)}},[e?.popupParams]);m.useEffect(()=>{h()},[h]);const g=m.useCallback((C,O)=>{for(const k of C){if(k.deptCd===O)return k;if(k.children){const T=g(k.children,O);if(T)return T}}return null},[]),v=m.useMemo(()=>{const C=s[0];return C?g(c,C):null},[s,c,g]),x=m.useMemo(()=>{const C=k=>k.map(T=>({title:T.deptNm,key:T.deptCd,meta:T,children:T.children?C(T.children):void 0}));return C(c)},[c]),y=m.useMemo(()=>{const C=r.trim().toLowerCase();if(!C)return x;const O=k=>k.map(T=>{const D=T.meta,L=(D?.deptNm||"").toLowerCase().includes(C)||(D?.deptCd||"").toLowerCase().includes(C),A=T.children?O(T.children):void 0;return L||A&&A.length?{...T,children:A}:null}).filter(Boolean);return O(x)},[x,r]),w=m.useCallback(C=>{l(C.slice(0,1).map(String))},[]),b=m.useCallback(C=>a(C.map(String)),[]),j=m.useCallback((C,O)=>{if(C.stopPropagation(),!O.children||O.children.length===0)return;const k=i.includes(O.key);a(T=>k?T.filter(D=>D!==O.key):[...T,O.key])},[i]),P=m.useCallback(()=>l([]),[]),E={confirm:()=>{if(!v){p.message.error("부서를 선택해주세요.");return}const C={deptCd:v.deptCd,deptNm:v.deptNm,hrnkDeptCd:v.hrnkDeptCd,hrnkDeptNm:v.hrnkDeptNm,deptLvl:v.deptLvl,orgSortOrd:v.orgSortOrd},O=e?.config;O?.onSelect?O.onSelect(C):e?.config?.callback&&e.config.callback(JSON.stringify(C)),O?.onClose&&O.onClose(),e?.close?.()},cancel:()=>{const C=e?.config;C?.onCancel&&C.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{E.confirm()}}],popupEvent:E,onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"70%",min:"70%",max:"75%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:o.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[o.jsx(Le,{title:"조직도"}),o.jsx(p.Row,{gutter:[16,16],children:o.jsx(p.Col,{span:24,children:o.jsx(p.Input,{placeholder:"부서명, 부서코드 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,onChange:C=>n(C.target.value)})})})]})}),o.jsx("div",{style:{padding:16,overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:u,children:o.jsx(p.Tree,{treeData:y,expandedKeys:i,selectedKeys:s,onSelect:w,onExpand:b,onDoubleClick:j,showLine:!0,showIcon:!1,selectable:!0,style:{overflow:"hidden"},titleRender:C=>{const O=C.meta;return o.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%",fontWeight:s.includes(C.key)?"bold":"normal"},children:[o.jsx("span",{children:O.deptNm}),o.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:O.deptCd})]})}})})})]}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:16,overflowY:"hidden",height:"100%"},children:[o.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:16,fontWeight:700},children:"선택된 부서"}),v?o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:14,border:"1px solid #e0e0e0",borderRadius:12,background:"#fafafa"},children:[o.jsx("div",{style:{width:42,height:42,borderRadius:"50%",border:"1px solid #e6e6e6",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:18,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:o.jsx(Y.TeamOutlined,{})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsxs("div",{style:{fontSize:15,fontWeight:700,marginBottom:4},children:[v.deptNm," ",o.jsxs("span",{style:{color:"#8c8c8c",fontSize:12},children:["(",v.deptCd,")"]})]}),o.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:2},children:["상위부서: ",v.hrnkDeptNm||"-"]})]}),o.jsx(p.Button,{type:"text",onClick:P,icon:o.jsx(Y.RestOutlined,{style:{fontSize:24,color:"#FF6363"}})})]}):o.jsx("div",{style:{color:"#999",fontSize:14},children:"부서를 선택해주세요."})]})})]})})})})},_W=Object.freeze(Object.defineProperty({__proto__:null,default:GP},Symbol.toStringTag,{value:"Module"})),BW=e=>{if(e==null)return"";const t=String(e).trim();return!t||t.toUpperCase()==="NULL"?"":t.toUpperCase()},Kf=(e,t=0)=>{const r=Number(e);return Number.isFinite(r)?r:t};function Pa(e){return{crprCd:e.crprCd||void 0,wkplCd:e.wkplCd||void 0,deptCd:BW(e.deptCd),deptNm:(e.deptNm??"").toString().trim(),hrnkDeptCd:e.hrnkDeptCd||null,hrnkDeptNm:e.hrnkDeptNm||null,deptGbCd:e.deptGbCd||null,deptLvl:Kf(e.deptLvl,e.hrnkDeptCd?2:1),orgSortOrd:Kf(e.orgSortOrd,0),orgOtptOrd:Kf(e.orgOtptOrd,0),deptAbrv:e.deptAbrv||null,deptFullNm:e.deptFullNm||null,deptEnglNm:e.deptEnglNm||null,isLeaf:e.isLeaf||null}}function $W(e){const t=new Set,r=e.map(Pa).filter(l=>l.deptCd).filter(l=>(l.deptCd===l.hrnkDeptCd&&(l.hrnkDeptCd=""),!0)).filter(l=>t.has(l.deptCd)?!1:(t.add(l.deptCd),!0));r.sort((l,c)=>(l.deptLvl||0)-(c.deptLvl||0)||(l.orgSortOrd||0)-(c.orgSortOrd||0)||l.deptCd.localeCompare(c.deptCd));const n=new Map;for(const l of r)n.set(l.deptCd,{...l,children:[]});const i=[];for(const l of r){const c=n.get(l.deptCd),d=l.hrnkDeptCd;d&&n.has(d)?n.get(d).children.push(c):i.push(c)}const a=l=>{!l||l.length===0||(l.sort((c,d)=>c.deptCd.localeCompare(d.deptCd)),l.forEach(c=>a(c.children)))};a(i);const s=l=>{if(!l.children||l.children.length===0){delete l.children;return}l.children.forEach(s)};if(i.forEach(s),i.length>1){const l=i.find(c=>c.deptCd==="D00");if(l)return[l]}return i}function LW(e){const t=e.map(Pa),r=t.filter(n=>n.isLeaf!=="Y").map(n=>n.deptCd);return r.length>200?t.filter(n=>(n.deptLvl||0)<=2).map(n=>n.deptCd):r}const XP=({popup:e,onClose:t})=>{const[r,n]=m.useState(""),[i,a]=m.useState(""),[s,l]=m.useState([]),[c,d]=m.useState([]),[u,f]=m.useState([]),[h,g]=m.useState(!1),[v,x]=m.useState([]),[y,w]=m.useState(!1),b=m.useCallback(async F=>{try{w(!0);const R=await se.callService("SCMUTIL00103",{...e?.popupParams,...F}),N=Array.isArray(R?.data)?R.data:Array.isArray(R?.deptList)?R.deptList:Array.isArray(R)?R:[],I=$W(N);x(I);const M=LW(N);l(M);const W=I[0]?.deptCd||Pa(N.find($=>Pa($).deptLvl===1)||{}).deptCd||Pa(N[0]||{}).deptCd||"";d(W?[W]:[])}catch{p.message.error("조직 데이터를 불러오는 중 오류가 발생했습니다.")}finally{w(!1)}},[e?.popupParams]);m.useEffect(()=>{b()},[b]);const j=m.useCallback((F,R)=>{for(const N of F){if(N.deptCd===R)return N;if(N.children){const I=j(N.children,R);if(I)return I}}return null},[v]),P=m.useMemo(()=>u.map(F=>{const R=j(v,F);if(!R)return null;const{children:N,...I}=R;return I}).filter(Boolean),[u,v,j]),E=m.useMemo(()=>{const F=R=>R.map(N=>({title:N.deptNm,key:N.deptCd,meta:N,children:N.children?F(N.children):void 0,isLeaf:!N.children||N.children.length===0}));return F(v)},[v]),C=m.useMemo(()=>{const F=r.trim().toLowerCase();if(!F)return E;const R=N=>N.map(I=>{const M=I.meta,W=(M?.deptNm||"").toLowerCase().includes(F)||(M?.deptCd||"").toLowerCase().includes(F),$=I.children?R(I.children):void 0;return W||$&&$.length>0?{...I,children:$}:null}).filter(Boolean);return R(E)},[E,r]),O=m.useCallback(F=>{const R=[],N=I=>{for(const M of I)if(M.deptCd===F&&M.children){const W=$=>{for(const H of $)R.push(H.deptCd),H.children&&W(H.children)};W(M.children)}else M.children&&N(M.children)};return N(v),R},[v]),k=m.useCallback((F,R)=>{let N=Array.isArray(F)?F:F?.checked??[];if(h&&R?.node?.key){const I=R.node.key,M=O(I);if(R.checked){const W=new Set(N);for(const $ of M)W.add($);N=Array.from(W)}else{const W=new Set([I,...M]);N=N.filter($=>!W.has($))}}f(N)},[h,O]),T=m.useCallback(F=>{const R=F.map(String);if(d(R),R.length>0){const N=R[0],I=(W,$)=>{for(const H of W){if(H.deptCd===$)return H.deptNm;if(H.children){const X=I(H.children,$);if(X)return X}}return null},M=I(v,N);M&&a(M)}},[v]),D=m.useCallback(F=>l(F.map(String)),[]),L=m.useCallback((F,R)=>{if(F.stopPropagation(),R.children&&R.children.length>0){const N=s.includes(R.key);l(I=>N?I.filter(M=>M!==R.key):[...I,R.key])}},[s]),A=m.useCallback(F=>{f(R=>R.filter(N=>N!==F))},[]),B=m.useCallback(()=>{f([])},[]),z={confirm:()=>{if(u.length===0){p.message.error("부서를 선택해주세요.");return}const R=Array.from(new Set(u)).map(I=>{const M=j(v,I);return M?{deptCd:M.deptCd,deptNm:M.deptNm,hrnkDeptCd:M.hrnkDeptCd,hrnkDeptNm:M.hrnkDeptNm}:null}).filter(Boolean),N=e?.config;N?.onSelect?N.onSelect(R):e?.config?.callback&&e.config.callback(JSON.stringify(R)),N?.onClose&&N.onClose(),e?.close?.()},cancel:()=>{const F=e?.config;F?.onCancel&&F.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{z.confirm()}}],popupEvent:z,onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:o.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[o.jsx(Le,{title:"조직도"}),o.jsx("div",{style:{fontSize:14,color:"#666",padding:8,backgroundColor:"#f8f8f8",borderRadius:4},children:i}),o.jsxs(p.Row,{gutter:[16,16],children:[o.jsx(p.Col,{span:18,children:o.jsx(p.Input,{placeholder:"부서명, 부서장명, 부서코드 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,onChange:F=>n(F.target.value)})}),o.jsx(p.Col,{span:6,style:{justifyContent:"center",display:"flex",alignItems:"center"},children:o.jsx(p.Checkbox,{checked:h,onChange:F=>g(F.target.checked),children:"하위까지 선택"})})]})]})}),o.jsx("div",{style:{padding:16,overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:y,children:o.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:C,expandedKeys:s,selectedKeys:c,checkedKeys:u,checkable:!0,checkStrictly:!0,showLine:!0,showIcon:!1,selectable:!0,onSelect:T,onExpand:D,onCheck:k,onDoubleClick:L,style:{overflow:"hidden"},titleRender:F=>{const R=F.meta;return o.jsxs("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 4px",width:"100%"},children:[o.jsx("span",{style:{fontWeight:c.includes(F.key)?"bold":"normal"},children:R.deptNm}),o.jsx("span",{style:{fontSize:11,color:"#999",marginLeft:8},children:R.deptCd})]})}})})})]}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:16,overflowY:"hidden"},children:[o.jsxs("div",{style:{marginBottom:12,display:"flex",alignItems:"center",gap:8},children:[o.jsxs("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:["선택된 부서 (",P.length,"개)"]}),P.length>0&&o.jsx("button",{onClick:B,style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",fontSize:12,padding:4},title:"전체 해제",children:"전체 해제"})]}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"flex-start",minHeight:48},children:P.length===0?o.jsx("div",{style:{color:"#999",fontSize:14},children:"선택된 부서가 없습니다."}):P.map(F=>o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"4px 8px",borderRadius:999,border:"1px solid #e6e6e6",background:"#fafafa",lineHeight:1.1,cursor:"default",maxWidth:260},title:`${F.deptNm}`,children:[o.jsx("span",{style:{width:18,height:18,borderRadius:"50%",border:"1px solid #e6e6e6",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#8c8c8c",background:"#fff",flex:"0 0 auto"},children:o.jsx(Y.TeamOutlined,{})}),o.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",gap:2,overflow:"hidden"},children:[o.jsx("span",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:F.deptNm}),o.jsx("span",{style:{fontSize:11,color:"#8c8c8c",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:180},children:F.deptCd})]}),o.jsx("button",{onClick:()=>A(F.deptCd),style:{border:"none",background:"transparent",color:"#8c8c8c",cursor:"pointer",padding:2,lineHeight:0},"aria-label":`${F.deptNm} 선택 해제`,title:"선택 해제",children:"×"})]},F.deptCd))})]})})]})})})})},zW=Object.freeze(Object.defineProperty({__proto__:null,default:XP},Symbol.toStringTag,{value:"Module"})),FW=e=>{const t=[...e].sort((a,s)=>a.deptLvl-s.deptLvl||a.orgSortOrd-s.orgSortOrd||a.deptCd.localeCompare(s.deptCd)),r=new Map;t.forEach(a=>r.set(a.deptCd,{...a,children:[]}));const n=[];t.forEach(a=>{const s=r.get(a.deptCd),l=a.hrnkDeptCd;l&&r.has(l)?r.get(l).children.push(s):n.push(s)});const i=a=>{!a.children||a.children.length===0?delete a.children:a.children.forEach(i)};return n.forEach(i),n},ZP=({popup:e,onClose:t})=>{const[r,n]=m.useState([]),[i,a]=m.useState([]),[s,l]=m.useState([]),[c,d]=m.useState(!1),[u,f]=m.useState([]),[h,g]=m.useState(null),[v,x]=m.useState(""),[y,w]=m.useState(!1),[b,j]=m.useState([]),[P,E]=m.useState(!1),C=m.useCallback(async R=>{if(R)try{const N=await se.callService("SCMUTIL00106",{deptCds:R},{showLoading:!1}),I=Array.isArray(N?.empList)&&N.empList||[];f(I)}catch(N){console.error("직원 목록 로딩 실패:",N),p.message.error("직원 목록을 불러오는 중 오류가 발생했습니다.")}},[]),O=m.useCallback(async(R,N)=>{try{const I={keyword:R,deptCds:N},M=await se.callService("SCMUTIL00106",I,{showLoading:!1});f(M?.empList||[]),M?.empCnt===0?E(!0):E(!1)}catch(I){console.error("검색 실패:",I),p.message.error("검색 중 오류가 발생했습니다."),f([]),E(!1)}},[]),k=m.useCallback(async()=>{d(!0);try{const R=await se.callService("SCMUTIL00103",{...e?.popupParams},{showLoading:!1}),N=Array.isArray(R?.deptList)&&R.deptList||[];if(N.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const I=FW(N);l(I);const M=N.filter($=>Number($.deptLvl)<=2).map($=>String($.deptCd));if(n(M),e?.popupParams?.keyword){const $=e.popupParams.keyword;await O($,[]);return}const W=I[1];W&&C&&(a([W.deptCd]),C([W.deptCd]))}catch(R){console.error("부서 목록 로딩 실패:",R),p.message.error("부서 목록을 불러오는 중 오류가 발생했습니다.")}finally{d(!1)}},[C]);m.useEffect(()=>{k()},[k]);const T=m.useMemo(()=>{const R=N=>N.map(I=>({title:o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{marginRight:4},children:[I.deptNm," "]}),o.jsx(p.Tag,{color:"default",icon:o.jsx(Y.UserOutlined,{}),style:{borderRadius:"7px",fontSize:"11px"},children:I.empCnt},I.deptCd)]}),key:I.deptCd,children:I.children?R(I.children):void 0,isLeaf:!I.children||I.children.length===0}));return R(s)},[s]),D=m.useCallback(R=>{h&&h.empNo===R.empNo?g(null):g(R)},[]),L=m.useCallback(R=>{const N=R.map(String);a(N);const I=(W,$)=>{for(const H of W){if(H.deptCd===$)return{deptCd:H.deptCd,deptNm:H.deptNm};if(H.children){const X=I(H.children,$);if(X)return X}}return null};if(!N[0])return;const M=I(s,N[0]);if(M){if(y){if(b.some($=>$.deptCd===M.deptCd))return;if(b.length>=5){p.message.warning("부서는 최대 5개까지 선택할 수 있습니다.");return}j($=>[...$,M])}else j([M]);x(""),C([M.deptCd])}},[s,C,y,b]),A=m.useCallback(R=>{n(R.map(String))},[]),B=m.useCallback(async R=>{const N=R.trim(),I=y&&b.length>0?b.map(M=>M.deptCd):[];await O(N,I)},[O,y,b]),z=m.useCallback(R=>{j(N=>N.filter(I=>I.deptCd!==R))},[]),F={confirm:()=>{if(h){const R=e?.config;R?.onSelect?R.onSelect(h):e?.popupParams?.onSelect?e.popupParams.onSelect(h):e?.config?.callback&&e.config.callback(JSON.stringify(h,null,2)),R?.onClose&&R.onClose(),e?.close?.()}else p.message.error("사원을 선택해주세요.")},cancel:()=>{const R=e?.config;R?.onCancel&&R.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{F.confirm()}}],onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"20%",max:"80%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:"8px"},children:o.jsxs(p.Flex,{gap:12,vertical:!0,children:[o.jsx(Le,{title:"조직도",marginBottom:0}),o.jsx(p.Input.Search,{placeholder:"이름, 소속, 전화번호 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:v,allowClear:!0,enterButton:o.jsx(p.Button,{children:"검색"}),onChange:R=>{x(R.target.value),j([]),g(null),f([]),E(!1),!R.target.value.trim()&&i.length>0&&C([i[0]])},onSearch:B}),o.jsx(p.Flex,{gap:8,align:"center",style:{marginLeft:6},children:o.jsxs(Oh,{children:[o.jsx(p.Switch,{checked:y,onChange:R=>{w(R),R||j([])}}),o.jsx("span",{style:{fontSize:"14px"},children:"부서 안에서 검색하기"})]})}),y&&o.jsx(p.Flex,{gap:4,wrap:"wrap",style:{margin:4},children:b.length>0?o.jsx(o.Fragment,{children:b.slice(0,5).map(R=>o.jsx(p.Tag,{closable:!0,onClose:()=>z(R.deptCd),children:R.deptNm},R.deptCd))}):o.jsx("span",{style:{fontSize:"12px",color:"#999"},children:"트리에서 부서를 선택하면 조건에 추가됩니다."})})]})}),o.jsx("div",{style:{padding:"16px",overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:c,children:o.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:T,expandedKeys:r,selectedKeys:i,onSelect:L,onExpand:A,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:R=>o.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontWeight:i.includes(R.key)?"bold":"normal",display:"inline-block",width:"100%"},children:R.title})})})})]}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:"16px",overflowY:"hidden"},children:[o.jsx("div",{style:{marginBottom:"16px"},children:o.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px",fontWeight:"bold"},children:v?"검색 결과":b[0]?.deptNm})}),o.jsxs("div",{style:{overflow:"hidden",height:"100%"},children:[u.map(R=>o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"12px",border:"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:h&&h.crprCd===R.crprCd&&h.wkplCd===R.wkplCd&&h.empNo===R.empNo?"#efebff":"white"},onClick:()=>D(R),children:[o.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px"},onClick:N=>{N.stopPropagation(),D(R)},children:h&&h.crprCd===R.crprCd&&h.wkplCd===R.wkplCd&&h.empNo===R.empNo?o.jsx(Y.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):o.jsx(Y.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),o.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"12px",fontSize:"18px",color:"#666"},children:o.jsx(Y.UserOutlined,{})}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px"},children:R.empNm}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"2px"},children:[R.deptNm," (",R.deptCd,") | 직급:"," ",R.jbpsCd," | 등급: ",R.jbgdCd]})]})]},`emp-${R.crprCd}-${R.wkplCd}-${R.empNo}-${R.jbpsCd}-${R.jbgdCd}-${R.empMarkOrd}`)),u.length===0&&o.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:b.length>0?"해당 부서에 직원이 없습니다.":v&&P?"검색 결과가 없습니다.":v&&!P?"검색 버튼을 누르거나 엔터키를 눌러 검색해주세요.":"검색어를 입력하거나 부서를 눌러 직원을 조회해주세요."})]})]})})]})})})})},VW=Object.freeze(Object.defineProperty({__proto__:null,default:ZP},Symbol.toStringTag,{value:"Module"})),HW=e=>{const t=[...e].sort((a,s)=>a.deptLvl-s.deptLvl||a.orgSortOrd-s.orgSortOrd||a.deptCd.localeCompare(s.deptCd)),r=new Map;t.forEach(a=>r.set(a.deptCd,{...a,children:[]}));const n=[];t.forEach(a=>{const s=r.get(a.deptCd),l=a.hrnkDeptCd;l&&r.has(l)?r.get(l).children.push(s):n.push(s)});const i=a=>{!a.children||a.children.length===0?delete a.children:a.children.forEach(i)};return n.forEach(i),n},QP=({popup:e,onClose:t})=>{const[r,n]=m.useState(""),[i,a]=m.useState(""),[s,l]=m.useState([]),[c,d]=m.useState([]),[u,f]=m.useState([]),[h,g]=m.useState([]),[v,x]=m.useState(!1),[y,w]=m.useState(!1),[b,j]=m.useState({}),P=m.useCallback(async M=>{if(M)try{const W=await se.callService("SCMUTIL00106",{deptCds:M},{showLoading:!1}),$=Array.isArray(W?.empList)&&W.empList||[];g($)}catch(W){console.error("직원 목록 로딩 실패:",W),p.message.error("직원 목록을 불러오는 중 오류가 발생했습니다.")}},[]),E=m.useCallback(async(M,W)=>{try{const $={keyword:M,deptCds:W},H=await se.callService("SCMUTIL00106",$,{showLoading:!1});g(H?.empList||[]),H?.empCnt===0?w(!0):w(!1)}catch($){console.error("검색 실패:",$),p.message.error("검색 중 오류가 발생했습니다."),g([]),w(!1)}},[]),C=m.useCallback(async()=>{try{x(!0);const M=await se.callService("SCMUTIL00105",{...e?.popupParams}),W=Array.isArray(M?.data)?M.data:Array.isArray(M?.orgnList)?M.orgnList:Array.isArray(M)?M:[];if(W.length===0){console.warn("⚠️ 조직도 데이터가 없습니다.");return}const $=HW(W);f($);const H=W.filter(X=>X.deptLvl<=2).map(X=>X.deptCd);if(l(H),$.length>0){const X=$[0];d([X.deptCd]),a(X.deptNm),P([X.deptCd])}}catch(M){console.error("❌ 조직도 데이터 로딩 실패:",M),p.message.error("조직도 데이터를 불러오는 중 오류가 발생했습니다.")}finally{x(!1)}},[e?.popupParams,P]);m.useEffect(()=>{C()},[C]);const O=m.useMemo(()=>{const M=W=>W.map($=>({title:$.deptNm,key:$.deptCd,children:$.children?M($.children):void 0,isLeaf:!$.children||$.children.length===0}));return M(u)},[u]),k=m.useCallback(async M=>{const W=M.trim();n(W),W?await E(W,[]):c.length>0&&P([c[0]])},[E,P,c]),T=m.useMemo(()=>h,[h]),D=m.useCallback(M=>{j(W=>{const $={...W};return $[M.empNo]?delete $[M.empNo]:$[M.empNo]=M,$})},[]),L=m.useCallback(M=>{j(W=>{const $={...W};return delete $[M],$})},[]),A=m.useCallback(()=>j({}),[]),B=m.useCallback(()=>{j(M=>{const W={...M};for(const $ of T)W[$.empNo]=$;return W})},[T]),z=m.useCallback(()=>{j(M=>{const W={...M};for(const $ of T)delete W[$.empNo];return W})},[T]),F=m.useCallback(M=>{const W=M.map(String);if(d(W),n(""),W.length>0){const $=W[0],H=(ue,fe)=>{for(const me of ue){if(me.deptCd===fe)return me.deptNm;if(me.children){const Pe=H(me.children,fe);if(Pe)return Pe}}return null},X=H(u,$);X&&a(X),n(""),P([$])}},[u,P]),R=m.useCallback(M=>{l(M.map(String))},[]),N=m.useCallback((M,W)=>{if(M.stopPropagation(),!W.children||!W.children.length)return;const $=s.includes(W.key);l(H=>$?H.filter(X=>X!==W.key):[...H,W.key])},[s]),I={confirm:()=>{const M=Object.values(b).map($=>({crprCd:$.crprCd,wkplCd:$.wkplCd,empNo:$.empNo,deptCd:$.deptCd,deptNm:$.deptNm,empNm:$.empNm,jbpsCd:$.jbpsCd,jbgdCd:$.jbgdCd,empMarkOrd:$.empMarkOrd,emplyStCd:$.emplyStCd}));if(M.length===0){p.message.error("직원을 선택해주세요.");return}const W=e?.config;W?.onSelect?W.onSelect(M):e?.config?.callback&&e.config.callback(JSON.stringify(M)),W?.onClose&&W.onClose(),e?.close?.()},cancel:()=>{const M=e?.config;M?.onCancel&&M.onCancel(),e?.close?.()}};return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{I.confirm()}}],onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsx(Ie,{border:!1,style:{paddingBottom:20},children:o.jsxs(p.Splitter,{style:{height:"100%"},children:[o.jsx(p.Splitter.Panel,{defaultSize:"50%",min:"50%",max:"70%",children:o.jsxs(p.Splitter,{layout:"vertical",style:{height:"100%"},children:[o.jsxs(p.Splitter.Panel,{defaultSize:"60%",min:"35%",max:"75%",children:[o.jsx("div",{style:{position:"sticky",top:0,zIndex:10,backgroundColor:"white",borderBottom:"1px solid #e0e0e0",padding:8},children:o.jsxs(p.Flex,{gap:8,vertical:!0,style:{marginBottom:6},children:[o.jsx(Le,{title:"조직도"}),o.jsx(p.Input.Search,{placeholder:"이름, 소속, 직급/직위, 전화번호 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,enterButton:o.jsx(p.Button,{children:"검색"}),onChange:M=>{n(M.target.value),w(!1),g([]),!M.target.value.trim()&&c.length>0&&P([c[0]])},onSearch:k})]})}),o.jsx("div",{style:{padding:16,overflowY:"hidden"},children:o.jsx(p.Spin,{spinning:v,children:o.jsx(p.Tree,{className:"bwg-ogrn-tree",treeData:O,expandedKeys:s,selectedKeys:c,onSelect:F,onExpand:R,onDoubleClick:N,showLine:!0,showIcon:!1,style:{overflow:"hidden"},titleRender:M=>o.jsx("span",{style:{padding:"4px 8px",borderRadius:4,fontWeight:c.includes(M.key)?"bold":"normal",display:"inline-block",width:"100%"},children:M.title})})})})]}),o.jsx(p.Splitter.Panel,{children:o.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("h3",{style:{margin:0,fontSize:16,fontWeight:700},children:r?"검색 결과":`${i} 사용자`}),o.jsxs("div",{style:{display:"flex",gap:8},children:[o.jsx(p.Button,{size:"small",onClick:B,children:"현재 목록 전체 선택"}),o.jsx(p.Button,{size:"small",onClick:z,children:"현재 목록 전체 해제"})]})]}),o.jsx(p.Divider,{style:{margin:"8px 0"}}),o.jsxs("div",{style:{overflowY:"auto"},children:[T.map(M=>{const W=!!b[M.empNo];return o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,cursor:"pointer",background:W?"#efebff":"#fff"},onClick:()=>D(M),children:[o.jsx("div",{style:{marginRight:12,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center"},onClick:$=>{$.stopPropagation(),D(M)},children:W?o.jsx(Y.CheckCircleFilled,{style:{fontSize:20,color:"#6449fc"}}):o.jsx(Y.CheckCircleOutlined,{style:{fontSize:20,color:"#d9d9d9"}})}),o.jsx("div",{style:{width:36,height:36,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:12,fontSize:16,color:"#666",flex:"0 0 auto"},children:o.jsx(Y.UserOutlined,{})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:600,marginBottom:2},children:M.empNm}),o.jsxs("div",{style:{fontSize:12,color:"#666"},children:[M.deptNm," (",M.deptCd,") | 직급: ",M.jbpsCd," ","| 등급: ",M.jbgdCd]})]})]},`emp-${M.crprCd}-${M.wkplCd}-${M.empNo}-${M.jbpsCd}-${M.jbgdCd}-${M.empMarkOrd}`)}),T.length===0&&o.jsx("div",{style:{textAlign:"center",padding:32,color:"#999",fontSize:14},children:!r&&c.length>0?"해당 부서에 직원이 없습니다.":r&&y?"검색 결과가 없습니다.":r&&!y?"검색 버튼을 누르거나 엔터키를 눌러 검색해주세요.":"검색어를 입력하거나 부서를 눌러 직원을 조회해주세요."})]})]})})]})}),o.jsx(p.Splitter.Panel,{collapsible:!0,children:o.jsxs("div",{style:{padding:16,height:"100%",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx(Le,{title:`선택된 사용자 (${Object.keys(b).length})`}),o.jsx(p.Button,{type:"link",size:"small",onClick:A,children:"전체 해제"})]}),o.jsx(p.Divider,{style:{margin:"8px 0"}}),o.jsxs("div",{style:{overflowY:"auto",flex:1},children:[Object.values(b).map(M=>o.jsxs("div",{style:{display:"flex",alignItems:"center",padding:10,border:"1px solid #e0e0e0",borderRadius:8,marginBottom:8,background:"#fafafa"},children:[o.jsx("div",{style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#e0e0e0",display:"flex",alignItems:"center",justifyContent:"center",marginRight:10,color:"#666"},children:o.jsx(Y.UserOutlined,{})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{fontSize:13,fontWeight:600,marginBottom:2},children:M.empNm}),o.jsxs("div",{style:{fontSize:12,color:"#666"},children:[M.deptNm," (",M.deptCd,") | 직급: ",M.jbpsCd," | 등급: ",M.jbgdCd]})]}),o.jsx(p.Button,{type:"text",shape:"circle",icon:o.jsx(Y.CloseOutlined,{}),onClick:()=>L(M.empNo)})]},`selected-${M.crprCd}-${M.wkplCd}-${M.empNo}-${M.jbpsCd}-${M.jbgdCd}-${M.empMarkOrd}`)),Object.keys(b).length===0&&o.jsx("div",{style:{color:"#999",fontSize:14,textAlign:"center",padding:24},children:"선택된 사용자가 없습니다."})]})]})})]})})})})},UW=Object.freeze(Object.defineProperty({__proto__:null,default:QP},Symbol.toStringTag,{value:"Module"})),{Text:W1,Title:WW}=p.Typography,JP=({popup:e})=>{const[t,r]=m.useState(xl()),[n,i]=m.useState(xl()),[a,s]=m.useState([]),[l,c]=m.useState([]),[d,u]=m.useState("month");tt.useCodeStore();const{token:f}=p.theme.useToken(),h=(w,b,j=d)=>{const P=b.filter(E=>{if(j==="year"){const C=E.stndYmd.substring(0,6),O=w.format("YYYYMM");return C===O}else{const C=w.format("YYYYMMDD");return E.stndYmd===C}});s(P)},g=w=>{r(w),h(w,l,d)},v=(w,b)=>{i(w),u(b),y.SCMHLDY00101(b,w)};m.useEffect(()=>{y.SCMHLDY00101()},[]);const x=w=>{const b=l.filter(j=>{if(d==="year"){const P=j.stndYmd.substring(0,6),E=w.format("YYYYMM");return P===E}else{const P=w.format("YYYYMMDD");return j.stndYmd===P}});return b.length>0?o.jsx("div",{style:{position:"absolute",bottom:"1px",left:"1px",right:"1px",height:"3px",display:"flex",gap:"1px"},children:b.map((j,P)=>o.jsx("div",{style:{flex:1,height:"3px",background:j.hldyYn==="Y"?f.colorError:f.colorSuccess,borderRadius:"1px"}},P))}):null},y={SCMHLDY00101:async(w=d,b=t)=>{try{let j;w==="year"?j=b.format("YYYY"):j=b.format("YYYYMM");const P=await se.callService("SCMHLDY00101",{crprCd:se.getUserInfo()?.crprCd||"",sysCd:__SYS_CD__,stndYmd:j});c(P.sub||[]),h(b,P.sub||[],w)}catch(j){console.error("휴일 데이터 로드 실패:",j),p.message.error("휴일 데이터를 불러오는데 실패했습니다.")}}};return o.jsx(fi,{popup:e,children:o.jsx(ze,{children:o.jsx(Ie,{children:o.jsxs(p.Row,{gutter:f.padding,style:{marginTop:f.padding},children:[o.jsx(p.Col,{span:12,children:o.jsx(p.Card,{title:o.jsxs(p.Space,{children:[o.jsx(Y.CalendarOutlined,{}),o.jsx("span",{children:"휴일 달력"})]}),style:{height:"500px"},children:o.jsx(p.Calendar,{fullscreen:!1,value:t,onSelect:g,onPanelChange:v,cellRender:x,style:{height:"400px"},mode:d})})}),o.jsx(p.Col,{span:12,children:o.jsx(p.Card,{title:o.jsxs(p.Space,{children:[o.jsx(Y.CalendarOutlined,{}),o.jsx("span",{children:d==="year"?`${t.format("YYYY년 MM월")} 휴일 목록`:`${t.format("YYYY년 MM월 DD일")} 휴일 목록`})]}),style:{height:"500px"},children:o.jsx("div",{style:{height:"400px",overflowY:"auto"},children:a.length>0?o.jsx(p.Space,{direction:"vertical",style:{width:"100%"},size:"small",children:a.map((w,b)=>o.jsx(p.Card,{size:"small",style:{border:`${f.lineWidth}px solid ${f.colorBorder}`,borderRadius:f.borderRadiusLG},children:o.jsxs("div",{style:{padding:`${f.paddingXS}px 0`},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:f.paddingXS},children:[o.jsx(WW,{level:5,style:{margin:0,color:f.colorPrimary},children:w.hldyDscr||"휴일명 미입력"}),w.hldyYn==="Y"&&o.jsx(p.Tag,{color:f.colorSuccess,children:"휴일"})]}),o.jsx("div",{style:{marginBottom:f.paddingXXS},children:o.jsx(W1,{type:"secondary",style:{fontSize:f.fontSizeSM},children:xl(w.stndYmd).format("YYYY년 MM월 DD일 dddd")})}),w.hldyDscr&&o.jsx("div",{children:o.jsx(W1,{style:{fontSize:f.fontSizeSM+1},children:w.hldyDscr})})]})},b))}):o.jsx(p.Empty,{description:"선택된 날짜에 등록된 휴일이 없습니다.",style:{marginTop:"100px"}})})})})]})})})})},KW=Object.freeze(Object.defineProperty({__proto__:null,default:JP},Symbol.toStringTag,{value:"Module"})),eO=({popup:e})=>{const t=m.useRef(null),[r,n]=m.useState(""),{menuList:i}=tt.useMenuModelStore(),[a,s]=m.useState(void 0),[l,c]=m.useState(null),d=m.useCallback(b=>{const j=[],P=E=>{E.forEach(C=>{C.children&&C.children.length>0&&(j.push(C.menuId),P(C.children))})};return P(b),j},[]),[u,f]=m.useState(()=>d([])),h=m.useCallback((b,j,P)=>{const E=(j||"").trim().toLowerCase(),C=k=>{const T=!E||k.menuNm?.toLowerCase().includes(E)||k.menuId?.toLowerCase().includes(E),D=!P||k.sysCd===P;return T&&D},O=k=>k.map(T=>{const D=T.children?O(T.children):[];return C(T)||D.length>0?{...T,children:D}:null}).filter(Boolean);return O(b||[])},[]),g=m.useMemo(()=>h(i,r,a),[i,r,a,h]),v=m.useCallback(b=>b.map(j=>({key:j.menuId,label:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(!j.children||j.children.length===0)&&o.jsx(p.Tag,{color:"blue",style:{margin:0},children:j.menuId}),o.jsx("span",{children:j.menuNm})]}),children:j.children&&j.children.length>0?v(j.children):void 0,icon:x(j.iconCd,j.menuGbCd)})),[]),x=(b,j)=>{if(b){const P=Ti[b];if(P)return o.jsx(P,{})}if(j)switch(j){case"CMPRGRM":return o.jsx(Ti.HomeOutlined,{});case"CMPRGRS":return null;case"CMPRGRP":return null;default:return null}return null},y=m.useCallback((b,j)=>{for(const P of b){if(P.menuId===j)return P;if(P.children&&P.children.length>0){const E=y(P.children,j);if(E)return E}}return null},[]);m.useEffect(()=>{r&&f(d(g))},[r,g,d]);const w=[{id:"confirm",label:"확인",onClick:()=>{if(!l)return;const b=y(g,l);b&&(e?.config?.callback?.({menuId:b.menuId,menuNm:b.menuNm}),e?.close?.())}}];return o.jsx(fi,{popup:e,buttons:w,children:o.jsx(ze,{children:o.jsxs(Ie,{border:!1,children:[o.jsx(ko,{ref:t,reqRows:o.jsx(o.Fragment,{children:o.jsxs(wt,{gutter:[12,8],style:{marginBottom:"8px"},children:[o.jsx($e,{span:8,children:o.jsx(_.BwgSelect,{itemProps:{name:"sysCd",label:"시스템 코드"},selectProps:{options:[{label:"공통",value:"CM"},{label:"K-ERP",value:"KE"},{label:"K-HR",value:"HR"},{label:"K-업무지원",value:"KS"}],onChange:b=>s(b),placeholder:"전체"}})}),o.jsx($e,{span:8,children:o.jsx(p.Input,{placeholder:"메뉴 이름, ID 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:r,allowClear:!0,onChange:b=>{n(b.target.value)}})})]})})}),o.jsx(p.Menu,{mode:"inline",theme:"light",items:v(g),openKeys:u,onOpenChange:f,onClick:({key:b})=>{c(String(b))},style:{overflow:"auto"}})]})})})},qW=Object.freeze(Object.defineProperty({__proto__:null,default:eO},Symbol.toStringTag,{value:"Module"})),YW=[{label:"정확도 우선",value:"none"},{label:"도로명 포함",value:"road"},{label:"지번 포함",value:"location"}],GW=["SELECT","INSERT","UPDATE","DELETE","DROP","CREATE","ALTER","TRUNCATE","EXEC","EXECUTE","UNION","OR","AND","WHERE","FROM","JOIN","INNER","OUTER","LEFT","RIGHT","FULL","ON","AS","IS","NULL","NOT","IN","LIKE","BETWEEN","EXISTS","HAVING","GROUP","BY","ORDER","ASC","DESC","DISTINCT","TOP","LIMIT","OFFSET","CASE","WHEN","THEN","ELSE","END","IF","WHILE","FOR","DECLARE","SET","BEGIN","COMMIT","ROLLBACK","TRANSACTION","GRANT","REVOKE","DENY","TABLE","VIEW","INDEX","PROCEDURE","FUNCTION","TRIGGER","DATABASE","SCHEMA","USER","ROLE","BACKUP","RESTORE"],tO=({popup:e,onClose:t})=>{const r=m.useRef(null),n=m.useRef(null),[i,a]=m.useState(""),[s,l]=m.useState([]),[c,d]=m.useState(null),[u,f]=m.useState(!1),[h,g]=m.useState(0),[v,x]=m.useState("none"),[y,w]=m.useState(!1),b=m.useMemo(()=>o.jsxs("div",{style:{maxWidth:"400px"},children:[o.jsx(p.Typography.Title,{level:5,style:{marginTop:0,marginBottom:12},children:"검색 가이드"}),o.jsxs(p.Space,{direction:"vertical",size:"small",style:{width:"100%"},children:[o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 검색 방법"}),o.jsx("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:"도로명, 지번, 건물명, 우편번호로 검색할 수 있습니다."})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 검색 예시"}),o.jsxs("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:['- 도로명: "논현로", "강남대로"',o.jsx("br",{}),'- 지번: "논현동 234", "역삼동 123"',o.jsx("br",{}),'- 건물명: "태성빌딩", "강남역"',o.jsx("br",{}),'- 우편번호: "06234", "12345"']})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 정렬 옵션"}),o.jsxs("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:["- 정확도 우선: 검색어와 가장 유사한 결과 우선",o.jsx("br",{}),"- 도로명 포함: 도로명 주소를 포함한 결과 우선",o.jsx("br",{}),"- 지번 포함: 지번 주소를 포함한 결과 우선"]})]}),o.jsxs("div",{children:[o.jsx(p.Typography.Text,{strong:!0,children:"• 검색 팁"}),o.jsxs("div",{style:{marginTop:4,fontSize:"12px",color:"#666"},children:["- 검색어는 최소 2글자 이상 입력해주세요.",o.jsx("br",{}),"- 공백은 자동으로 제거됩니다.",o.jsx("br",{}),"- 검색 결과를 클릭하여 주소를 선택하세요.",o.jsx("br",{}),"- 검색하기 위해 검색 버튼이나 엔터키를 눌러주세요."]})]})]})]}),[]),j=m.useMemo(()=>o.jsxs("div",{style:{maxWidth:"420px",maxHeight:"600px",overflowY:"auto"},children:[o.jsx(p.Typography.Title,{level:5,style:{marginTop:0,marginBottom:12},children:"에러 메시지 안내"}),o.jsxs(p.Space,{direction:"vertical",size:"small",style:{width:"100%"},children:[o.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:[o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0005"}),": 검색어가 입력되지 않았습니다."]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0006"}),": 주소를 상세히 입력해 주시기 바랍니다.",o.jsx("div",{style:{marginLeft:40,fontSize:"11px",color:"#999"},children:"(예시: 여의나루로 76, 문현금융로 40)"})]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0008"}),": 검색어는 한글자 이상 입력되어야 합니다."]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0009"}),": 검색어는 문자와 숫자 같이 입력되어야 합니다. (숫자만 검색 불가)"]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0010"}),": 검색어가 너무 깁니다. (한글40자, 영문,숫자 80자 이하)"]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0011"}),": 검색어에 너무 긴 숫자가 포함되어 있습니다. (숫자10자 이하)"]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0012"}),": 특수문자+숫자만으로는 검색이 불가능 합니다."]}),o.jsxs("div",{style:{marginBottom:6},children:[o.jsx(p.Typography.Text,{type:"danger",style:{fontSize:"12px"},children:"E0013"}),": SQL 예약어 또는 특수문자( %,=,",">",",","<",",[,] )는 검색이 불가능 합니다."]})]}),o.jsxs("div",{style:{marginTop:12,paddingTop:8,borderTop:"1px solid #f0f0f0"},children:[o.jsx(p.Typography.Text,{type:"warning",style:{fontSize:"12px",fontWeight:"bold"},children:"관리자 문의 바랍니다"}),o.jsxs("div",{style:{marginTop:6,fontSize:"11px",color:"#999"},children:["-999: 시스템에러",o.jsx("br",{}),"E0001: 승인되지 않은 KEY 입니다.",o.jsx("br",{}),"E0002: 승인되지 않은 사이트 입니다.",o.jsx("br",{}),"E0003: 정상적인 경로로 접속하시기 바랍니다.",o.jsx("br",{}),"E0014: 개발승인키 기간이 만료되어 서비스를 이용하실 수 없습니다."]})]})]})]}),[]);m.useEffect(()=>{(async()=>{try{const T=await se.callService("SCMUTIL00202",{},{showLoading:!1});w(T?.result===1)}catch{w(!1)}})()},[]);const P=m.useCallback(async(k,T)=>{if(i.trim().length<2){p.message.warning("검색어는 2글자 이상 입력해주세요.");return}const D=i.replace(/(시|도|구|군)(?=[가-힣0-9])/g,"$1 ").replace(/\s+/g," ").trim(),L=D.split(/\s+/).filter(R=>R.length>0);if(L.length===1&&/[시도구군]$/.test(L[0])){p.message.warning("주소를 상세히 입력해 주시기 바랍니다.");return}const B=/[가-힣]/.test(D)?40:80,z=/^\d+$/.test(D);if(D.length>B){p.message.warning("검색어가 너무 깁니다. (한글 40자, 영문/숫자 80자 이하)");return}if(/\d{11,}/.test(D)){p.message.warning("검색어에 너무 긴 숫자가 포함되어 있습니다. (숫자 10자 이하)");return}if(z&&D.length!==5||/^[0-9\W_]+$/.test(D)&&/\d/.test(D)&&!/[A-Za-z가-힣]/.test(D)&&!z){p.message.warning("특수문자+숫자만으로는 검색이 불가능 합니다.");return}if(GW.some(R=>new RegExp(`\\b${R}\\b`,"i").test(D))||/[[\]%=><]/.test(D)){p.message.warning("SQL 예약어 또는 특수문자( %,=,>,<,[,] )는 검색이 불가능 합니다.");return}f(!0);try{const R=k||r.current?.currentPage||1,N=T||r.current?.pageSize||10,I={keyword:D,currentPage:R,countPerPage:N,firstSort:v,...e?.popupParams},M=await se.callService("SCMUTIL00201",I,{showLoading:!1});if(M.errorCode!=="0"){p.message.error(M.errorCode+" : "+M.errorMessage);return}const W=M?.pageList&&Array.isArray(M.pageList)&&M.pageList||[],$=M?.pageCnt||0;l(W),g($),r.current?.setTotalData($),setTimeout(()=>{n.current&&(n.current.scrollTop=0)},0),(W.length===0||$===0)&&p.message.info("검색 결과가 없습니다.")}catch(R){console.error("주소 검색 실패:",R),p.message.error("주소 검색 중 오류가 발생했습니다."),l([]),g(0),r.current?.setTotalData(0)}finally{f(!1)}},[i,v,e?.popupParams]),E=m.useCallback(()=>{r.current?r.current.setPage(1):P(1,10)},[P]),C=m.useCallback(k=>{c&&c.bdMgtSn===k.bdMgtSn?d(null):d(k)},[c]),O=m.useMemo(()=>({confirm:()=>{if(!c){p.message.error("주소를 선택해주세요.");return}const k={...c},T=e?.config;T?.onSelect?T.onSelect(k):e?.popupParams?.onSelect?e.popupParams.onSelect(k):e?.config?.callback&&e.config.callback(k),T?.onClose&&T.onClose(),e?.close?.()}}),[c,e]);return o.jsx(fi,{popup:e,buttons:[{id:"confirm",label:"확인",onClick:()=>{O.confirm()}}],onClose:()=>{e?.close?.(),t?.()},children:o.jsx(ze,{children:o.jsxs(Ie,{border:!1,style:{paddingBottom:10},children:[o.jsx("div",{style:{paddingInline:"16px"},children:o.jsxs(p.Flex,{gap:12,vertical:!0,style:{marginBottom:"6px"},children:[o.jsxs(p.Flex,{gap:16,align:"center",justify:"space-between",wrap:!0,style:{width:"100%"},children:[y&&o.jsx(p.Radio.Group,{value:v,onChange:k=>{x(k.target.value)},children:YW.map(k=>o.jsx(p.Radio,{value:k.value,children:k.label},k.value))}),o.jsxs(p.Flex,{gap:16,wrap:!0,align:"center",justify:"flex-end",children:[o.jsx(p.Popover,{content:b,title:null,trigger:"click",placement:"right",children:o.jsxs("span",{style:{display:"inline-flex",gap:4,alignItems:"center",color:"#1890ff",cursor:"pointer",fontSize:"13px"},children:[o.jsx(Y.QuestionCircleOutlined,{style:{fontSize:"18px"}}),"검색 가이드"]})}),o.jsx(p.Popover,{content:j,title:null,trigger:"click",placement:"right",children:o.jsxs("span",{style:{display:"inline-flex",gap:4,alignItems:"center",color:"#fa8c16",cursor:"pointer",fontSize:"13px"},children:[o.jsx(Y.QuestionCircleOutlined,{style:{fontSize:"18px"}}),"에러 메시지 안내"]})})]})]}),o.jsx(p.Input.Search,{placeholder:"도로명, 지번, 건물명, 우편번호로 검색",prefix:o.jsx(Y.SearchOutlined,{}),value:i,allowClear:!0,enterButton:"검색",onChange:k=>{a(k.target.value)},onSearch:E,style:{flex:1}})]})}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minHeight:0},children:[s.length>0&&o.jsx("div",{style:{padding:"16px 16px 12px 16px"},children:o.jsxs("h3",{style:{fontSize:"16px",fontWeight:"bold"},children:["검색 결과 (",h,"개)"]})}),o.jsx("div",{ref:n,style:{paddingInline:"15px",overflowY:"auto",flex:1},children:o.jsx(p.Spin,{spinning:u,children:s.length>0?o.jsx("div",{children:s.map((k,T)=>{const D=c?.bdMgtSn===k.bdMgtSn;return o.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"12px",border:D?"2px solid #6449fc":"1px solid #e0e0e0",borderRadius:"8px",marginBottom:"8px",cursor:"pointer",backgroundColor:D?"#efebff":"white",transition:"all 0.2s ease"},onClick:()=>C(k),children:[o.jsx("div",{style:{marginRight:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginTop:"2px"},onClick:L=>{L.stopPropagation(),C(k)},children:D?o.jsx(Y.CheckCircleFilled,{style:{fontSize:"20px",color:"#6449fc"}}):o.jsx(Y.CheckCircleOutlined,{style:{fontSize:"20px",color:"#d9d9d9"}})}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginBottom:"4px"},children:["[",k.zipNo,"]"]}),o.jsx("div",{style:{fontSize:"14px",fontWeight:"bold",marginBottom:"4px",lineHeight:"1.4",color:"#333"},children:k.roadAddr}),k.detBdNmList&&o.jsx("div",{style:{fontSize:"12px",color:"#666",marginBottom:"4px"},children:k.detBdNmList}),o.jsx("div",{style:{fontSize:"12px",color:"#999",lineHeight:"1.3"},children:k.jibunAddr})]})]},`addr-${k.bdMgtSn}-${T}`)})}):o.jsx("div",{style:{textAlign:"center",padding:"40px",color:"#999",fontSize:"14px"},children:i?"검색 버튼이나 엔터키를 눌러 검색해주세요.":"주소를 검색해주세요."})})}),o.jsx(To,{ref:r,mode:"server",onServerPageChange:(k,T)=>{P(k,T)},pageSizeOptions:[10,20,50]})]})]})})})},XW=Object.freeze(Object.defineProperty({__proto__:null,default:tO},Symbol.toStringTag,{value:"Module"}));exports.ButtonAccessController=qf;exports.BwgButtonGroup=Yf;exports.BwgCmptArea=lO;exports.BwgCol=$e;exports.BwgComponentGuideM01=TN;exports.BwgConfigProvider=Oh;exports.BwgDetail=bO;exports.BwgDeveloperGuideM01=AN;exports.BwgDrawer=dn;exports.BwgEditor=kh;exports.BwgGrid=Ve;exports.BwgInfoArea=fn;exports.BwgPagination=To;exports.BwgPopup=fi;exports.BwgReactGuideM01=BN;exports.BwgRow=wt;exports.BwgSpace=Oc;exports.BwgTable=NO;exports.BwgTabs=ar;exports.BwgTitleBox=Le;exports.BwgView=kt;exports.CMAdminBoardM01=MW;exports.CMAuthMstrM01=jN;exports.CMBoardCommentS01=Km;exports.CMFileMstrM01=$N;exports.CMHldyCfg=KN;exports.CMMenuMstrM01=zN;exports.CMMenuPrgrSelectModal=sS;exports.CMMenuPrntSelectModal=lS;exports.CMMyBoardM01=AW;exports.CMPopuMstrM01=FN;exports.CMPrgrMstrM01=WN;exports.CMPrgrMstrP02=eO;exports.CMPrgrMstrP02$1=qW;exports.CMRoleMstrM01=EN;exports.CMSystCfgM01=qN;exports.CMSystCodeM01=YN;exports.CMUserMstrM01=PW;exports.ContentBox=Ie;exports.ContentLayOut=ze;exports.GlobalConfigProvider=yN;exports.QuickServiceToggle=CN;exports.SSOHandler=SN;exports.SearchAddressP01=tO;exports.SearchAddressP01$1=XW;exports.SearchBox=ko;exports.SearchDepartmentP01=GP;exports.SearchDepartmentP01$1=_W;exports.SearchDepartmentP02=XP;exports.SearchDepartmentP02$1=zW;exports.SearchHolidayP01=JP;exports.SearchHolidayP01$1=KW;exports.SearchOrganizationP01=ZP;exports.SearchOrganizationP01$1=VW;exports.SearchOrganizationP02=QP;exports.SearchOrganizationP02$1=UW;exports.SystemCodeManage=EW;exports.commonjsGlobal=aO;exports.getAugmentedNamespace=sO;exports.getDefaultExportFromCjs=wr;