관리자 환경설정이 값을 저장은 하지만 실제 동작에는 닿지 않던 결함군을 정리했다. 설정 화면(min/max)·저장 검증(FormRequest)·런타임 적용(Service) 세 계층이 각자 리터럴을 들고 있어 서로 조용히 갈라지던 것이 공통 원인이다. 경계값 SSoT 도입: - config/core.php `settings_limits` 를 단일 출처로 두고, FormRequest 는 이 값으로 규칙을 만들고 화면은 설정 응답의 `_meta.limits` 로 같은 값을 받아 바인딩한다. - 게시판·이커머스도 각 모듈 config 의 limits 를 동일 구조로 노출한다. 적용되지 않던 정책을 실제로 적용: - 비밀번호 최소 길이·특수문자 필수(신규 지정 7개 경로. 로그인은 제외 — 정책을 올렸을 때 기존 회원이 자기 계정에 접근조차 못 하는 데드락을 막기 위함) - 계정 잠금 시간 0 = 무한대(전용 컬럼 분리. timestamp 상한과 NULL 규약 때문에 기존 컬럼 재사용이 불가능하다) + 관리자 수동 해제 경로 - 업로드 최대 크기·허용 확장자, 게시판 첨부 개수·댓글 깊이, 페이지 첨부 정책, 장바구니 수량·구매 한도, 마일리지 사용 한도, 주문 부가세 파생 결함: - 큐 Job(sync 드라이버)이 진행 중인 요청의 Request 바인딩을 덮어써, 뒤이어 실행되는 훅 리스너가 헤더를 잃고 조용히 건너뛰었다. Job 이 원 바인딩을 복원하도록 고치고, 전송 헤더가 필요한 리스너는 동기 실행으로 선언한다. - 확장 업데이트 실패 시 상태만 되돌리고 상태 캐시를 비우지 않아, 그 확장의 관리자 화면만 캐시 TTL(기본 하루) 동안 404 로 남았다. 실패 경로에도 무효화를 대칭으로 두고, 빈 목록 자체를 캐시하지 않는다. - 글 작성 시 첨부 파일이 Service 로 전달되지 않아 검증·권한은 통과하고 첨부만 사라졌다. - 환경설정 저장 실패 안내가 내부 설정 키를 그대로 노출했다(105개 항목에 라벨 부여). 재발 방지: - audit 룰 3종(레이아웃 경계 리터럴 / FormRequest 경계 불일치 / Service 재클램프) - 테스트 실행 범위 강제 훅(check-test-scope) - 트러블슈팅 사례 2건(큐 Job 요청 오염 / 확장 상태 캐시 고착) 공개 이슈: gnuboard/g7
261 lines
701 KiB
JavaScript
261 lines
701 KiB
JavaScript
var SirsoftAdminBasic=(function(R,h,v,On){"use strict";var F5=Object.defineProperty;var z5=(R,h,v)=>h in R?F5(R,h,{enumerable:!0,configurable:!0,writable:!0,value:v}):R[h]=v;var Fe=(R,h,v)=>z5(R,typeof h!="symbol"?h+"":h,v);var Ta,ur;function eb(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const P=eb(v),tb=()=>window.G7Core,oe=v.forwardRef(({children:t,variant:e="primary",size:n="md",className:r="",...s},o)=>{const i="button",a=tb()?.style?.mergeClasses?.(i,r)??`${i} ${r}`;return h.jsx("button",{ref:o,className:a,...s,children:t})});oe.displayName="Button";const Md=v.forwardRef(({accept:t,maxSize:e,onChange:n,onError:r,buttonText:s="Browse",placeholder:o="No file selected",className:i="",disabled:a,...l},c)=>{const d=v.useRef(null),u=c||d,[f,g]=v.useState(""),m={},p={};Object.entries(l).forEach(([x,E])=>{x.startsWith("data-editor-")||x==="id"||x==="onMouseMove"||x==="onMouseLeave"?m[x]=E:p[x]=E});const y=v.useCallback(()=>{!a&&u.current&&u.current.click()},[a,u]),b=v.useCallback(x=>{const E=x.target.files?.[0]||null;if(!E){g(""),n?.({target:{value:null,name:""}});return}if(e&&E.size>e*1024*1024){const k=`File size exceeds ${e}MB limit`;r?.(k),u.current&&(u.current.value=""),g("");return}g(E.name),n?.({target:{value:E,name:E.name}})},[e,n,r,u]),S=v.useCallback(x=>{x.stopPropagation(),u.current&&(u.current.value=""),g(""),n?.({target:{value:null,name:""}})},[n,u]);return h.jsxs("div",{className:`flex items-center gap-2 ${i}`,...m,children:[h.jsx("input",{ref:u,type:"file",accept:t,onChange:b,disabled:a,className:"hidden",...p}),h.jsx("button",{type:"button",onClick:y,disabled:a,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:s}),h.jsx("span",{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:f||o}),f&&!a&&h.jsx("button",{type:"button",onClick:S,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});Md.displayName="FileInput";const nb=t=>t==="checkbox"?"checkbox":t==="radio"?"radio":"input",rb=(t,e)=>{const n=nb(t);return e?e.split(/\s+/).filter(Boolean).includes(n)?e:`${n} ${e}`:n},wt=v.forwardRef(({label:t,error:e,className:n="",onChange:r,onKeyPress:s,value:o,defaultValue:i,type:a="text",checked:l,defaultChecked:c,...d},u)=>{const f=a==="radio"||a==="checkbox",g=rb(a,n),m=v.useRef(!1),p=v.useRef(null);v.useImperativeHandle(u,()=>p.current);const[y,b]=v.useState(o??i??"");v.useEffect(()=>{if(!f&&!m.current&&o!==void 0){if(p.current&&document.activeElement===p.current)return;b(o)}},[o,f]);const S=v.useCallback(()=>{m.current=!0},[]),x=v.useCallback(M=>{if(m.current=!1,r){const O=M.target.value;b(O);const L=new Event("change",{bubbles:!0});Object.defineProperty(L,"target",{writable:!1,value:{value:O}}),Object.defineProperty(L,"currentTarget",{writable:!1,value:{value:O}}),r(L)}},[r]),E=v.useCallback(M=>{const O=M.target.value;b(O),!m.current&&r&&r(M)},[r]),k=v.useCallback(M=>{m.current||s&&s(M)},[s]),{loadingactions:C,formdata:N,..._}=d;if(f)return h.jsx("input",{ref:p,type:a,className:g,onChange:r,checked:l,defaultChecked:c,value:o,..._});const w=o!==void 0?{value:y}:{defaultValue:i};return h.jsx("input",{ref:p,type:a,className:g,onChange:E,onKeyPress:k,onCompositionStart:S,onCompositionEnd:x,...w,..._})});wt.displayName="Input";const Zn=({label:t,error:e,className:n="",onChange:r,value:s,defaultValue:o,...i})=>{const a=v.useRef(!1),l=v.useRef(null),[c,d]=v.useState(s??o??"");v.useEffect(()=>{!a.current&&s!==void 0&&d(s)},[s]);const u=v.useCallback(()=>{a.current=!0},[]),f=v.useCallback(E=>{if(a.current=!1,r){const k=E.target.value;d(k);const C=new Event("change",{bubbles:!0});Object.defineProperty(C,"target",{writable:!1,value:{value:k}}),Object.defineProperty(C,"currentTarget",{writable:!1,value:{value:k}}),r(C)}},[r]),g=v.useCallback(E=>{const k=E.target.value;d(k),!a.current&&r&&r(E)},[r]),{loadingactions:m,formdata:p,...y}=i,b=s!==void 0?{value:c}:{defaultValue:o},x=(n??"").split(/\s+/).filter(Boolean).includes("textarea")?n??"":["textarea",n].filter(Boolean).join(" ");return h.jsx("textarea",{ref:l,className:x,onChange:g,onCompositionStart:u,onCompositionEnd:f,...b,...y})},rn=({children:t,className:e="",...n})=>h.jsx("label",{className:e,...n,children:t}),I=v.forwardRef(({children:t,className:e="",...n},r)=>h.jsx("div",{ref:r,className:e,...n,children:t})),Q=({children:t,className:e="",...n})=>h.jsx("span",{className:e,...n,children:t}),bt=({children:t,className:e="",...n})=>h.jsx("p",{className:e,...n,children:t}),yn=({className:t="",alt:e="",...n})=>h.jsx("img",{className:t,alt:e,...n}),Da=({children:t,className:e="",...n})=>h.jsx("h1",{className:e,...n,children:t}),Qn=({children:t,className:e="",...n})=>h.jsx("h2",{className:e,...n,children:t}),Ir=({children:t,className:e="",...n})=>h.jsx("h3",{className:e,...n,children:t}),Nd=({children:t,className:e="",...n})=>h.jsx("h4",{className:e,...n,children:t}),Ia=({children:t,className:e="",...n})=>h.jsx("ul",{className:e,...n,children:t}),sb=({children:t,className:e="",...n})=>h.jsx("ol",{className:e,...n,children:t}),La=({children:t,className:e="",...n})=>h.jsx("li",{className:e,...n,children:t}),Lr=({children:t,className:e="",...n})=>h.jsx("a",{className:e,...n,children:t}),Pa=({children:t,className:e="",...n})=>h.jsx("form",{className:e,...n,children:t}),Hn=({children:t,className:e="",...n})=>h.jsx("svg",{className:e,...n,children:t}),ob=window.G7Core?.createLogger?.("Comp:Select")??{log:(...t)=>console.log("[Comp:Select]",...t),warn:(...t)=>console.warn("[Comp:Select]",...t),error:(...t)=>console.error("[Comp:Select]",...t)};function ib(t){const e=window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[t];return e||{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[t]||t}const Pr=({children:t,label:e,error:n,options:r,className:s="",value:o,onChange:i,disabled:a,searchable:l=!1,searchPlaceholder:c,editorAttrs:d,...u})=>{const[f,g]=v.useState(!1),[m,p]=v.useState(""),[y,b]=v.useState(null),S=v.useRef(null),x=v.useRef(null),E=v.useRef(null),k=v.useRef(null),C=v.useMemo(()=>r?Array.isArray(r)?r.length===0?[]:typeof r[0]=="string"?r.map(T=>({value:T,label:ib(T)})):r:(ob.warn("options prop is not an array:",r),null):null,[r]),N=v.useMemo(()=>C&&C.find(z=>String(z.value)===String(o))?.label||"",[C,o]),_=v.useMemo(()=>{if(!C)return null;if(!l||m.trim()==="")return C;const T=m.trim().toLowerCase();return C.filter(z=>z.label.toLowerCase().includes(T)||String(z.value).toLowerCase().includes(T))},[C,l,m]);v.useEffect(()=>{if(f&&l){p("");const T=setTimeout(()=>E.current?.focus(),0);return()=>clearTimeout(T)}f||p("")},[f,l]);const w=v.useCallback(()=>{if(!x.current)return;const T=x.current.getBoundingClientRect(),z=window.innerHeight-T.bottom,W=z<280&&T.top>z;b(W?{bottom:window.innerHeight-T.top+4,left:T.left,width:T.width}:{top:T.bottom+4,left:T.left,width:T.width})},[]);v.useEffect(()=>{if(!f){b(null);return}return w(),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[f,w]),v.useEffect(()=>{const T=z=>{const H=z.target;S.current&&!S.current.contains(H)&&(!k.current||!k.current.contains(H))&&g(!1)};return f&&document.addEventListener("mousedown",T),()=>{document.removeEventListener("mousedown",T)}},[f]),v.useEffect(()=>{const T=z=>{z.key==="Escape"&&f&&(g(!1),x.current?.focus())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[f]);const M=()=>{a||g(!f)},O=T=>{i&&i({target:{value:T},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),x.current?.focus()};if(!C){const z=(s??"").split(/\s+/).filter(Boolean).includes("select")?s??"":["select",s].filter(Boolean).join(" ");return h.jsx("select",{className:z,value:o,onChange:i,disabled:a,...d,...u,children:t})}const L=(s??"").split(/\s+/).filter(T=>T&&!T.includes(":")).join(" "),F=L.includes("bg-"),$=/text-(gray|red|blue|green|yellow|white|black|indigo|purple|pink|orange|amber|emerald|teal|cyan|slate)-\d+|text-white|text-black/.test(L),D=F?`${s}${$?"":" text-gray-700 dark:text-gray-200"}`:`w-full px-4 py-2.5 bg-gray-100 dark:bg-gray-700 border-0 rounded-xl text-sm text-gray-700 dark:text-gray-200 font-medium focus:ring-2 focus:ring-blue-500 focus:outline-none ${s}`,A={...d,...u};return h.jsxs(I,{ref:S,className:"relative",...A,children:[h.jsxs(oe,{ref:x,type:"button",onClick:M,disabled:a,className:`${D} flex items-center justify-between gap-2 text-left cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,"aria-haspopup":"listbox","aria-expanded":f,children:[h.jsx(Q,{className:"truncate",children:N||" "}),h.jsx(Hn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&y&&On.createPortal(h.jsxs(I,{ref:k,className:"fixed z-[9999] bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",style:{top:y.top,bottom:y.bottom,left:y.left,width:y.width},role:"listbox",children:[l&&h.jsx(I,{className:"p-2 border-b border-gray-200 dark:border-gray-600",children:h.jsx(wt,{ref:E,type:"text",value:m,onChange:T=>p(T.target.value),placeholder:c??"Search...",className:"w-full px-3 py-2 bg-gray-100 dark:bg-gray-700 border-0 rounded-lg text-sm text-gray-700 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:outline-none",role:"searchbox","aria-label":c??"Search"})}),h.jsxs(I,{className:"py-2 max-h-60 overflow-auto",children:[_&&_.length===0&&h.jsx(I,{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400 text-center",children:m?"No results":""}),(_??[]).map(T=>{const z=String(T.value)===String(o);return h.jsxs(oe,{type:"button",onClick:()=>!T.disabled&&O(T.value),disabled:T.disabled,className:`w-full px-4 py-3 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${z?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-700 dark:text-gray-200"} ${T.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,role:"option","aria-selected":z,children:[h.jsx(Q,{children:T.label}),z&&h.jsx(Hn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},T.value)})]})]}),document.body)]})},ab=({children:t,className:e="",...n})=>h.jsx("option",{className:e,...n,children:t}),lb=({children:t,className:e="",...n})=>h.jsx("optgroup",{className:e,...n,children:t}),vn=v.forwardRef(({label:t,className:e="",indeterminate:n=!1,...r},s)=>{const o=v.useRef(null),i=a=>{o.current=a,typeof s=="function"?s(a):s&&(s.current=a)};return v.useEffect(()=>{o.current&&(o.current.indeterminate=n)},[n]),h.jsx("input",{ref:i,type:"checkbox",className:e,...r})});vn.displayName="Checkbox";const $a=({children:t,className:e="",...n})=>h.jsx("table",{className:e,...n,children:t}),Fa=({children:t,className:e="",...n})=>h.jsx("thead",{className:e,...n,children:t}),za=({children:t,className:e="",...n})=>h.jsx("tbody",{className:e,...n,children:t}),Va=({children:t,className:e="",...n})=>h.jsx("tfoot",{className:e,...n,children:t}),Jn=({children:t,className:e="",...n})=>h.jsx("tr",{className:e,...n,children:t}),$r=({children:t,className:e="",...n})=>h.jsx("th",{className:e,...n,children:t}),Kt=({children:t,className:e="",...n})=>h.jsx("td",{className:e,...n,children:t}),Lo=({children:t,className:e="",...n})=>h.jsx("nav",{className:e,...n,children:t}),Od=({children:t,className:e="",...n})=>h.jsx("section",{className:e,...n,children:t}),re=({name:t,iconStyle:e="solid",size:n,color:r,spin:s=!1,pulse:o=!1,fixedWidth:i=!1,ariaLabel:a,className:l="",style:c,...d})=>{const u={solid:"fas",regular:"far",light:"fal",duotone:"fad",brands:"fab"},f={"fa-solid":"solid","fa-regular":"regular","fa-light":"light","fa-duotone":"duotone","fa-brands":"brands"},g=typeof t=="string"?t:String(t);let m=e,p=g;for(const[S,x]of Object.entries(f))if(g.startsWith(S+" ")){m=x,p=g.substring(S.length+1);break}p=p.replace(/^fa-/,"");const y=[u[m],`fa-${p}`,n&&`fa-${n}`,s&&"fa-spin",o&&"fa-pulse",i&&"fa-fw",r,l].filter(Boolean).join(" "),b=a||p.replace(/-/g," ");return h.jsx("i",{className:y,style:c,"aria-label":b,role:"img",...d})},cb={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"},Td={xs:"xs",sm:"sm",md:void 0,lg:"lg",xl:"2x"},db=({icon:t,size:e="md",className:n="",color:r,ariaLabel:s})=>{const o=t.indexOf(":"),i=t.startsWith("fa-")||t.startsWith("fas ")||t.startsWith("far ")||t.startsWith("fab ")||t.startsWith("fal ")||t.startsWith("fad ");let a,l;i?(a="fa",l=t):o>0?(a=t.substring(0,o),l=t.substring(o+1)):(a="fa",l=t);const c=cb[e],d=r||"";switch(a){case"fa":return h.jsx(re,{name:l,size:Td[e],className:n,color:r,ariaLabel:s});case"svg":return h.jsx("img",{src:l,className:`${c} ${d} ${n}`.trim(),alt:s||"","aria-label":s,role:"img"});case"img":return h.jsx("img",{src:l,className:`${c} ${n}`.trim(),alt:s||"",role:"img"});default:return h.jsx(re,{name:t,size:Td[e],className:n,color:r,ariaLabel:s})}},ub=({children:t,className:e="",...n})=>h.jsx("code",{className:e,...n,children:t}),fb=({children:t,className:e="",...n})=>h.jsx("pre",{className:e,...n,children:t}),hb=({children:t})=>h.jsx(h.Fragment,{children:t}),gb=({className:t="",...e})=>h.jsx("hr",{className:t,...e}),pt=({className:t="",children:e,style:n,...r})=>h.jsx("i",{className:t,style:n,...r,children:e});var de=(t=>(t.User="fa-user",t.Users="fa-users",t.UserCircle="fa-user-circle",t.UserPlus="fa-user-plus",t.UserMinus="fa-user-minus",t.UserShield="fa-user-shield",t.Search="fa-search",t.Edit="fa-edit",t.Pencil="fa-pencil-alt",t.Trash="fa-trash",t.Save="fa-save",t.Plus="fa-plus",t.Minus="fa-minus",t.Check="fa-check",t.Times="fa-times",t.Download="fa-download",t.Upload="fa-upload",t.Copy="fa-copy",t.ExternalLink="fa-external-link-alt",t.Home="fa-home",t.CaretRight="fa-caret-right",t.CaretDown="fa-caret-down",t.ChevronLeft="fa-chevron-left",t.ChevronRight="fa-chevron-right",t.ChevronUp="fa-chevron-up",t.ChevronDown="fa-chevron-down",t.AngleLeft="fa-angle-left",t.AngleRight="fa-angle-right",t.AngleUp="fa-angle-up",t.AngleDown="fa-angle-down",t.ArrowUp="fa-arrow-up",t.ArrowDown="fa-arrow-down",t.ArrowLeft="fa-arrow-left",t.ArrowRight="fa-arrow-right",t.Bars="fa-bars",t.EllipsisVertical="fa-ellipsis-v",t.EllipsisHorizontal="fa-ellipsis-h",t.CheckCircle="fa-check-circle",t.TimesCircle="fa-times-circle",t.ExclamationCircle="fa-exclamation-circle",t.ExclamationTriangle="fa-exclamation-triangle",t.InfoCircle="fa-info-circle",t.QuestionCircle="fa-question-circle",t.XCircle="fa-times-circle",t.ShoppingCart="fa-shopping-cart",t.ShoppingBag="fa-shopping-bag",t.CreditCard="fa-credit-card",t.Tag="fa-tag",t.Tags="fa-tags",t.File="fa-file",t.FileAlt="fa-file-alt",t.Folder="fa-folder",t.FolderOpen="fa-folder-open",t.Envelope="fa-envelope",t.Phone="fa-phone",t.Comment="fa-comment",t.Comments="fa-comments",t.Cog="fa-cog",t.Cogs="fa-cogs",t.Settings="fa-cog",t.Wrench="fa-wrench",t.Sliders="fa-sliders-h",t.Image="fa-image",t.Images="fa-images",t.Video="fa-video",t.Camera="fa-camera",t.Heart="fa-heart",t.Star="fa-star",t.ThumbsUp="fa-thumbs-up",t.ThumbsDown="fa-thumbs-down",t.Share="fa-share",t.Clock="fa-clock",t.Calendar="fa-calendar",t.CalendarAlt="fa-calendar-alt",t.Lock="fa-lock",t.Unlock="fa-unlock",t.Eye="fa-eye",t.EyeSlash="fa-eye-slash",t.Bell="fa-bell",t.Flag="fa-flag",t.Map="fa-map",t.MapMarker="fa-map-marker-alt",t.Globe="fa-globe",t.Link="fa-link",t.Unlink="fa-unlink",t.Sun="fa-sun",t.Moon="fa-moon",t.ChartBar="fa-chart-bar",t.ChartLine="fa-chart-line",t.ChartPie="fa-chart-pie",t.ChartArea="fa-chart-area",t.Spinner="fa-spinner",t.CircleNotch="fa-circle-notch",t.CheckBadge="fa-badge-check",t.Cube="fa-cube",t.Cubes="fa-cubes",t.Plug="fa-plug",t.PuzzlePiece="fa-puzzle-piece",t.Palette="fa-palette",t))(de||{});const pb=({title:t,content:e,imageUrl:n,imageAlt:r="",className:s="",onClick:o,style:i,id:a,editorAttrs:l})=>h.jsxs(I,{className:`card-clickable ${s}`,onClick:o,style:i,id:a,...l,children:[n&&h.jsx(I,{className:"w-full",children:h.jsx(yn,{src:n,alt:r,className:"card-image"})}),h.jsxs(I,{className:"p-4",children:[t&&h.jsx(Qn,{className:"card-title",children:t}),e&&h.jsx(bt,{className:"card-content",children:e})]})]}),bs=({items:t,triggerLabel:e="작업",triggerIconName:n=de.EllipsisVertical,position:r="right",className:s="",style:o,children:i,onItemClick:a,id:l,editorAttrs:c})=>{const[d,u]=v.useState(!1),[f,g]=v.useState({top:0,left:0}),m=v.useRef(null),p=v.useRef(null),y=v.useCallback(()=>{if(!m.current)return;const x=m.current.getBoundingClientRect(),E=224;let k=r==="right"?x.right-E:x.left;const C=x.bottom+8;k<8&&(k=8),k+E>window.innerWidth-8&&(k=window.innerWidth-E-8),g({top:C,left:k})},[r]);v.useEffect(()=>{d&&y()},[d,y]),v.useEffect(()=>{if(!d)return;const x=()=>{u(!1)};return window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[d]),v.useEffect(()=>{const x=E=>{const k=E.target,C=m.current?.contains(k),N=p.current?.contains(k);!C&&!N&&u(!1)};return d&&document.addEventListener("mousedown",x),()=>{document.removeEventListener("mousedown",x)}},[d]);const b=x=>{x.disabled||(x.onClick&&x.onClick(),a&&a(x.id,x),u(!1))},S=d?On.createPortal(h.jsx("div",{ref:p,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:f.top,left:f.left},children:t.filter(x=>x.if!==!1).map(x=>{if(x.divider)return h.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600 my-1"},x.id);const E=x.variant==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",k=x.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer";return h.jsxs("div",{onClick:()=>b(x),className:`flex items-center gap-3 px-4 py-3 transition-colors ${E} ${k}`,children:[x.iconName&&h.jsx(re,{name:x.iconName,className:"w-4 h-4"}),h.jsx("span",{className:"text-sm font-medium",children:x.label})]},x.id)})}),document.body):null;return h.jsxs(I,{className:`relative inline-block ${s}`,style:o,id:l,...c,children:[i?h.jsx(I,{ref:m,onClick:()=>u(!d),className:"cursor-pointer",children:i}):h.jsxs(oe,{ref:m,onClick:()=>u(!d),className:"flex items-center gap-2 px-2 py-1 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[e&&h.jsx(Q,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:e}),n&&h.jsx(re,{name:n,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})]}),S]})},Fr=(t,e)=>window.G7Core?.t?.(t,e)??t,Po=({currentPage:t,totalPages:e,onPageChange:n,maxVisiblePages:r=5,showFirstLast:s=!0,className:o="",style:i,prevText:a,nextText:l,id:c,editorAttrs:d})=>{const u=v.useMemo(()=>{const p=[];if(e<=r+2)for(let y=1;y<=e;y++)p.push(y);else{const y=Math.floor(r/2);let b=Math.max(2,t-y),S=Math.min(e-1,t+y);t<=y+1?S=r:t>=e-y&&(b=e-r+1),p.push(1),b>2&&p.push("...");for(let x=b;x<=S;x++)p.push(x);S<e-1&&p.push("..."),e>1&&p.push(e)}return p},[t,e,r]),f=p=>{p<1||p>e||p===t||n(p)},g=()=>{t>1&&n(t-1)},m=()=>{t<e&&n(t+1)};return h.jsxs(I,{className:`pagination ${o}`,style:i,role:"navigation","aria-label":Fr("common.pagination"),id:c,...d,children:[s&&h.jsx(oe,{onClick:()=>f(1),disabled:t===1,className:"pagination-btn","aria-label":Fr("common.first_page"),children:"«"}),h.jsx(oe,{onClick:g,disabled:t===1,className:"pagination-btn","aria-label":Fr("common.prev_page"),children:a||h.jsx(h.Fragment,{children:"‹"})}),h.jsx(I,{className:"pagination",children:u.map((p,y)=>{if(p==="...")return h.jsx(Q,{className:"pagination-ellipsis",children:"..."},`ellipsis-${y}`);const b=p,S=b===t;return h.jsx(oe,{onClick:()=>f(b),className:S?"pagination-btn-active":"pagination-btn","aria-label":Fr("common.page_n",{n:b}),"aria-current":S?"page":void 0,children:b},b)})}),h.jsx(oe,{onClick:m,disabled:t===e,className:"pagination-btn","aria-label":Fr("common.next_page"),children:l||h.jsx(h.Fragment,{children:"›"})}),s&&h.jsx(oe,{onClick:()=>f(e),disabled:t===e,className:"pagination-btn","aria-label":Fr("common.last_page"),children:"»"})]})},Ad=(t,e)=>window.G7Core?.t?.(t,e)??t,mb=()=>window.G7Core?.locale?.supported?.()??["ko","en"],bb=()=>window.G7Core?.locale?.current?.()??"ko",Dd=t=>{const e=Ad(`common.language_${t}`);return e===`common.language_${t}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[t]||t.toUpperCase():e},yb=()=>mb().map(e=>({code:e,name:Dd(e),nativeName:Dd(e)})),Ha=({value:t={},onChange:e,inputType:n="text",layout:r="inline",availableLocales:s,defaultLocale:o,placeholder:i="",required:a=!1,disabled:l=!1,maxLength:c,rows:d=4,className:u="",name:f="multilingual_input",showCodeOnMobile:g=!1,error:m,id:p,editorAttrs:y})=>{const b=!!m,S=v.useMemo(()=>s??yb(),[s]),x=v.useMemo(()=>o??bb(),[o]),E=v.useRef(t),[k,C]=v.useState(t),N=v.useRef(JSON.stringify(t));v.useEffect(()=>{const X=JSON.stringify(t);X!==N.current&&(N.current=X,E.current=t,C(t))},[t]);const _=v.useCallback((X,Z)=>{const ee={target:{name:f,value:X}};Z&&(ee._changedKeys=Z),e?.(ee)},[e,f]),[w,M]=v.useState(()=>{if(r==="tabs"||r==="compact"){const ee=S.map(he=>he.code);return[x,...ee.filter(he=>he!==x)]}const X=Object.keys(t).filter(ee=>t[ee]!==void 0);if(X.length===0)return[x];const Z=[];return X.includes(x)&&Z.push(x),X.forEach(ee=>{ee!==x&&Z.push(ee)}),Z}),[O,L]=v.useState(x),F=v.useMemo(()=>S.filter(X=>!w.includes(X.code)),[S,w]),[$,D]=v.useState(!1);v.useEffect(()=>{if(r==="tabs"||r==="compact"){const he=S.map(ae=>ae.code),J=[x,...he.filter(ae=>ae!==x)],ce=w.join(","),ue=J.join(",");ce!==ue&&M(J);return}const X=Object.keys(t).filter(he=>t[he]!==void 0);if(X.length===0){M([x]);return}const Z=[];X.includes(x)&&Z.push(x),X.forEach(he=>{he!==x&&Z.push(he)});const ee=w.join(","),ne=Z.join(",");ee!==ne&&M(Z)},[t,x,r,S]);const A=v.useCallback((X,Z)=>{const ee={...E.current,[X]:Z};E.current=ee,C(ee),_(ee,[X])},[_]),T=v.useCallback(X=>{M(ee=>[...ee,X]),L(X),D(!1);const Z={...E.current,[X]:""};E.current=Z,C(Z),_(Z)},[_]),z=v.useCallback(X=>{if(X===x)return;M(ee=>ee.filter(ne=>ne!==X)),O===X&&L(x);const Z={...E.current};delete Z[X],E.current=Z,C(Z),_(Z)},[O,x,_]),H=v.useCallback(X=>{const Z=S.find(ee=>ee.code===X);return Z?.nativeName||Z?.name||X.toUpperCase()},[S]),W=v.useCallback(X=>!!k[X]?.trim(),[k]),j=v.useCallback(()=>F.length===0?null:h.jsxs(I,{className:"relative",children:[h.jsxs(oe,{type:"button",className:"inline-flex items-center gap-1 px-3 py-1 text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 hover:bg-blue-100 dark:hover:bg-blue-900/50 rounded-full border border-dashed border-blue-300 dark:border-blue-600 transition-colors",onClick:()=>D(!$),disabled:l,children:[h.jsx(re,{name:"plus",className:"w-3 h-3"}),h.jsx(Q,{children:Ad("common.add_language")})]}),$&&h.jsx(I,{className:"absolute top-full left-0 mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-10 min-w-[120px]",children:F.map(X=>h.jsxs(oe,{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 first:rounded-t-lg last:rounded-b-lg transition-colors",onClick:()=>T(X.code),children:[h.jsx(re,{name:"globe",className:"w-3.5 h-3.5 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{children:X.nativeName||X.name})]},X.code))})]}),[F,$,l,T]),U=v.useCallback((X,Z=!1)=>{const ee=b?"input input-error":"input",ne=b?"textarea input-error":"textarea",he=X===x,J=`${i}${i?" (":""}${H(X)}${i?")":""}`;return h.jsxs(I,{className:"space-y-2",children:[h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsxs(Q,{className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium
|
||
${he?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}
|
||
`,children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),H(X),he&&h.jsx(Q,{className:"text-red-500 dark:text-red-400",children:"*"}),!he&&h.jsx(oe,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",onClick:()=>z(X),disabled:l,children:h.jsx(re,{name:"xmark",className:"w-3 h-3"})})]}),he&&Z&&j()]}),n==="textarea"?h.jsx(Zn,{name:`${f}[${X}]`,value:k[X]||"",onChange:ce=>A(X,ce.target.value),placeholder:J,required:a&&he,disabled:l,maxLength:c,rows:d,className:`${ne} resize-vertical`}):h.jsx(wt,{type:"text",name:`${f}[${X}]`,value:k[X]||"",onChange:ce=>A(X,ce.target.value),placeholder:J,required:a&&he,disabled:l,maxLength:c,className:ee})]},X)},[f,k,A,i,a,l,c,d,n,H,x,z,j,b]),B=v.useCallback(X=>{const Z=b?"input input-error":"input",ee=b?"textarea input-error":"textarea",ne=`${i}${i?" (":""}${H(X)}${i?")":""}`;return h.jsx(I,{children:n==="textarea"?h.jsx(Zn,{name:`${f}[${X}]`,value:k[X]||"",onChange:he=>A(X,he.target.value),placeholder:ne,required:a&&X===x,disabled:l,maxLength:c,rows:d,className:`${ee} resize-vertical`}):h.jsx(wt,{type:"text",name:`${f}[${X}]`,value:k[X]||"",onChange:he=>A(X,he.target.value),placeholder:ne,required:a&&X===x,disabled:l,maxLength:c,className:Z})},X)},[f,k,A,i,a,l,c,d,n,x,H,b]),G=()=>h.jsx(I,{className:u,children:h.jsx(I,{className:"space-y-4",children:w.map((X,Z)=>U(X,Z===0))})}),V=()=>h.jsxs(I,{className:u,children:[h.jsxs(I,{className:"flex flex-wrap items-center gap-2 mb-3",children:[w.map(X=>h.jsxs(oe,{type:"button",className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
||
${O===X?X===x?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":X===x?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
`,onClick:()=>L(X),children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),g?h.jsxs(h.Fragment,{children:[h.jsx(Q,{className:"hidden md:inline",children:H(X)}),h.jsx(Q,{className:"inline md:hidden",children:X.toUpperCase()})]}):H(X),X===x&&h.jsx(Q,{className:"text-red-500 dark:text-red-400",children:"*"}),W(X)&&O!==X&&h.jsx(re,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"}),X!==x&&h.jsx(oe,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",onClick:Z=>{Z.stopPropagation(),z(X)},disabled:l,children:h.jsx(re,{name:"xmark",className:"w-3 h-3"})})]},X)),j()]}),w.map(X=>h.jsx(I,{className:O===X?"block":"hidden",children:B(X)},X))]}),K=()=>{const X=b?"input input-error":"input",Z=b?"textarea input-error":"textarea";return h.jsx(I,{className:u,children:h.jsxs(I,{className:"flex items-center gap-1",children:[h.jsx(I,{className:"flex items-center shrink-0",children:w.map(ee=>h.jsxs(oe,{type:"button",className:`
|
||
px-2 py-1.5 text-xs font-medium border-y border-l first:rounded-l last:rounded-r last:border-r transition-colors
|
||
${O===ee?"bg-blue-500 text-white border-blue-500 dark:bg-blue-600 dark:border-blue-600":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700"}
|
||
`,onClick:()=>L(ee),title:H(ee),children:[ee.toUpperCase(),ee===x&&h.jsx(Q,{className:"text-red-400 ml-0.5",children:"*"})]},ee))}),h.jsx(I,{className:"flex-1 min-w-0",children:n==="textarea"?h.jsx(Zn,{name:`${f}[${O}]`,value:k[O]||"",onChange:ee=>A(O,ee.target.value),placeholder:i,required:a&&O===x,disabled:l,maxLength:c,rows:d,className:Z}):h.jsx(wt,{type:"text",name:`${f}[${O}]`,value:k[O]||"",onChange:ee=>A(O,ee.target.value),placeholder:i,required:a&&O===x,disabled:l,maxLength:c,className:X})})]})})};return h.jsxs(I,{className:l?"opacity-50 cursor-not-allowed":void 0,id:p,...y,children:[r==="compact"?K():r==="tabs"?V():G(),b&&m&&h.jsx(Q,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:m})]})};Ha.displayName="MultilingualInput";const vb=()=>window.G7Core,Ua=({checked:t,value:e,onChange:n,disabled:r=!1,label:s,description:o,size:i="md",className:a="",name:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(()=>t??e??!1);v.useEffect(()=>{f(t??e??!1)},[t,e]);const g=b=>{const S=b.target.checked;f(S),n&&!r&&n(b)},p={sm:{track:"w-9 h-5",thumb:"after:h-4 after:w-4"},md:{track:"w-11 h-6",thumb:"after:h-5 after:w-5"},lg:{track:"w-14 h-7",thumb:"after:h-6 after:w-6"}}[i],y=()=>{if(!r){const b=!u;if(f(b),n){const S=vb();S?.createChangeEvent&&n(S.createChangeEvent({checked:b,name:l}))}}};return h.jsxs("div",{className:`toggle-container ${a}`,id:c,...d,children:[h.jsxs("div",{className:`toggle-switch-wrapper ${r?"cursor-not-allowed opacity-50":"cursor-pointer"}`,onClick:b=>{b.preventDefault(),b.stopPropagation(),y()},children:[h.jsx("input",{type:"checkbox",id:l,name:l,checked:u,onChange:g,disabled:r,className:"sr-only peer",tabIndex:-1}),h.jsx("div",{className:`toggle-switch-track ${p.track} ${p.thumb}`})]}),s&&h.jsx("span",{className:`toggle-label ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:y,children:s}),o&&h.jsx("p",{className:"toggle-description",children:o})]})},$o=({status:t,label:e,showIcon:n=!0,iconName:r,className:s="",style:o,id:i,editorAttrs:a})=>{const l={success:"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 border-green-200 dark:border-green-800",warning:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800",error:"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 border-red-200 dark:border-red-800",info:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-400 border-blue-200 dark:border-blue-800",pending:"bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-200 dark:border-gray-600",default:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-600"},c={success:de.CheckCircle,warning:de.ExclamationTriangle,error:de.XCircle,info:de.InfoCircle,pending:de.Clock,default:de.QuestionCircle},d={success:"성공",warning:"경고",error:"오류",info:"정보",pending:"대기 중",default:"기본"},u=r||c[t],f=e||d[t],g=l[t];return h.jsxs(Q,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border ${g} ${s}`,style:o,id:i,...a,children:[n&&h.jsx(re,{name:u,className:"w-4 h-4"}),h.jsx(Q,{children:f})]})},Id={blue:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",green:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",red:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",gray:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",yellow:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",orange:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",teal:"bg-teal-100 text-teal-800 dark:bg-teal-900/30 dark:text-teal-300",cyan:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-300"},xb={success:"green",warning:"yellow",danger:"red",error:"red",info:"blue",primary:"blue",secondary:"gray",text:"gray",default:"gray"},Ld={sm:"px-1.5 py-0.5 text-[10px]",md:"px-2 py-0.5 text-xs",lg:"px-2.5 py-1 text-sm"},Pd=({color:t,variant:e,text:n,size:r="md",className:s="",style:o,children:i,id:a,editorAttrs:l})=>{const c=t||(e?xb[e]:void 0)||"gray",d=Id[c]||Id.gray,u=Ld[r]||Ld.md;return h.jsxs(Q,{className:`inline-flex items-center rounded-full font-medium ${u} ${d} ${s}`,style:o,id:a,...l,children:[n,i]})};const{entries:$d,setPrototypeOf:Fd,isFrozen:wb,getPrototypeOf:kb,getOwnPropertyDescriptor:Cb}=Object;let{freeze:jt,seal:cn,create:zd}=Object,{apply:Ba,construct:ja}=typeof Reflect<"u"&&Reflect;jt||(jt=function(e){return e}),cn||(cn=function(e){return e}),Ba||(Ba=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),o=2;o<r;o++)s[o-2]=arguments[o];return e.apply(n,s)}),ja||(ja=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new e(...r)});const Fo=Gt(Array.prototype.forEach),Sb=Gt(Array.prototype.lastIndexOf),Vd=Gt(Array.prototype.pop),ys=Gt(Array.prototype.push),_b=Gt(Array.prototype.splice),zo=Gt(String.prototype.toLowerCase),Wa=Gt(String.prototype.toString),Ga=Gt(String.prototype.match),vs=Gt(String.prototype.replace),Eb=Gt(String.prototype.indexOf),Mb=Gt(String.prototype.trim),xn=Gt(Object.prototype.hasOwnProperty),Wt=Gt(RegExp.prototype.test),xs=Nb(TypeError);function Gt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return Ba(t,e,r)}}function Nb(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return ja(t,n)}}function Ye(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zo;Fd&&Fd(t,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const o=n(s);o!==s&&(wb(e)||(e[r]=o),s=o)}t[s]=!0}return t}function Ob(t){for(let e=0;e<t.length;e++)xn(t,e)||(t[e]=null);return t}function Un(t){const e=zd(null);for(const[n,r]of $d(t))xn(t,n)&&(Array.isArray(r)?e[n]=Ob(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Un(r):e[n]=r);return e}function ws(t,e){for(;t!==null;){const r=Cb(t,e);if(r){if(r.get)return Gt(r.get);if(typeof r.value=="function")return Gt(r.value)}t=kb(t)}function n(){return null}return n}const Hd=jt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ya=jt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xa=jt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Tb=jt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ka=jt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ab=jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ud=jt(["#text"]),Bd=jt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qa=jt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jd=jt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Vo=jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Db=cn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ib=cn(/<%[\w\W]*|[\w\W]*%>/gm),Lb=cn(/\$\{[\w\W]*/gm),Pb=cn(/^data-[\-\w.\u00B7-\uFFFF]+$/),$b=cn(/^aria-[\-\w]+$/),Wd=cn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fb=cn(/^(?:\w+script|data):/i),zb=cn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gd=cn(/^html$/i),Vb=cn(/^[a-z][.\w]*(-[.\w]+)+$/i);var Yd=Object.freeze({__proto__:null,ARIA_ATTR:$b,ATTR_WHITESPACE:zb,CUSTOM_ELEMENT:Vb,DATA_ATTR:Pb,DOCTYPE_NAME:Gd,ERB_EXPR:Ib,IS_ALLOWED_URI:Wd,IS_SCRIPT_OR_DATA:Fb,MUSTACHE_EXPR:Db,TMPLIT_EXPR:Lb});const ks={element:1,text:3,progressingInstruction:7,comment:8,document:9},Hb=function(){return typeof window>"u"?null:window},Ub=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Xd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kd(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hb();const e=Ce=>Kd(Ce);if(e.version="3.2.7",e.removed=[],!t||!t.document||t.document.nodeType!==ks.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,s=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:i,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:g}=t,m=l.prototype,p=ws(m,"cloneNode"),y=ws(m,"remove"),b=ws(m,"nextSibling"),S=ws(m,"childNodes"),x=ws(m,"parentNode");if(typeof i=="function"){const Ce=n.createElement("template");Ce.content&&Ce.content.ownerDocument&&(n=Ce.content.ownerDocument)}let E,k="";const{implementation:C,createNodeIterator:N,createDocumentFragment:_,getElementsByTagName:w}=n,{importNode:M}=r;let O=Xd();e.isSupported=typeof $d=="function"&&typeof x=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:L,ERB_EXPR:F,TMPLIT_EXPR:$,DATA_ATTR:D,ARIA_ATTR:A,IS_SCRIPT_OR_DATA:T,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:H}=Yd;let{IS_ALLOWED_URI:W}=Yd,j=null;const U=Ye({},[...Hd,...Ya,...Xa,...Ka,...Ud]);let B=null;const G=Ye({},[...Bd,...qa,...jd,...Vo]);let V=Object.seal(zd(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,X=null,Z=!0,ee=!0,ne=!1,he=!0,J=!1,ce=!0,ue=!1,ae=!1,ve=!1,fe=!1,ye=!1,ke=!1,Ue=!0,se=!1;const Oe="user-content-";let Pe=!0,Ie=!1,je={},st=null;const ut=Ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let We=null;const et=Ye({},["audio","video","img","source","image","track"]);let Xe=null;const te=Ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let be=me,Be=!1,Se=null;const ze=Ye({},[ge,pe,me],Wa);let _e=Ye({},["mi","mo","mn","ms","mtext"]),Re=Ye({},["annotation-xml"]);const ot=Ye({},["title","style","font","a","script"]);let $e=null;const Te=["application/xhtml+xml","text/html"],He="text/html";let De=null,Ze=null;const it=n.createElement("form"),gt=function(Y){return Y instanceof RegExp||Y instanceof Function},tn=function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ze&&Ze===Y)){if((!Y||typeof Y!="object")&&(Y={}),Y=Un(Y),$e=Te.indexOf(Y.PARSER_MEDIA_TYPE)===-1?He:Y.PARSER_MEDIA_TYPE,De=$e==="application/xhtml+xml"?Wa:zo,j=xn(Y,"ALLOWED_TAGS")?Ye({},Y.ALLOWED_TAGS,De):U,B=xn(Y,"ALLOWED_ATTR")?Ye({},Y.ALLOWED_ATTR,De):G,Se=xn(Y,"ALLOWED_NAMESPACES")?Ye({},Y.ALLOWED_NAMESPACES,Wa):ze,Xe=xn(Y,"ADD_URI_SAFE_ATTR")?Ye(Un(te),Y.ADD_URI_SAFE_ATTR,De):te,We=xn(Y,"ADD_DATA_URI_TAGS")?Ye(Un(et),Y.ADD_DATA_URI_TAGS,De):et,st=xn(Y,"FORBID_CONTENTS")?Ye({},Y.FORBID_CONTENTS,De):ut,K=xn(Y,"FORBID_TAGS")?Ye({},Y.FORBID_TAGS,De):Un({}),X=xn(Y,"FORBID_ATTR")?Ye({},Y.FORBID_ATTR,De):Un({}),je=xn(Y,"USE_PROFILES")?Y.USE_PROFILES:!1,Z=Y.ALLOW_ARIA_ATTR!==!1,ee=Y.ALLOW_DATA_ATTR!==!1,ne=Y.ALLOW_UNKNOWN_PROTOCOLS||!1,he=Y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,J=Y.SAFE_FOR_TEMPLATES||!1,ce=Y.SAFE_FOR_XML!==!1,ue=Y.WHOLE_DOCUMENT||!1,fe=Y.RETURN_DOM||!1,ye=Y.RETURN_DOM_FRAGMENT||!1,ke=Y.RETURN_TRUSTED_TYPE||!1,ve=Y.FORCE_BODY||!1,Ue=Y.SANITIZE_DOM!==!1,se=Y.SANITIZE_NAMED_PROPS||!1,Pe=Y.KEEP_CONTENT!==!1,Ie=Y.IN_PLACE||!1,W=Y.ALLOWED_URI_REGEXP||Wd,be=Y.NAMESPACE||me,_e=Y.MATHML_TEXT_INTEGRATION_POINTS||_e,Re=Y.HTML_INTEGRATION_POINTS||Re,V=Y.CUSTOM_ELEMENT_HANDLING||{},Y.CUSTOM_ELEMENT_HANDLING&>(Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=Y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Y.CUSTOM_ELEMENT_HANDLING&>(Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=Y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Y.CUSTOM_ELEMENT_HANDLING&&typeof Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(V.allowCustomizedBuiltInElements=Y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),J&&(ee=!1),ye&&(fe=!0),je&&(j=Ye({},Ud),B=[],je.html===!0&&(Ye(j,Hd),Ye(B,Bd)),je.svg===!0&&(Ye(j,Ya),Ye(B,qa),Ye(B,Vo)),je.svgFilters===!0&&(Ye(j,Xa),Ye(B,qa),Ye(B,Vo)),je.mathMl===!0&&(Ye(j,Ka),Ye(B,jd),Ye(B,Vo))),Y.ADD_TAGS&&(j===U&&(j=Un(j)),Ye(j,Y.ADD_TAGS,De)),Y.ADD_ATTR&&(B===G&&(B=Un(B)),Ye(B,Y.ADD_ATTR,De)),Y.ADD_URI_SAFE_ATTR&&Ye(Xe,Y.ADD_URI_SAFE_ATTR,De),Y.FORBID_CONTENTS&&(st===ut&&(st=Un(st)),Ye(st,Y.FORBID_CONTENTS,De)),Pe&&(j["#text"]=!0),ue&&Ye(j,["html","head","body"]),j.table&&(Ye(j,["tbody"]),delete K.tbody),Y.TRUSTED_TYPES_POLICY){if(typeof Y.TRUSTED_TYPES_POLICY.createHTML!="function")throw xs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=Y.TRUSTED_TYPES_POLICY,k=E.createHTML("")}else E===void 0&&(E=Ub(g,s)),E!==null&&typeof k=="string"&&(k=E.createHTML(""));jt&&jt(Y),Ze=Y}},mt=Ye({},[...Ya,...Xa,...Tb]),xt=Ye({},[...Ka,...Ab]),Dt=function(Y){let ie=x(Y);(!ie||!ie.tagName)&&(ie={namespaceURI:be,tagName:"template"});const xe=zo(Y.tagName),ft=zo(ie.tagName);return Se[Y.namespaceURI]?Y.namespaceURI===pe?ie.namespaceURI===me?xe==="svg":ie.namespaceURI===ge?xe==="svg"&&(ft==="annotation-xml"||_e[ft]):!!mt[xe]:Y.namespaceURI===ge?ie.namespaceURI===me?xe==="math":ie.namespaceURI===pe?xe==="math"&&Re[ft]:!!xt[xe]:Y.namespaceURI===me?ie.namespaceURI===pe&&!Re[ft]||ie.namespaceURI===ge&&!_e[ft]?!1:!xt[xe]&&(ot[xe]||!mt[xe]):!!($e==="application/xhtml+xml"&&Se[Y.namespaceURI]):!1},Ve=function(Y){ys(e.removed,{element:Y});try{x(Y).removeChild(Y)}catch{y(Y)}},Bt=function(Y,ie){try{ys(e.removed,{attribute:ie.getAttributeNode(Y),from:ie})}catch{ys(e.removed,{attribute:null,from:ie})}if(ie.removeAttribute(Y),Y==="is")if(fe||ye)try{Ve(ie)}catch{}else try{ie.setAttribute(Y,"")}catch{}},ln=function(Y){let ie=null,xe=null;if(ve)Y="<remove></remove>"+Y;else{const le=Ga(Y,/^[\r\n\t ]+/);xe=le&&le[0]}$e==="application/xhtml+xml"&&be===me&&(Y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Y+"</body></html>");const ft=E?E.createHTML(Y):Y;if(be===me)try{ie=new f().parseFromString(ft,$e)}catch{}if(!ie||!ie.documentElement){ie=C.createDocument(be,"template",null);try{ie.documentElement.innerHTML=Be?k:ft}catch{}}const q=ie.body||ie.documentElement;return Y&&xe&&q.insertBefore(n.createTextNode(xe),q.childNodes[0]||null),be===me?w.call(ie,ue?"html":"body")[0]:ue?ie.documentElement:q},nn=function(Y){return N.call(Y.ownerDocument||Y,Y,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Nn=function(Y){return Y instanceof u&&(typeof Y.nodeName!="string"||typeof Y.textContent!="string"||typeof Y.removeChild!="function"||!(Y.attributes instanceof d)||typeof Y.removeAttribute!="function"||typeof Y.setAttribute!="function"||typeof Y.namespaceURI!="string"||typeof Y.insertBefore!="function"||typeof Y.hasChildNodes!="function")},fr=function(Y){return typeof a=="function"&&Y instanceof a};function bn(Ce,Y,ie){Fo(Ce,xe=>{xe.call(e,Y,ie,Ze)})}const To=function(Y){let ie=null;if(bn(O.beforeSanitizeElements,Y,null),Nn(Y))return Ve(Y),!0;const xe=De(Y.nodeName);if(bn(O.uponSanitizeElement,Y,{tagName:xe,allowedTags:j}),ce&&Y.hasChildNodes()&&!fr(Y.firstElementChild)&&Wt(/<[/\w!]/g,Y.innerHTML)&&Wt(/<[/\w!]/g,Y.textContent)||Y.nodeType===ks.progressingInstruction||ce&&Y.nodeType===ks.comment&&Wt(/<[/\w]/g,Y.data))return Ve(Y),!0;if(!j[xe]||K[xe]){if(!K[xe]&&Do(xe)&&(V.tagNameCheck instanceof RegExp&&Wt(V.tagNameCheck,xe)||V.tagNameCheck instanceof Function&&V.tagNameCheck(xe)))return!1;if(Pe&&!st[xe]){const ft=x(Y)||Y.parentNode,q=S(Y)||Y.childNodes;if(q&&ft){const le=q.length;for(let we=le-1;we>=0;--we){const Ke=p(q[we],!0);Ke.__removalCount=(Y.__removalCount||0)+1,ft.insertBefore(Ke,b(Y))}}}return Ve(Y),!0}return Y instanceof l&&!Dt(Y)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Wt(/<\/no(script|embed|frames)/i,Y.innerHTML)?(Ve(Y),!0):(J&&Y.nodeType===ks.text&&(ie=Y.textContent,Fo([L,F,$],ft=>{ie=vs(ie,ft," ")}),Y.textContent!==ie&&(ys(e.removed,{element:Y.cloneNode()}),Y.textContent=ie)),bn(O.afterSanitizeElements,Y,null),!1)},Ao=function(Y,ie,xe){if(Ue&&(ie==="id"||ie==="name")&&(xe in n||xe in it))return!1;if(!(ee&&!X[ie]&&Wt(D,ie))){if(!(Z&&Wt(A,ie))){if(!B[ie]||X[ie]){if(!(Do(Y)&&(V.tagNameCheck instanceof RegExp&&Wt(V.tagNameCheck,Y)||V.tagNameCheck instanceof Function&&V.tagNameCheck(Y))&&(V.attributeNameCheck instanceof RegExp&&Wt(V.attributeNameCheck,ie)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(ie,Y))||ie==="is"&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Wt(V.tagNameCheck,xe)||V.tagNameCheck instanceof Function&&V.tagNameCheck(xe))))return!1}else if(!Xe[ie]){if(!Wt(W,vs(xe,z,""))){if(!((ie==="src"||ie==="xlink:href"||ie==="href")&&Y!=="script"&&Eb(xe,"data:")===0&&We[Y])){if(!(ne&&!Wt(T,vs(xe,z,"")))){if(xe)return!1}}}}}}return!0},Do=function(Y){return Y!=="annotation-xml"&&Ga(Y,H)},Dr=function(Y){bn(O.beforeSanitizeAttributes,Y,null);const{attributes:ie}=Y;if(!ie||Nn(Y))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let ft=ie.length;for(;ft--;){const q=ie[ft],{name:le,namespaceURI:we,value:Ke}=q,Le=De(le),Io=Ke;let Pt=le==="value"?Io:Mb(Io);if(xe.attrName=Le,xe.attrValue=Pt,xe.keepAttr=!0,xe.forceKeepAttr=void 0,bn(O.uponSanitizeAttribute,Y,xe),Pt=xe.attrValue,se&&(Le==="id"||Le==="name")&&(Bt(le,Y),Pt=Oe+Pt),ce&&Wt(/((--!?|])>)|<\/(style|title|textarea)/i,Pt)){Bt(le,Y);continue}if(Le==="attributename"&&Ga(Pt,"href")){Bt(le,Y);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){Bt(le,Y);continue}if(!he&&Wt(/\/>/i,Pt)){Bt(le,Y);continue}J&&Fo([L,F,$],Rm=>{Pt=vs(Pt,Rm," ")});const Jm=De(Y.nodeName);if(!Ao(Jm,Le,Pt)){Bt(le,Y);continue}if(E&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!we)switch(g.getAttributeType(Jm,Le)){case"TrustedHTML":{Pt=E.createHTML(Pt);break}case"TrustedScriptURL":{Pt=E.createScriptURL(Pt);break}}if(Pt!==Io)try{we?Y.setAttributeNS(we,le,Pt):Y.setAttribute(le,Pt),Nn(Y)?Ve(Y):Vd(e.removed)}catch{Bt(le,Y)}}bn(O.afterSanitizeAttributes,Y,null)},Aa=function Ce(Y){let ie=null;const xe=nn(Y);for(bn(O.beforeSanitizeShadowDOM,Y,null);ie=xe.nextNode();)bn(O.uponSanitizeShadowNode,ie,null),To(ie),Dr(ie),ie.content instanceof o&&Ce(ie.content);bn(O.afterSanitizeShadowDOM,Y,null)};return e.sanitize=function(Ce){let Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=null,xe=null,ft=null,q=null;if(Be=!Ce,Be&&(Ce="<!-->"),typeof Ce!="string"&&!fr(Ce))if(typeof Ce.toString=="function"){if(Ce=Ce.toString(),typeof Ce!="string")throw xs("dirty is not a string, aborting")}else throw xs("toString is not a function");if(!e.isSupported)return Ce;if(ae||tn(Y),e.removed=[],typeof Ce=="string"&&(Ie=!1),Ie){if(Ce.nodeName){const Ke=De(Ce.nodeName);if(!j[Ke]||K[Ke])throw xs("root node is forbidden and cannot be sanitized in-place")}}else if(Ce instanceof a)ie=ln("<!---->"),xe=ie.ownerDocument.importNode(Ce,!0),xe.nodeType===ks.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?ie=xe:ie.appendChild(xe);else{if(!fe&&!J&&!ue&&Ce.indexOf("<")===-1)return E&&ke?E.createHTML(Ce):Ce;if(ie=ln(Ce),!ie)return fe?null:ke?k:""}ie&&ve&&Ve(ie.firstChild);const le=nn(Ie?Ce:ie);for(;ft=le.nextNode();)To(ft),Dr(ft),ft.content instanceof o&&Aa(ft.content);if(Ie)return Ce;if(fe){if(ye)for(q=_.call(ie.ownerDocument);ie.firstChild;)q.appendChild(ie.firstChild);else q=ie;return(B.shadowroot||B.shadowrootmode)&&(q=M.call(r,q,!0)),q}let we=ue?ie.outerHTML:ie.innerHTML;return ue&&j["!doctype"]&&ie.ownerDocument&&ie.ownerDocument.doctype&&ie.ownerDocument.doctype.name&&Wt(Gd,ie.ownerDocument.doctype.name)&&(we="<!DOCTYPE "+ie.ownerDocument.doctype.name+`>
|
||
`+we),J&&Fo([L,F,$],Ke=>{we=vs(we,Ke," ")}),E&&ke?E.createHTML(we):we},e.setConfig=function(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tn(Ce),ae=!0},e.clearConfig=function(){Ze=null,ae=!1},e.isValidAttribute=function(Ce,Y,ie){Ze||tn({});const xe=De(Ce),ft=De(Y);return Ao(xe,ft,ie)},e.addHook=function(Ce,Y){typeof Y=="function"&&ys(O[Ce],Y)},e.removeHook=function(Ce,Y){if(Y!==void 0){const ie=Sb(O[Ce],Y);return ie===-1?void 0:_b(O[Ce],ie,1)[0]}return Vd(O[Ce])},e.removeHooks=function(Ce){O[Ce]=[]},e.removeAllHooks=function(){O=Xd()},e}var Bb=Kd();const Za=({content:t,text:e,isHtml:n=!0,className:r="",purifyConfig:s,id:o,editorAttrs:i})=>{const a=e??t??"";if(!a||a.trim()==="")return null;if(!n){const u=`
|
||
whitespace-pre-wrap
|
||
text-gray-900 dark:text-gray-100
|
||
font-sans
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:u,id:o,...i,children:a})}const l={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},c=v.useMemo(()=>{const u=s?{...l,...s,FORBID_TAGS:[...l.FORBID_TAGS,...s.FORBID_TAGS||[]],FORBID_ATTR:[...l.FORBID_ATTR,...s.FORBID_ATTR||[]]}:l;return Bb.sanitize(a,u).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,m,p,y)=>(p.startsWith("http://")||p.startsWith("https://"))&&!g.includes("rel=")?`<a ${m}href="${p}"${y} rel="noopener noreferrer">`:g)},[a,s]),d=`
|
||
prose dark:prose-invert max-w-none
|
||
prose-p:my-2
|
||
prose-headings:font-bold prose-headings:mt-6 prose-headings:mb-4
|
||
prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg
|
||
prose-a:text-blue-600 dark:prose-a:text-blue-400
|
||
prose-a:no-underline hover:prose-a:underline
|
||
prose-blockquote:border-l-4 prose-blockquote:border-gray-300 dark:prose-blockquote:border-gray-600
|
||
prose-blockquote:pl-4 prose-blockquote:italic
|
||
prose-code:bg-gray-100 dark:prose-code:bg-gray-800
|
||
prose-code:px-1 prose-code:py-0.5 prose-code:rounded
|
||
prose-pre:bg-gray-100 dark:prose-pre:bg-gray-800
|
||
prose-pre:p-4 prose-pre:rounded-lg prose-pre:overflow-x-auto
|
||
[&_table]:w-full [&_table]:border-collapse [&_table]:border [&_table]:border-gray-300
|
||
dark:[&_table]:border-gray-600
|
||
[&_th]:border [&_th]:border-gray-300 [&_th]:px-4 [&_th]:py-2 [&_th]:bg-gray-100 [&_th]:text-left
|
||
dark:[&_th]:border-gray-600 dark:[&_th]:bg-gray-800
|
||
[&_td]:border [&_td]:border-gray-300 [&_td]:px-4 [&_td]:py-2
|
||
dark:[&_td]:border-gray-600
|
||
[&_tr:hover]:bg-gray-50 dark:[&_tr:hover]:bg-gray-700/50
|
||
after:content-[''] after:block after:clear-both
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:d,dangerouslySetInnerHTML:{__html:c},id:o,...i})},Ho=window.G7Core?.createLogger?.("Comp:DataGrid")??{log:(...t)=>console.log("[Comp:DataGrid]",...t),warn:(...t)=>console.warn("[Comp:DataGrid]",...t),error:(...t)=>console.error("[Comp:DataGrid]",...t)},Cs=(t,e)=>window.G7Core?.t?.(t,e)??t,Qa={Div:I,Span:Q,Button:oe,Icon:re,Checkbox:vn,P:bt,A:Lr,Label:rn,Input:wt,H1:Da,H2:Qn,H3:Ir,H4:Nd,Img:yn,Select:Pr,Textarea:Zn,Table:$a,Thead:Fa,Tbody:za,Tfoot:Va,Tr:Jn,Th:$r,Td:Kt,MultilingualInput:Ha,Toggle:Ua,StatusBadge:$o,Badge:Pd,HtmlContent:Za,ActionMenu:bs},Ja=t=>{if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(e=>Ja(e)).join(", ");if(typeof t=="object"){if(v.isValidElement(t))return t;if(Object.keys(t).length===0)return"";try{return JSON.stringify(t)}catch{return Ho.warn("객체를 문자열로 변환할 수 없습니다:",t),"[Object]"}}return String(t)},qd=(t,e)=>{if(!t)return!0;const n=t.match(/^\{\{(.+)\}\}$/);if(!n)return!0;const r=n[1].trim();try{return!!new Function("row",`return ${r}`)(e)}catch(s){return Ho.warn("subRow 조건 평가 실패:",t,s),!0}},Ss=(t,e,n,r="",s)=>{const o=window.G7Core;if(o?.renderItemChildren){const i={row:e,value:n,$value:n};return o.renderItemChildren(t,i,Qa,r,s?{componentContext:s}:void 0)}return Ho.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Ra=(t,e,n="",r)=>{const s=window.G7Core;if(s?.renderItemChildren){const o={row:e,$value:e};return s.renderItemChildren(t,o,Qa,n,r?{componentContext:r}:void 0)}return Ho.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},jb=({id:t,columns:e,data:n,sortable:r=!0,pagination:s=!1,pageSize:o=10,onRowClick:i,className:a="",style:l,sortField:c,sortDirection:d,onSortChange:u,selectable:f=!1,selectedIds:g=[],onSelectionChange:m,idField:p="id",showColumnSelector:y=!1,visibleColumns:b,onColumnVisibilityChange:S,responsiveBreakpoint:x=768,cardRenderer:E,rowActions:k,onRowAction:C,alwaysShowPagination:N=!1,serverSidePagination:_=!1,serverCurrentPage:w,serverTotalPages:M,onPageChange:O,prevText:L,nextText:F,columnSelectorText:$,emptyMessage:D,actionsColumnHeader:A,requiredText:T,selectedCountText:z,showFirstLast:H=!0,expandable:W=!1,expandedRowIds:j,onExpandChange:U,expandChildren:B,expandedRowRender:G,expandColumnWidth:V="48px",expandIconExpanded:K=de.ChevronDown,expandIconCollapsed:X=de.ChevronRight,expandConditionField:Z,dynamicColumns:ee,dynamicColumnsInsertAfter:ne,expandContext:he,__componentContext:J,subRowChildren:ce,subRowCondition:ue,subRowClassName:ae="px-6 py-2 bg-gray-50 dark:bg-gray-900",subRowRender:ve,footerCells:fe,footerClassName:ye="bg-gray-50 dark:bg-gray-800/50 font-medium",footerCardChildren:ke,editorAttrs:Ue})=>{const se=L||void 0,Oe=F||void 0,Pe=$??Cs("common.column_selector"),Ie=D??Cs("common.no_data"),je=A??Cs("common.actions"),st=T??Cs("common.required"),ut=z??Cs("common.selected_count"),We=window.G7Core,et=We?.useControllableState,Xe=We?.shallowArrayEqual,[te,ge]=et?et(c,null,q=>{q!==null&&u?.(q,pe)}):[c??null,()=>{}],[pe,me]=et?et(d,"asc",q=>{te!==null&&u?.(te,q)}):[d??"asc",()=>{}],[be,Be]=v.useState(1),[Se,ze]=et?et(j,[],U,{isEqual:Xe}):[j??[],()=>{}],[_e,Re]=v.useState(!1),ot=v.useRef(null),$e=We?.useResponsive,Te=$e?.(),He=Te?Te.width<x:typeof window<"u"&&window.innerWidth<x,De=v.useMemo(()=>{if(!ee||!Array.isArray(ee)||ee.length===0)return e;if(ne){const q=e.findIndex(le=>le.field===ne);if(q!==-1)return[...e.slice(0,q+1),...ee,...e.slice(q+1)]}return[...e,...ee]},[e,ee,ne]),[Ze,it]=v.useState(()=>b&&b.length>0?b:e.filter(q=>!q.hidden).map(q=>q.field));v.useEffect(()=>{b&&b.length>0&&it(b)},[b]);const gt=v.useRef("");v.useEffect(()=>{const q=e.map(le=>le.field).join(",");gt.current&&q!==gt.current&&(!b||b.length===0)&&it(e.filter(le=>!le.hidden).map(le=>le.field)),gt.current=q},[e,b]);const tn=v.useRef([]),mt=v.useRef(null);v.useEffect(()=>{if(ee&&ee.length>0){const q=ee.map(Ke=>Ke.field);if(mt.current===null&&(mt.current=b!==void 0&&b.length>0,mt.current)){tn.current=q;return}const le=tn.current,we=q.filter(Ke=>!le.includes(Ke));if(we.length>0){const Ke=we.filter(Le=>!Ze.includes(Le));if(Ke.length>0){const Le=[...Ze,...Ke];it(Le),S?.(Le)}}tn.current=q}},[ee]),v.useEffect(()=>{_||Be(1)},[n,_]),v.useEffect(()=>{const q=le=>{ot.current&&!ot.current.contains(le.target)&&Re(!1)};return _e&&document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[_e]);const xt=v.useMemo(()=>!y&&(!b||b.length===0)?De.filter(q=>!q.hidden):De.filter(q=>Ze.includes(q.field)),[De,Ze,y,b]),Dt=v.useMemo(()=>!te||!r||!n?n||[]:u?n:[...n].sort((q,le)=>{const we=q[te],Ke=le[te];if(we===Ke)return 0;const Le=we>Ke?1:-1;return pe==="asc"?Le:-Le}),[n,te,pe,r,u]),Ve=v.useMemo(()=>{if(_||!s)return Dt;const q=(be-1)*o,le=q+o;return Dt.slice(q,le)},[Dt,be,o,s,_]),Bt=_?w||1:be,ln=_?M||1:Math.ceil((Dt?.length||0)/o),nn=v.useCallback(q=>{_&&O?O(q):Be(q)},[_,O]),Nn=q=>{if(!r||e.find(Ke=>Ke.field===q)?.sortable===!1)return;const we=te===q&&pe==="asc"?"desc":"asc";et?(ge(q),me(we)):u&&u(q,we)},fr=v.useCallback(()=>{if(!m||!Ve)return;const q=Ve.map(we=>we[p]);if(q.every(we=>g.includes(we)))m(g.filter(we=>!q.includes(we)));else{const we=[...new Set([...g,...q])];m(we)}},[Ve,g,m,p]),bn=v.useCallback(q=>{m&&(g.includes(q)?m(g.filter(le=>le!==q)):m([...g,q]))},[g,m]),To=v.useCallback(q=>{if(De.find(Ke=>Ke.field===q)?.required)return;const we=Ze.includes(q)?Ze.filter(Ke=>Ke!==q):[...Ze,q];it(we),S?.(we)},[De,Ze,S]),Ao=v.useCallback((q,le)=>{C?.(q,le)},[C]),Do=v.useCallback(q=>k?k.map(le=>{let we=le.disabled??!1;if(le.disabledField&&!we){const Ke=le.disabledField.split(".");let Le=q;for(const Io of Ke)Le=Le?.[Io];Le||(we=!0)}return{...le,disabled:we,onClick:()=>Ao(le.id,q)}}):[],[k,Ao]),Dr=v.useCallback(q=>{if(!Z)return!0;const le=q[Z];return Array.isArray(le)?le.length>0:!!le},[Z]),Aa=v.useCallback(q=>{const le=Se.includes(q)?Se.filter(we=>we!==q):[...Se,q];et?ze(le):U&&U(le)},[Se,U,et,ze]),Ce=v.useCallback(q=>Se.includes(q),[Se]),Y=v.useCallback(q=>G?G(q):B&&B.length>0&&We?.renderExpandContent?We.renderExpandContent({children:B,row:q,expandContext:he,componentContext:J,componentMap:Qa,keyPrefix:`expand-${q[p]}`}):null,[G,B,p,he,J,J?.state]),ie=v.useMemo(()=>!Ve||Ve.length===0?!1:Ve.every(q=>g.includes(q[p])),[Ve,g,p]),xe=v.useMemo(()=>{if(!Ve||Ve.length===0)return!1;const q=Ve.filter(le=>g.includes(le[p])).length;return q>0&&q<Ve.length},[Ve,g,p]),ft=(q,le)=>{const we=q[p],Ke=Ce(we);return h.jsxs(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 mb-4",children:[h.jsxs(I,{className:"flex items-start justify-between",children:[W&&Dr(q)&&h.jsx(oe,{onClick:()=>Aa(we),className:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors mr-2","aria-label":Ke?"Collapse card":"Expand card",children:h.jsx(re,{name:Ke?K:X,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}),f&&h.jsx(vn,{checked:g.includes(q[p]),onChange:()=>bn(q[p]),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded mr-3 mt-1"}),h.jsx(I,{className:"flex-1",children:h.jsx(I,{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:le.map(Le=>h.jsxs(I,{className:"min-w-0",children:[h.jsx(Q,{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase",children:Le.header}),h.jsx(I,{className:"text-sm text-gray-900 dark:text-gray-200 mt-0.5 break-words",children:Le.cellChildren&&Le.cellChildren.length>0?Ss(Le.cellChildren,q,q[Le.field],`card-${q[p]}-${Le.field}`,J):Le.render?Le.render(q[Le.field],q):Ja(q[Le.field])})]},Le.field))})}),k&&k.length>0&&h.jsx(I,{className:"ml-2",children:h.jsx(bs,{items:Do(q),triggerLabel:"",triggerIconName:de.EllipsisHorizontal})})]}),W&&Ke&&Dr(q)&&h.jsx(I,{className:"mt-4 pt-4 border-t border-gray-200 dark:border-gray-700",children:Y(q)}),(ce&&ce.length>0||ve)&&qd(ue,q)&&h.jsx(I,{className:ae?`mt-3 ${ae}`:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-700",children:ve?ve(q):Ra(ce,q,`card-subrow-${we}`,J)})]})};return He?h.jsxs(I,{id:t,className:`w-full ${a}`,style:l,...Ue,children:[y&&h.jsx(I,{className:"mb-4 flex justify-end",children:h.jsxs(I,{ref:ot,className:"relative",children:[h.jsxs(oe,{onClick:()=>Re(!_e),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700",children:[h.jsx(re,{name:de.Cog,className:"w-4 h-4 text-gray-500 dark:text-gray-400"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:Pe})]}),_e&&h.jsx(I,{className:"absolute right-0 z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",children:h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:De.map(q=>h.jsxs(I,{className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${q.required?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:()=>!q.required&&To(q.field),children:[h.jsx(vn,{checked:Ze.includes(q.field),disabled:q.required,onChange:()=>{},className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"}),h.jsxs(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:[q.header,q.required&&h.jsxs(Q,{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:["(",st,")"]})]})]},q.field))})})]})}),f&&g.length>0&&ut&&h.jsx(I,{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:ut.replace("{count}",String(g.length))}),h.jsx(I,{id:t?`${t}__body`:void 0,children:Ve&&Ve.length>0?Ve.map((q,le)=>h.jsx(I,{children:E?E(q,xt):ft(q,xt)},q[p]||le)):h.jsx(I,{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:Ie})}),fe&&fe.length>0&&Ve&&Ve.length>0&&h.jsx(I,{className:`rounded-lg p-4 mt-2 ${ye}`,children:ke&&ke.length>0?Ss(ke,{},null,"footer-card",J):h.jsx(I,{className:"space-y-1",children:fe.filter(q=>q.text||q.children&&q.children.length>0).map((q,le)=>{const we=xt.find(Ke=>Ke.field===q.field);return h.jsxs(I,{className:"flex justify-between text-sm",children:[h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:we?.header||""}),h.jsx(Q,{className:q.className||"text-gray-900 dark:text-gray-100",children:q.children&&q.children.length>0?Ss(q.children,{},null,`footer-mobile-${le}`,J):q.text||""})]},`footer-mobile-${le}`)})})}),s&&(N||ln>1)&&h.jsx(I,{className:"flex justify-center mt-4",children:h.jsx(Po,{currentPage:Bt,totalPages:ln,onPageChange:nn,showFirstLast:H,maxVisiblePages:5,prevText:se,nextText:Oe})})]}):h.jsxs(I,{id:t,className:`w-full ${a}`,style:l,...Ue,children:[y&&h.jsx(I,{className:"mb-4 flex justify-end",children:h.jsxs(I,{ref:ot,className:"relative",children:[h.jsxs(oe,{onClick:()=>Re(!_e),className:"flex items-center gap-2 px-4 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700",children:[h.jsx(re,{name:de.Cog,className:"w-4 h-4 text-gray-500 dark:text-gray-400"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:Pe})]}),_e&&h.jsx(I,{className:"absolute right-0 z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",children:h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:De.map(q=>h.jsxs(I,{className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${q.required?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:()=>!q.required&&To(q.field),children:[h.jsx(vn,{checked:Ze.includes(q.field),disabled:q.required,onChange:()=>{},className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"}),h.jsxs(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:[q.header,q.required&&h.jsxs(Q,{className:"text-xs text-gray-500 dark:text-gray-400 ml-1",children:["(",st,")"]})]})]},q.field))})})]})}),f&&g.length>0&&ut&&h.jsx(I,{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:ut.replace("{count}",String(g.length))}),h.jsx(I,{id:t?`${t}__body`:void 0,className:"overflow-x-auto border border-gray-200 dark:border-gray-700 rounded-lg",children:h.jsxs($a,{className:"w-full",children:[h.jsx(Fa,{className:"bg-gray-50 dark:bg-gray-700",children:h.jsxs(Jn,{children:[W&&h.jsx($r,{className:"px-2 py-3",style:{width:V}}),f&&h.jsx($r,{className:"px-4 py-3 w-10",children:h.jsx(vn,{checked:ie,ref:q=>{q&&(q.indeterminate=xe)},onChange:fr,className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"})}),xt.map(q=>h.jsxs($r,{className:`px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider ${r&&q.sortable!==!1?"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-600":""}`,style:{width:q.width,minWidth:q.width},onClick:()=>Nn(q.field),children:[q.header,te===q.field&&h.jsx(Q,{className:"ml-1",children:pe==="asc"?"↑":"↓"})]},q.field)),k&&k.length>0&&h.jsx($r,{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider w-24",children:je})]})}),h.jsx(za,{className:`bg-white dark:bg-gray-800 ${ae?"":"divide-y divide-gray-200 dark:divide-gray-700"}`,children:Ve&&Ve.length>0?Ve.map((q,le)=>{const we=q[p]||le,Ke=Ce(we);return h.jsxs(v.Fragment,{children:[h.jsxs(Jn,{className:`${i?"cursor-pointer":""} hover:bg-gray-50 dark:hover:bg-gray-700 ${g.includes(q[p])?"bg-blue-50 dark:bg-blue-900/20":""} ${ae&&le>0?"border-t border-gray-200 dark:border-gray-700":""}`,onClick:()=>i?.(q),children:[W&&h.jsx(Kt,{className:"px-2 py-4 text-center",onClick:Le=>Le.stopPropagation(),children:Dr(q)?h.jsx(oe,{onClick:()=>Aa(we),className:"p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors","aria-label":Ke?"Collapse row":"Expand row",children:h.jsx(re,{name:Ke?K:X,className:"w-4 h-4 text-gray-500 dark:text-gray-400"})}):null}),f&&h.jsx(Kt,{className:"px-4 py-4",onClick:Le=>Le.stopPropagation(),children:h.jsx(vn,{checked:g.includes(q[p]),onChange:()=>bn(q[p]),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded"})}),xt.map(Le=>h.jsx(Kt,{className:"px-6 py-4 align-top whitespace-nowrap text-sm text-gray-900 dark:text-gray-200",style:{width:Le.width,minWidth:Le.width},children:Le.cellChildren&&Le.cellChildren.length>0?Ss(Le.cellChildren,q,q[Le.field],`${q[p]}-${Le.field}`,J):Le.render?Le.render(q[Le.field],q):Ja(q[Le.field])},Le.field)),k&&k.length>0&&h.jsx(Kt,{className:"px-6 py-4 text-right",onClick:Le=>Le.stopPropagation(),children:h.jsx(bs,{items:Do(q),triggerLabel:"",triggerIconName:de.EllipsisHorizontal,position:"right"})})]}),W&&Ke&&Dr(q)&&h.jsx(Jn,{className:"bg-gray-50 dark:bg-gray-900",children:h.jsx(Kt,{colSpan:xt.length+1+(f?1:0)+(k&&k.length>0?1:0),className:"px-6 py-4",children:Y(q)})}),(ce&&ce.length>0||ve)&&qd(ue,q)&&h.jsx(Jn,{className:ae?"!border-t-0":"",children:h.jsx(Kt,{colSpan:xt.length+(W?1:0)+(f?1:0)+(k&&k.length>0?1:0),className:ae?"p-2":ae||"px-6 py-2 bg-gray-50 dark:bg-gray-900",children:ae?h.jsx(I,{className:ae,children:ve?ve(q):Ra(ce,q,`subrow-${we}`,J)}):ve?ve(q):Ra(ce,q,`subrow-${we}`,J)})})]},we)}):h.jsx(Jn,{children:h.jsx(Kt,{colSpan:xt.length+(W?1:0)+(f?1:0)+(k&&k.length>0?1:0),className:"px-6 py-8 text-center text-gray-500 dark:text-gray-400",children:Ie})})}),fe&&fe.length>0&&Ve&&Ve.length>0&&h.jsx(Va,{children:h.jsxs(Jn,{className:ye,children:[W&&h.jsx(Kt,{className:"px-2 py-4"}),f&&h.jsx(Kt,{className:"px-4 py-4"}),(()=>{const q=new Map(fe.filter(le=>le.field).map(le=>[le.field,le]));return xt.map(le=>{const we=q.get(le.field);return we?h.jsx(Kt,{className:`px-6 py-4 text-sm text-gray-900 dark:text-gray-200 ${we.className||""}`,colSpan:we.colSpan,style:{width:le.width,minWidth:le.width},children:we.children&&we.children.length>0?Ss(we.children,{},null,`footer-${le.field}`,J):we.text||""},`footer-${le.field}`):h.jsx(Kt,{className:"px-6 py-4",style:{width:le.width,minWidth:le.width}},`footer-${le.field}`)})})(),k&&k.length>0&&h.jsx(Kt,{className:"px-6 py-4"})]})})]})}),s&&(N||ln>1)&&h.jsx(I,{className:"flex justify-center mt-4",children:h.jsx(Po,{currentPage:Bt,totalPages:ln,onPageChange:nn,showFirstLast:H,maxVisiblePages:5,prevText:se,nextText:Oe})})]})},el=window.G7Core?.createLogger?.("Comp:CardGrid")??{log:(...t)=>console.log("[Comp:CardGrid]",...t),warn:(...t)=>console.warn("[Comp:CardGrid]",...t),error:(...t)=>console.error("[Comp:CardGrid]",...t)},Wb=(t,e)=>window.G7Core?.t?.(t,e)??t,Gb=()=>window.G7Core?.getComponentMap?.()||{},Yb=(t,e)=>{if(!t)return!0;const n=t.match(/^\{\{(.+)\}\}$/);if(!n)return!0;const r=n[1].trim();if(el.log("evaluateCondition:",{condition:t,expr:r,row:e,rowStatus:e?.status}),/[&|<>=!]/.test(r)||r.includes(".length"))try{const o=!!new Function("row",`return ${r}`)(e);return el.log("evaluateCondition result:",o),o}catch(s){return el.warn("evaluateCondition: 표현식 평가 실패:",r,s),!1}if(r.startsWith("!row.")){const s=r.slice(5);return!e[s]}if(r.startsWith("row.")){const s=r.slice(4);return!!e[s]}return!0},Zd=(t,e,n,r,s)=>{const o=window.G7Core;if(t.name==="ActionMenu"){if(r&&r.length>0&&s)return{...t,props:{...t.props,items:r.map(i=>({...i,onClick:()=>s(i.id,e)}))}};if(t.actions&&Array.isArray(t.actions)){const i=t.props?.items||[],a=new Map(t.actions.map(c=>[c.id,c])),l=i.map(c=>{if(typeof c.onClick=="string"){const d=c.onClick,u=a.get(d);if(u&&o?.ActionDispatcher)return{...c,onClick:()=>{const f={...n};o.ActionDispatcher.dispatch(u,f)}}}return c});return{...t,props:{...t.props,items:l}}}}return t.children&&Array.isArray(t.children)?{...t,children:t.children.map(i=>Zd(i,e,n,r,s))}:t},Xb=(t,e,n,r="",s,o)=>{const i=window.G7Core;if(i?.renderItemChildren){const a=t.filter(d=>{const u=d.condition||d.if;return u?Yb(u,e):!0}),l={row:e,$value:e,index:n},c=a.map(d=>Zd(d,e,l,s,o));try{const d=Gb();return i.renderItemChildren(c,l,d,r)}catch{return h.jsxs(I,{className:"text-red-600 dark:text-red-400 p-4",children:[h.jsx(bt,{children:"컴포넌트 로드 실패"}),h.jsx(bt,{className:"text-sm",children:"[CardGrid] 데이터를 표시할 수 없습니다."})]})}}return null},tl=(t,e)=>{if(t.name==="Div"&&t.children&&t.children.length>0){const n=t.children.map((r,s)=>tl(r,`${e}-child-${s}`)).filter(Boolean);return h.jsx(I,{className:t.props?.className||"",children:n},e)}return h.jsx(I,{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-full animate-pulse"},e)},Qd=(t,e="skeleton")=>!t||t.length===0?null:t.map((n,r)=>{const s=`${e}-${n.id||n.name}-${r}`;return n.condition||n.if?null:(n.iteration,tl(n,s))}).filter(Boolean),Kb=({data:t,cardColumns:e=[],gridColumns:n=3,gap:r=4,responsiveColumns:s,cardClassName:o="",idField:i="id",pagination:a=!0,pageSize:l=12,serverSidePagination:c=!1,serverCurrentPage:d,serverTotalPages:u,alwaysShowPagination:f=!1,onPageChange:g,paginationInfoText:m,rowActions:p,onRowAction:y,className:b="",style:S,emptyMessage:x,prevText:E,nextText:k,showSkeleton:C=!0,skeletonCount:N,skeletonCellChildren:_,id:w,editorAttrs:M})=>{const O=x??Wb("common.no_data"),L=e[0]?.cellChildren||[],[F,$]=v.useState(1);window.G7Core?.useResponsive?.();const A=c?d??1:F,T=c?u??1:Math.ceil((t?.length??0)/l),z=G=>{c?g?.(G):$(G)},H=v.useCallback((G,V)=>{y?.(G,V)},[y]),W=v.useMemo(()=>{if(!t)return[];if(!a||c)return t;const G=(F-1)*l,V=G+l;return t.slice(G,V)},[t,a,c,F,l]),j=v.useMemo(()=>{const G=[],V=s?.sm??1;G.push(`grid-cols-${V}`),s?.sm&&G.push(`sm:grid-cols-${s.sm}`);const K=s?.md??Math.min(n,2);G.push(`md:grid-cols-${K}`);const X=s?.lg??n;return G.push(`lg:grid-cols-${X}`),s?.xl&&G.push(`xl:grid-cols-${s.xl}`),G.join(" ")},[n,s]),U=v.useMemo(()=>C?_&&_.length>0?Qd(_,"custom-skeleton"):L&&L.length>0?Qd(L,"auto-skeleton"):null:null,[C,_,L]);if(!t){if(!C)return null;const G=N??n;return h.jsx(I,{className:`grid ${j} gap-${r} ${b}`,style:S,id:w,...M,children:Array.from({length:G}).map((V,K)=>h.jsx(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6 space-y-4",children:U},`skeleton-${K}`))})}if(W.length===0)return h.jsx(I,{className:b,style:S,id:w,...M,children:h.jsx(I,{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-12",children:h.jsx(bt,{className:"text-center text-gray-600 dark:text-gray-400",children:O})})});const B=a&&(f||T>1);return h.jsxs(I,{className:b,style:S,id:w,...M,children:[h.jsx(I,{className:`grid ${j} gap-${r}`,children:W.map((G,V)=>h.jsx(I,{className:o,children:Xb(L,G,V,`card-${V}`,p,H)},G[i]||V))}),B&&h.jsxs(I,{className:"mt-6 space-y-4 flex flex-col items-center",children:[h.jsx(Po,{currentPage:A,totalPages:T,onPageChange:z,showFirstLast:!1,maxVisiblePages:5,prevText:E,nextText:k}),m&&h.jsx(I,{className:"text-sm text-gray-600 dark:text-gray-400 text-center",children:m})]})]})},qb=(t,e)=>window.G7Core?.t?.(t,e)??t,Uo=({isOpen:t,onClose:e,title:n,titlePrefix:r,titleSuffix:s,closeOnBackdropClick:o=!0,closeOnOverlayClick:i,showCloseButton:a=!0,closeOnEscape:l=!0,children:c,width:d="500px",className:u="",style:f,__dataContext:g,__translationContext:m})=>{const p=i!==void 0?i:o,y=v.useRef(null),b=v.useRef(null);if(v.useEffect(()=>{const E=k=>{k.key==="Escape"&&t&&l&&e()};if(t&&l)return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[t,e,l]),v.useEffect(()=>{if(t&&y.current){b.current=document.activeElement;const E=y.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),k=E[0],C=E[E.length-1];k?.focus();const N=_=>{_.key==="Tab"&&(_.shiftKey?document.activeElement===k&&(_.preventDefault(),C?.focus()):document.activeElement===C&&(_.preventDefault(),k?.focus()))};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N),b.current?.focus()}}},[t]),v.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),!t)return null;const S=f?.zIndex??50,x=(E,k)=>{if(!E||E.length===0)return null;const C=window.G7Core;if(!C)return null;const N=C.getDynamicRenderer?.();return N?E.map((_,w)=>h.jsx(N,{componentDef:_,dataContext:g||{},translationContext:m,registry:C.getComponentRegistry(),bindingEngine:C.getDataBindingEngine(),translationEngine:C.getTranslationEngine(),actionDispatcher:C.getActionDispatcher(),isRootRenderer:!1},`${k}-${w}`)):null};return h.jsxs(I,{className:"modal-wrapper",style:{zIndex:S},onClick:p?e:void 0,children:[h.jsx(I,{className:"modal-backdrop","aria-hidden":"true"}),h.jsxs(I,{ref:y,className:`modal-container ${u}`,style:{width:d,...f?{...f,zIndex:void 0}:{}},onClick:E=>E.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":n?"modal-title":void 0,children:[(n||r||s||a)&&h.jsxs(I,{className:"modal-header-row",children:[h.jsxs(I,{className:"flex-center gap-sm",children:[x(r,"title-prefix"),n&&h.jsx(I,{id:"modal-title",className:"modal-title",children:n}),x(s,"title-suffix")]}),a&&h.jsx(oe,{onClick:e,className:"modal-close-btn","aria-label":qb("common.close_modal"),children:h.jsx("svg",{className:"icon-lg",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsx(I,{className:"modal-body-content",children:c})]})]})},Zb=({label:t,items:e,onItemClick:n,position:r="bottom-left",variant:s="default",className:o="",style:i,id:a,editorAttrs:l})=>{const[c,d]=v.useState(!1),[u,f]=v.useState(-1),g=v.useRef(null),m=v.useRef(null),[p,y]=v.useState(r);v.useEffect(()=>{const x=E=>{g.current&&!g.current.contains(E.target)&&(d(!1),f(-1))};if(c)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[c]),v.useEffect(()=>{const x=E=>{if(!c)return;const k=e.map((C,N)=>C.disabled?-1:N).filter(C=>C!==-1);switch(E.key){case"ArrowDown":E.preventDefault(),f(C=>{const _=(k.indexOf(C)+1)%k.length;return k[_]});break;case"ArrowUp":E.preventDefault(),f(C=>{const N=k.indexOf(C),_=N<=0?k.length-1:N-1;return k[_]});break;case"Enter":E.preventDefault(),u>=0&&!e[u].disabled&&b(e[u]);break;case"Escape":E.preventDefault(),d(!1),f(-1);break}};if(c)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[c,u,e]),v.useEffect(()=>{if(c&&m.current&&g.current){const x=m.current.getBoundingClientRect(),E=g.current.getBoundingClientRect(),k=window.innerWidth,C=window.innerHeight,N=x.width||224,_=x.height||200;let w=r;r.includes("left")?E.left+N>k&&(w=w.replace("left","right")):E.right-N<0&&(w=w.replace("right","left")),r.includes("top")?E.top-_<0&&(w=w.replace("top","bottom")):E.bottom+_>C&&(w=w.replace("bottom","top")),y(w)}},[c,r]);const b=x=>{x.disabled||(x.onClick?.(),n?.(x.value,x),d(!1),f(-1))},S={"bottom-left":"dropdown-menu-bottom-left","bottom-right":"dropdown-menu-bottom-right","top-left":"dropdown-menu-top-left","top-right":"dropdown-menu-top-right"};return h.jsxs(I,{ref:g,className:`dropdown ${o}`,style:i,id:a,...l,children:[h.jsxs(oe,{onClick:()=>d(!c),className:s==="text"?"dropdown-trigger-text":"dropdown-trigger","aria-haspopup":"true","aria-expanded":c,children:[t,s!=="text"&&h.jsx("svg",{className:`inline-block ml-2 w-4 h-4 transition-transform ${c?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),c&&h.jsx(I,{ref:m,className:`dropdown-menu ${S[p]}`,role:"menu","aria-orientation":"vertical",children:h.jsx(I,{className:"py-1",children:e.map((x,E)=>h.jsx(I,{className:`${x.disabled?"dropdown-item-disabled":"dropdown-item"} ${u===E?"dropdown-item-focused":""}`,onClick:()=>b(x),onMouseEnter:()=>!x.disabled&&f(E),role:"menuitem","aria-disabled":x.disabled,tabIndex:x.disabled?-1:0,children:x.label},x.value))})})]})},Qb=({imageUrl:t,imageAlt:e="",title:n,subtitle:r,description:s,price:o,originalPrice:i,discountRate:a,currency:l="₩",buttonText:c="자세히 보기",onButtonClick:d,className:u="",style:f,id:g,editorAttrs:m})=>{const p=a&&a>0,y=(o??0).toLocaleString(),b=i?.toLocaleString();return h.jsxs(I,{className:`rounded-lg bg-white dark:bg-gray-800 shadow-md hover:shadow-xl transition-shadow border border-gray-200 dark:border-gray-700 overflow-hidden ${u}`,style:f,id:g,...m,children:[t&&h.jsxs(I,{className:"relative w-full",children:[h.jsx(yn,{src:t,alt:e||n,className:"w-full h-64 object-cover"}),p&&h.jsx(I,{className:"absolute top-2 right-2 bg-red-500 text-white px-2 py-1 rounded-md",children:h.jsxs(Q,{className:"text-sm font-bold",children:["-",a,"%"]})})]}),h.jsxs(I,{className:"p-4",children:[r&&h.jsx(Ir,{className:"text-xs font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wider mb-2",children:r}),h.jsx(Qn,{className:"text-xl font-bold text-gray-900 dark:text-white mb-2 line-clamp-2",children:n}),s&&h.jsx(bt,{className:"text-sm text-gray-600 dark:text-gray-400 mb-4 line-clamp-3",children:s}),h.jsxs(I,{className:"flex items-center gap-2 mb-4",children:[h.jsxs(Q,{className:"text-2xl font-bold text-gray-900 dark:text-white",children:[l,y]}),i&&h.jsxs(Q,{className:"text-sm text-gray-400 dark:text-gray-500 line-through",children:[l,b]})]}),c&&h.jsx(oe,{onClick:d,className:"w-full bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg transition-colors",children:c})]})]})},Jb=({value:t,label:e,change:n,changeLabel:r="전월 대비",iconName:s,trend:o="neutral",className:i="",style:a,id:l,editorAttrs:c})=>{const d=o==="up",u=o==="down",f=n!==void 0?Math.abs(n):0,g=d?"stats-trend-up":u?"stats-trend-down":"stats-trend-neutral",m=d?de.ArrowUp:u?de.ArrowDown:void 0;return h.jsxs(I,{className:`stat-card ${i}`,style:a,id:l,...c,children:[h.jsxs(I,{className:"flex-between mb-md",children:[s&&h.jsx(I,{className:"stats-icon stats-icon-blue",children:h.jsx(re,{name:s,className:"icon-lg"})}),n!==void 0&&h.jsxs(I,{className:`stats-change ${g}`,children:[m&&h.jsx(re,{name:m,className:"icon-sm"}),h.jsxs(Q,{className:"text-sm font-semibold",children:[f,"%"]})]})]}),h.jsx(Ir,{className:"stats-value-lg",children:typeof t=="number"?t.toLocaleString():t}),h.jsx(bt,{className:"stats-label",children:e}),n!==void 0&&r&&h.jsx(I,{className:"stats-sublabel",children:h.jsx(Q,{children:r})})]})},Jd=()=>window.G7Core,Rd=(t,e)=>Jd()?.t?.(t,e)??t,Rb=({name:t="search",placeholder:e,value:n,onChange:r,onSubmit:s,showButton:o=!1,suggestions:i=[],onSuggestionClick:a,showSuggestions:l=!1,className:c="",style:d,id:u,editorAttrs:f})=>{const g=e??Rd("common.search_placeholder"),[m,p]=v.useState(""),[y,b]=v.useState(!1),S=v.useRef(null),x=v.useRef(""),E=n!==void 0?n:m,k=l&&y&&i.length>0&&E.length>0,C="w-64 pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-sm",N=Jd()?.style?.mergeClasses?.(C,c)??`${C} ${c}`;v.useEffect(()=>{n!==void 0&&(x.current=n)},[n]);const _=O=>{const L=O.target.value;p(L),r?.(O),x.current!==""&&L===""&&!O.nativeEvent.inputType&&setTimeout(()=>{const F=S.current?.querySelector("form");F&&F.requestSubmit()},0),x.current=L},w=O=>{p(O.text);const L={target:{value:O.text,name:t}};r?.(L),a?.(O),b(!1)},M=O=>{O.preventDefault(),s?.(O)};return h.jsxs(I,{ref:S,className:"relative",style:d,id:u,...f,children:[h.jsx(Pa,{onSubmit:M,className:"relative",children:h.jsxs(I,{className:`relative flex items-center ${o?"gap-2":""}`,children:[h.jsxs(I,{className:"relative flex-1",children:[h.jsx(I,{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",children:h.jsx(re,{name:de.Search,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),h.jsx(wt,{type:"search",name:t,value:E,onChange:_,onFocus:()=>b(!0),onBlur:()=>setTimeout(()=>b(!1),200),placeholder:g,className:N})]}),o&&h.jsx(oe,{type:"submit",className:"px-4 py-2 bg-gray-800 dark:bg-gray-600 text-white rounded-lg hover:bg-gray-900 dark:hover:bg-gray-500 transition-colors text-sm font-medium cursor-pointer h-[42px]",children:Rd("common.search")})]})}),k&&h.jsx(I,{className:"absolute z-10 w-full mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-64 overflow-y-auto",children:i.map(O=>h.jsx(I,{className:"px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer border-b border-gray-100 dark:border-gray-700 last:border-b-0 transition-colors",onClick:()=>w(O),children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:de.Search,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:O.text})]})},O.id))})]})},nl=(t,e)=>window.G7Core?.t?.(t,e)??t,ey=({title:t,filters:e,onChange:n,onReset:r,showResetButton:s=!0,className:o="",style:i,id:a,editorAttrs:l})=>{const c=t??nl("common.filter"),d=(f,g)=>{n?.(f,g)},u=(f,g,m)=>{const p=e.find(b=>b.id===f);if(!p)return;const y=Array.isArray(p.value)?p.value:[];if(typeof g=="string"){const b=y.filter(x=>typeof x=="string"),S=m?[...b,g]:b.filter(x=>x!==g);n?.(f,S)}else{const b=y.filter(x=>typeof x=="number"),S=m?[...b,g]:b.filter(x=>x!==g);n?.(f,S)}};return h.jsxs(I,{className:`rounded-lg bg-white dark:bg-gray-800 shadow-md border border-gray-200 dark:border-gray-700 p-4 ${o}`,style:i,id:a,...l,children:[h.jsxs(I,{className:"flex items-center justify-between mb-4 pb-3 border-b border-gray-200 dark:border-gray-700",children:[h.jsx(Q,{className:"text-lg font-semibold text-gray-900 dark:text-white",children:c}),s&&r&&h.jsx(oe,{onClick:r,className:"text-sm text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:nl("common.reset")})]}),h.jsx(I,{className:"space-y-4",children:e.map(f=>h.jsxs(I,{className:"space-y-2",children:[h.jsx(rn,{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:f.label}),f.type==="select"&&h.jsxs(Pr,{value:f.value,onChange:g=>d(f.id,g.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 focus:border-blue-500 dark:focus:border-blue-400 bg-white dark:bg-gray-700 text-gray-900 dark:text-white",children:[h.jsx("option",{value:"",children:nl("common.select_placeholder")}),f.options.map(g=>h.jsx("option",{value:g.value,children:g.label},g.id))]}),f.type==="checkbox"&&h.jsx(I,{className:"space-y-2",children:f.options.map(g=>{const m=Array.isArray(f.value)?f.value.some(p=>p===g.value):!1;return h.jsxs(rn,{className:"flex items-center gap-2 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-md transition-colors",children:[h.jsx(vn,{checked:m,onChange:p=>u(f.id,g.value,p.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-500"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:g.label})]},g.id)})})]},f.id))})]})},ty=({tabs:t,activeTabId:e,onTabChange:n,variant:r="default",className:s="",style:o,mobileBreakpoint:i=768,id:a,editorAttrs:l})=>{const d=window.G7Core?.useResponsive,u=d?.(),f=u?u.width<i:typeof window<"u"&&window.innerWidth<i,g=S=>{!S.disabled&&S.id!==e&&n?.(S.id)},m=S=>{const x=S.target.value,E=Number(x),k=typeof x=="string"&&x!==""&&!Number.isNaN(E)?E:x,C=t.find(N=>String(N.id)===String(k));C&&g(C)};if(f)return h.jsx(I,{className:s,style:o,id:a,...l,children:h.jsx(Pr,{value:e!==void 0?String(e):"",onChange:m,options:t.map(S=>({value:String(S.id),label:S.badge!==void 0?`${S.label} (${S.badge})`:S.label,disabled:S.disabled})),className:"w-full"})});const p=S=>{const x=S.id===e;if(S.disabled)return"tab-btn-base tab-btn-disabled";switch(r){case"pills":return x?"tab-btn-base tab-btn-pills-active":"tab-btn-base tab-btn-pills";case"underline":return x?"tab-btn-base tab-btn-underline-active":"tab-btn-base tab-btn-underline";default:return x?"tab-btn-base tab-btn-default-active":"tab-btn-base tab-btn-default"}},y=r==="underline"?"tab-nav-underline":"tab-nav-default",b=l?.["data-editor-path"];return h.jsx(Lo,{className:`${y} ${s}`,style:o,id:a,...l,children:t.map((S,x)=>h.jsxs(oe,{type:"button",onClick:()=>g(S),disabled:S.disabled,className:p(S),...b?{"data-editor-item-path":`${b}.props.tabs.${x}`}:{},children:[S.iconName&&h.jsx(re,{name:S.iconName,className:"w-4 h-4"}),h.jsx(Q,{children:S.label}),S.badge!==void 0&&h.jsx(I,{className:"flex items-center justify-center min-w-[20px] h-5 px-1.5 bg-red-500 text-white text-xs font-bold rounded-full",children:h.jsx(Q,{children:S.badge})})]},S.id))})},rl=window.G7Core?.createLogger?.("Handler:ScrollToSection")??{log:(...t)=>console.log("[Handler:ScrollToSection]",...t),warn:(...t)=>console.warn("[Handler:ScrollToSection]",...t),error:(...t)=>console.error("[Handler:ScrollToSection]",...t)};async function eu(t,e){const n=t.params||{},{targetId:r,offset:s=120,delay:o=100,scrollContainerId:i}=n;if(!r){rl.warn("targetId is required");return}const a=await ny(r,o);if(!a){rl.warn(`Element not found: ${r}`);return}const l=ry(a,i),c=sy(a,l,s);oy(l,c)}async function ny(t,e){await new Promise(s=>setTimeout(s,e));const n=10,r=50;for(let s=0;s<n;s++){const o=document.getElementById(t);if(o)return await new Promise(i=>setTimeout(i,50)),o;await new Promise(i=>setTimeout(i,r))}return null}function ry(t,e){if(e){const o=document.getElementById(e);if(o&&tu(o))return o;rl.warn(`Container '${e}' ${o?"has no scroll":"not found"}, trying auto-detect`)}let n=t.parentElement,r=0;const s=10;for(;n&&n!==document.body&&r<s;){if(tu(n))return n;n=n.parentElement,r++}return window}function tu(t){const e=window.getComputedStyle(t);return(e.overflowY==="auto"||e.overflowY==="scroll")&&t.scrollHeight>t.clientHeight}function sy(t,e,n){if(e===window||!("getBoundingClientRect"in e))return t.getBoundingClientRect().top+window.pageYOffset-n;{const r=e.getBoundingClientRect(),s=t.getBoundingClientRect();return e.scrollTop+(s.top-r.top)-n}}function oy(t,e){t===window||!("scrollTo"in t)?window.scrollTo({top:e,behavior:"smooth"}):t.scrollTo({top:e,behavior:"smooth"})}window.G7Core?.createLogger?.("Comp:TabNavigation");const iy=({tabs:t,activeTabId:e,className:n="bg-white dark:bg-gray-800 flex gap-2 border-b border-gray-200 dark:border-gray-700 px-6",style:r,activeClassName:s="tab-btn-base tab-btn-default-active",inactiveClassName:o="tab-btn-base tab-btn-default",sectionIdPrefix:i="tab_content_",scrollOffset:a=120,scrollDelay:l=100,onTabChange:c,enableScrollSpy:d=!1,scrollSpyOffset:u=80,scrollContainerId:f,id:g,editorAttrs:m})=>{const[p,y]=v.useState(e??(t.length>0?t[0].id:"")),S=window.G7Core?.useResponsive,x=S?.(),E=x?x.width<768:typeof window<"u"&&window.innerWidth<768,k=v.useRef(!1),C=v.useRef(null),N=w=>{if(d&&(k.current=!0,C.current&&clearTimeout(C.current)),w.onClick){if(w.onClick(w.id),!d)return}else if(c){if(c(w.id),!d)return}else y(w.id);const M=w.scrollOffset??a,O=w.scrollDelay??l;eu({params:{targetId:`${i}${w.id}`,offset:M,delay:O,scrollContainerId:f}}),d&&(C.current=setTimeout(()=>{k.current=!1},O+500))};v.useEffect(()=>{if(!d)return;const w=f?document.getElementById(f):null,M={root:w??null,rootMargin:`-${u}px 0px -30% 0px`,threshold:[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1]},O=new Map,L=()=>{const A=w,T=A?A.scrollTop:window.pageYOffset||document.documentElement.scrollTop,z=A?A.scrollHeight:document.documentElement.scrollHeight,H=A?A.clientHeight:document.documentElement.clientHeight;return T+H>=z-10},F=A=>{if(k.current)return;A.forEach(U=>{const B=U.target.id;U.isIntersecting?O.set(B,U.intersectionRatio):O.delete(B)});let T=0,z="";O.forEach((U,B)=>{U>T&&(T=U,z=B)});const H=t[t.length-1],W=`${i}${H?.id}`,j=O.has(W);if(L()&&j&&H){y(H.id);return}if(z){const U=z.replace(i,""),B=Number(U),G=isNaN(B)?U:B;t.some(K=>K.id===G)&&y(G)}},$=()=>{},D=new IntersectionObserver(F,M);return t.forEach(A=>{const T=document.getElementById(`${i}${A.id}`);T&&D.observe(T)}),window.addEventListener("scroll",$,{passive:!0}),()=>{D.disconnect(),window.removeEventListener("scroll",$),C.current&&clearTimeout(C.current)}},[d,t,i,u,f]);const _=w=>{const M=w.target.value,O=Number(M),L=isNaN(O)?M:O,F=t.find($=>$.id===L);F&&N(F)};return E?h.jsx(I,{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-4 py-3",id:g,...m,children:h.jsx(Pr,{value:String(p),onChange:_,options:t.map(w=>({value:String(w.id),label:w.label,disabled:w.disabled})),className:"w-full"})}):h.jsx(I,{className:n,style:r,id:g,...m,children:t.map(w=>h.jsxs(oe,{className:p===w.id?s:o,disabled:w.disabled,onClick:()=>N(w),children:[w.iconName&&h.jsx(re,{name:w.iconName,size:"sm"}),h.jsx(Q,{children:w.label})]},w.id))})},ay=()=>window.G7Core,ly=({iconName:t,label:e,onClick:n,variant:r="primary",size:s="md",disabled:o=!1,className:i="",style:a,id:l,editorAttrs:c})=>{const d={sm:e?"px-3 py-1.5 text-sm":"w-8 h-8",md:e?"px-4 py-2 text-base":"w-10 h-10",lg:e?"px-5 py-2.5 text-lg":"w-12 h-12"},u={sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},f={primary:"bg-blue-600 hover:bg-blue-700 text-white border-transparent",secondary:"bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600",danger:"bg-red-600 hover:bg-red-700 text-white border-transparent",ghost:"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 border-transparent",outline:"bg-transparent hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600"},g="inline-flex items-center justify-center gap-2 font-medium rounded-lg border transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-blue-400",m=o?"opacity-50 cursor-not-allowed":"",p=`${g} ${d[s]} ${f[r]} ${m}`,y=ay()?.style?.mergeClasses?.(p,i)??`${p} ${i}`;return h.jsxs(oe,{onClick:n,disabled:o,className:y,style:a,id:l,...c,children:[h.jsx(re,{name:t,className:u[s]}),e]})},cy=(t,e)=>window.G7Core?.t?.(t,e)??t,nu=({isOpen:t,onClose:e,title:n,content:r,actions:s=[],width:o="500px",closeOnOverlay:i=!0,showCloseButton:a=!0,className:l="",style:c})=>{const d=()=>{i&&e()},u={primary:"dialog-btn-primary",secondary:"dialog-btn-secondary",danger:"dialog-btn-danger",ghost:"dialog-btn-ghost"};return h.jsxs(Uo,{isOpen:t,onClose:d,width:o,className:l,style:c,children:[h.jsxs(I,{className:"dialog-header",children:[h.jsx(Qn,{className:"dialog-title",children:n}),a&&h.jsx(oe,{onClick:e,className:"dialog-close","aria-label":cy("common.close_dialog"),children:h.jsx(re,{name:de.Times,className:"icon-md"})})]}),h.jsx(I,{className:"dialog-body",children:r}),s.length>0&&h.jsx(I,{className:"dialog-footer",children:s.map((f,g)=>h.jsxs(oe,{onClick:f.onClick,disabled:f.disabled,className:u[f.variant||"primary"],children:[f.iconName&&h.jsx(re,{name:f.iconName,className:"icon-sm mr-2 inline-block"}),f.label]},g))})]})},sl=(t,e)=>window.G7Core?.t?.(t,e)??t,ru=({isOpen:t,onClose:e,title:n,message:r,confirmText:s,cancelText:o,onConfirm:i,onCancel:a,confirmButtonVariant:l="primary",cancelButtonVariant:c="secondary",width:d="500px",closeOnOverlay:u=!0,isLoading:f=!1,loadingText:g})=>{const m=s??sl("common.confirm"),p=o??sl("common.cancel"),y=g??sl("common.loading"),b=()=>{i()},S=()=>{f||(a?.(),e())},x=()=>{f||e()},E={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"};return h.jsxs(Uo,{isOpen:t,onClose:x,title:n,width:d,children:[h.jsx(I,{className:"py-2",children:typeof r=="string"?h.jsx(bt,{className:"text-gray-700 dark:text-gray-300",children:r}):r}),h.jsxs(I,{className:"flex justify-end gap-3 mt-6",children:[h.jsx(oe,{onClick:S,disabled:f,className:"px-4 py-2 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:h.jsx(Q,{children:p})}),h.jsxs(oe,{onClick:b,disabled:f,className:`flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${E[l]}`,children:[f&&h.jsx(re,{name:de.Spinner,className:"w-4 h-4 animate-spin"}),h.jsx(Q,{children:f?y:m})]})]})]})},dy=(t,e)=>window.G7Core?.t?.(t,e)??t,uy=({isOpen:t,onClose:e,title:n,message:r,confirmText:s,onConfirm:o,confirmButtonVariant:i="primary",width:a="500px",closeOnOverlay:l=!0})=>{const u=[{label:s??dy("common.confirm"),onClick:()=>{o?.(),e()},variant:i}],f=typeof r=="string"?h.jsx(bt,{className:"text-gray-700 dark:text-gray-300",children:r}):r;return h.jsx(nu,{isOpen:t,onClose:e,title:n,content:f,actions:u,width:a,closeOnOverlay:l})},fy=(t,e)=>window.G7Core?.t?.(t,e)??t,hy={success:de.CheckCircle,error:de.XCircle,warning:de.ExclamationTriangle,info:de.InfoCircle},su={success:{bg:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800",text:"text-green-800 dark:text-green-300"},error:{bg:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",text:"text-red-800 dark:text-red-300"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800",text:"text-yellow-800 dark:text-yellow-300"},info:{bg:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",text:"text-blue-800 dark:text-blue-300"}},gy={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"},py=({toasts:t,position:e="bottom-center",duration:n=3e3,onRemove:r})=>{const[s,o]=v.useState(new Map),i=v.useCallback(a=>{o(l=>{const c=new Map(l);return c.set(a,!1),c}),setTimeout(()=>{if(r)r(a);else{const l=window.G7Core;l?.state?.update&&l.state.update(c=>({toasts:(Array.isArray(c.toasts)?c.toasts:[]).filter(u=>u.id!==a)}))}},300)},[r]);return v.useEffect(()=>{!t||t.length===0||t.forEach(a=>{if(s.has(a.id))return;o(c=>{const d=new Map(c);return d.set(a.id,!0),d});const l=a.duration||n;l>0&&setTimeout(()=>{i(a.id)},l)})},[t,n,i,s]),!t||t.length===0?null:h.jsx(I,{className:`fixed z-[9999] flex flex-col gap-2 ${gy[e]}`,"aria-live":"polite","aria-atomic":"true",children:t.map(a=>h.jsx(my,{toast:a,position:e,isVisible:s.get(a.id)??!0,onClose:()=>i(a.id)},a.id))})},my=({toast:t,position:e,isVisible:n,onClose:r})=>{const s=su[t.type]||su.info,o=t.icon?t.icon:hy[t.type],i=e.startsWith("bottom")?"translate-y-2":"-translate-y-2";return h.jsxs(I,{className:`
|
||
flex items-center gap-3 p-4 rounded-lg border shadow-lg
|
||
min-w-[300px] max-w-md
|
||
transition-all duration-300
|
||
${s.bg}
|
||
${n?"opacity-100 translate-y-0":`opacity-0 ${i}`}
|
||
`,role:"alert",children:[h.jsx(re,{name:o,className:`w-5 h-5 flex-shrink-0 ${s.text}`}),h.jsx(Q,{className:`flex-1 text-sm font-medium ${s.text}`,children:t.message}),h.jsx(oe,{onClick:r,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${s.text} focus:outline-none`,"aria-label":fy("common.close_notification"),children:h.jsx(re,{name:de.Times,className:"w-4 h-4"})})]})},ou=({items:t,separator:e=h.jsx(re,{name:de.ChevronRight,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),showHome:n=!1,homeHref:r="/",maxItems:s,className:o="",id:i,editorAttrs:a})=>{let c=n?[{label:"Home",href:r},...t]:t,d=c,u=!1;if(s&&c.length>s){u=!0;const f=c.slice(0,1),g=c.slice(-(s-2));d=[...f,...g]}return h.jsx(Lo,{className:`flex items-center space-x-2 text-sm ${o}`,"aria-label":"Breadcrumb",id:i,...a,children:h.jsx(I,{className:"flex items-center space-x-2",children:d.map((f,g)=>{const m=g===d.length-1,p=g===0;return h.jsxs(v.Fragment,{children:[u&&p&&h.jsxs(h.Fragment,{children:[h.jsx(iu,{item:f,isLast:!1}),h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e}),h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:"..."}),d.length>1&&h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e})]}),(!u||!p)&&h.jsxs(h.Fragment,{children:[h.jsx(iu,{item:f,isLast:m}),!m&&h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e})]})]},g)})})})},iu=({item:t,isLast:e})=>e||!t.href&&!t.onClick?h.jsx(Q,{className:"font-medium text-gray-900 dark:text-white","aria-current":e?"page":void 0,children:t.label}):t.onClick?h.jsx(Lr,{href:"#",onClick:n=>{n.preventDefault(),t.onClick?.()},className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:t.label}):h.jsx(Lr,{href:t.href,className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:t.label}),by=({title:t,description:e,iconName:n,illustrationSrc:r,illustrationAlt:s="Empty state illustration",actions:o=[],className:i="",id:a,editorAttrs:l})=>{const c={primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600 focus:ring-gray-500",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500"};return h.jsxs(I,{className:`flex flex-col items-center justify-center p-8 text-center ${i}`,role:"status","aria-live":"polite",id:a,...l,children:[r?h.jsx(yn,{src:r,alt:s,className:"w-48 h-48 mb-6 object-contain"}):n?h.jsx(I,{className:"mb-6 p-4 rounded-full bg-gray-100 dark:bg-gray-700",children:h.jsx(re,{name:n,className:"w-12 h-12 text-gray-400 dark:text-gray-500"})}):null,h.jsx(Qn,{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:t}),e&&h.jsx(bt,{className:"text-gray-600 dark:text-gray-400 mb-6 max-w-md",children:e}),o.length>0&&h.jsx(I,{className:"flex flex-wrap gap-3 justify-center",children:o.map((d,u)=>h.jsxs(oe,{onClick:d.onClick,className:`
|
||
px-4 py-2 rounded-md font-medium transition-colors
|
||
focus:outline-none focus:ring-2 focus:ring-offset-2
|
||
${c[d.variant||"primary"]}
|
||
`,children:[d.iconName&&h.jsx(re,{name:d.iconName,className:"w-4 h-4 mr-2 inline-block"}),d.label]},u))})]})},yy=(t,e)=>window.G7Core?.t?.(t,e)??t,vy=({id:t,size:e="md",color:n="text-blue-600",fullscreen:r=!1,text:s,className:o="",editorAttrs:i})=>{const a={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-2",lg:"w-12 h-12 border-3",xl:"w-16 h-16 border-4"},l={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},c=h.jsxs(I,{className:`flex flex-col items-center justify-center gap-3 ${o}`,children:[h.jsx(I,{className:`
|
||
${a[e]}
|
||
border-gray-200 dark:border-gray-700 border-t-current
|
||
rounded-full animate-spin
|
||
${n}
|
||
`,role:"status","aria-label":yy("common.loading")}),s&&h.jsx(Q,{className:`${l[e]} ${n} font-medium`,children:s})]});return r?h.jsx(I,{id:t,className:"fixed inset-0 z-50 flex items-center justify-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90","aria-live":"polite","aria-busy":"true",...i,children:c}):h.jsx(I,{id:t,className:"flex items-center justify-center p-4","aria-live":"polite","aria-busy":"true",...i,children:c})},zr=()=>window.G7Core,ol=(t,e)=>window.G7Core?.t?.(t,e)??t,xy=({logo:t,logoAlt:e="Logo",menu:n=[],collapsed:r=!1,onToggleCollapse:s,className:o="",currentLocale:i,id:a,editorAttrs:l})=>{const[c,d]=v.useState(new Set),[u,f]=v.useState(i||zr()?.locale?.current?.()||"ko"),[g,m]=v.useState(window.location.pathname),p=v.useMemo(()=>{const w=[],M=O=>{for(const L of O)L.url&&w.push(L.url),L.children&&M(L.children)};return M(n),w},[n]),y=v.useCallback(w=>{let M=null;for(const O of p)(w===O||w.startsWith(O+"/"))&&(!M||O.length>M.length)&&(M=O);return M},[p]);v.useEffect(()=>{const w=zr();return w?.state?.subscribe?w.state.subscribe(O=>{const L=O?._global?.locale||w?.locale?.current?.()||"ko";f(L);const F=O?._global?.currentPath||window.location.pathname;m(F)}):void 0},[]),v.useEffect(()=>{const w=()=>{m(window.location.pathname)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[]),v.useEffect(()=>{i&&f(i)},[i]);const b=(w,M)=>!w||typeof M!="string"?!1:M===w?!0:M.startsWith(w+"/")?y(M)===w:!1,S=(w,M)=>{const O=new Set,L=F=>{for(const $ of F)if($.children&&$.children.length>0){if(L($.children)||b($.url,M))return O.add($.id),!0}else if(b($.url,M))return!0;return!1};return L(w),O};v.useEffect(()=>{if(n.length>0&&g){const w=S(n,g);w.size>0&&d(M=>new Set([...M,...w]))}},[g,n]);const x=w=>b(w,g),E=w=>w.children?w.children.some(M=>x(M.url)||E(M)):!1,k=w=>{d(M=>{const O=new Set(M);return O.has(w)?O.delete(w):O.add(w),O})},C=w=>typeof w=="string"?w:w[u]||w.en||Object.values(w)[0]||"",N=(w,M)=>{zr()?.dispatch?(w.preventDefault(),zr().navigation?.onComplete(()=>{zr().dispatch({handler:"setState",params:{target:"global",sidebarOpen:!1}})}),zr().dispatch({handler:"navigate",params:{path:M}})):window.location.href=M},_=(w,M=0,O=!1)=>{const L=w.children&&w.children.length>0,F=c.has(w.id),$=C(w.name),D=M>0,A=x(w.url),T=E(w),z=D?"admin-sidebar-subitem":"admin-sidebar-item",H="admin-sidebar-item-active",W="admin-sidebar-item-active-parent",j="admin-sidebar-item-default";return h.jsxs(I,{className:D?"relative group":"",children:[D&&h.jsxs(h.Fragment,{children:[!O&&h.jsx(I,{className:"admin-sidebar-tree-line-vertical"}),h.jsx(I,{className:"admin-sidebar-tree-line-curve"})]}),L&&w.url?h.jsxs(I,{className:`
|
||
${z}
|
||
${A?H:T?W:j}
|
||
${r?"justify-center":""}
|
||
`,children:[h.jsxs(oe,{onClick:B=>N(B,w.url),className:"flex items-center justify-start flex-1 min-w-0",children:[w.icon&&h.jsx(pt,{className:`${w.icon} ${r?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!r&&h.jsx(Q,{className:"truncate",children:$})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(oe,{onClick:()=>k(w.id),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600","aria-label":ol(F?"common.collapse":"common.expand"),children:h.jsx(pt,{className:`fas fa-chevron-down w-4 h-4 transition-transform ${F?"rotate-180":""}`})})]})]}):L?h.jsxs(oe,{onClick:()=>k(w.id),className:`
|
||
${z}
|
||
${T?W:j}
|
||
${r?"justify-center":""}
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(pt,{className:w.icon})}),!r&&h.jsx(Q,{children:$})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(pt,{className:`fas fa-chevron-right w-4 h-4 text-slate-400 transition-transform duration-200 ${F?"rotate-90":""}`})]})]}):w.url?h.jsxs(oe,{onClick:B=>N(B,w.url),className:`
|
||
${z}
|
||
${A?H:j}
|
||
${r?"justify-center":""}
|
||
text-left
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(pt,{className:w.icon})}),!r&&h.jsx(Q,{children:$})]}),!r&&w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}):h.jsxs(oe,{className:`
|
||
${z}
|
||
admin-sidebar-item-disabled
|
||
${r?"justify-center":""}
|
||
text-left
|
||
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(pt,{className:w.icon})}),!r&&h.jsx(Q,{children:$})]}),!r&&w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}),L&&!r&&F&&h.jsx(I,{className:"relative ml-2",children:w.children.map((B,G)=>_(B,M+1,G===w.children.length-1))})]},w.id)};return h.jsxs(I,{className:o,id:a,...l,children:[(t||s)&&h.jsxs(I,{className:"admin-sidebar-header",children:[t&&!r&&h.jsx(yn,{src:t,alt:e,className:"h-8"}),s&&h.jsx(oe,{onClick:s,className:"admin-sidebar-collapse-btn","aria-label":ol(r?"common.expand_sidebar":"common.collapse_sidebar"),children:h.jsx(pt,{className:`${r?"fas fa-chevron-right":"fas fa-chevron-left"} w-5 h-5 text-slate-600 dark:text-slate-400`})})]}),h.jsx(I,{className:"admin-sidebar-menu-list",children:n.map((w,M)=>_(w,0,M===n.length-1))})]})},_s=(t,e)=>window.G7Core?.t?.(t,e)??t,wy=({user:t={name:"",email:""},notifications:e=[],onNotificationClick:n,onProfileClick:r,onLogoutClick:s,className:o=""})=>{const[i,a]=v.useState(!1),[l,c]=v.useState(!1),d=v.useRef(null),u=v.useRef(null),f=e.filter(g=>!g.read).length;return v.useEffect(()=>{const g=m=>{d.current&&!d.current.contains(m.target)&&a(!1),u.current&&!u.current.contains(m.target)&&c(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),h.jsxs(I,{className:`
|
||
bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-6 py-4 flex items-center justify-end gap-4
|
||
${o}
|
||
`,children:[h.jsxs(I,{ref:d,className:"relative",children:[h.jsxs(oe,{onClick:()=>a(!i),className:"relative p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full transition-colors","aria-label":_s("common.notifications"),children:[h.jsx(re,{name:de.Bell,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),f>0&&h.jsx(Q,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 rounded-full",children:f>9?"9+":f})]}),i&&h.jsxs(I,{className:"absolute right-0 mt-2 w-80 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[h.jsx(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx(Q,{className:"font-semibold text-gray-900 dark:text-white",children:_s("common.notifications")})}),h.jsx(I,{className:"max-h-96 overflow-y-auto",children:e.length===0?h.jsx(I,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:h.jsx(Q,{children:_s("common.no_notifications")})}):e.map(g=>h.jsx(oe,{onClick:()=>{g.onClick?.(),n?.(g.id),a(!1)},className:`
|
||
w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 border-b border-gray-100 dark:border-gray-700 transition-colors
|
||
${g.read?"":"bg-blue-50 dark:bg-blue-900/20"}
|
||
`,children:h.jsxs(I,{className:"flex items-start gap-3",children:[g.iconName&&h.jsx(re,{name:g.iconName,className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5"}),h.jsxs(I,{className:"flex-1",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:g.title}),h.jsx(I,{className:"text-gray-600 dark:text-gray-400 text-sm mt-1",children:g.message}),h.jsx(I,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1",children:g.time})]}),!g.read&&h.jsx(Q,{className:"w-2 h-2 bg-blue-500 rounded-full mt-1.5"})]})},g.id))})]})]}),h.jsxs(I,{ref:u,className:"relative",children:[h.jsxs(oe,{onClick:()=>c(!l),className:"flex items-center gap-3 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[t.avatar?h.jsx(yn,{src:t.avatar,alt:t.name,className:"w-8 h-8 rounded-full object-cover"}):h.jsx(I,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:"hidden md:block text-left",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t.name}),t.role&&h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-xs",children:t.role})]}),h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]}),l&&h.jsxs(I,{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white",children:t.name}),h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-sm",children:t.email})]}),h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>{r?.(),c(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors text-gray-900 dark:text-white",children:[h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{children:_s("common.profile_settings")})]}),h.jsxs(oe,{onClick:()=>{s?.(),c(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 text-red-600 dark:text-red-400 transition-colors",children:[h.jsx(re,{name:de.ArrowRight,className:"w-5 h-5"}),h.jsx(Q,{children:_s("common.logout")})]})]})]})]})]})},ky=({notifications:t=[],unreadCount:e=0,hasMore:n=!1,loading:r=!1,titleText:s="Notifications",emptyText:o="No notifications",markAllReadText:i="Mark all as read",deleteAllText:a="Delete all",unreadOnlyText:l="Unread only",unreadOnly:c=!1,onNotificationClick:d,onClose:u,onLoadMore:f,onMarkAllRead:g,onDeleteAll:m,onDelete:p,onUnreadOnlyToggle:y,dropdownAlign:b="right",className:S="",id:x,editorAttrs:E})=>{const[k,C]=v.useState(!1),N=v.useRef(null),_=v.useRef(null),w=v.useRef(null),M=v.useRef(null),O=v.useRef(new Set),L=v.useRef(f),F=v.useRef(n),$=v.useRef(r),D=v.useRef(t.length),A=v.useRef(-1);v.useEffect(()=>{L.current=f,F.current=n,$.current=r,D.current=t.length}),v.useEffect(()=>{if(!M.current||!w.current||!k)return;A.current=-1;const W=new IntersectionObserver(([j])=>{j.isIntersecting&&($.current||!F.current||A.current!==D.current&&(A.current=D.current,L.current?.()))},{root:w.current,threshold:.1});return W.observe(M.current),()=>W.disconnect()},[k]),v.useEffect(()=>{if(!w.current||!k)return;const W=new IntersectionObserver(U=>{U.forEach(B=>{const G=B.target.getAttribute("data-notification-id"),V=B.target.getAttribute("data-unread")==="true";G&&V&&B.isIntersecting&&O.current.add(G)})},{root:w.current,threshold:.5});return w.current.querySelectorAll("[data-notification-id]").forEach(U=>W.observe(U)),()=>W.disconnect()},[k,t]);const T=e>0?e:t.filter(W=>!W.read).length,z=v.useCallback(()=>{if(k){if(T>0){const W=Array.from(O.current).filter(j=>{const U=t.find(B=>String(B.id)===String(j));return U&&!U.read});W.length>0&&u?.(W)}O.current.clear(),C(!1)}},[k,u,T,t]);v.useEffect(()=>{if(!k)return;const W=j=>{N.current&&!N.current.contains(j.target)&&z()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[k,z]);const H=v.useCallback(()=>{k?z():C(!0)},[k,z]);return v.useLayoutEffect(()=>{const W=_.current;if(!k||!W)return;W.style.transform="";const j=W.getBoundingClientRect(),U=typeof window<"u"?window.innerWidth:0;if(j.width===0&&j.height===0)return;const B=8;let G=0;j.right>U-B?G=-(j.right-(U-B)):j.left<B&&(G=B-j.left),G!==0&&(W.style.transform=`translateX(${G}px)`)},[k,b,t.length]),h.jsxs(I,{ref:N,className:`relative ${S}`,id:x,...E,children:[h.jsxs(oe,{onClick:H,className:"relative w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors cursor-pointer","aria-label":s,children:[h.jsx(re,{name:de.Bell,className:"text-sm text-slate-500 dark:text-slate-400"}),T>0&&h.jsx(Q,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 dark:bg-red-600 rounded-full",children:T>99?"99+":T})]}),k&&h.jsxs(I,{ref:_,className:`absolute ${b==="left"?"left-0":"right-0"} mt-2 w-80 max-w-[calc(100vw-1rem)] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50`,children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between gap-2",children:[h.jsxs(I,{className:"flex items-center gap-3 min-w-0",children:[h.jsx(Q,{className:"font-semibold text-gray-900 dark:text-white",children:s}),y&&h.jsxs(I,{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>y(!c),children:[h.jsx(wt,{type:"checkbox",checked:c,onChange:W=>{W.stopPropagation(),y(W.target.checked)},onClick:W=>W.stopPropagation(),className:"w-3.5 h-3.5 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-400 focus:ring-blue-500 dark:focus:ring-blue-400 cursor-pointer"}),h.jsx(Q,{className:"text-xs text-gray-600 dark:text-gray-400",children:l})]})]}),h.jsxs(I,{className:"flex items-center gap-3 flex-shrink-0",children:[g&&T>0&&h.jsx(oe,{onClick:()=>{g(),O.current.clear()},className:"text-xs text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline cursor-pointer",children:i}),m&&t.length>0&&h.jsx(oe,{onClick:()=>{m()},className:"text-xs text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300 hover:underline cursor-pointer",children:a})]})]}),h.jsx(I,{ref:w,className:"max-h-96 overflow-y-auto",children:t.length===0&&!r?h.jsx(I,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:h.jsx(Q,{children:o})}):h.jsxs(h.Fragment,{children:[t.map(W=>{const j=!W.read;return h.jsxs(I,{"data-notification-id":W.id,"data-unread":j?"true":"false",onClick:()=>{W.onClick?.(),d?.(W),C(!1)},className:`group flex items-start gap-3 px-4 py-3 text-left border-b border-gray-100 dark:border-gray-700 transition-colors cursor-pointer ${j?"bg-blue-50/70 dark:bg-blue-900/20 hover:bg-blue-50 dark:hover:bg-blue-900/30":"bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700/50 opacity-70"}`,children:[W.iconName&&h.jsx(re,{name:W.iconName,className:`w-5 h-5 mt-0.5 flex-shrink-0 ${j?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"}`}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsx(I,{className:`text-sm truncate ${j?"font-semibold text-gray-900 dark:text-white":"font-normal text-gray-600 dark:text-gray-400"}`,children:W.title}),h.jsx(I,{className:`text-sm mt-1 line-clamp-2 ${j?"text-gray-700 dark:text-gray-300":"text-gray-500 dark:text-gray-500"}`,children:W.message}),h.jsx(I,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1 font-mono",children:W.time})]}),h.jsxs(I,{className:"flex flex-col items-center gap-2 flex-shrink-0",children:[j&&h.jsx(Q,{className:"w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full mt-1.5"}),p&&h.jsx(oe,{onClick:U=>{U.stopPropagation(),p(W)},className:"p-1 text-gray-400 dark:text-gray-500 hover:text-red-600 dark:hover:text-red-400 rounded hover:bg-red-50 dark:hover:bg-red-900/20 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Delete notification",children:h.jsx(re,{name:de.Trash,className:"w-4 h-4"})})]})]},W.id)}),n&&h.jsx(I,{ref:M,className:"px-4 py-3 text-center",children:r?h.jsx(Q,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."}):h.jsx(Q,{className:"text-sm text-gray-400 dark:text-gray-500"})}),r&&!n&&t.length>0&&h.jsx(I,{className:"px-4 py-2 text-center",children:h.jsx(Q,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."})})]})})]})]})},au=window.G7Core?.createLogger?.("Comp:UserProfile")??{log:(...t)=>console.log("[Comp:UserProfile]",...t),warn:(...t)=>console.warn("[Comp:UserProfile]",...t),error:(...t)=>console.error("[Comp:UserProfile]",...t)},Cy=({user:t={name:"",email:""},profileText:e="Profile Settings",logoutText:n="Logout",onProfileClick:r,onLogoutClick:s,className:o="",logoutEndpoint:i="/api/admin/auth/logout",redirectPath:a="/admin/login",showChevron:l=!0,dropdownDirection:c="up",dropdownOnly:d=!1,id:u,editorAttrs:f})=>{const[g,m]=v.useState(!1),[p,y]=v.useState(!1),b=v.useRef(null);v.useEffect(()=>{const k=C=>{b.current&&!b.current.contains(C.target)&&m(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);const S=()=>{const C=`; ${document.cookie}`.split("; XSRF-TOKEN=");return C.length===2?decodeURIComponent(C.pop()?.split(";").shift()||""):null},x=()=>localStorage.getItem("auth_token"),E=async()=>{if(!p)try{if(y(!0),m(!1),s){s();return}const k=S(),C=x(),N=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...k&&{"X-XSRF-TOKEN":k},...C&&{Authorization:`Bearer ${C}`}},credentials:"include"});N.ok?(localStorage.removeItem("auth_token"),window.location.href=a):(au.error("로그아웃 실패:",N.statusText),localStorage.removeItem("auth_token"),window.location.href=a)}catch(k){au.error("로그아웃 오류:",k),localStorage.removeItem("auth_token"),window.location.href=a}finally{y(!1)}};return h.jsxs(I,{ref:b,className:d?`absolute inset-0 ${o}`:`relative ${o}`,id:u,...f,children:[h.jsx(oe,{onClick:()=>m(!g),className:d?"w-full h-full opacity-0 cursor-pointer":"flex items-center gap-2 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors w-full",children:!d&&h.jsxs(h.Fragment,{children:[t.avatar?h.jsx(yn,{src:t.avatar,alt:t.name,className:"w-8 h-8 rounded-full object-cover"}):h.jsx(I,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:"flex-1 text-left",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t.name}),t.role&&h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-xs",children:t.role})]}),l&&h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]})}),g&&h.jsxs(I,{className:`absolute ${c==="down"?"top-full mt-2":"bottom-full mb-2"} ${d?"right-0 w-72":"left-0 w-full"} bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50`,children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:()=>{m(!1),window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${t.uuid}`}})},children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white",children:t.name}),h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-sm",children:t.email})]}),h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>{m(!1),r?r():window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${t.uuid}/edit`}})},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 transition-colors",children:[h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"text-gray-900 dark:text-white",children:e})]}),h.jsxs(oe,{onClick:E,disabled:p,className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 text-red-600 dark:text-red-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[h.jsx(re,{name:de.ArrowRight,className:"w-5 h-5"}),h.jsx(Q,{children:p?"Logging out...":n})]})]})]})]})},Bo=window.G7Core?.createLogger?.("Comp:LanguageSelector")??{log:(...t)=>console.log("[Comp:LanguageSelector]",...t),warn:(...t)=>console.warn("[Comp:LanguageSelector]",...t),error:(...t)=>console.error("[Comp:LanguageSelector]",...t)},lu=t=>{const e=window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[t];return e||{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[t]||t},Sy=({availableLocales:t=["ko","en"],languageText:e="Language",apiEndpoint:n="/api/admin/users/me/language",onLanguageChange:r,className:s="",inline:o=!1,showCode:i=!1,id:a,editorAttrs:l})=>{const[c,d]=v.useState(!1),[u,f]=v.useState(!1),[g,m]=v.useState(()=>localStorage.getItem("g7_locale")||"ko"),p=v.useRef(null);v.useEffect(()=>{if(o)return;const x=E=>{p.current&&!p.current.contains(E.target)&&d(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[o]);const y=()=>{const E=`; ${document.cookie}`.split("; XSRF-TOKEN=");return E.length===2?decodeURIComponent(E.pop()?.split(";").shift()||""):null},b=()=>localStorage.getItem("auth_token"),S=async x=>{if(!(u||x===g))try{f(!0);const E=y(),k=b();try{const C=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json",Accept:"application/json",...E&&{"X-XSRF-TOKEN":E},...k&&{Authorization:`Bearer ${k}`}},credentials:"include",body:JSON.stringify({language:x})});C.ok||Bo.warn("언어 설정 저장 실패 (UI는 변경됨):",C.statusText)}catch(C){Bo.warn("언어 설정 API 호출 실패 (UI는 변경됨):",C)}m(x),d(!1),r?.(x),window.__templateApp?await window.__templateApp.changeLocale(x):(Bo.warn("TemplateApp not found, reloading page"),window.location.reload())}catch(E){Bo.error("언어 변경 오류:",E)}finally{f(!1)}};return o?h.jsxs(I,{className:`${s}`,id:a,...l,children:[h.jsxs(oe,{onClick:()=>d(!c),disabled:u,className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors",children:[h.jsx(re,{name:de.Globe,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"text-gray-900 dark:text-white flex-1",children:e}),h.jsx(Q,{className:"px-2 py-0.5 text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300 rounded",children:g.toUpperCase()}),h.jsx(re,{name:de.ChevronDown,className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${c?"rotate-180":""}`})]}),c&&h.jsx(I,{className:"px-4 py-2 flex flex-wrap gap-2",children:t.map(x=>h.jsx(oe,{onClick:()=>S(x),disabled:u,className:`
|
||
px-3 py-1.5 text-sm font-medium rounded-md transition-colors
|
||
${g===x?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
${u?"opacity-50 cursor-not-allowed":""}
|
||
`,children:lu(x)},x))})]}):h.jsxs(I,{ref:p,className:`relative ${s}`,id:a,...l,children:[h.jsxs(oe,{onClick:()=>d(!c),className:i?"flex items-center gap-1.5 px-2.5 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors cursor-pointer":"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors","aria-haspopup":"listbox","aria-expanded":c,"aria-label":e,children:[h.jsx(re,{name:de.Globe,className:i?"w-4 h-4":"w-5 h-5 text-gray-600 dark:text-gray-400"}),i&&h.jsx(Q,{className:"font-medium uppercase",children:g}),i&&h.jsx(re,{name:de.ChevronDown,className:"w-3 h-3"})]}),c&&h.jsx(I,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:h.jsx(I,{className:"py-2",children:t.map(x=>h.jsxs(oe,{onClick:()=>S(x),disabled:u,className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${g===x?"bg-gray-50 dark:bg-gray-700":""}
|
||
${u?"opacity-50 cursor-not-allowed":""}
|
||
`,children:[h.jsx(Q,{className:"text-gray-900 dark:text-white flex-1",children:lu(x)}),g===x&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400"})]},x))})})]})},_y=({copyright:t="© 2026 G7",version:e,quickLinks:n=[],className:r="",changelogModalId:s,copyrightModalId:o,id:i,editorAttrs:a})=>{const l=v.useCallback(()=>{s&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/changelog",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreChangelogContent:"{{response.data.content}}"}},{handler:"openModal",target:s}],onError:[{handler:"openModal",target:s}]}]})},[s]),c=v.useCallback(()=>{o&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/license",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreLicenseContent:"{{response.data.content}}"}},{handler:"openModal",target:o}],onError:[{handler:"openModal",target:o}]}]})},[o]);return h.jsx(I,{className:`admin-footer ${r}`,id:i,...a,children:h.jsxs(I,{className:"admin-footer-row",children:[h.jsxs(I,{className:"admin-footer-group",children:[h.jsx(Q,{className:o?"admin-footer-link-hover":"",onClick:o?c:void 0,children:t}),e&&h.jsxs(h.Fragment,{children:[h.jsx(Q,{className:"hidden md:inline",children:"•"}),h.jsxs(Q,{className:`flex-center gap-2 ${s?"admin-footer-link-hover":""}`,onClick:s?l:void 0,children:[h.jsx(re,{name:de.Tag,className:"w-4 h-4"}),h.jsxs(Q,{children:["v",e]})]})]})]}),n.length>0&&h.jsx(I,{className:"flex-center gap-4",children:n.map(d=>h.jsxs(Lr,{href:d.url,className:"admin-footer-link",children:[d.iconName&&h.jsx(re,{name:d.iconName,className:"w-4 h-4"}),h.jsx(Q,{children:d.label})]},d.id))})]})})},Ey=({title:t,description:e,breadcrumbItems:n,tabs:r,onTabChange:s,actions:o,className:i="",children:a,id:l,editorAttrs:c})=>{const d=(u="secondary")=>({primary:"page-action-primary",secondary:"page-action-secondary",danger:"page-action-danger",ghost:"page-action-ghost"})[u];return h.jsxs(I,{className:i,id:l,...c,children:[n&&n.length>0&&h.jsx(I,{className:"mb-md",children:h.jsx(ou,{items:n})}),h.jsxs(I,{className:"flex-between mb-lg",children:[h.jsxs(I,{children:[h.jsx(Da,{className:"page-title",children:t}),e&&h.jsx(bt,{className:"page-description",children:e})]}),a?h.jsx(I,{className:"flex-center page-actions",children:a}):o&&o.length>0?h.jsx(I,{className:"page-actions",children:o.map(u=>h.jsxs(oe,{onClick:u.onClick,disabled:u.disabled,className:d(u.variant),children:[u.iconName&&h.jsx(re,{name:u.iconName,className:"icon-md"}),u.variant!=="ghost"&&u.label&&h.jsx(I,{children:u.label})]},u.id))}):null]}),r&&r.length>0&&h.jsx(I,{className:"tab-container",children:r.map(u=>h.jsxs(oe,{onClick:()=>s?.(u.value),className:u.active?"tab-btn-active":"tab-btn",children:[h.jsx(I,{children:u.label}),u.badge!==void 0&&h.jsx(I,{className:u.active?"tab-badge-active":"tab-badge",children:u.badge})]},u.id))})]})},My=()=>window.G7Core,Ny=({title:t,description:e,className:n="",style:r,children:s,id:o,editorAttrs:i})=>{const a="flex items-center justify-between",l=My()?.style?.mergeClasses?.(a,n)??`${a} ${n}`;return h.jsxs(I,{className:l,style:r,id:o,...i,children:[h.jsxs(I,{children:[t&&h.jsx(Qn,{className:"text-base font-semibold text-gray-900 dark:text-white",children:t}),e&&h.jsx(bt,{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:e})]}),s&&h.jsx(I,{className:"flex items-center gap-2",children:s})]})},Rn=(t,e)=>window.G7Core?.t?.(t,e)??t,Oy=({image:t,imageAlt:e,vendor:n,name:r,version:s,status:o,updateAvailable:i=!1,latestVersion:a,dependencies:l=[],showLayoutEditButton:c=!1,actions:d=[],onLayoutEditClick:u,className:f="",id:g,editorAttrs:m})=>{const p=b=>({active:"success",inactive:"default",pending:"pending",error:"error"})[b],y=b=>({active:Rn("common.status_active"),inactive:Rn("common.status_inactive"),pending:Rn("common.status_pending"),error:Rn("common.status_error")})[b];return h.jsxs(I,{className:`
|
||
bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden hover:shadow-lg transition-shadow
|
||
${f}
|
||
`,id:g,...m,children:[t&&h.jsxs(I,{className:"relative",children:[h.jsx(yn,{src:t,alt:e||Rn("common.template_preview",{vendor:n,name:r}),className:"w-full h-48 object-cover"}),h.jsx(I,{className:"absolute top-3 right-3",children:h.jsx($o,{status:p(o),label:y(o),showIcon:!0})}),i&&h.jsx(I,{className:"absolute top-3 left-3",children:h.jsxs(Q,{className:"flex items-center gap-1 px-2 py-1 bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border border-yellow-200 dark:border-yellow-800 rounded-md text-xs font-semibold",children:[h.jsx(re,{name:de.ExclamationTriangle,className:"w-3 h-3"}),h.jsx(Q,{children:Rn("common.update_available")})]})})]}),h.jsxs(I,{className:"p-4",children:[h.jsxs(I,{className:"flex items-start justify-between mb-3",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs(Ir,{className:"text-lg font-bold text-gray-900 dark:text-white",children:[n,"/",r]}),h.jsxs(I,{className:"flex items-center gap-2 mt-1 text-sm text-gray-600 dark:text-gray-400",children:[h.jsxs(Q,{children:["v",s]}),i&&a&&h.jsxs(h.Fragment,{children:[h.jsx(Q,{children:"→"}),h.jsxs(Q,{className:"text-yellow-600 dark:text-yellow-400 font-semibold",children:["v",a]})]})]}),!t&&h.jsx(I,{className:"mt-2",children:h.jsx($o,{status:p(o),label:y(o),showIcon:!0})})]}),d.length>0&&h.jsx(bs,{items:d,triggerIconName:de.EllipsisVertical,position:"left"})]}),l.length>0&&h.jsxs(I,{className:"mb-3",children:[h.jsxs(bt,{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:[Rn("common.dependencies"),":"]}),h.jsx(I,{className:"flex flex-wrap gap-1",children:l.map((b,S)=>h.jsx(Q,{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:b},S))})]}),c&&u&&h.jsxs(oe,{onClick:u,className:"w-full px-4 py-2 bg-blue-600 dark:bg-blue-500 text-white rounded-md hover:bg-blue-700 dark:hover:bg-blue-600 transition-colors flex items-center justify-center gap-2 font-medium",children:[h.jsx(re,{name:de.Edit,className:"w-4 h-4"}),h.jsx(Q,{children:Rn("common.edit_layout")})]})]})]})},cu=({type:t,message:e,dismissible:n=!1,onDismiss:r,className:s="",id:o,editorAttrs:i})=>{const a={info:{containerClass:"alert-info",iconClass:"alert-icon-info",textClass:"alert-text-info",icon:de.InfoCircle},success:{containerClass:"alert-success",iconClass:"alert-icon-success",textClass:"alert-text-success",icon:de.CheckCircle},warning:{containerClass:"alert-warning",iconClass:"alert-icon-warning",textClass:"alert-text-warning",icon:de.ExclamationTriangle},error:{containerClass:"alert-error",iconClass:"alert-icon-error",textClass:"alert-text-error",icon:de.TimesCircle}},l=a[t]??a.info;return h.jsxs(I,{className:`${l.containerClass} ${s}`,role:"alert","aria-live":"polite",id:o,...i,children:[h.jsx(re,{name:l.icon,className:l.iconClass,ariaLabel:`${t} icon`}),h.jsx(bt,{className:l.textClass,children:e}),n&&h.jsx(oe,{onClick:r,className:`alert-dismiss ${l.textClass}`,"aria-label":"Close alert",children:h.jsx(re,{name:de.Times,className:l.iconClass,ariaLabel:"Close"})})]})},Ty=({layoutName:t,onBack:e,onPreview:n,onSave:r,isSaving:s=!1,className:o=""})=>{const i=`
|
||
flex items-center justify-between gap-4 p-4 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700
|
||
${o}
|
||
`.trim().replace(/\s+/g," ");return h.jsxs(I,{className:i,children:[h.jsxs(I,{className:"flex items-center gap-3",children:[h.jsx(oe,{onClick:e,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors bg-transparent border-0 cursor-pointer","aria-label":"뒤로가기",children:h.jsx(re,{name:de.ArrowLeft,className:"text-gray-700 dark:text-gray-300",ariaLabel:"뒤로가기"})}),h.jsx(Qn,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:t})]}),h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(oe,{onClick:n,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors border-0 cursor-pointer","aria-label":"미리보기",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:de.Eye,className:"text-gray-700 dark:text-gray-300",ariaLabel:"미리보기 아이콘"}),h.jsx("span",{children:"미리보기"})]})}),h.jsx(oe,{onClick:r,disabled:s,className:`
|
||
px-4 py-2 rounded-lg transition-colors border-0 cursor-pointer
|
||
${s?"bg-blue-400 dark:bg-blue-600 cursor-not-allowed":"bg-blue-600 dark:bg-blue-500 hover:bg-blue-700 dark:hover:bg-blue-600"}
|
||
text-white
|
||
`.trim().replace(/\s+/g," "),"aria-label":s?"저장 중...":"저장",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:s?de.Spinner:de.Save,className:`text-white ${s?"animate-spin":""}`,ariaLabel:s?"저장 중 아이콘":"저장 아이콘"}),h.jsx("span",{children:s?"저장 중...":"저장"})]})})]})]})},Ay=({files:t,selectedId:e,onSelect:n,className:r=""})=>{const s=a=>{try{const l=new Date(a);if(isNaN(l.getTime()))return a;const c=l.getFullYear(),d=String(l.getMonth()+1).padStart(2,"0"),u=String(l.getDate()).padStart(2,"0"),f=String(l.getHours()).padStart(2,"0"),g=String(l.getMinutes()).padStart(2,"0");return`${c}-${d}-${u} ${f}:${g}`}catch{return a}},o=a=>{n(a)},i=`
|
||
w-full
|
||
${r}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:i,children:t.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"파일이 없습니다."}):h.jsx(Ia,{className:"divide-y divide-gray-200 dark:divide-gray-700",role:"listbox","aria-label":"레이아웃 파일 목록",children:t.map(a=>{const l=a.id===e,c=`
|
||
flex items-center justify-between p-4 cursor-pointer
|
||
transition-colors duration-150
|
||
${l?"bg-blue-100 dark:bg-blue-900 border-l-4 border-blue-500":"hover:bg-gray-100 dark:hover:bg-gray-800"}
|
||
`.trim().replace(/\s+/g," "),d=`
|
||
font-medium
|
||
${l?"text-blue-900 dark:text-blue-100":"text-gray-900 dark:text-gray-100"}
|
||
`.trim().replace(/\s+/g," "),u=`
|
||
text-sm
|
||
${l?"text-blue-700 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}
|
||
`.trim().replace(/\s+/g," ");return h.jsx(La,{className:c,onClick:()=>o(a.id),role:"option","aria-selected":l,tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),o(a.id))},children:h.jsxs(I,{className:"flex flex-col gap-1",children:[h.jsx(Q,{className:d,children:a.name}),h.jsx(Q,{className:u,children:s(a.updated_at)})]})},a.id)})})})};function du(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Dy(t){if(Array.isArray(t))return t}function Iy(t,e,n){return(e=Hy(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ly(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function Py(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function fu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?uu(Object(n),!0).forEach(function(r){Iy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):uu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $y(t,e){if(t==null)return{};var n,r,s=Fy(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function Fy(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function zy(t,e){return Dy(t)||Ly(t,e)||Uy(t,e)||Py()}function Vy(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hy(t){var e=Vy(t,"string");return typeof e=="symbol"?e:e+""}function Uy(t,e){if(t){if(typeof t=="string")return du(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?du(t,e):void 0}}function By(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function gu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hu(Object(n),!0).forEach(function(r){By(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jy(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return e.reduceRight(function(s,o){return o(s)},r)}}function Es(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return e.apply(n,[].concat(s,a))}}}function jo(t){return{}.toString.call(t).includes("Object")}function Wy(t){return!Object.keys(t).length}function Ms(t){return typeof t=="function"}function Gy(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Yy(t,e){return jo(e)||er("changeType"),Object.keys(e).some(function(n){return!Gy(t,n)})&&er("changeField"),e}function Xy(t){Ms(t)||er("selectorType")}function Ky(t){Ms(t)||jo(t)||er("handlerType"),jo(t)&&Object.values(t).some(function(e){return!Ms(e)})&&er("handlersType")}function qy(t){t||er("initialIsRequired"),jo(t)||er("initialType"),Wy(t)&&er("initialContent")}function Zy(t,e){throw new Error(t[e]||t.default)}var Qy={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},er=Es(Zy)(Qy),Wo={changes:Yy,selector:Xy,handler:Ky,initial:qy};function Jy(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Wo.initial(t),Wo.handler(e);var n={current:t},r=Es(tv)(n,e),s=Es(ev)(n),o=Es(Wo.changes)(t),i=Es(Ry)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Wo.selector(c),c(n.current)}function l(c){jy(r,s,o,i)(c)}return[a,l]}function Ry(t,e){return Ms(e)?e(t.current):e}function ev(t,e){return t.current=gu(gu({},t.current),e),e}function tv(t,e,n){return Ms(e)?e(t.current):Object.keys(n).forEach(function(r){var s;return(s=e[r])===null||s===void 0?void 0:s.call(e,t.current[r])}),n}var nv={create:Jy},rv={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function sv(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return e.apply(n,[].concat(s,a))}}}function ov(t){return{}.toString.call(t).includes("Object")}function iv(t){return t||mu("configIsRequired"),ov(t)||mu("configType"),t.urls?(av(),{paths:{vs:t.urls.monacoBase}}):t}function av(){console.warn(pu.deprecation)}function lv(t,e){throw new Error(t[e]||t.default)}var pu={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
||
You are using deprecated way of configuration.
|
||
|
||
Instead of using
|
||
monaco.config({ urls: { monacoBase: '...' } })
|
||
use
|
||
monaco.config({ paths: { vs: '...' } })
|
||
|
||
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
||
`},mu=sv(lv)(pu),cv={config:iv},dv=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,i){return i(o)},s)}};function bu(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],bu(t[n],e[n]))}),fu(fu({},t),e)}var uv={type:"cancelation",msg:"operation is manually canceled"};function il(t){var e=!1,n=new Promise(function(r,s){t.then(function(o){return e?s(uv):r(o)}),t.catch(s)});return n.cancel=function(){return e=!0},n}var fv=["monaco"],hv=nv.create({config:rv,isInitialized:!1,resolve:null,reject:null,monaco:null}),yu=zy(hv,2),Ns=yu[0],Go=yu[1];function gv(t){var e=cv.config(t),n=e.monaco,r=$y(e,fv);Go(function(s){return{config:bu(s.config,r),monaco:n}})}function pv(){var t=Ns(function(e){var n=e.monaco,r=e.isInitialized,s=e.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!t.isInitialized){if(Go({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),il(al);if(window.monaco&&window.monaco.editor)return vu(window.monaco),t.resolve(window.monaco),il(al);dv(mv,yv)(vv)}return il(al)}function mv(t){return document.body.appendChild(t)}function bv(t){var e=document.createElement("script");return t&&(e.src=t),e}function yv(t){var e=Ns(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=bv("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function vv(){var t=Ns(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){var r=n.m||n;vu(r),t.resolve(r)},function(n){t.reject(n)})}function vu(t){Ns().monaco||Go({monaco:t})}function xv(){return Ns(function(t){var e=t.monaco;return e})}var al=new Promise(function(t,e){return Go({resolve:t,reject:e})}),xu={config:gv,init:pv,__getMonacoInstance:xv},wv={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ll=wv,kv={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Cv=kv;function Sv({children:t}){return v.createElement("div",{style:Cv.container},t)}var _v=Sv,Ev=_v;function Mv({width:t,height:e,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:i}){return v.createElement("section",{style:{...ll.wrapper,width:t,height:e},...i},!n&&v.createElement(Ev,null,r),v.createElement("div",{ref:s,style:{...ll.fullWidth,...!n&&ll.hide},className:o}))}var Nv=Mv,wu=v.memo(Nv);function Ov(t){v.useEffect(t,[])}var ku=Ov;function Tv(t,e,n=!0){let r=v.useRef(!0);v.useEffect(r.current||!n?()=>{r.current=!1}:t,e)}var sn=Tv;function Os(){}function Vr(t,e,n,r){return Av(t,r)||Dv(t,e,n,r)}function Av(t,e){return t.editor.getModel(Cu(t,e))}function Dv(t,e,n,r){return t.editor.createModel(e,n,r?Cu(t,r):void 0)}function Cu(t,e){return t.Uri.parse(e)}function Iv({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:i,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:u={},height:f="100%",width:g="100%",className:m,wrapperProps:p={},beforeMount:y=Os,onMount:b=Os}){let[S,x]=v.useState(!1),[E,k]=v.useState(!0),C=v.useRef(null),N=v.useRef(null),_=v.useRef(null),w=v.useRef(b),M=v.useRef(y),O=v.useRef(!1);ku(()=>{let D=xu.init();return D.then(A=>(N.current=A)&&k(!1)).catch(A=>A?.type!=="cancelation"&&console.error("Monaco initialization: error:",A)),()=>C.current?$():D.cancel()}),sn(()=>{if(C.current&&N.current){let D=C.current.getOriginalEditor(),A=Vr(N.current,t||"",r||n||"text",o||"");A!==D.getModel()&&D.setModel(A)}},[o],S),sn(()=>{if(C.current&&N.current){let D=C.current.getModifiedEditor(),A=Vr(N.current,e||"",s||n||"text",i||"");A!==D.getModel()&&D.setModel(A)}},[i],S),sn(()=>{let D=C.current.getModifiedEditor();D.getOption(N.current.editor.EditorOption.readOnly)?D.setValue(e||""):e!==D.getValue()&&(D.executeEdits("",[{range:D.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),D.pushUndoStop())},[e],S),sn(()=>{C.current?.getModel()?.original.setValue(t||"")},[t],S),sn(()=>{let{original:D,modified:A}=C.current.getModel();N.current.editor.setModelLanguage(D,r||n||"text"),N.current.editor.setModelLanguage(A,s||n||"text")},[n,r,s],S),sn(()=>{N.current?.editor.setTheme(c)},[c],S),sn(()=>{C.current?.updateOptions(u)},[u],S);let L=v.useCallback(()=>{if(!N.current)return;M.current(N.current);let D=Vr(N.current,t||"",r||n||"text",o||""),A=Vr(N.current,e||"",s||n||"text",i||"");C.current?.setModel({original:D,modified:A})},[n,e,s,t,r,o,i]),F=v.useCallback(()=>{!O.current&&_.current&&(C.current=N.current.editor.createDiffEditor(_.current,{automaticLayout:!0,...u}),L(),N.current?.editor.setTheme(c),x(!0),O.current=!0)},[u,c,L]);v.useEffect(()=>{S&&w.current(C.current,N.current)},[S]),v.useEffect(()=>{!E&&!S&&F()},[E,S,F]);function $(){let D=C.current?.getModel();a||D?.original?.dispose(),l||D?.modified?.dispose(),C.current?.dispose()}return v.createElement(wu,{width:g,height:f,isEditorReady:S,loading:d,_ref:_,className:m,wrapperProps:p})}var Lv=Iv;v.memo(Lv);function Pv(t){let e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}var $v=Pv,Yo=new Map;function Fv({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:s,path:o,theme:i="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:u=!0,keepCurrentModel:f=!1,width:g="100%",height:m="100%",className:p,wrapperProps:y={},beforeMount:b=Os,onMount:S=Os,onChange:x,onValidate:E=Os}){let[k,C]=v.useState(!1),[N,_]=v.useState(!0),w=v.useRef(null),M=v.useRef(null),O=v.useRef(null),L=v.useRef(S),F=v.useRef(b),$=v.useRef(),D=v.useRef(r),A=$v(o),T=v.useRef(!1),z=v.useRef(!1);ku(()=>{let j=xu.init();return j.then(U=>(w.current=U)&&_(!1)).catch(U=>U?.type!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>M.current?W():j.cancel()}),sn(()=>{let j=Vr(w.current,t||r||"",e||s||"",o||n||"");j!==M.current?.getModel()&&(u&&Yo.set(A,M.current?.saveViewState()),M.current?.setModel(j),u&&M.current?.restoreViewState(Yo.get(o)))},[o],k),sn(()=>{M.current?.updateOptions(c)},[c],k),sn(()=>{!M.current||r===void 0||(M.current.getOption(w.current.editor.EditorOption.readOnly)?M.current.setValue(r):r!==M.current.getValue()&&(z.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),M.current.pushUndoStop(),z.current=!1))},[r],k),sn(()=>{let j=M.current?.getModel();j&&s&&w.current?.editor.setModelLanguage(j,s)},[s],k),sn(()=>{a!==void 0&&M.current?.revealLine(a)},[a],k),sn(()=>{w.current?.editor.setTheme(i)},[i],k);let H=v.useCallback(()=>{if(!(!O.current||!w.current)&&!T.current){F.current(w.current);let j=o||n,U=Vr(w.current,r||t||"",e||s||"",j||"");M.current=w.current?.editor.create(O.current,{model:U,automaticLayout:!0,...c},d),u&&M.current.restoreViewState(Yo.get(j)),w.current.editor.setTheme(i),a!==void 0&&M.current.revealLine(a),C(!0),T.current=!0}},[t,e,n,r,s,o,c,d,u,i,a]);v.useEffect(()=>{k&&L.current(M.current,w.current)},[k]),v.useEffect(()=>{!N&&!k&&H()},[N,k,H]),D.current=r,v.useEffect(()=>{k&&x&&($.current?.dispose(),$.current=M.current?.onDidChangeModelContent(j=>{z.current||x(M.current.getValue(),j)}))},[k,x]),v.useEffect(()=>{if(k){let j=w.current.editor.onDidChangeMarkers(U=>{let B=M.current.getModel()?.uri;if(B&&U.find(G=>G.path===B.path)){let G=w.current.editor.getModelMarkers({resource:B});E?.(G)}});return()=>{j?.dispose()}}return()=>{}},[k,E]);function W(){$.current?.dispose(),f?u&&Yo.set(o,M.current.saveViewState()):M.current.getModel()?.dispose(),M.current.dispose()}return v.createElement(wu,{width:g,height:m,isEditorReady:k,loading:l,_ref:O,className:p,wrapperProps:y})}var zv=Fv,Vv=v.memo(zv),Hv=Vv;const Uv=({value:t,onChange:e,language:n="json",height:r="100%",readOnly:s=!1,theme:o="vs-dark"})=>{const i=v.useRef(null),a=(c,d)=>{i.current=c,n==="json"&&d.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",allowComments:!1}),c.updateOptions({readOnly:s,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,lineNumbers:"on",renderWhitespace:"selection",automaticLayout:!0})},l=c=>{e&&c!==void 0&&e({target:{value:c}})};return v.useEffect(()=>{i.current&&i.current.updateOptions({readOnly:s})},[s]),h.jsx("div",{className:"border border-gray-300 dark:border-gray-700 rounded-lg overflow-hidden",children:h.jsx(Hv,{height:r,language:n,value:t,theme:o,onChange:l,onMount:a,options:{readOnly:s,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,lineNumbers:"on",renderWhitespace:"selection",automaticLayout:!0}})})},Bv=t=>{const e=new Date(t);return new Intl.DateTimeFormat("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)},Su=v.memo(({version:t,isSelected:e,onSelect:n})=>{const r=v.useCallback(()=>{n?.(t.id)},[n,t.id]);return h.jsx(La,{role:"listitem","aria-selected":e,className:`
|
||
p-3 rounded-lg border cursor-pointer transition-colors
|
||
${e?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 hover:border-gray-400 dark:border-gray-600 dark:hover:border-gray-500"}
|
||
`,onClick:r,children:h.jsxs(I,{className:"flex justify-between items-start",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs(Q,{className:"font-semibold text-gray-900 dark:text-gray-100",children:["버전 ",t.version]}),h.jsx(Q,{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:Bv(t.created_at)})]}),h.jsxs(I,{className:"flex gap-3 text-sm",children:[h.jsxs(Q,{className:"text-green-600 dark:text-green-400",children:["+",t.changes_summary.added]}),h.jsxs(Q,{className:"text-red-600 dark:text-red-400",children:["-",t.changes_summary.removed]})]})]})})});Su.displayName="VersionListItem";const _u=({versions:t,selectedId:e,onSelect:n})=>t.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"버전이 없습니다."}):h.jsx(Ia,{role:"list",className:"space-y-2",children:t.map(r=>h.jsx(Su,{version:r,isSelected:e===r.id,onSelect:n},r.id))}),jv=({layoutId:t,versions:e,onRestore:n})=>{const[r,s]=v.useState(),o=l=>{s(l)},i=()=>{r!==void 0&&n(r)},a=r===void 0;return h.jsxs(I,{className:"space-y-4",role:"region","aria-label":"레이아웃 히스토리 패널",children:[h.jsx(I,{className:"border border-gray-300 dark:border-gray-600 rounded-lg p-4",children:h.jsx(_u,{versions:e,selectedId:r,onSelect:o})}),h.jsx(I,{className:"flex justify-end",children:h.jsx(oe,{variant:"primary",disabled:a,onClick:i,"aria-label":"선택한 버전으로 복원",children:"복원"})})]})},Wv=({emailLabel:t="Email",passwordLabel:e="Password",submitButtonText:n="Sign In",processingText:r="Processing...",emailPlaceholder:s="Email",passwordPlaceholder:o="Password",forgotPasswordText:i="Forgot your password?",forgotPasswordUrl:a="/admin/password/reset",emailRequiredError:l="Please enter your email.",emailInvalidError:c="Please enter a valid email address.",passwordRequiredError:d="Please enter your password.",onSubmit:u,loadingActions:f={},isLoading:g=!1,disabled:m=!1,apiError:p="",className:y="",style:b})=>{const[S,x]=v.useState(""),[E,k]=v.useState(""),[C,N]=v.useState({}),_=p,w=Object.values(f).some($=>$===!0),M=g||w,O=m||M,L=()=>{const $={},D=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return!S||S.trim()===""?$.email=l:D.test(S)||($.email=c),(!E||E.trim()==="")&&($.password=d),N($),Object.keys($).length===0},F=async $=>{if(!L()){$.preventDefault();return}N({}),u?await u($):$.preventDefault()};return h.jsx(I,{className:`w-full ${y}`,style:b,children:h.jsxs(Pa,{onSubmit:F,className:"space-y-6",noValidate:!0,children:[_&&h.jsx(I,{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:h.jsx(bt,{className:"text-sm text-red-600 dark:text-red-400",children:_})}),h.jsxs(I,{children:[h.jsx(rn,{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t}),h.jsx(wt,{id:"email",name:"email",type:"email",value:S,onChange:$=>x($.target.value),placeholder:s,disabled:O,className:`
|
||
w-full px-4 py-3 rounded-lg border
|
||
${C.email?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
||
bg-white dark:bg-gray-800
|
||
text-gray-900 dark:text-white
|
||
placeholder-gray-400 dark:placeholder-gray-500
|
||
focus:outline-none focus:ring-2
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
`}),C.email&&h.jsx(bt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:C.email})]}),h.jsxs(I,{children:[h.jsx(rn,{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:e}),h.jsx(wt,{id:"password",name:"password",type:"password",value:E,onChange:$=>k($.target.value),placeholder:o,disabled:O,className:`
|
||
w-full px-4 py-3 rounded-lg border
|
||
${C.password?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
||
bg-white dark:bg-gray-800
|
||
text-gray-900 dark:text-white
|
||
placeholder-gray-400 dark:placeholder-gray-500
|
||
focus:outline-none focus:ring-2
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
`}),C.password&&h.jsx(bt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:C.password})]}),a&&h.jsx(I,{className:"flex items-center justify-end",children:h.jsx(Lr,{href:a,className:"text-sm text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300 transition-colors duration-200",children:i})}),h.jsx(oe,{type:"submit",disabled:O,className:`
|
||
w-full px-4 py-3 rounded-lg font-medium
|
||
bg-blue-600 hover:bg-blue-700
|
||
dark:bg-blue-500 dark:hover:bg-blue-600
|
||
text-white
|
||
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2
|
||
dark:focus:ring-offset-gray-900
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
transition-colors duration-200
|
||
flex items-center justify-center
|
||
`,children:M?h.jsxs(h.Fragment,{children:[h.jsxs(Hn,{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r]}):n})]})})},Eu=t=>t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,cl=t=>{const e=Eu(t);document.documentElement.setAttribute("data-theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},Gv=()=>{const t=localStorage.getItem("g7_color_scheme");return t&&["auto","light","dark"].includes(t)?t:"auto"},Yv=({onThemeChange:t,className:e="",autoText:n="System",lightText:r="Light",darkText:s="Dark",id:o,editorAttrs:i})=>{const a=Gv(),[l,c]=v.useState(a),[d,u]=v.useState(!1),f=v.useRef(null);v.useEffect(()=>{cl(l)},[]),v.useEffect(()=>{if(l!=="auto")return;const p=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{cl("auto")};return p.addEventListener("change",y),()=>p.removeEventListener("change",y)},[l]),v.useEffect(()=>{const p=y=>{f.current&&!f.current.contains(y.target)&&u(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const g=p=>{c(p),localStorage.setItem("g7_color_scheme",p),cl(p),u(!1),t?.(p)},m=()=>Eu(l)==="dark"?de.Moon:de.Sun;return h.jsxs(I,{ref:f,className:`relative ${e}`,id:o,...i,children:[h.jsx(oe,{onClick:()=>u(!d),className:"w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors","aria-label":"Toggle theme",children:h.jsx(re,{name:m(),className:"text-sm text-slate-500 dark:text-slate-400"})}),d&&h.jsx(I,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>g("auto"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${l==="auto"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(re,{name:de.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),l==="auto"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(oe,{onClick:()=>g("light"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${l==="light"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(re,{name:de.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),l==="light"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(oe,{onClick:()=>g("dark"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${l==="dark"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[h.jsx(re,{name:de.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:s}),l==="dark"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Mu=window.G7Core?.createLogger?.("Comp:ColumnSelector")??{log:(...t)=>console.log("[Comp:ColumnSelector]",...t),warn:(...t)=>console.warn("[Comp:ColumnSelector]",...t),error:(...t)=>console.error("[Comp:ColumnSelector]",...t)},Nu=(t,e)=>window.G7Core?.t?.(t,e)??t,Xv=()=>window.G7Core,Kv=({id:t,columns:e,visibleColumns:n,onColumnVisibilityChange:r,triggerLabel:s,triggerIconName:o=de.Sliders,position:i="right",className:a="",style:l,requiredText:c,menuTitle:d,menuDescription:u,defaultColumns:f,triggerClassName:g,labelClassName:m,dynamicColumns:p,dynamicColumnsInsertAfter:y,editorAttrs:b})=>{const S=s??Nu("common.column_selector"),x=c??Nu("common.required"),E=v.useMemo(()=>{if(!p||!Array.isArray(p)||p.length===0)return e;if(y){const V=e.findIndex(K=>K.field===y);if(V!==-1)return[...e.slice(0,V+1),...p,...e.slice(V+1)]}return[...e,...p]},[e,p,y]),[k,C]=v.useState(!1),N=v.useRef(null),_=v.useRef(null),[w,M]=v.useState(!1),[O,L]=v.useState(i),F=v.useMemo(()=>{try{const V=window.G7Core?.AuthManager?.getInstance();return V?V.getUser()?.uuid:void 0}catch{return}},[]),$=t?`g7_columns_${t}${F!==void 0?`_${F}`:""}`:null,D=()=>{if(!$)return null;try{const V=localStorage.getItem($);if(V){const K=JSON.parse(V);if(Array.isArray(K)&&K.length>0)return K}}catch(V){Mu.warn("Failed to load from localStorage:",V)}return null},A=V=>{if($)try{localStorage.setItem($,JSON.stringify(V))}catch(K){Mu.warn("Failed to save to localStorage:",K)}},T=()=>{const V=D();return V||(n&&n.length>0?n:f&&f.length>0?f:E.filter(K=>K.visible!==!1).map(K=>K.field))},[z,H]=v.useState(T);v.useEffect(()=>{w||(r&&z.length>0&&r(z),M(!0))},[w,r,z]),v.useEffect(()=>{w&&n&&n.length>0&&(D()||H(n))},[n,w]);const W=v.useRef([]),j=v.useRef(null);v.useEffect(()=>{if(w&&p&&p.length>0){const V=p.map(Z=>Z.field);if(j.current===null){const Z=D();if(j.current=Z!==null,Z!==null){W.current=V;return}}const K=W.current,X=V.filter(Z=>!K.includes(Z));if(X.length>0){const Z=n&&n.length>0?n:z,ee=X.filter(ne=>!Z.includes(ne));if(ee.length>0){const ne=[...Z,...ee];H(ne),A(ne),r?.(ne)}}W.current=V}},[p,w]);const U=n&&n.length>0?n:z;v.useEffect(()=>{const V=K=>{N.current&&!N.current.contains(K.target)&&C(!1)};return k&&document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[k]),v.useEffect(()=>{if(k&&_.current&&N.current){const V=_.current.getBoundingClientRect(),K=N.current.getBoundingClientRect(),X=window.innerWidth,Z=V.width||256;i==="right"?K.right-Z<0?L("left"):L("right"):K.left+Z>X?L("right"):L("left")}},[k,i]);const B=V=>{if(E.find(Z=>Z.field===V)?.required)return;const X=U.includes(V)?U.filter(Z=>Z!==V):[...U,V];H(X),A(X),r?.(X)},G=O==="left"?"left-0":"right-0";return h.jsxs(I,{ref:N,className:`relative inline-block ${a}`,style:l,id:t,...b,children:[h.jsxs(oe,{onClick:()=>C(!k),className:Xv()?.style?.mergeClasses?.("flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",g)??`flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors ${g??""}`,children:[h.jsx(re,{name:o,className:"w-5 h-5"}),S&&h.jsx(Q,{className:`${m||"hidden sm:inline"} text-sm`,children:S})]}),k&&h.jsxs(I,{ref:_,className:`absolute ${G} z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg`,children:[(d||u)&&h.jsxs(I,{className:"px-4 pt-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:[d&&h.jsx(Q,{className:"block text-sm font-medium text-gray-900 dark:text-white",children:d}),u&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-1",children:u})]}),h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:E.map(V=>{const K=U.includes(V.field),X=V.required===!0;return h.jsxs(I,{onClick:()=>!X&&B(V.field),className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${X?"cursor-default":"cursor-pointer"}`,children:[h.jsx(vn,{checked:K,disabled:X,readOnly:!0,className:"h-4 w-4 text-blue-600 rounded border-gray-300 dark:border-gray-600 pointer-events-none"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:V.header}),X&&x&&h.jsx(Q,{className:"ml-auto text-xs text-gray-400 dark:text-gray-500",children:x})]},V.field)})})]})]})},qv=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...t)=>console.log("[Comp:PageTransition]",...t),warn:(...t)=>console.warn("[Comp:PageTransition]",...t),error:(...t)=>console.error("[Comp:PageTransition]",...t)},Zv=({className:t="",style:e})=>{const[n,r]=v.useState(!1);return v.useEffect(()=>{const s=window.G7Core?.TransitionManager;if(!s){qv.warn("TransitionManager를 찾을 수 없습니다.");return}return r(s.getIsPending()),s.subscribe(i=>{r(i)})},[]),n?h.jsxs(I,{className:`fixed top-0 left-0 right-0 z-[999] ${t}`,style:e,role:"progressbar","aria-label":"페이지 로딩 중",children:[h.jsx(I,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:h.jsx(I,{className:"h-full bg-blue-700 animate-[loading_1.5s_ease-in-out_infinite]",style:{width:"30%",animation:"loading 1.5s ease-in-out infinite"}})}),h.jsx("style",{children:`
|
||
@keyframes loading {
|
||
0% {
|
||
transform: translateX(-100%);
|
||
}
|
||
50% {
|
||
transform: translateX(300%);
|
||
}
|
||
100% {
|
||
transform: translateX(-100%);
|
||
}
|
||
}
|
||
`})]}):null},Qv=(t,e)=>window.G7Core?.t?.(t,e)??t,Jv=({options:t})=>{const e=document.documentElement.classList.contains("dark"),n=e?"rgb(17,24,39)":"rgb(249,250,251)",r=e?"#6b7280":"#9ca3af",s=e?"#9ca3af":"#6b7280";return h.jsxs("div",{style:{position:"absolute",inset:0,zIndex:2147483647,overflow:"hidden",background:n,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"15%",gap:"12px"},children:[h.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${r}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),h.jsx("span",{style:{color:s,fontSize:"14px"},children:t?.text||Qv("nav.loading")})]})};function hr(t){"@babel/helpers - typeof";return hr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hr(t)}function Rv(t,e){if(hr(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(hr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ou(t){var e=Rv(t,"string");return hr(e)=="symbol"?e:e+""}function Ts(t,e,n){return(e=Ou(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Me(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Tu(Object(n),!0).forEach(function(r){Ts(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ex(t){if(Array.isArray(t))return t}function tx(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function dl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Au(t,e){if(t){if(typeof t=="string")return dl(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dl(t,e):void 0}}function nx(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bn(t,e){return ex(t)||tx(t,e)||Au(t,e)||nx()}function rx(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Tn(t,e){if(t==null)return{};var n,r,s=rx(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}var sx=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Du(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,s=r===void 0?!1:r,o=t.defaultValue,i=o===void 0?null:o,a=t.inputValue,l=t.menuIsOpen,c=t.onChange,d=t.onInputChange,u=t.onMenuClose,f=t.onMenuOpen,g=t.value,m=Tn(t,sx),p=v.useState(a!==void 0?a:n),y=Bn(p,2),b=y[0],S=y[1],x=v.useState(l!==void 0?l:s),E=Bn(x,2),k=E[0],C=E[1],N=v.useState(g!==void 0?g:i),_=Bn(N,2),w=_[0],M=_[1],O=v.useCallback(function(z,H){typeof c=="function"&&c(z,H),M(z)},[c]),L=v.useCallback(function(z,H){var W;typeof d=="function"&&(W=d(z,H)),S(W!==void 0?W:z)},[d]),F=v.useCallback(function(){typeof f=="function"&&f(),C(!0)},[f]),$=v.useCallback(function(){typeof u=="function"&&u(),C(!1)},[u]),D=a!==void 0?a:b,A=l!==void 0?l:k,T=g!==void 0?g:w;return Me(Me({},m),{},{inputValue:D,menuIsOpen:A,onChange:O,onInputChange:L,onMenuClose:$,onMenuOpen:F,value:T})}function Ae(){return Ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ae.apply(null,arguments)}function ox(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Iu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ou(r.key),r)}}function ix(t,e,n){return e&&Iu(t.prototype,e),n&&Iu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ul(t,e){return ul=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ul(t,e)}function ax(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ul(t,e)}function Xo(t){return Xo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xo(t)}function Lu(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lu=function(){return!!t})()}function lx(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cx(t,e){if(e&&(hr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lx(t)}function dx(t){var e=Lu();return function(){var n,r=Xo(t);if(e){var s=Xo(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return cx(this,n)}}function ux(t){if(Array.isArray(t))return dl(t)}function fx(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hr(t){return ux(t)||fx(t)||Au(t)||hx()}function gx(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function px(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var mx=(function(){function t(n){var r=this;this._insertTag=function(s){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,o),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(px(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var o=gx(s);try{o.insertRule(r,o.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},t})(),$t="-ms-",Ko="-moz-",tt="-webkit-",Pu="comm",fl="rule",hl="decl",bx="@import",$u="@keyframes",yx="@layer",vx=Math.abs,qo=String.fromCharCode,xx=Object.assign;function wx(t,e){return It(t,0)^45?(((e<<2^It(t,0))<<2^It(t,1))<<2^It(t,2))<<2^It(t,3):0}function Fu(t){return t.trim()}function kx(t,e){return(t=e.exec(t))?t[0]:t}function nt(t,e,n){return t.replace(e,n)}function gl(t,e){return t.indexOf(e)}function It(t,e){return t.charCodeAt(e)|0}function As(t,e,n){return t.slice(e,n)}function An(t){return t.length}function pl(t){return t.length}function Zo(t,e){return e.push(t),t}function Cx(t,e){return t.map(e).join("")}var Qo=1,Ur=1,zu=0,qt=0,kt=0,Br="";function Jo(t,e,n,r,s,o,i){return{value:t,root:e,parent:n,type:r,props:s,children:o,line:Qo,column:Ur,length:i,return:""}}function Ds(t,e){return xx(Jo("",null,null,"",null,null,0),t,{length:-t.length},e)}function Sx(){return kt}function _x(){return kt=qt>0?It(Br,--qt):0,Ur--,kt===10&&(Ur=1,Qo--),kt}function on(){return kt=qt<zu?It(Br,qt++):0,Ur++,kt===10&&(Ur=1,Qo++),kt}function Dn(){return It(Br,qt)}function Ro(){return qt}function Is(t,e){return As(Br,t,e)}function Ls(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Vu(t){return Qo=Ur=1,zu=An(Br=t),qt=0,[]}function Hu(t){return Br="",t}function ei(t){return Fu(Is(qt-1,ml(t===91?t+2:t===40?t+1:t)))}function Ex(t){for(;(kt=Dn())&&kt<33;)on();return Ls(t)>2||Ls(kt)>3?"":" "}function Mx(t,e){for(;--e&&on()&&!(kt<48||kt>102||kt>57&&kt<65||kt>70&&kt<97););return Is(t,Ro()+(e<6&&Dn()==32&&on()==32))}function ml(t){for(;on();)switch(kt){case t:return qt;case 34:case 39:t!==34&&t!==39&&ml(kt);break;case 40:t===41&&ml(t);break;case 92:on();break}return qt}function Nx(t,e){for(;on()&&t+kt!==57;)if(t+kt===84&&Dn()===47)break;return"/*"+Is(e,qt-1)+"*"+qo(t===47?t:on())}function Ox(t){for(;!Ls(Dn());)on();return Is(t,qt)}function Tx(t){return Hu(ti("",null,null,null,[""],t=Vu(t),0,[0],t))}function ti(t,e,n,r,s,o,i,a,l){for(var c=0,d=0,u=i,f=0,g=0,m=0,p=1,y=1,b=1,S=0,x="",E=s,k=o,C=r,N=x;y;)switch(m=S,S=on()){case 40:if(m!=108&&It(N,u-1)==58){gl(N+=nt(ei(S),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:N+=ei(S);break;case 9:case 10:case 13:case 32:N+=Ex(m);break;case 92:N+=Mx(Ro()-1,7);continue;case 47:switch(Dn()){case 42:case 47:Zo(Ax(Nx(on(),Ro()),e,n),l);break;default:N+="/"}break;case 123*p:a[c++]=An(N)*b;case 125*p:case 59:case 0:switch(S){case 0:case 125:y=0;case 59+d:b==-1&&(N=nt(N,/\f/g,"")),g>0&&An(N)-u&&Zo(g>32?Bu(N+";",r,n,u-1):Bu(nt(N," ","")+";",r,n,u-2),l);break;case 59:N+=";";default:if(Zo(C=Uu(N,e,n,c,d,s,a,x,E=[],k=[],u),o),S===123)if(d===0)ti(N,e,C,C,E,o,u,a,k);else switch(f===99&&It(N,3)===110?100:f){case 100:case 108:case 109:case 115:ti(t,C,C,r&&Zo(Uu(t,C,C,0,0,s,a,x,s,E=[],u),k),s,k,u,a,r?E:k);break;default:ti(N,C,C,C,[""],k,0,a,k)}}c=d=g=0,p=b=1,x=N="",u=i;break;case 58:u=1+An(N),g=m;default:if(p<1){if(S==123)--p;else if(S==125&&p++==0&&_x()==125)continue}switch(N+=qo(S),S*p){case 38:b=d>0?1:(N+="\f",-1);break;case 44:a[c++]=(An(N)-1)*b,b=1;break;case 64:Dn()===45&&(N+=ei(on())),f=Dn(),d=u=An(x=N+=Ox(Ro())),S++;break;case 45:m===45&&An(N)==2&&(p=0)}}return o}function Uu(t,e,n,r,s,o,i,a,l,c,d){for(var u=s-1,f=s===0?o:[""],g=pl(f),m=0,p=0,y=0;m<r;++m)for(var b=0,S=As(t,u+1,u=vx(p=i[m])),x=t;b<g;++b)(x=Fu(p>0?f[b]+" "+S:nt(S,/&\f/g,f[b])))&&(l[y++]=x);return Jo(t,e,n,s===0?fl:a,l,c,d)}function Ax(t,e,n){return Jo(t,e,n,Pu,qo(Sx()),As(t,2,-2),0)}function Bu(t,e,n,r){return Jo(t,e,n,hl,As(t,0,r),As(t,r+1,-1),r)}function jr(t,e){for(var n="",r=pl(t),s=0;s<r;s++)n+=e(t[s],s,t,e)||"";return n}function Dx(t,e,n,r){switch(t.type){case yx:if(t.children.length)break;case bx:case hl:return t.return=t.return||t.value;case Pu:return"";case $u:return t.return=t.value+"{"+jr(t.children,r)+"}";case fl:t.value=t.props.join(",")}return An(n=jr(t.children,r))?t.return=t.value+"{"+n+"}":""}function Ix(t){var e=pl(t);return function(n,r,s,o){for(var i="",a=0;a<e;a++)i+=t[a](n,r,s,o)||"";return i}}function Lx(t){return function(e){e.root||(e=e.return)&&t(e)}}function Px(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var $x=function(e,n,r){for(var s=0,o=0;s=o,o=Dn(),s===38&&o===12&&(n[r]=1),!Ls(o);)on();return Is(e,qt)},Fx=function(e,n){var r=-1,s=44;do switch(Ls(s)){case 0:s===38&&Dn()===12&&(n[r]=1),e[r]+=$x(qt-1,n,r);break;case 2:e[r]+=ei(s);break;case 4:if(s===44){e[++r]=Dn()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=qo(s)}while(s=on());return e},zx=function(e,n){return Hu(Fx(Vu(e),n))},ju=new WeakMap,Vx=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,s=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!ju.get(r))&&!s){ju.set(e,!0);for(var o=[],i=zx(n,o),a=r.props,l=0,c=0;l<i.length;l++)for(var d=0;d<a.length;d++,c++)e.props[c]=o[l]?i[l].replace(/&\f/g,a[d]):a[d]+" "+i[l]}}},Hx=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function Wu(t,e){switch(wx(t,e)){case 5103:return tt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return tt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return tt+t+Ko+t+$t+t+t;case 6828:case 4268:return tt+t+$t+t+t;case 6165:return tt+t+$t+"flex-"+t+t;case 5187:return tt+t+nt(t,/(\w+).+(:[^]+)/,tt+"box-$1$2"+$t+"flex-$1$2")+t;case 5443:return tt+t+$t+"flex-item-"+nt(t,/flex-|-self/,"")+t;case 4675:return tt+t+$t+"flex-line-pack"+nt(t,/align-content|flex-|-self/,"")+t;case 5548:return tt+t+$t+nt(t,"shrink","negative")+t;case 5292:return tt+t+$t+nt(t,"basis","preferred-size")+t;case 6060:return tt+"box-"+nt(t,"-grow","")+tt+t+$t+nt(t,"grow","positive")+t;case 4554:return tt+nt(t,/([^-])(transform)/g,"$1"+tt+"$2")+t;case 6187:return nt(nt(nt(t,/(zoom-|grab)/,tt+"$1"),/(image-set)/,tt+"$1"),t,"")+t;case 5495:case 3959:return nt(t,/(image-set\([^]*)/,tt+"$1$`$1");case 4968:return nt(nt(t,/(.+:)(flex-)?(.*)/,tt+"box-pack:$3"+$t+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+tt+t+t;case 4095:case 3583:case 4068:case 2532:return nt(t,/(.+)-inline(.+)/,tt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(An(t)-1-e>6)switch(It(t,e+1)){case 109:if(It(t,e+4)!==45)break;case 102:return nt(t,/(.+:)(.+)-([^]+)/,"$1"+tt+"$2-$3$1"+Ko+(It(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~gl(t,"stretch")?Wu(nt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(It(t,e+1)!==115)break;case 6444:switch(It(t,An(t)-3-(~gl(t,"!important")&&10))){case 107:return nt(t,":",":"+tt)+t;case 101:return nt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+tt+(It(t,14)===45?"inline-":"")+"box$3$1"+tt+"$2$3$1"+$t+"$2box$3")+t}break;case 5936:switch(It(t,e+11)){case 114:return tt+t+$t+nt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return tt+t+$t+nt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return tt+t+$t+nt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return tt+t+$t+t+t}return t}var Ux=function(e,n,r,s){if(e.length>-1&&!e.return)switch(e.type){case hl:e.return=Wu(e.value,e.length);break;case $u:return jr([Ds(e,{value:nt(e.value,"@","@"+tt)})],s);case fl:if(e.length)return Cx(e.props,function(o){switch(kx(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return jr([Ds(e,{props:[nt(o,/:(read-\w+)/,":"+Ko+"$1")]})],s);case"::placeholder":return jr([Ds(e,{props:[nt(o,/:(plac\w+)/,":"+tt+"input-$1")]}),Ds(e,{props:[nt(o,/:(plac\w+)/,":"+Ko+"$1")]}),Ds(e,{props:[nt(o,/:(plac\w+)/,$t+"input-$1")]})],s)}return""})}},Bx=[Ux],jx=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var y=p.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var s=e.stylisPlugins||Bx,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var y=p.getAttribute("data-emotion").split(" "),b=1;b<y.length;b++)o[y[b]]=!0;a.push(p)});var l,c=[Vx,Hx];{var d,u=[Dx,Lx(function(p){d.insert(p)})],f=Ix(c.concat(s,u)),g=function(y){return jr(Tx(y),f)};l=function(y,b,S,x){d=S,g(y?y+"{"+b.styles+"}":b.styles),x&&(m.inserted[b.name]=!0)}}var m={key:n,sheet:new mx({key:n,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return m.sheet.hydrate(a),m},bl={exports:{}},rt={};var Gu;function Wx(){if(Gu)return rt;Gu=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,s=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,i=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,u=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,p=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function x(k){if(typeof k=="object"&&k!==null){var C=k.$$typeof;switch(C){case e:switch(k=k.type,k){case l:case c:case r:case o:case s:case u:return k;default:switch(k=k&&k.$$typeof,k){case a:case d:case m:case g:case i:return k;default:return C}}case n:return C}}}function E(k){return x(k)===c}return rt.AsyncMode=l,rt.ConcurrentMode=c,rt.ContextConsumer=a,rt.ContextProvider=i,rt.Element=e,rt.ForwardRef=d,rt.Fragment=r,rt.Lazy=m,rt.Memo=g,rt.Portal=n,rt.Profiler=o,rt.StrictMode=s,rt.Suspense=u,rt.isAsyncMode=function(k){return E(k)||x(k)===l},rt.isConcurrentMode=E,rt.isContextConsumer=function(k){return x(k)===a},rt.isContextProvider=function(k){return x(k)===i},rt.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===e},rt.isForwardRef=function(k){return x(k)===d},rt.isFragment=function(k){return x(k)===r},rt.isLazy=function(k){return x(k)===m},rt.isMemo=function(k){return x(k)===g},rt.isPortal=function(k){return x(k)===n},rt.isProfiler=function(k){return x(k)===o},rt.isStrictMode=function(k){return x(k)===s},rt.isSuspense=function(k){return x(k)===u},rt.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===c||k===o||k===s||k===u||k===f||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===g||k.$$typeof===i||k.$$typeof===a||k.$$typeof===d||k.$$typeof===y||k.$$typeof===b||k.$$typeof===S||k.$$typeof===p)},rt.typeOf=x,rt}var Yu;function Gx(){return Yu||(Yu=1,bl.exports=Wx()),bl.exports}var yl,Xu;function Yx(){if(Xu)return yl;Xu=1;var t=Gx(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[t.ForwardRef]=r,o[t.Memo]=s;function i(m){return t.isMemo(m)?s:o[m.$$typeof]||e}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function g(m,p,y){if(typeof p!="string"){if(f){var b=u(p);b&&b!==f&&g(m,b,y)}var S=l(p);c&&(S=S.concat(c(p)));for(var x=i(m),E=i(p),k=0;k<S.length;++k){var C=S[k];if(!n[C]&&!(y&&y[C])&&!(E&&E[C])&&!(x&&x[C])){var N=d(p,C);try{a(m,C,N)}catch{}}}}return m}return yl=g,yl}Yx();var Xx=!0;function Kx(t,e,n){var r="";return n.split(" ").forEach(function(s){t[s]!==void 0?e.push(t[s]+";"):s&&(r+=s+" ")}),r}var Ku=function(e,n,r){var s=e.key+"-"+n.name;(r===!1||Xx===!1)&&e.registered[s]===void 0&&(e.registered[s]=n.styles)},qx=function(e,n,r){Ku(e,n,r);var s=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+s:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function Zx(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var Qx={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Jx=/[A-Z]|^ms/g,Rx=/_EMO_([^_]+?)_([^]*?)_EMO_/g,qu=function(e){return e.charCodeAt(1)===45},Zu=function(e){return e!=null&&typeof e!="boolean"},vl=Px(function(t){return qu(t)?t:t.replace(Jx,"-$&").toLowerCase()}),Qu=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(Rx,function(r,s,o){return In={name:s,styles:o,next:In},s})}return Qx[e]!==1&&!qu(e)&&typeof n=="number"&&n!==0?n+"px":n};function Ps(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var s=n;if(s.anim===1)return In={name:s.name,styles:s.styles,next:In},s.name;var o=n;if(o.styles!==void 0){var i=o.next;if(i!==void 0)for(;i!==void 0;)In={name:i.name,styles:i.styles,next:In},i=i.next;var a=o.styles+";";return a}return ew(t,e,n)}case"function":{if(t!==void 0){var l=In,c=n(t);return In=l,Ps(t,e,c)}break}}var d=n;return d}function ew(t,e,n){var r="";if(Array.isArray(n))for(var s=0;s<n.length;s++)r+=Ps(t,e,n[s])+";";else for(var o in n){var i=n[o];if(typeof i!="object"){var a=i;Zu(a)&&(r+=vl(o)+":"+Qu(o,a)+";")}else if(Array.isArray(i)&&typeof i[0]=="string"&&e==null)for(var l=0;l<i.length;l++)Zu(i[l])&&(r+=vl(o)+":"+Qu(o,i[l])+";");else{var c=Ps(t,e,i);switch(o){case"animation":case"animationName":{r+=vl(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var Ju=/label:\s*([^\s;{]+)\s*(;|$)/g,In;function Ru(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,s="";In=void 0;var o=t[0];if(o==null||o.raw===void 0)r=!1,s+=Ps(n,e,o);else{var i=o;s+=i[0]}for(var a=1;a<t.length;a++)if(s+=Ps(n,e,t[a]),r){var l=o;s+=l[a]}Ju.lastIndex=0;for(var c="",d;(d=Ju.exec(s))!==null;)c+="-"+d[1];var u=Zx(s)+c;return{name:u,styles:s,next:In}}var tw=function(e){return e()},nw=P.useInsertionEffect?P.useInsertionEffect:!1,rw=nw||tw,ef=P.createContext(typeof HTMLElement<"u"?jx({key:"css"}):null);ef.Provider;var sw=function(e){return v.forwardRef(function(n,r){var s=v.useContext(ef);return e(n,s,r)})},ow=P.createContext({}),xl={}.hasOwnProperty,wl="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",iw=function(e,n){var r={};for(var s in n)xl.call(n,s)&&(r[s]=n[s]);return r[wl]=e,r},aw=function(e){var n=e.cache,r=e.serialized,s=e.isStringTag;return Ku(n,r,s),rw(function(){return qx(n,r,s)}),null},lw=sw(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var s=t[wl],o=[r],i="";typeof t.className=="string"?i=Kx(e.registered,o,t.className):t.className!=null&&(i=t.className+" ");var a=Ru(o,void 0,P.useContext(ow));i+=e.key+"-"+a.name;var l={};for(var c in t)xl.call(t,c)&&c!=="css"&&c!==wl&&(l[c]=t[c]);return l.className=i,n&&(l.ref=n),P.createElement(P.Fragment,null,P.createElement(aw,{cache:e,serialized:a,isStringTag:typeof s=="string"}),P.createElement(s,l))}),cw=lw,Ee=function(e,n){var r=arguments;if(n==null||!xl.call(n,"css"))return P.createElement.apply(void 0,r);var s=r.length,o=new Array(s);o[0]=cw,o[1]=iw(e,n);for(var i=2;i<s;i++)o[i]=r[i];return P.createElement.apply(null,o)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Ee||(Ee={}));function kl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Ru(e)}function dw(){var t=kl.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function uw(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const fw=Math.min,hw=Math.max,ni=Math.round,ri=Math.floor,si=t=>({x:t,y:t});function gw(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function oi(){return typeof window<"u"}function tf(t){return rf(t)?(t.nodeName||"").toLowerCase():"#document"}function jn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function nf(t){var e;return(e=(rf(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rf(t){return oi()?t instanceof Node||t instanceof jn(t).Node:!1}function pw(t){return oi()?t instanceof Element||t instanceof jn(t).Element:!1}function Cl(t){return oi()?t instanceof HTMLElement||t instanceof jn(t).HTMLElement:!1}function sf(t){return!oi()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof jn(t).ShadowRoot}function of(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=_l(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}let Sl;function mw(){return Sl==null&&(Sl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Sl}function bw(t){return/^(html|body|#document)$/.test(tf(t))}function _l(t){return jn(t).getComputedStyle(t)}function yw(t){if(tf(t)==="html")return t;const e=t.assignedSlot||t.parentNode||sf(t)&&t.host||nf(t);return sf(e)?e.host:e}function af(t){const e=yw(t);return bw(e)?t.ownerDocument?t.ownerDocument.body:t.body:Cl(e)&&of(e)?e:af(e)}function ii(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=af(t),o=s===((r=t.ownerDocument)==null?void 0:r.body),i=jn(s);if(o){const a=El(i);return e.concat(i,i.visualViewport||[],of(s)?s:[],a&&n?ii(a):[])}else return e.concat(s,ii(s,[],n))}function El(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function vw(t){const e=_l(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Cl(t),o=s?t.offsetWidth:n,i=s?t.offsetHeight:r,a=ni(n)!==o||ni(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function Ml(t){return pw(t)?t:t.contextElement}function lf(t){const e=Ml(t);if(!Cl(e))return si(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:o}=vw(e);let i=(o?ni(n.width):n.width)/r,a=(o?ni(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const xw=si(0);function ww(t){const e=jn(t);return!mw()||!e.visualViewport?xw:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function kw(t,e,n){return!1}function cf(t,e,n,r){e===void 0&&(e=!1);const s=t.getBoundingClientRect(),o=Ml(t);let i=si(1);e&&(i=lf(t));const a=kw()?ww(o):si(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,d=s.width/i.x,u=s.height/i.y;if(o){const f=jn(o),g=r;let m=f,p=El(m);for(;p&&r&&g!==m;){const y=lf(p),b=p.getBoundingClientRect(),S=_l(p),x=b.left+(p.clientLeft+parseFloat(S.paddingLeft))*y.x,E=b.top+(p.clientTop+parseFloat(S.paddingTop))*y.y;l*=y.x,c*=y.y,d*=y.x,u*=y.y,l+=x,c+=E,m=jn(p),p=El(m)}}return gw({width:d,height:u,x:l,y:c})}function df(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Cw(t,e){let n=null,r;const s=nf(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:d,top:u,width:f,height:g}=c;if(a||e(),!f||!g)return;const m=ri(u),p=ri(s.clientWidth-(d+f)),y=ri(s.clientHeight-(u+g)),b=ri(d),x={rootMargin:-m+"px "+-p+"px "+-y+"px "+-b+"px",threshold:hw(0,fw(1,l))||1};let E=!0;function k(C){const N=C[0].intersectionRatio;if(N!==l){if(!E)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!df(c,t.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(k,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(k,x)}n.observe(t)}return i(!0),o}function Sw(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ml(t),d=s||o?[...c?ii(c):[],...e?ii(e):[]]:[];d.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const u=c&&a?Cw(c,n):null;let f=-1,g=null;i&&(g=new ResizeObserver(b=>{let[S]=b;S&&S.target===c&&g&&e&&(g.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(e)})),n()}),c&&!l&&g.observe(c),e&&g.observe(e));let m,p=l?cf(t):null;l&&y();function y(){const b=cf(t);p&&!df(p,b)&&n(),p=b,m=requestAnimationFrame(y)}return n(),()=>{var b;d.forEach(S=>{s&&S.removeEventListener("scroll",n),o&&S.removeEventListener("resize",n)}),u?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(m)}}var Nl=v.useLayoutEffect,_w=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ai=function(){};function Ew(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function Mw(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];var o=[].concat(r);if(e&&t)for(var i in e)e.hasOwnProperty(i)&&e[i]&&o.push("".concat(Ew(t,i)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var li=function(e){return $w(e)?e.filter(Boolean):hr(e)==="object"&&e!==null?[e]:[]},uf=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=Tn(e,_w);return Me({},n)},yt=function(e,n,r){var s=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(n,e),className:s(r??{},i(n,e),a)}};function ci(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function Nw(t){return ci(t)?window.innerHeight:t.clientHeight}function ff(t){return ci(t)?window.pageYOffset:t.scrollTop}function di(t,e){if(ci(t)){window.scrollTo(0,e);return}t.scrollTop=e}function Ow(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var s=t;s=s.parentElement;)if(e=getComputedStyle(s),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return s;return document.documentElement}function Tw(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function ui(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ai,s=ff(t),o=e-s,i=10,a=0;function l(){a+=i;var c=Tw(a,s,o,n);di(t,c),a<n?window.requestAnimationFrame(l):r(t)}l()}function hf(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),s=e.offsetHeight/3;r.bottom+s>n.bottom?di(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+s,t.scrollHeight)):r.top-s<n.top&&di(t,Math.max(e.offsetTop-s,0))}function Aw(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function gf(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Dw(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var pf=!1,Iw={get passive(){return pf=!0}},fi=typeof window<"u"?window:{};fi.addEventListener&&fi.removeEventListener&&(fi.addEventListener("p",ai,Iw),fi.removeEventListener("p",ai,!1));var Lw=pf;function Pw(t){return t!=null}function $w(t){return Array.isArray(t)}function $s(t,e,n){return t?e:n}function V5(t){return t}function H5(t){return t}var Fw=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];var o=Object.entries(e).filter(function(i){var a=Bn(i,1),l=a[0];return!r.includes(l)});return o.reduce(function(i,a){var l=Bn(a,2),c=l[0],d=l[1];return i[c]=d,i},{})},zw=["children","innerProps"],Vw=["children","innerProps"];function Hw(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,s=t.placement,o=t.shouldScroll,i=t.isFixedPosition,a=t.controlHeight,l=Ow(n),c={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return c;var d=l.getBoundingClientRect(),u=d.height,f=n.getBoundingClientRect(),g=f.bottom,m=f.height,p=f.top,y=n.offsetParent.getBoundingClientRect(),b=y.top,S=i?window.innerHeight:Nw(l),x=ff(l),E=parseInt(getComputedStyle(n).marginBottom,10),k=parseInt(getComputedStyle(n).marginTop,10),C=b-k,N=S-p,_=C+x,w=u-x-p,M=g-S+x+E,O=x+p-k,L=160;switch(s){case"auto":case"bottom":if(N>=m)return{placement:"bottom",maxHeight:e};if(w>=m&&!i)return o&&ui(l,M,L),{placement:"bottom",maxHeight:e};if(!i&&w>=r||i&&N>=r){o&&ui(l,M,L);var F=i?N-E:w-E;return{placement:"bottom",maxHeight:F}}if(s==="auto"||i){var $=e,D=i?C:_;return D>=r&&($=Math.min(D-E-a,e)),{placement:"top",maxHeight:$}}if(s==="bottom")return o&&di(l,M),{placement:"bottom",maxHeight:e};break;case"top":if(C>=m)return{placement:"top",maxHeight:e};if(_>=m&&!i)return o&&ui(l,O,L),{placement:"top",maxHeight:e};if(!i&&_>=r||i&&C>=r){var A=e;return(!i&&_>=r||i&&C>=r)&&(A=i?C-k:_-k),o&&ui(l,O,L),{placement:"top",maxHeight:A}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(s,'".'))}return c}function Uw(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var mf=function(e){return e==="auto"?"bottom":e},Bw=function(e,n){var r,s=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,l=o.colors;return Me((r={label:"menu"},Ts(r,Uw(s),"100%"),Ts(r,"position","absolute"),Ts(r,"width","100%"),Ts(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},bf=v.createContext(null),jw=function(e){var n=e.children,r=e.minMenuHeight,s=e.maxMenuHeight,o=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=v.useContext(bf)||{},d=c.setPortalPlacement,u=v.useRef(null),f=v.useState(s),g=Bn(f,2),m=g[0],p=g[1],y=v.useState(null),b=Bn(y,2),S=b[0],x=b[1],E=l.spacing.controlHeight;return Nl(function(){var k=u.current;if(k){var C=i==="fixed",N=a&&!C,_=Hw({maxHeight:s,menuEl:k,minHeight:r,placement:o,shouldScroll:N,isFixedPosition:C,controlHeight:E});p(_.maxHeight),x(_.placement),d?.(_.placement)}},[s,o,i,a,r,d,E]),n({ref:u,placerProps:Me(Me({},e),{},{placement:S||mf(o),maxHeight:m})})},Ww=function(e){var n=e.children,r=e.innerRef,s=e.innerProps;return Ee("div",Ae({},yt(e,"menu",{menu:!0}),{ref:r},s),n)},Gw=Ww,Yw=function(e,n){var r=e.maxHeight,s=e.theme.spacing.baseUnit;return Me({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:s,paddingTop:s})},Xw=function(e){var n=e.children,r=e.innerProps,s=e.innerRef,o=e.isMulti;return Ee("div",Ae({},yt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:s},r),n)},yf=function(e,n){var r=e.theme,s=r.spacing.baseUnit,o=r.colors;return Me({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(s*2,"px ").concat(s*3,"px")})},Kw=yf,qw=yf,Zw=function(e){var n=e.children,r=n===void 0?"No options":n,s=e.innerProps,o=Tn(e,zw);return Ee("div",Ae({},yt(Me(Me({},o),{},{children:r,innerProps:s}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),s),r)},Qw=function(e){var n=e.children,r=n===void 0?"Loading...":n,s=e.innerProps,o=Tn(e,Vw);return Ee("div",Ae({},yt(Me(Me({},o),{},{children:r,innerProps:s}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),s),r)},Jw=function(e){var n=e.rect,r=e.offset,s=e.position;return{left:n.left,position:s,top:r,width:n.width,zIndex:1}},Rw=function(e){var n=e.appendTo,r=e.children,s=e.controlElement,o=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=v.useRef(null),c=v.useRef(null),d=v.useState(mf(i)),u=Bn(d,2),f=u[0],g=u[1],m=v.useMemo(function(){return{setPortalPlacement:g}},[]),p=v.useState(null),y=Bn(p,2),b=y[0],S=y[1],x=v.useCallback(function(){if(s){var N=Aw(s),_=a==="fixed"?0:window.pageYOffset,w=N[f]+_;(w!==b?.offset||N.left!==b?.rect.left||N.width!==b?.rect.width)&&S({offset:w,rect:N})}},[s,a,f,b?.offset,b?.rect.left,b?.rect.width]);Nl(function(){x()},[x]);var E=v.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),s&&l.current&&(c.current=Sw(s,l.current,x,{elementResize:"ResizeObserver"in window}))},[s,x]);Nl(function(){E()},[E]);var k=v.useCallback(function(N){l.current=N,E()},[E]);if(!n&&a!=="fixed"||!b)return null;var C=Ee("div",Ae({ref:k},yt(Me(Me({},e),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),o),r);return Ee(bf.Provider,{value:m},n?On.createPortal(C,n):C)},e1=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},t1=function(e){var n=e.children,r=e.innerProps,s=e.isDisabled,o=e.isRtl;return Ee("div",Ae({},yt(e,"container",{"--is-disabled":s,"--is-rtl":o}),r),n)},n1=function(e,n){var r=e.theme.spacing,s=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Me({alignItems:"center",display:s&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},r1=function(e){var n=e.children,r=e.innerProps,s=e.isMulti,o=e.hasValue;return Ee("div",Ae({},yt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":s,"value-container--has-value":o}),r),n)},s1=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},o1=function(e){var n=e.children,r=e.innerProps;return Ee("div",Ae({},yt(e,"indicatorsContainer",{indicators:!0}),r),n)},vf,i1=["size"],a1=["innerProps","isRtl","size"],l1={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},xf=function(e){var n=e.size,r=Tn(e,i1);return Ee("svg",Ae({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:l1},r))},Ol=function(e){return Ee(xf,Ae({size:20},e),Ee("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},wf=function(e){return Ee(xf,Ae({size:20},e),Ee("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},kf=function(e,n){var r=e.isFocused,s=e.theme,o=s.spacing.baseUnit,i=s.colors;return Me({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?i.neutral60:i.neutral20,padding:o*2,":hover":{color:r?i.neutral80:i.neutral40}})},c1=kf,d1=function(e){var n=e.children,r=e.innerProps;return Ee("div",Ae({},yt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||Ee(wf,null))},u1=kf,f1=function(e){var n=e.children,r=e.innerProps;return Ee("div",Ae({},yt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||Ee(Ol,null))},h1=function(e,n){var r=e.isDisabled,s=e.theme,o=s.spacing.baseUnit,i=s.colors;return Me({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?i.neutral10:i.neutral20,marginBottom:o*2,marginTop:o*2})},g1=function(e){var n=e.innerProps;return Ee("span",Ae({},n,yt(e,"indicatorSeparator",{"indicator-separator":!0})))},p1=dw(vf||(vf=uw([`
|
||
0%, 80%, 100% { opacity: 0; }
|
||
40% { opacity: 1; }
|
||
`]))),m1=function(e,n){var r=e.isFocused,s=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return Me({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:s,lineHeight:1,marginRight:s,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?i.neutral60:i.neutral20,padding:a*2})},Tl=function(e){var n=e.delay,r=e.offset;return Ee("span",{css:kl({animation:"".concat(p1," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},b1=function(e){var n=e.innerProps,r=e.isRtl,s=e.size,o=s===void 0?4:s,i=Tn(e,a1);return Ee("div",Ae({},yt(Me(Me({},i),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ee(Tl,{delay:0,offset:r}),Ee(Tl,{delay:160,offset:!0}),Ee(Tl,{delay:320,offset:!r}))},y1=function(e,n){var r=e.isDisabled,s=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return Me({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?i.neutral5:i.neutral0,borderColor:r?i.neutral10:s?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:s?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:s?i.primary:i.neutral30}})},v1=function(e){var n=e.children,r=e.isDisabled,s=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Ee("div",Ae({ref:o},yt(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":a}),i,{"aria-disabled":r||void 0}),n)},x1=v1,w1=["data"],k1=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},C1=function(e){var n=e.children,r=e.cx,s=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,d=e.theme,u=e.selectProps;return Ee("div",Ae({},yt(e,"group",{group:!0}),l),Ee(i,Ae({},a,{selectProps:u,theme:d,getStyles:s,getClassNames:o,cx:r}),c),Ee("div",null,n))},S1=function(e,n){var r=e.theme,s=r.colors,o=r.spacing;return Me({label:"group",cursor:"default",display:"block"},n?{}:{color:s.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},_1=function(e){var n=uf(e);n.data;var r=Tn(n,w1);return Ee("div",Ae({},yt(e,"groupHeading",{"group-heading":!0}),r))},E1=C1,M1=["innerRef","isDisabled","isHidden","inputClassName"],N1=function(e,n){var r=e.isDisabled,s=e.value,o=e.theme,i=o.spacing,a=o.colors;return Me(Me({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},O1),n?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},Cf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},O1={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Me({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Cf)},T1=function(e){return Me({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Cf)},A1=function(e){var n=e.cx,r=e.value,s=uf(e),o=s.innerRef,i=s.isDisabled,a=s.isHidden,l=s.inputClassName,c=Tn(s,M1);return Ee("div",Ae({},yt(e,"input",{"input-container":!0}),{"data-value":r||""}),Ee("input",Ae({className:n({input:!0},l),ref:o,style:T1(a),disabled:i},c)))},D1=A1,I1=function(e,n){var r=e.theme,s=r.spacing,o=r.borderRadius,i=r.colors;return Me({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:s.baseUnit/2})},L1=function(e,n){var r=e.theme,s=r.borderRadius,o=r.colors,i=e.cropWithEllipsis;return Me({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:s/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},P1=function(e,n){var r=e.theme,s=r.spacing,o=r.borderRadius,i=r.colors,a=e.isFocused;return Me({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:s.baseUnit,paddingRight:s.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Sf=function(e){var n=e.children,r=e.innerProps;return Ee("div",r,n)},$1=Sf,F1=Sf;function z1(t){var e=t.children,n=t.innerProps;return Ee("div",Ae({role:"button"},n),e||Ee(Ol,{size:14}))}var V1=function(e){var n=e.children,r=e.components,s=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,c=r.Container,d=r.Label,u=r.Remove;return Ee(c,{data:s,innerProps:Me(Me({},yt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},Ee(d,{data:s,innerProps:Me({},yt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Ee(u,{data:s,innerProps:Me(Me({},yt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},H1=V1,U1=function(e,n){var r=e.isDisabled,s=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Me({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:s?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},B1=function(e){var n=e.children,r=e.isDisabled,s=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return Ee("div",Ae({},yt(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":s,"option--is-selected":o}),{ref:i,"aria-disabled":r},a),n)},j1=B1,W1=function(e,n){var r=e.theme,s=r.spacing,o=r.colors;return Me({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},G1=function(e){var n=e.children,r=e.innerProps;return Ee("div",Ae({},yt(e,"placeholder",{placeholder:!0}),r),n)},Y1=G1,X1=function(e,n){var r=e.isDisabled,s=e.theme,o=s.spacing,i=s.colors;return Me({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},K1=function(e){var n=e.children,r=e.isDisabled,s=e.innerProps;return Ee("div",Ae({},yt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),s),n)},q1=K1,hi={ClearIndicator:f1,Control:x1,DropdownIndicator:d1,DownChevron:wf,CrossIcon:Ol,Group:E1,GroupHeading:_1,IndicatorsContainer:o1,IndicatorSeparator:g1,Input:D1,LoadingIndicator:b1,Menu:Gw,MenuList:Xw,MenuPortal:Rw,LoadingMessage:Qw,NoOptionsMessage:Zw,MultiValue:H1,MultiValueContainer:$1,MultiValueLabel:F1,MultiValueRemove:z1,Option:j1,Placeholder:Y1,SelectContainer:t1,SingleValue:q1,ValueContainer:r1},Z1=function(e){return Me(Me({},hi),e.components)},_f=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Q1(t,e){return!!(t===e||_f(t)&&_f(e))}function J1(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!Q1(t[n],e[n]))return!1;return!0}function R1(t,e){e===void 0&&(e=J1);var n=null;function r(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];if(n&&n.lastThis===this&&e(s,n.lastArgs))return n.lastResult;var i=t.apply(this,s);return n={lastResult:i,lastArgs:s,lastThis:this},i}return r.clear=function(){n=null},r}for(var ek={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},tk=function(e){return Ee("span",Ae({css:ek},e))},Ef=tk,nk={guidance:function(e){var n=e.isSearchable,r=e.isMulti,s=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(s?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,s=r===void 0?"":r,o=e.labels,i=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(s,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return i?"option ".concat(s," is disabled. Select another option."):"option ".concat(s,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,s=e.options,o=e.label,i=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,c=e.isSelected,d=e.isAppleDevice,u=function(p,y){return p&&p.length?"".concat(p.indexOf(y)+1," of ").concat(p.length):""};if(n==="value"&&a)return"value ".concat(i," focused, ").concat(u(a,r),".");if(n==="menu"&&d){var f=l?" disabled":"",g="".concat(c?" selected":"").concat(f);return"".concat(i).concat(g,", ").concat(u(s,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},rk=function(e){var n=e.ariaSelection,r=e.focusedOption,s=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,d=e.isAppleDevice,u=l.ariaLiveMessages,f=l.getOptionLabel,g=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,y=l.isSearchable,b=l.menuIsOpen,S=l.options,x=l.screenReaderStatus,E=l.tabSelectsValue,k=l.isLoading,C=l["aria-label"],N=l["aria-live"],_=v.useMemo(function(){return Me(Me({},nk),u||{})},[u]),w=v.useMemo(function(){var D="";if(n&&_.onChange){var A=n.option,T=n.options,z=n.removedValue,H=n.removedValues,W=n.value,j=function(Z){return Array.isArray(Z)?null:Z},U=z||A||j(W),B=U?f(U):"",G=T||H||void 0,V=G?G.map(f):[],K=Me({isDisabled:U&&p(U,a),label:B,labels:V},n);D=_.onChange(K)}return D},[n,_,p,a,f]),M=v.useMemo(function(){var D="",A=r||s,T=!!(r&&a&&a.includes(r));if(A&&_.onFocus){var z={focused:A,label:f(A),isDisabled:p(A,a),isSelected:T,options:o,context:A===r?"menu":"value",selectValue:a,isAppleDevice:d};D=_.onFocus(z)}return D},[r,s,f,p,_,o,a,d]),O=v.useMemo(function(){var D="";if(b&&S.length&&!k&&_.onFilter){var A=x({count:o.length});D=_.onFilter({inputValue:g,resultsMessage:A})}return D},[o,g,b,_,S,x,k]),L=n?.action==="initial-input-focus",F=v.useMemo(function(){var D="";if(_.guidance){var A=s?"value":b?"menu":"input";D=_.guidance({"aria-label":C,context:A,isDisabled:r&&p(r,a),isMulti:m,isSearchable:y,tabSelectsValue:E,isInitialFocus:L})}return D},[C,r,s,m,p,y,b,_,a,E,L]),$=Ee(v.Fragment,null,Ee("span",{id:"aria-selection"},w),Ee("span",{id:"aria-focused"},M),Ee("span",{id:"aria-results"},O),Ee("span",{id:"aria-guidance"},F));return Ee(v.Fragment,null,Ee(Ef,{id:c},L&&$),Ee(Ef,{"aria-live":N,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!L&&$))},sk=rk,Al=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],ok=new RegExp("["+Al.map(function(t){return t.letters}).join("")+"]","g"),Mf={},Dl=0;Dl<Al.length;Dl++)for(var Il=Al[Dl],Ll=0;Ll<Il.letters.length;Ll++)Mf[Il.letters[Ll]]=Il.base;var Nf=function(e){return e.replace(ok,function(n){return Mf[n]})},ik=R1(Nf),Of=function(e){return e.replace(/^\s+|\s+$/g,"")},ak=function(e){return"".concat(e.label," ").concat(e.value)},lk=function(e){return function(n,r){if(n.data.__isNew__)return!0;var s=Me({ignoreCase:!0,ignoreAccents:!0,stringify:ak,trim:!0,matchFrom:"any"},e),o=s.ignoreCase,i=s.ignoreAccents,a=s.stringify,l=s.trim,c=s.matchFrom,d=l?Of(r):r,u=l?Of(a(n)):a(n);return o&&(d=d.toLowerCase(),u=u.toLowerCase()),i&&(d=ik(d),u=Nf(u)),c==="start"?u.substr(0,d.length)===d:u.indexOf(d)>-1}},ck=["innerRef"];function dk(t){var e=t.innerRef,n=Tn(t,ck),r=Fw(n,"onExited","in","enter","exit","appear");return Ee("input",Ae({ref:e},r,{css:kl({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var uk=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function fk(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,s=t.onTopArrive,o=t.onTopLeave,i=v.useRef(!1),a=v.useRef(!1),l=v.useRef(0),c=v.useRef(null),d=v.useCallback(function(y,b){if(c.current!==null){var S=c.current,x=S.scrollTop,E=S.scrollHeight,k=S.clientHeight,C=c.current,N=b>0,_=E-k-x,w=!1;_>b&&i.current&&(r&&r(y),i.current=!1),N&&a.current&&(o&&o(y),a.current=!1),N&&b>_?(n&&!i.current&&n(y),C.scrollTop=E,w=!0,i.current=!0):!N&&-b>x&&(s&&!a.current&&s(y),C.scrollTop=0,w=!0,a.current=!0),w&&uk(y)}},[n,r,s,o]),u=v.useCallback(function(y){d(y,y.deltaY)},[d]),f=v.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),g=v.useCallback(function(y){var b=l.current-y.changedTouches[0].clientY;d(y,b)},[d]),m=v.useCallback(function(y){if(y){var b=Lw?{passive:!1}:!1;y.addEventListener("wheel",u,b),y.addEventListener("touchstart",f,b),y.addEventListener("touchmove",g,b)}},[g,f,u]),p=v.useCallback(function(y){y&&(y.removeEventListener("wheel",u,!1),y.removeEventListener("touchstart",f,!1),y.removeEventListener("touchmove",g,!1))},[g,f,u]);return v.useEffect(function(){if(e){var y=c.current;return m(y),function(){p(y)}}},[e,m,p]),function(y){c.current=y}}var Tf=["boxSizing","height","overflow","paddingRight","position"],Af={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Df(t){t.cancelable&&t.preventDefault()}function If(t){t.stopPropagation()}function Lf(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function Pf(){return"ontouchstart"in window||navigator.maxTouchPoints}var $f=!!(typeof window<"u"&&window.document&&window.document.createElement),Fs=0,Wr={capture:!1,passive:!1};function hk(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,s=v.useRef({}),o=v.useRef(null),i=v.useCallback(function(l){if($f){var c=document.body,d=c&&c.style;if(r&&Tf.forEach(function(m){var p=d&&d[m];s.current[m]=p}),r&&Fs<1){var u=parseInt(s.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,g=window.innerWidth-f+u||0;Object.keys(Af).forEach(function(m){var p=Af[m];d&&(d[m]=p)}),d&&(d.paddingRight="".concat(g,"px"))}c&&Pf()&&(c.addEventListener("touchmove",Df,Wr),l&&(l.addEventListener("touchstart",Lf,Wr),l.addEventListener("touchmove",If,Wr))),Fs+=1}},[r]),a=v.useCallback(function(l){if($f){var c=document.body,d=c&&c.style;Fs=Math.max(Fs-1,0),r&&Fs<1&&Tf.forEach(function(u){var f=s.current[u];d&&(d[u]=f)}),c&&Pf()&&(c.removeEventListener("touchmove",Df,Wr),l&&(l.removeEventListener("touchstart",Lf,Wr),l.removeEventListener("touchmove",If,Wr)))}},[r]);return v.useEffect(function(){if(e){var l=o.current;return i(l),function(){a(l)}}},[e,i,a]),function(l){o.current=l}}var gk=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},pk={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function mk(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,s=r===void 0?!0:r,o=t.onBottomArrive,i=t.onBottomLeave,a=t.onTopArrive,l=t.onTopLeave,c=fk({isEnabled:s,onBottomArrive:o,onBottomLeave:i,onTopArrive:a,onTopLeave:l}),d=hk({isEnabled:n}),u=function(g){c(g),d(g)};return Ee(v.Fragment,null,n&&Ee("div",{onClick:gk,css:pk}),e(u))}var bk={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},yk=function(e){var n=e.name,r=e.onFocus;return Ee("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:bk,value:"",onChange:function(){}})},vk=yk;function Pl(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function xk(){return Pl(/^iPhone/i)}function Ff(){return Pl(/^Mac/i)}function wk(){return Pl(/^iPad/i)||Ff()&&navigator.maxTouchPoints>1}function kk(){return xk()||wk()}function Ck(){return Ff()||kk()}var Sk=function(e){return e.label},zf=function(e){return e.label},Vf=function(e){return e.value},_k=function(e){return!!e.isDisabled},Ek={clearIndicator:u1,container:e1,control:y1,dropdownIndicator:c1,group:k1,groupHeading:S1,indicatorsContainer:s1,indicatorSeparator:h1,input:N1,loadingIndicator:m1,loadingMessage:qw,menu:Bw,menuList:Yw,menuPortal:Jw,multiValue:I1,multiValueLabel:L1,multiValueRemove:P1,noOptionsMessage:Kw,option:U1,placeholder:W1,singleValue:X1,valueContainer:n1},Mk={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Nk=4,Hf=4,Ok=38,Tk=Hf*2,Ak={baseUnit:Hf,controlHeight:Ok,menuGutter:Tk},$l={borderRadius:Nk,colors:Mk,spacing:Ak},Dk={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:gf(),captureMenuScroll:!gf(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:lk(),formatGroupLabel:Sk,getOptionLabel:zf,getOptionValue:Vf,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:_k,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Dw(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Uf(t,e,n,r){var s=Yf(t,e,n),o=Xf(t,e,n),i=Gf(t,e),a=pi(t,e);return{type:"option",data:e,isDisabled:s,isSelected:o,label:i,value:a,index:r}}function gi(t,e){return t.options.map(function(n,r){if("options"in n){var s=n.options.map(function(i,a){return Uf(t,i,e,a)}).filter(function(i){return Wf(t,i)});return s.length>0?{type:"group",data:n,options:s,index:r}:void 0}var o=Uf(t,n,e,r);return Wf(t,o)?o:void 0}).filter(Pw)}function Bf(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,Hr(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function jf(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Hr(r.options.map(function(s){return{data:s.data,id:"".concat(e,"-").concat(r.index,"-").concat(s.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function Ik(t,e){return Bf(gi(t,e))}function Wf(t,e){var n=t.inputValue,r=n===void 0?"":n,s=e.data,o=e.isSelected,i=e.label,a=e.value;return(!qf(t)||!o)&&Kf(t,{label:i,value:a,data:s},r)}function Lk(t,e){var n=t.focusedValue,r=t.selectValue,s=r.indexOf(n);if(s>-1){var o=e.indexOf(n);if(o>-1)return n;if(s<e.length)return e[s]}return null}function Pk(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var Fl=function(e,n){var r,s=(r=e.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return s||null},Gf=function(e,n){return e.getOptionLabel(n)},pi=function(e,n){return e.getOptionValue(n)};function Yf(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function Xf(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=pi(t,e);return n.some(function(s){return pi(t,s)===r})}function Kf(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var qf=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},$k=1,zl=(function(t){ax(n,t);var e=dx(n);function n(r){var s;if(ox(this,n),s=e.call(this,r),s.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},s.blockOptionHover=!1,s.isComposing=!1,s.commonProps=void 0,s.initialTouchX=0,s.initialTouchY=0,s.openAfterFocus=!1,s.scrollToFocusedOptionOnUpdate=!1,s.userIsDragging=void 0,s.controlRef=null,s.getControlRef=function(l){s.controlRef=l},s.focusedOptionRef=null,s.getFocusedOptionRef=function(l){s.focusedOptionRef=l},s.menuListRef=null,s.getMenuListRef=function(l){s.menuListRef=l},s.inputRef=null,s.getInputRef=function(l){s.inputRef=l},s.focus=s.focusInput,s.blur=s.blurInput,s.onChange=function(l,c){var d=s.props,u=d.onChange,f=d.name;c.name=f,s.ariaOnChange(l,c),u(l,c)},s.setValue=function(l,c,d){var u=s.props,f=u.closeMenuOnSelect,g=u.isMulti,m=u.inputValue;s.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(s.setState({inputIsHiddenAfterUpdate:!g}),s.onMenuClose()),s.setState({clearFocusValueOnUpdate:!0}),s.onChange(l,{action:c,option:d})},s.selectOption=function(l){var c=s.props,d=c.blurInputOnSelect,u=c.isMulti,f=c.name,g=s.state.selectValue,m=u&&s.isOptionSelected(l,g),p=s.isOptionDisabled(l,g);if(m){var y=s.getOptionValue(l);s.setValue(g.filter(function(b){return s.getOptionValue(b)!==y}),"deselect-option",l)}else if(!p)u?s.setValue([].concat(Hr(g),[l]),"select-option",l):s.setValue(l,"select-option");else{s.ariaOnChange(l,{action:"select-option",option:l,name:f});return}d&&s.blurInput()},s.removeValue=function(l){var c=s.props.isMulti,d=s.state.selectValue,u=s.getOptionValue(l),f=d.filter(function(m){return s.getOptionValue(m)!==u}),g=$s(c,f,f[0]||null);s.onChange(g,{action:"remove-value",removedValue:l}),s.focusInput()},s.clearValue=function(){var l=s.state.selectValue;s.onChange($s(s.props.isMulti,[],null),{action:"clear",removedValues:l})},s.popValue=function(){var l=s.props.isMulti,c=s.state.selectValue,d=c[c.length-1],u=c.slice(0,c.length-1),f=$s(l,u,u[0]||null);d&&s.onChange(f,{action:"pop-value",removedValue:d})},s.getFocusedOptionId=function(l){return Fl(s.state.focusableOptionsWithIds,l)},s.getFocusableOptionsWithIds=function(){return jf(gi(s.props,s.state.selectValue),s.getElementId("option"))},s.getValue=function(){return s.state.selectValue},s.cx=function(){for(var l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];return Mw.apply(void 0,[s.props.classNamePrefix].concat(c))},s.getOptionLabel=function(l){return Gf(s.props,l)},s.getOptionValue=function(l){return pi(s.props,l)},s.getStyles=function(l,c){var d=s.props.unstyled,u=Ek[l](c,d);u.boxSizing="border-box";var f=s.props.styles[l];return f?f(u,c):u},s.getClassNames=function(l,c){var d,u;return(d=(u=s.props.classNames)[l])===null||d===void 0?void 0:d.call(u,c)},s.getElementId=function(l){return"".concat(s.state.instancePrefix,"-").concat(l)},s.getComponents=function(){return Z1(s.props)},s.buildCategorizedOptions=function(){return gi(s.props,s.state.selectValue)},s.getCategorizedOptions=function(){return s.props.menuIsOpen?s.buildCategorizedOptions():[]},s.buildFocusableOptions=function(){return Bf(s.buildCategorizedOptions())},s.getFocusableOptions=function(){return s.props.menuIsOpen?s.buildFocusableOptions():[]},s.ariaOnChange=function(l,c){s.setState({ariaSelection:Me({value:l},c)})},s.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),s.focusInput())},s.onMenuMouseMove=function(l){s.blockOptionHover=!1},s.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=s.props.openMenuOnClick;s.state.isFocused?s.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&s.onMenuClose():c&&s.openMenu("first"):(c&&(s.openAfterFocus=!0),s.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},s.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!s.props.isDisabled){var c=s.props,d=c.isMulti,u=c.menuIsOpen;s.focusInput(),u?(s.setState({inputIsHiddenAfterUpdate:!d}),s.onMenuClose()):s.openMenu("first"),l.preventDefault()}},s.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(s.clearValue(),l.preventDefault(),s.openAfterFocus=!1,l.type==="touchend"?s.focusInput():setTimeout(function(){return s.focusInput()}))},s.onScroll=function(l){typeof s.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&ci(l.target)&&s.props.onMenuClose():typeof s.props.closeMenuOnScroll=="function"&&s.props.closeMenuOnScroll(l)&&s.props.onMenuClose()},s.onCompositionStart=function(){s.isComposing=!0},s.onCompositionEnd=function(){s.isComposing=!1},s.onTouchStart=function(l){var c=l.touches,d=c&&c.item(0);d&&(s.initialTouchX=d.clientX,s.initialTouchY=d.clientY,s.userIsDragging=!1)},s.onTouchMove=function(l){var c=l.touches,d=c&&c.item(0);if(d){var u=Math.abs(d.clientX-s.initialTouchX),f=Math.abs(d.clientY-s.initialTouchY),g=5;s.userIsDragging=u>g||f>g}},s.onTouchEnd=function(l){s.userIsDragging||(s.controlRef&&!s.controlRef.contains(l.target)&&s.menuListRef&&!s.menuListRef.contains(l.target)&&s.blurInput(),s.initialTouchX=0,s.initialTouchY=0)},s.onControlTouchEnd=function(l){s.userIsDragging||s.onControlMouseDown(l)},s.onClearIndicatorTouchEnd=function(l){s.userIsDragging||s.onClearIndicatorMouseDown(l)},s.onDropdownIndicatorTouchEnd=function(l){s.userIsDragging||s.onDropdownIndicatorMouseDown(l)},s.handleInputChange=function(l){var c=s.props.inputValue,d=l.currentTarget.value;s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange(d,{action:"input-change",prevInputValue:c}),s.props.menuIsOpen||s.onMenuOpen()},s.onInputFocus=function(l){s.props.onFocus&&s.props.onFocus(l),s.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(s.openAfterFocus||s.props.openMenuOnFocus)&&s.openMenu("first"),s.openAfterFocus=!1},s.onInputBlur=function(l){var c=s.props.inputValue;if(s.menuListRef&&s.menuListRef.contains(document.activeElement)){s.inputRef.focus();return}s.props.onBlur&&s.props.onBlur(l),s.onInputChange("",{action:"input-blur",prevInputValue:c}),s.onMenuClose(),s.setState({focusedValue:null,isFocused:!1})},s.onOptionHover=function(l){if(!(s.blockOptionHover||s.state.focusedOption===l)){var c=s.getFocusableOptions(),d=c.indexOf(l);s.setState({focusedOption:l,focusedOptionId:d>-1?s.getFocusedOptionId(l):null})}},s.shouldHideSelectedOptions=function(){return qf(s.props)},s.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),s.focus()},s.onKeyDown=function(l){var c=s.props,d=c.isMulti,u=c.backspaceRemovesValue,f=c.escapeClearsValue,g=c.inputValue,m=c.isClearable,p=c.isDisabled,y=c.menuIsOpen,b=c.onKeyDown,S=c.tabSelectsValue,x=c.openMenuOnFocus,E=s.state,k=E.focusedOption,C=E.focusedValue,N=E.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(s.blockOptionHover=!0,l.key){case"ArrowLeft":if(!d||g)return;s.focusValue("previous");break;case"ArrowRight":if(!d||g)return;s.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(C)s.removeValue(C);else{if(!u)return;d?s.popValue():m&&s.clearValue()}break;case"Tab":if(s.isComposing||l.shiftKey||!y||!S||!k||x&&s.isOptionSelected(k,N))return;s.selectOption(k);break;case"Enter":if(l.keyCode===229)break;if(y){if(!k||s.isComposing)return;s.selectOption(k);break}return;case"Escape":y?(s.setState({inputIsHiddenAfterUpdate:!1}),s.onInputChange("",{action:"menu-close",prevInputValue:g}),s.onMenuClose()):m&&f&&s.clearValue();break;case" ":if(g)return;if(!y){s.openMenu("first");break}if(!k)return;s.selectOption(k);break;case"ArrowUp":y?s.focusOption("up"):s.openMenu("last");break;case"ArrowDown":y?s.focusOption("down"):s.openMenu("first");break;case"PageUp":if(!y)return;s.focusOption("pageup");break;case"PageDown":if(!y)return;s.focusOption("pagedown");break;case"Home":if(!y)return;s.focusOption("first");break;case"End":if(!y)return;s.focusOption("last");break;default:return}l.preventDefault()}},s.state.instancePrefix="react-select-"+(s.props.instanceId||++$k),s.state.selectValue=li(r.value),r.menuIsOpen&&s.state.selectValue.length){var o=s.getFocusableOptionsWithIds(),i=s.buildFocusableOptions(),a=i.indexOf(s.state.selectValue[0]);s.state.focusableOptionsWithIds=o,s.state.focusedOption=i[a],s.state.focusedOptionId=Fl(o,i[a])}return s}return ix(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&hf(this.menuListRef,this.focusedOptionRef),Ck()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(s){var o=this.props,i=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!i&&s.isDisabled||l&&a&&!s.menuIsOpen)&&this.focusInput(),l&&i&&!s.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&s.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(hf(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(s,o){this.props.onInputChange(s,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(s){var o=this,i=this.state,a=i.selectValue,l=i.isFocused,c=this.buildFocusableOptions(),d=s==="first"?0:c.length-1;if(!this.props.isMulti){var u=c.indexOf(a[0]);u>-1&&(d=u)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[d],focusedOptionId:this.getFocusedOptionId(c[d])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(s){var o=this.state,i=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var c=i.length-1,d=-1;if(i.length){switch(s){case"previous":l===0?d=0:l===-1?d=c:d=l-1;break;case"next":l>-1&&l<c&&(d=l+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:i[d]})}}}},{key:"focusOption",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(i);i||(c=-1),s==="up"?l=c>0?c-1:a.length-1:s==="down"?l=(c+1)%a.length:s==="pageup"?(l=c-o,l<0&&(l=0)):s==="pagedown"?(l=c+o,l>a.length-1&&(l=a.length-1)):s==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme($l):Me(Me({},$l),this.props.theme):$l})},{key:"getCommonProps",value:function(){var s=this.clearValue,o=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,d=this.setValue,u=this.props,f=u.isMulti,g=u.isRtl,m=u.options,p=this.hasValue();return{clearValue:s,cx:o,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:f,isRtl:g,options:m,selectOption:c,selectProps:u,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var s=this.state.selectValue;return s.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var s=this.props,o=s.isClearable,i=s.isMulti;return o===void 0?i:o}},{key:"isOptionDisabled",value:function(s,o){return Yf(this.props,s,o)}},{key:"isOptionSelected",value:function(s,o){return Xf(this.props,s,o)}},{key:"filterOption",value:function(s,o){return Kf(this.props,s,o)}},{key:"formatOptionLabel",value:function(s,o){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(s,{context:o,inputValue:i,selectValue:a})}else return this.getOptionLabel(s)}},{key:"formatGroupLabel",value:function(s){return this.props.formatGroupLabel(s)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var s=this.props,o=s.isDisabled,i=s.isSearchable,a=s.inputId,l=s.inputValue,c=s.tabIndex,d=s.form,u=s.menuIsOpen,f=s.required,g=this.getComponents(),m=g.Input,p=this.state,y=p.inputIsHidden,b=p.ariaSelection,S=this.commonProps,x=a||this.getElementId("input"),E=Me(Me(Me({"aria-autocomplete":"list","aria-expanded":u,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},u&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?P.createElement(m,Ae({},S,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:d,type:"text",value:l},E)):P.createElement(dk,Ae({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ai,onFocus:this.onInputFocus,disabled:o,tabIndex:c,inputMode:"none",form:d,value:""},E))})},{key:"renderPlaceholderOrValue",value:function(){var s=this,o=this.getComponents(),i=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,c=o.MultiValueRemove,d=o.SingleValue,u=o.Placeholder,f=this.commonProps,g=this.props,m=g.controlShouldRenderValue,p=g.isDisabled,y=g.isMulti,b=g.inputValue,S=g.placeholder,x=this.state,E=x.selectValue,k=x.focusedValue,C=x.isFocused;if(!this.hasValue()||!m)return b?null:P.createElement(u,Ae({},f,{key:"placeholder",isDisabled:p,isFocused:C,innerProps:{id:this.getElementId("placeholder")}}),S);if(y)return E.map(function(_,w){var M=_===k,O="".concat(s.getOptionLabel(_),"-").concat(s.getOptionValue(_));return P.createElement(i,Ae({},f,{components:{Container:a,Label:l,Remove:c},isFocused:M,isDisabled:p,key:O,index:w,removeProps:{onClick:function(){return s.removeValue(_)},onTouchEnd:function(){return s.removeValue(_)},onMouseDown:function(F){F.preventDefault()}},data:_}),s.formatOptionLabel(_,"value"))});if(b)return null;var N=E[0];return P.createElement(d,Ae({},f,{data:N,isDisabled:p}),this.formatOptionLabel(N,"value"))}},{key:"renderClearIndicator",value:function(){var s=this.getComponents(),o=s.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||c)return null;var u={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return P.createElement(o,Ae({},i,{innerProps:u,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var s=this.getComponents(),o=s.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!o||!c)return null;var u={"aria-hidden":"true"};return P.createElement(o,Ae({},i,{innerProps:u,isDisabled:l,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var s=this.getComponents(),o=s.DropdownIndicator,i=s.IndicatorSeparator;if(!o||!i)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return P.createElement(i,Ae({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var s=this.getComponents(),o=s.DropdownIndicator;if(!o)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return P.createElement(o,Ae({},i,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var s=this,o=this.getComponents(),i=o.Group,a=o.GroupHeading,l=o.Menu,c=o.MenuList,d=o.MenuPortal,u=o.LoadingMessage,f=o.NoOptionsMessage,g=o.Option,m=this.commonProps,p=this.state.focusedOption,y=this.props,b=y.captureMenuScroll,S=y.inputValue,x=y.isLoading,E=y.loadingMessage,k=y.minMenuHeight,C=y.maxMenuHeight,N=y.menuIsOpen,_=y.menuPlacement,w=y.menuPosition,M=y.menuPortalTarget,O=y.menuShouldBlockScroll,L=y.menuShouldScrollIntoView,F=y.noOptionsMessage,$=y.onMenuScrollToTop,D=y.onMenuScrollToBottom;if(!N)return null;var A=function(B,G){var V=B.type,K=B.data,X=B.isDisabled,Z=B.isSelected,ee=B.label,ne=B.value,he=p===K,J=X?void 0:function(){return s.onOptionHover(K)},ce=X?void 0:function(){return s.selectOption(K)},ue="".concat(s.getElementId("option"),"-").concat(G),ae={id:ue,onClick:ce,onMouseMove:J,onMouseOver:J,tabIndex:-1,role:"option","aria-selected":s.state.isAppleDevice?void 0:Z};return P.createElement(g,Ae({},m,{innerProps:ae,data:K,isDisabled:X,isSelected:Z,key:ue,label:ee,type:V,value:ne,isFocused:he,innerRef:he?s.getFocusedOptionRef:void 0}),s.formatOptionLabel(B.data,"menu"))},T;if(this.hasOptions())T=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var B=U.data,G=U.options,V=U.index,K="".concat(s.getElementId("group"),"-").concat(V),X="".concat(K,"-heading");return P.createElement(i,Ae({},m,{key:K,data:B,options:G,Heading:a,headingProps:{id:X,data:U.data},label:s.formatGroupLabel(U.data)}),U.options.map(function(Z){return A(Z,"".concat(V,"-").concat(Z.index))}))}else if(U.type==="option")return A(U,"".concat(U.index))});else if(x){var z=E({inputValue:S});if(z===null)return null;T=P.createElement(u,m,z)}else{var H=F({inputValue:S});if(H===null)return null;T=P.createElement(f,m,H)}var W={minMenuHeight:k,maxMenuHeight:C,menuPlacement:_,menuPosition:w,menuShouldScrollIntoView:L},j=P.createElement(jw,Ae({},m,W),function(U){var B=U.ref,G=U.placerProps,V=G.placement,K=G.maxHeight;return P.createElement(l,Ae({},m,W,{innerRef:B,innerProps:{onMouseDown:s.onMenuMouseDown,onMouseMove:s.onMenuMouseMove},isLoading:x,placement:V}),P.createElement(mk,{captureEnabled:b,onTopArrive:$,onBottomArrive:D,lockEnabled:O},function(X){return P.createElement(c,Ae({},m,{innerRef:function(ee){s.getMenuListRef(ee),X(ee)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:s.getElementId("listbox")},isLoading:x,maxHeight:K,focusedOption:p}),T)}))});return M||w==="fixed"?P.createElement(d,Ae({},m,{appendTo:M,controlElement:this.controlRef,menuPlacement:_,menuPosition:w}),j):j}},{key:"renderFormField",value:function(){var s=this,o=this.props,i=o.delimiter,a=o.isDisabled,l=o.isMulti,c=o.name,d=o.required,u=this.state.selectValue;if(d&&!this.hasValue()&&!a)return P.createElement(vk,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(i){var f=u.map(function(p){return s.getOptionValue(p)}).join(i);return P.createElement("input",{name:c,type:"hidden",value:f})}else{var g=u.length>0?u.map(function(p,y){return P.createElement("input",{key:"i-".concat(y),name:c,type:"hidden",value:s.getOptionValue(p)})}):P.createElement("input",{name:c,type:"hidden",value:""});return P.createElement("div",null,g)}else{var m=u[0]?this.getOptionValue(u[0]):"";return P.createElement("input",{name:c,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var s=this.commonProps,o=this.state,i=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,c=o.isFocused,d=o.selectValue,u=this.getFocusableOptions();return P.createElement(sk,Ae({},s,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:c,selectValue:d,focusableOptions:u,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var s=this.getComponents(),o=s.Control,i=s.IndicatorsContainer,a=s.SelectContainer,l=s.ValueContainer,c=this.props,d=c.className,u=c.id,f=c.isDisabled,g=c.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return P.createElement(a,Ae({},p,{className:d,innerProps:{id:u,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),P.createElement(o,Ae({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:g}),P.createElement(l,Ae({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),P.createElement(i,Ae({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(s,o){var i=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,c=o.ariaSelection,d=o.isFocused,u=o.prevWasFocused,f=o.instancePrefix,g=s.options,m=s.value,p=s.menuIsOpen,y=s.inputValue,b=s.isMulti,S=li(m),x={};if(i&&(m!==i.value||g!==i.options||p!==i.menuIsOpen||y!==i.inputValue)){var E=p?Ik(s,S):[],k=p?jf(gi(s,S),"".concat(f,"-option")):[],C=a?Lk(o,S):null,N=Pk(o,E),_=Fl(k,N);x={selectValue:S,focusedOption:N,focusedOptionId:_,focusableOptionsWithIds:k,focusedValue:C,clearFocusValueOnUpdate:!1}}var w=l!=null&&s!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},M=c,O=d&&u;return d&&!O&&(M={value:$s(b,S,S[0]||null),options:S,action:"initial-input-focus"},O=!u),c?.action==="initial-input-focus"&&(M=null),Me(Me(Me({},x),w),{},{prevProps:s,ariaSelection:M,prevWasFocused:O})}}]),n})(v.Component);zl.defaultProps=Dk;var Fk=v.forwardRef(function(t,e){var n=Du(t);return P.createElement(zl,Ae({ref:e},n))}),Zf=Fk,zk=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Qf=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,s=String(e).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),i=String(r.getOptionLabel(n)).toLowerCase();return o===s||i===s},Vl={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,r,s){return!(!e||n.some(function(o){return Qf(e,o,s)})||r.some(function(o){return Qf(e,o,s)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function Vk(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,r=t.createOptionPosition,s=r===void 0?"last":r,o=t.formatCreateLabel,i=o===void 0?Vl.formatCreateLabel:o,a=t.isValidNewOption,l=a===void 0?Vl.isValidNewOption:a,c=t.getNewOptionData,d=c===void 0?Vl.getNewOptionData:c,u=t.onCreateOption,f=t.options,g=f===void 0?[]:f,m=t.onChange,p=Tn(t,zk),y=p.getOptionValue,b=y===void 0?Vf:y,S=p.getOptionLabel,x=S===void 0?zf:S,E=p.inputValue,k=p.isLoading,C=p.isMulti,N=p.value,_=p.name,w=v.useMemo(function(){return l(E,li(N),g,{getOptionValue:b,getOptionLabel:x})?d(E,i(E)):void 0},[i,d,x,b,E,l,g,N]),M=v.useMemo(function(){return(n||!k)&&w?s==="first"?[w].concat(Hr(g)):[].concat(Hr(g),[w]):g},[n,s,k,w,g]),O=v.useCallback(function(L,F){if(F.action!=="select-option")return m(L,F);var $=Array.isArray(L)?L:[L];if($[$.length-1]===w){if(u)u(E);else{var D=d(E,E),A={action:"create-option",name:_,option:D};m($s(C,[].concat(Hr(li(N)),[D]),D),A)}return}m(L,F)},[d,E,C,_,w,u,m,N]);return Me(Me({},p),{},{options:M,onChange:O})}var Hk=v.forwardRef(function(t,e){var n=Du(t),r=Vk(n);return P.createElement(zl,Ae({ref:e},r))}),Jf=Hk;const Lt={control:"input-tag",valueContainer:"gap-1 flex flex-wrap",multiValue:{blue:"bg-blue-100 dark:bg-blue-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",green:"bg-green-100 dark:bg-green-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",amber:"bg-amber-100 dark:bg-amber-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",red:"bg-red-100 dark:bg-red-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",purple:"bg-purple-100 dark:bg-purple-900/20 rounded px-1.5 py-0.5 flex items-center gap-1",gray:"bg-gray-100 dark:bg-gray-700/50 rounded px-1.5 py-0.5 flex items-center gap-1"},multiValueLabel:{blue:"text-blue-700 dark:text-blue-300 text-xs",green:"text-green-700 dark:text-green-300 text-xs font-semibold",amber:"text-amber-700 dark:text-amber-300 text-xs font-semibold",red:"text-red-700 dark:text-red-300 text-xs font-semibold",purple:"text-purple-700 dark:text-purple-300 text-xs font-semibold",gray:"text-gray-700 dark:text-gray-300 text-xs"},multiValueRemove:{blue:"text-blue-700 dark:text-blue-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",green:"text-green-700 dark:text-green-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",amber:"text-amber-700 dark:text-amber-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",red:"text-red-700 dark:text-red-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",purple:"text-purple-700 dark:text-purple-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1",gray:"text-gray-700 dark:text-gray-300 hover:bg-red-100 dark:hover:bg-red-900/30 hover:text-red-600 dark:hover:text-red-400 rounded px-1"},input:"text-gray-900 dark:text-white text-sm",placeholder:"text-gray-400 dark:text-gray-500 text-sm",menu:"mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",menuList:"py-1",option:{base:"px-3 py-2 cursor-pointer text-gray-900 dark:text-white text-[13px]",selected:"bg-blue-100 dark:bg-blue-900/20",focused:"bg-gray-100 dark:bg-gray-700",default:"bg-white dark:bg-gray-800"},noOptionsMessage:"px-3 py-2 text-gray-500 dark:text-gray-400 text-[13px]",checkbox:{base:"w-4 h-4 rounded border flex items-center justify-center text-white text-[10px] shrink-0",selected:"bg-blue-500 border-blue-500",unselected:"border-gray-400 dark:border-gray-500"}},Rf=t=>{const{data:e,isSelected:n}=t;return h.jsx(hi.Option,{...t,children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`${Lt.checkbox.base} ${n?Lt.checkbox.selected:Lt.checkbox.unselected}`,children:n?"✓":""}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"text-[13px]",children:e.label}),e.count!==void 0&&e.count>0&&h.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-[10px]",children:["(",e.count,")"]})]}),e.description&&h.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.description})]})]})})},eh=t=>h.jsx(hi.GroupHeading,{...t,children:h.jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-gray-500 dark:text-gray-400 bg-gray-50 dark:bg-gray-800/50 border-b border-gray-200 dark:border-gray-700",children:t.data.label})}),Uk=t=>{const{data:e}=t;return h.jsxs(hi.MultiValueLabel,{...t,children:[h.jsx("span",{children:e.label}),e.count!==void 0&&e.count>0&&h.jsxs("span",{className:"text-xs opacity-60 ml-1",children:["(",e.count,")"]})]})},Bk=({value:t,options:e=[],onChange:n,creatable:r=!1,placeholder:s="검색 또는 입력...",noOptionsMessage:o="검색 결과가 없습니다",formatCreateLabel:i,createLabelSuffix:a="추가",maxItems:l,disabled:c=!1,onBeforeRemove:d,onCreateOption:u,className:f="",tagVariants:g,defaultVariant:m="blue",name:p,isMulti:y=!0,isClearable:b=!0,isSearchable:S=!0,delimiters:x=[","],splitOnPaste:E=!0,onInputChange:k,id:C,editorAttrs:N})=>{const _=c===!0||c==="true",w=v.useCallback(J=>J==null?[]:Array.isArray(J)?J:[J],[]),[M,O]=v.useState(()=>w(t)),[L,F]=v.useState(""),$=v.useRef(void 0);v.useEffect(()=>{const J=(ue,ae)=>!ue&&!ae?!0:!ue||!ae||ue.length!==ae.length?!1:ue.every((ve,fe)=>ve===ae[fe]),ce=w(t);J(ce,$.current)||(O(ce),$.current=ce)},[t,w]);const D=v.useMemo(()=>i?typeof i=="string"?J=>`${i} "${J}"`:i:J=>h.jsxs("span",{className:"text-[13px]",children:[h.jsx("strong",{children:J})," ",a]}),[i,a]),A=v.useMemo(()=>!M||!Array.isArray(M)?[]:M.map(J=>e.find(ue=>ue.value===J)||{value:J,label:String(J)}).filter(J=>J!==void 0),[M,e]),T=v.useMemo(()=>{const J=new Set(e.map(ke=>ke.value)),ce=M?M.filter(ke=>!J.has(ke)).map(ke=>({value:ke,label:String(ke)})):[],ue=[...e,...ce];if(!ue.some(ke=>ke.group))return ue;const ve=new Map,fe=[];ue.forEach(ke=>{if(ke.group){const Ue=ve.get(ke.group)||[];Ue.push(ke),ve.set(ke.group,Ue)}else fe.push(ke)});const ye=[];return ve.forEach((ke,Ue)=>{ye.push({label:Ue,options:ke})}),fe.length>0&&ye.push({label:"",options:fe}),ye},[e,M]),z=v.useCallback(J=>({target:{value:J},currentTarget:{value:J},preventDefault:()=>{},stopPropagation:()=>{}}),[]),H=v.useCallback(J=>{if(!x?.length)return[J.trim()].filter(Boolean);const ce=x.map(ae=>ae.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),ue=new RegExp(`[${ce.join("")}]`);return J.split(ue).map(ae=>ae.trim()).filter(Boolean)},[x]),W=v.useCallback((J,ce)=>{if(ce.action!=="input-change"){F(J);return}if(k&&k(z(J)),!x?.some(fe=>J.includes(fe))||!r||!y){F(J);return}const ve=H(J).filter(fe=>fe&&!M.includes(fe));if(ve.length>0){const fe=l?l-M.length:1/0,ye=ve.slice(0,fe);if(ye.length>0){const ke=[...M,...ye];O(ke),n(z(ke))}}F("")},[x,r,y,H,M,l,n,z,k]),j=v.useCallback(J=>{if(!E||!r||!y)return;const ce=J.clipboardData.getData("text"),ue=H(ce);if(ue.length<=1)return;J.preventDefault();const ae=ue.filter(ve=>ve&&!M.includes(ve));if(ae.length>0){const ve=l?l-M.length:1/0,fe=ae.slice(0,ve);if(fe.length>0){const ye=[...M,...fe];O(ye),n(z(ye))}}},[E,r,y,H,M,l,n,z]),U=v.useCallback((J,ce)=>{if((ce.action==="remove-value"||ce.action==="pop-value")&&ce.removedValue&&d){const ae=d(ce.removedValue);if(ae!==!0){const ve=typeof ae=="string"?ae:`"${ce.removedValue.label}"은(는) 제거할 수 없습니다.`;alert(ve);return}}if(l&&J.length>l)return;const ue=J.map(ae=>ae.value);O(ue),n(z(ue))},[n,d,l,z]),B=v.useCallback((J,ce)=>{if(ce.action==="clear"&&M.length>0&&d){const ve=e.find(ye=>ye.value===M[0])||{value:M[0],label:String(M[0])},fe=d(ve);if(fe!==!0){const ye=typeof fe=="string"?fe:`"${ve.label}"은(는) 제거할 수 없습니다.`;alert(ye);return}}const ue=J?J.value:null,ae=J?[J.value]:[];O(ae),n(z(ue))},[n,d,M,e,z]),G=v.useCallback(J=>{u&&u(J);const ce=[...M||[],J];O(ce),n(z(ce))},[n,u,M,z]),V=v.useCallback(J=>!J||!J.trim()?!1:!M?.includes(J.trim()),[M]),K=v.useCallback(J=>{const ce=L.trim();if(J.key==="Tab"&&r&&y&&ce){if(M.includes(ce))J.preventDefault(),F("");else if(!l||M.length<l){J.preventDefault();const ue=[...M,ce];O(ue),n(z(ue)),F("")}return}J.key==="Enter"&&(!ce||M&&M.includes(ce))&&(J.preventDefault(),J.stopPropagation())},[M,L,r,y,l,n,z]),X=v.useCallback(J=>g&&g[J]?g[J]:m,[g,m]),Z={control:()=>`${Lt.control} ${f} ${_?"opacity-60 cursor-not-allowed":""}`,valueContainer:()=>Lt.valueContainer,multiValue:J=>{const ce=X(J.data.value);return Lt.multiValue[ce]},multiValueLabel:J=>{const ce=X(J.data.value);return Lt.multiValueLabel[ce]},multiValueRemove:J=>{const ce=X(J.data.value);return`${Lt.multiValueRemove[ce]} ${_?"pointer-events-none":""}`},singleValue:()=>"text-gray-900 dark:text-white text-sm",input:()=>Lt.input,placeholder:()=>Lt.placeholder,menu:()=>Lt.menu,menuList:()=>Lt.menuList,menuPortal:()=>"z-[9999]",option:J=>`${Lt.option.base} ${J.isSelected?Lt.option.selected:J.isFocused?Lt.option.focused:Lt.option.default}`,noOptionsMessage:()=>Lt.noOptionsMessage,clearIndicator:()=>"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 cursor-pointer px-1",dropdownIndicator:()=>"text-gray-400 dark:text-gray-500 px-1"},ee={options:T,onKeyDown:K,placeholder:s,noOptionsMessage:()=>o,isDisabled:_,isSearchable:S,menuIsOpen:void 0,openMenuOnClick:!0,openMenuOnFocus:!0,menuPortalTarget:typeof document<"u"?document.body:null,menuPosition:"fixed",classNamePrefix:"tag-input",unstyled:!0,classNames:Z,...r&&y||k?{inputValue:L,onInputChange:W}:{}},ne=y?M.join(","):M[0]??"";if(!y){const J={...ee,isMulti:!1,value:A[0]||null,onChange:B,isClearable:b,closeMenuOnSelect:!0,components:{Option:Rf,GroupHeading:eh,IndicatorSeparator:()=>null,...b?{}:{ClearIndicator:()=>null}}};return r?h.jsxs(I,{id:C,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:ne}),h.jsx(Jf,{...J,onCreateOption:G,formatCreateLabel:D,isValidNewOption:V,createOptionPosition:"first"})]}):h.jsxs(I,{id:C,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:ne}),h.jsx(Zf,{...J})]})}const he={...ee,isMulti:!0,value:A,onChange:U,closeMenuOnSelect:!1,hideSelectedOptions:!1,backspaceRemovesValue:!1,isClearable:!1,components:{Option:Rf,GroupHeading:eh,MultiValueLabel:Uk,ClearIndicator:()=>null,DropdownIndicator:()=>null,IndicatorSeparator:()=>null}};return r?h.jsxs(I,{id:C,...N,onPaste:j,children:[p&&h.jsx("input",{type:"hidden",name:p,value:ne}),h.jsx(Jf,{...he,onCreateOption:G,formatCreateLabel:D,isValidNewOption:V,createOptionPosition:"first"})]}):h.jsxs(I,{id:C,...N,children:[p&&h.jsx("input",{type:"hidden",name:p,value:ne}),h.jsx(Zf,{...he})]})},Gr=(t,e)=>window.G7Core?.t?.(t,e)??t,jk=()=>window.G7Core?.locale?.supported?.()??["ko","en"],Wk=()=>window.G7Core?.locale?.current?.()??"ko",Hl=t=>{const e=Gr(`common.language_${t}`);return e===`common.language_${t}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[t]||t.toUpperCase():e},Gk=({value:t=[],onChange:e,placeholder:n="입력 후 Enter",disabled:r=!1,creatable:s=!0,delimiters:o=[","],className:i="",name:a,error:l,maxItems:c,modalId:d,statePath:u,__componentContext:f,id:g,editorAttrs:m})=>{const p=v.useMemo(()=>jk(),[]),y=v.useMemo(()=>Wk(),[]),[b,S]=v.useState(()=>t||[]),[x,E]=v.useState(""),[k,C]=v.useState(!1),[N,_]=v.useState(null),[w,M]=v.useState({}),O=v.useRef(null),L=v.useRef(void 0);v.useEffect(()=>{const V=(X,Z)=>!X&&!Z?!0:!X||!Z||X.length!==Z.length?!1:JSON.stringify(X)===JSON.stringify(Z),K=t||[];V(K,L.current)||(S(K),L.current=K)},[t]);const F=v.useCallback(V=>({target:{name:a,value:V},currentTarget:{name:a,value:V},preventDefault:()=>{},stopPropagation:()=>{}}),[a]),$=v.useCallback(V=>{const K=[];for(const X of p){const Z=V[X];Z?.trim()&&K.push(`${X.toUpperCase()}: ${Z}`)}return K.length>0?K.join(" / "):""},[p]),D=v.useCallback(V=>{const K=b.filter((X,Z)=>Z!==V);S(K),e?.(F(K))},[b,e,F]),A=v.useCallback((V,K,X)=>{const Z=window.G7Core;if(!Z?.dispatch)return;const ee=p.map(ne=>({code:ne,label:Hl(ne)}));Z.dispatch({handler:"setState",params:{target:"global",multilingualTagEdit:{fieldName:a,editingIndex:V,values:K,supportedLocales:ee,defaultLocale:y,statePath:u,currentTags:X}}}),Z.dispatch({handler:"openModal",target:d},{componentContext:f})},[a,p,y,d,u,f]),T=v.useCallback(V=>{r||(d?A(V,{...b[V]},b):(_(V),M({...b[V]}),C(!0)))},[r,b,d,A]),z=v.useCallback((V="")=>{const K={};p.forEach(X=>{K[X]=X===y?V:""}),d?(A(null,K,b),E("")):(_(null),M(K),C(!0),E(""))},[p,y,d,A,b]),H=v.useCallback(()=>{if(!Object.values(w).some(X=>X.trim()!=="")){C(!1);return}let K;N!==null?K=b.map((X,Z)=>Z===N?w:X):K=[...b,w],S(K),e?.(F(K)),C(!1),M({}),_(null)},[w,N,b,e,F]),W=v.useCallback(()=>{C(!1),M({}),_(null)},[]),j=v.useCallback(V=>{const K=V.target.value;if(o.some(Z=>K.includes(Z))&&s){const Z=o.map(he=>he.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),ee=new RegExp(`[${Z.join("")}]`),ne=K.split(ee).map(he=>he.trim()).filter(Boolean);if(ne.length>0){z(ne[0]);return}}E(K)},[o,s,z]),U=v.useCallback(V=>{if(V.key==="Enter"&&x.trim()&&s){if(V.preventDefault(),c&&b.length>=c)return;z(x.trim())}},[x,s,c,b.length,z]),B=v.useCallback((V,K)=>{M(X=>({...X,[V]:K}))},[]),G=!!l;return h.jsxs(I,{className:i,id:g,...m,children:[h.jsxs(I,{className:`flex flex-wrap gap-1.5 p-2 border rounded-lg bg-white dark:bg-gray-700 min-h-[42px] ${G?"border-red-500 dark:border-red-400":"border-gray-300 dark:border-gray-600 focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500"} ${r?"opacity-60 bg-gray-100 dark:bg-gray-800 cursor-not-allowed":""}`,children:[b.map((V,K)=>h.jsxs(I,{className:"flex items-center gap-1 bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded px-2 py-0.5 text-sm",children:[h.jsx(Q,{className:`cursor-pointer hover:underline ${r?"cursor-not-allowed":""}`,onClick:()=>T(K),children:$(V)}),!r&&h.jsx(oe,{type:"button",className:"p-0 h-4 w-4 min-w-0 border-0 bg-transparent text-blue-600 dark:text-blue-400 hover:text-red-600 dark:hover:text-red-400 hover:bg-transparent",onClick:X=>{X.stopPropagation(),D(K)},children:h.jsx(re,{name:"times",className:"text-xs"})})]},K)),s&&!r&&(!c||b.length<c)&&h.jsx("input",{ref:O,type:"text",value:x,onChange:j,onKeyDown:U,placeholder:b.length===0?n:"",disabled:r,className:"flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500"})]}),l&&h.jsx(Q,{className:"text-xs text-red-500 dark:text-red-400 mt-1",children:l}),!d&&h.jsx(Uo,{isOpen:k,onClose:W,title:Gr(N!==null?"common.edit":"common.add"),width:"400px",children:h.jsxs(I,{className:"space-y-4 p-4",children:[p.map(V=>h.jsxs(I,{className:"space-y-1",children:[h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(Q,{className:"text-sm font-medium text-gray-700 dark:text-gray-300 w-16",children:Hl(V)}),h.jsxs(Q,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",V.toUpperCase(),")"]})]}),h.jsx(wt,{type:"text",value:w[V]??"",onChange:K=>B(V,K.target.value),placeholder:`${Hl(V)} 값 입력`,className:"w-full",autoFocus:V===y})]},V)),h.jsxs(I,{className:"flex justify-end gap-2 pt-4 border-t border-gray-200 dark:border-gray-700",children:[h.jsx(oe,{type:"button",variant:"secondary",onClick:W,children:Gr("common.cancel")}),h.jsx(oe,{type:"button",variant:"primary",onClick:H,children:Gr(N!==null?"common.save":"common.add")})]})]})}),a&&h.jsx("input",{type:"hidden",name:a,value:JSON.stringify(b)})]})},th=(t,e)=>window.G7Core?.t?.(t,e)??t,nh=({type:t,identifier:e,name:n,installedModules:r=[],installedPlugins:s=[],className:o="",style:i,id:a,editorAttrs:l})=>{const c={module:de.Cubes,plugin:de.PuzzlePiece},d={module:th("common.module"),plugin:th("common.plugin")},u=v.useMemo(()=>{if(n)return n;if(e){const p=(t==="module"?r:s)?.find(y=>y.identifier===e);if(p)return p.name}},[n,e,t,r,s]),f=c[t],g=u?`${u} ${d[t]}`:d[t];return h.jsxs(Q,{className:`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium text-gray-400 dark:text-gray-500 ${o}`,style:i,id:a,...l,children:[h.jsx(re,{name:f,className:"w-3.5 h-3.5"}),h.jsx(Q,{children:g})]})},Yk=({options:t=[],value:e,onChange:n,multiple:r=!1,searchPlaceholder:s="Search...",onSearch:o,noResultsText:i="No results found",initialText:a="Type to search",triggerLabel:l="Select",triggerIcon:c,disabled:d=!1,className:u="",id:f,editorAttrs:g})=>{const[m,p]=v.useState(!1),[y,b]=v.useState(""),S=v.useRef(null),x=v.useRef(null),E=v.useRef(`searchable-dropdown-input-${Math.random().toString(36).slice(2,9)}`).current,k=v.useMemo(()=>e==null?[]:Array.isArray(e)?e:[e],[e]),C=v.useMemo(()=>{if(!y.trim())return t;const D=y.toLowerCase();return t.filter(A=>A.label.toLowerCase().includes(D)||A.description?.toLowerCase().includes(D))},[t,y]),N=v.useMemo(()=>{if(k.length===0)return l;if(r){const A=k.length;return A===1?t.find(z=>String(z.value)===String(k[0]))?.label||l:`${A} selected`}return t.find(A=>String(A.value)===String(k[0]))?.label||l},[k,t,r,l]);v.useEffect(()=>{const D=A=>{S.current&&!S.current.contains(A.target)&&p(!1)};return m&&document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[m]),v.useEffect(()=>{const D=A=>{A.key==="Escape"&&m&&(p(!1),x.current?.focus())};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[m]),v.useEffect(()=>{if(!m){b("");return}const D=setTimeout(()=>{document.getElementById(E)?.focus()},50);return()=>{clearTimeout(D)}},[m,E]);const _=v.useCallback(()=>{d||p(D=>!D)},[d]),w=v.useCallback(D=>{const A=D.target.value;b(A),o?.(A)},[o]),M=v.useCallback(D=>{if(r){const T=k.some(z=>String(z)===String(D))?k.filter(z=>String(z)!==String(D)):[...k,D];n?.(T)}else n?.(D),p(!1),x.current?.focus()},[r,k,n]),O=D=>k.some(A=>String(A)===String(D)),L=y.length===0&&t.length===0,F=y.length>0&&C.length===0,$=C.length>0;return h.jsxs(I,{ref:S,className:`relative inline-block ${u}`,id:f,...g,children:[h.jsxs(oe,{ref:x,type:"button",onClick:_,disabled:d,className:`
|
||
px-4 py-2.5 bg-gray-100 dark:bg-gray-700
|
||
border-0 rounded-xl
|
||
text-gray-700 dark:text-gray-200 font-medium
|
||
focus:ring-2 focus:ring-blue-500 focus:outline-none
|
||
flex items-center justify-between gap-2
|
||
text-left cursor-pointer
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
min-w-[200px]
|
||
`,"aria-haspopup":"listbox","aria-expanded":m,children:[h.jsxs(I,{className:"flex items-center gap-2",children:[c,h.jsx(Q,{className:"truncate",children:N})]}),h.jsx(Hn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${m?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m&&h.jsxs(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden min-w-[280px]",role:"listbox",children:[h.jsx(I,{className:"p-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx("input",{id:E,type:"text",value:y,onChange:w,placeholder:s,className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent focus:outline-none"})}),h.jsxs(I,{className:"max-h-80 overflow-auto",children:[L&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:a}),F&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:i}),$&&h.jsx(I,{className:"py-2",children:C.map(D=>{const A=O(D.value);return h.jsxs(oe,{type:"button",onClick:()=>!D.disabled&&M(D.value),disabled:D.disabled,className:`
|
||
w-full px-4 py-3 text-left
|
||
flex items-start gap-3
|
||
hover:bg-gray-100 dark:hover:bg-gray-700
|
||
transition-colors
|
||
${D.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
||
`,role:"option","aria-selected":A,children:[h.jsx(I,{className:"w-5 h-5 flex-shrink-0 mt-0.5",children:A&&h.jsx(Hn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsx(I,{className:`font-medium ${A?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-white"}`,children:D.label}),D.description&&h.jsx(I,{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:D.description})]})]},D.value)})})]})]})]})},zs={container:{base:"tag-select",disabled:"opacity-50 cursor-not-allowed"},tag:"tag",tagRemove:"tag-remove",placeholder:"tag-select-placeholder"},Xk=({options:t=[],value:e=[],onChange:n,placeholder:r="No items selected",disabled:s=!1,className:o="",id:i,editorAttrs:a})=>{const l=v.useCallback(f=>t.find(m=>String(m.value)===String(f))?.label||String(f),[t]),c=v.useCallback(f=>{if(s)return;const g=e.filter(m=>String(m)!==String(f));n?.(g)},[e,n,s]),d=v.useMemo(()=>e.map(f=>({value:f,label:l(f)})),[e,l]),u=`${zs.container.base} ${s?zs.container.disabled:""} ${o}`.trim();return h.jsx(I,{className:u,id:i,...a,children:d.length===0?h.jsx(Q,{className:zs.placeholder,children:r}):d.map(f=>h.jsxs(Q,{className:zs.tag,children:[f.label,!s&&h.jsx(Q,{className:zs.tagRemove,onClick:()=>c(f.value),role:"button","aria-label":`Remove ${f.label}`,children:h.jsx(Hn,{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},f.value))})};function Kk(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const mi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yr(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Ul(t){return"nodeType"in t}function Yt(t){var e,n;return t?Yr(t)?t:Ul(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Bl(t){const{Document:e}=Yt(t);return t instanceof e}function Vs(t){return Yr(t)?!1:t instanceof Yt(t).HTMLElement}function rh(t){return t instanceof Yt(t).SVGElement}function Xr(t){return t?Yr(t)?t.document:Ul(t)?Bl(t)?t:Vs(t)||rh(t)?t.ownerDocument:document:document:document}const wn=mi?v.useLayoutEffect:v.useEffect;function bi(t){const e=v.useRef(t);return wn(()=>{e.current=t}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function qk(){const t=v.useRef(null),e=v.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Hs(t,e){e===void 0&&(e=[t]);const n=v.useRef(t);return wn(()=>{n.current!==t&&(n.current=t)},e),n}function Us(t,e){const n=v.useRef();return v.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function yi(t){const e=bi(t),n=v.useRef(null),r=v.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function vi(t){const e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}let jl={};function Bs(t,e){return v.useMemo(()=>{if(e)return e;const n=jl[t]==null?0:jl[t]+1;return jl[t]=n,t+"-"+n},[t,e])}function sh(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((o,i)=>{const a=Object.entries(i);for(const[l,c]of a){const d=o[l];d!=null&&(o[l]=d+t*c)}return o},{...e})}}const Kr=sh(1),js=sh(-1);function Zk(t){return"clientX"in t&&"clientY"in t}function xi(t){if(!t)return!1;const{KeyboardEvent:e}=Yt(t.target);return e&&t instanceof e}function Qk(t){if(!t)return!1;const{TouchEvent:e}=Yt(t.target);return e&&t instanceof e}function wi(t){if(Qk(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return Zk(t)?{x:t.clientX,y:t.clientY}:null}const Ln=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Ln.Translate.toString(t),Ln.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),oh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Jk(t){return t.matches(oh)?t:t.querySelector(oh)}const Rk={display:"none"};function eC(t){let{id:e,value:n}=t;return v.createElement("div",{id:e,style:Rk},n)}function tC(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return v.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function nC(){const[t,e]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const ih=v.createContext(null);function rC(t){const e=v.useContext(ih);v.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function sC(){const[t]=v.useState(()=>new Set),e=v.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[v.useCallback(r=>{let{type:s,event:o}=r;t.forEach(i=>{var a;return(a=i[s])==null?void 0:a.call(i,o)})},[t]),e]}const oC={draggable:`
|
||
To pick up a draggable item, press the space bar.
|
||
While dragging, use the arrow keys to move the item.
|
||
Press space again to drop the item in its new position, or press escape to cancel.
|
||
`},iC={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function aC(t){let{announcements:e=iC,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=oC}=t;const{announce:o,announcement:i}=nC(),a=Bs("DndLiveRegion"),[l,c]=v.useState(!1);if(v.useEffect(()=>{c(!0)},[]),rC(v.useMemo(()=>({onDragStart(u){let{active:f}=u;o(e.onDragStart({active:f}))},onDragMove(u){let{active:f,over:g}=u;e.onDragMove&&o(e.onDragMove({active:f,over:g}))},onDragOver(u){let{active:f,over:g}=u;o(e.onDragOver({active:f,over:g}))},onDragEnd(u){let{active:f,over:g}=u;o(e.onDragEnd({active:f,over:g}))},onDragCancel(u){let{active:f,over:g}=u;o(e.onDragCancel({active:f,over:g}))}}),[o,e])),!l)return null;const d=v.createElement(v.Fragment,null,v.createElement(eC,{id:r,value:s.draggable}),v.createElement(tC,{id:a,announcement:i}));return n?On.createPortal(d,n):d}var St;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(St||(St={}));function ki(){}function qr(t,e){return v.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Wl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const kn=Object.freeze({x:0,y:0});function ah(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function lC(t,e){const n=wi(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function lh(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function cC(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function ch(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function dh(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function uh(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Gl=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=uh(e,e.left,e.top),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=ah(uh(l),s);o.push({id:a,data:{droppableContainer:i,value:c}})}}return o.sort(lh)},dC=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=ch(e),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=ch(l),d=s.reduce((f,g,m)=>f+ah(c[m],g),0),u=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:u}})}}return o.sort(lh)};function uC(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height),i=s-r,a=o-n;if(r<s&&n<o){const l=e.width*e.height,c=t.width*t.height,d=i*a,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const fC=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const o of r){const{id:i}=o,a=n.get(i);if(a){const l=uC(a,e);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(cC)};function hC(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function fh(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:kn}function gC(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+t*a.y,bottom:i.bottom+t*a.y,left:i.left+t*a.x,right:i.right+t*a.x}),{...n})}}const pC=gC(1);function hh(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function mC(t,e,n){const r=hh(e);if(!r)return t;const{scaleX:s,scaleY:o,x:i,y:a}=r,l=t.left-i-(1-s)*parseFloat(n),c=t.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?t.width/s:t.width,u=o?t.height/o:t.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const bC={ignoreTransform:!1};function Zr(t,e){e===void 0&&(e=bC);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:d}=Yt(t).getComputedStyle(t);c&&(n=mC(n,c,d))}const{top:r,left:s,width:o,height:i,bottom:a,right:l}=n;return{top:r,left:s,width:o,height:i,bottom:a,right:l}}function gh(t){return Zr(t,{ignoreTransform:!0})}function yC(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function vC(t,e){return e===void 0&&(e=Yt(t).getComputedStyle(t)),e.position==="fixed"}function xC(t,e){e===void 0&&(e=Yt(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=e[s];return typeof o=="string"?n.test(o):!1})}function Ci(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(Bl(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Vs(s)||rh(s)||n.includes(s))return n;const o=Yt(t).getComputedStyle(s);return s!==t&&xC(s,o)&&n.push(s),vC(s,o)?n:r(s.parentNode)}return t?r(t):n}function ph(t){const[e]=Ci(t,1);return e??null}function Yl(t){return!mi||!t?null:Yr(t)?t:Ul(t)?Bl(t)||t===Xr(t).scrollingElement?window:Vs(t)?t:null:null}function mh(t){return Yr(t)?t.scrollX:t.scrollLeft}function bh(t){return Yr(t)?t.scrollY:t.scrollTop}function Xl(t){return{x:mh(t),y:bh(t)}}var Mt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Mt||(Mt={}));function yh(t){return!mi||!t?!1:t===document.scrollingElement}function vh(t){const e={x:0,y:0},n=yh(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,o=t.scrollLeft<=e.x,i=t.scrollTop>=r.y,a=t.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:r,minScroll:e}}const wC={x:.2,y:.2};function kC(t,e,n,r,s){let{top:o,left:i,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=wC);const{isTop:c,isBottom:d,isLeft:u,isRight:f}=vh(t),g={x:0,y:0},m={x:0,y:0},p={height:e.height*s.y,width:e.width*s.x};return!c&&o<=e.top+p.height?(g.y=Mt.Backward,m.y=r*Math.abs((e.top+p.height-o)/p.height)):!d&&l>=e.bottom-p.height&&(g.y=Mt.Forward,m.y=r*Math.abs((e.bottom-p.height-l)/p.height)),!f&&a>=e.right-p.width?(g.x=Mt.Forward,m.x=r*Math.abs((e.right-p.width-a)/p.width)):!u&&i<=e.left+p.width&&(g.x=Mt.Backward,m.x=r*Math.abs((e.left+p.width-i)/p.width)),{direction:g,speed:m}}function CC(t){if(t===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function xh(t){return t.reduce((e,n)=>Kr(e,Xl(n)),kn)}function SC(t){return t.reduce((e,n)=>e+mh(n),0)}function _C(t){return t.reduce((e,n)=>e+bh(n),0)}function wh(t,e){if(e===void 0&&(e=Zr),!t)return;const{top:n,left:r,bottom:s,right:o}=e(t);ph(t)&&(s<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const EC=[["x",["left","right"],SC],["y",["top","bottom"],_C]];class Kl{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ci(n),s=xh(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[o,i,a]of EC)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(r),d=s[o]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ws{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function MC(t){const{EventTarget:e}=Yt(t);return t instanceof e?t:Xr(t)}function ql(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var dn;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(dn||(dn={}));function kh(t){t.preventDefault()}function NC(t){t.stopPropagation()}var qe;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(qe||(qe={}));const Ch={start:[qe.Space,qe.Enter],cancel:[qe.Esc],end:[qe.Space,qe.Enter,qe.Tab]},OC=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case qe.Right:return{...n,x:n.x+25};case qe.Left:return{...n,x:n.x-25};case qe.Down:return{...n,y:n.y+25};case qe.Up:return{...n,y:n.y-25}}};class Gs{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Ws(Xr(n)),this.windowListeners=new Ws(Yt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(dn.Resize,this.handleCancel),this.windowListeners.add(dn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(dn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&wh(r),n(kn)}handleKeyDown(e){if(xi(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:o=Ch,coordinateGetter:i=OC,scrollBehavior:a="smooth"}=s,{code:l}=e;if(o.end.includes(l)){this.handleEnd(e);return}if(o.cancel.includes(l)){this.handleCancel(e);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:kn;this.referenceCoordinates||(this.referenceCoordinates=d);const u=i(e,{active:n,context:r.current,currentCoordinates:d});if(u){const f=js(u,d),g={x:0,y:0},{scrollableAncestors:m}=r.current;for(const p of m){const y=e.code,{isTop:b,isRight:S,isLeft:x,isBottom:E,maxScroll:k,minScroll:C}=vh(p),N=CC(p),_={x:Math.min(y===qe.Right?N.right-N.width/2:N.right,Math.max(y===qe.Right?N.left:N.left+N.width/2,u.x)),y:Math.min(y===qe.Down?N.bottom-N.height/2:N.bottom,Math.max(y===qe.Down?N.top:N.top+N.height/2,u.y))},w=y===qe.Right&&!S||y===qe.Left&&!x,M=y===qe.Down&&!E||y===qe.Up&&!b;if(w&&_.x!==u.x){const O=p.scrollLeft+f.x,L=y===qe.Right&&O<=k.x||y===qe.Left&&O>=C.x;if(L&&!f.y){p.scrollTo({left:O,behavior:a});return}L?g.x=p.scrollLeft-O:g.x=y===qe.Right?p.scrollLeft-k.x:p.scrollLeft-C.x,g.x&&p.scrollBy({left:-g.x,behavior:a});break}else if(M&&_.y!==u.y){const O=p.scrollTop+f.y,L=y===qe.Down&&O<=k.y||y===qe.Up&&O>=C.y;if(L&&!f.x){p.scrollTo({top:O,behavior:a});return}L?g.y=p.scrollTop-O:g.y=y===qe.Down?p.scrollTop-k.y:p.scrollTop-C.y,g.y&&p.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(e,Kr(js(u,this.referenceCoordinates),g))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Gs.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=Ch,onActivation:s}=e,{active:o}=n;const{code:i}=t.nativeEvent;if(r.start.includes(i)){const a=o.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function Sh(t){return!!(t&&"distance"in t)}function _h(t){return!!(t&&"delay"in t)}class Zl{constructor(e,n,r){var s;r===void 0&&(r=MC(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:o}=e,{target:i}=o;this.props=e,this.events=n,this.document=Xr(i),this.documentListeners=new Ws(this.document),this.listeners=new Ws(r),this.windowListeners=new Ws(Yt(i)),this.initialCoordinates=(s=wi(o))!=null?s:kn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(dn.Resize,this.handleCancel),this.windowListeners.add(dn.DragStart,kh),this.windowListeners.add(dn.VisibilityChange,this.handleCancel),this.windowListeners.add(dn.ContextMenu,kh),this.documentListeners.add(dn.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(_h(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Sh(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(dn.Click,NC,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(dn.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const l=(n=wi(e))!=null?n:kn,c=js(s,l);if(!r&&a){if(Sh(a)){if(a.tolerance!=null&&ql(c,a.tolerance))return this.handleCancel();if(ql(c,a.distance))return this.handleStart()}if(_h(a)&&ql(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===qe.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const TC={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ys extends Zl{constructor(e){const{event:n}=e,r=Xr(n.target);super(e,TC,r)}}Ys.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const AC={move:{name:"mousemove"},end:{name:"mouseup"}};var Ql;(function(t){t[t.RightClick=2]="RightClick"})(Ql||(Ql={}));class DC extends Zl{constructor(e){super(e,AC,Xr(e.event.target))}}DC.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Ql.RightClick?!1:(r?.({event:n}),!0)}}];const Jl={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class IC extends Zl{constructor(e){super(e,Jl)}static setup(){return window.addEventListener(Jl.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Jl.move.name,e)};function e(){}}}IC.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var Xs;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Xs||(Xs={}));var Si;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Si||(Si={}));function LC(t){let{acceleration:e,activator:n=Xs.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:i=5,order:a=Si.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:f}=t;const g=$C({delta:u,disabled:!o}),[m,p]=qk(),y=v.useRef({x:0,y:0}),b=v.useRef({x:0,y:0}),S=v.useMemo(()=>{switch(n){case Xs.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Xs.DraggableRect:return s}},[n,s,l]),x=v.useRef(null),E=v.useCallback(()=>{const C=x.current;if(!C)return;const N=y.current.x*b.current.x,_=y.current.y*b.current.y;C.scrollBy(N,_)},[]),k=v.useMemo(()=>a===Si.TreeOrder?[...c].reverse():c,[a,c]);v.useEffect(()=>{if(!o||!c.length||!S){p();return}for(const C of k){if(r?.(C)===!1)continue;const N=c.indexOf(C),_=d[N];if(!_)continue;const{direction:w,speed:M}=kC(C,_,S,e,f);for(const O of["x","y"])g[O][w[O]]||(M[O]=0,w[O]=0);if(M.x>0||M.y>0){p(),x.current=C,m(E,i),y.current=M,b.current=w;return}}y.current={x:0,y:0},b.current={x:0,y:0},p()},[e,E,r,p,o,i,JSON.stringify(S),JSON.stringify(g),m,c,k,d,JSON.stringify(f)])}const PC={x:{[Mt.Backward]:!1,[Mt.Forward]:!1},y:{[Mt.Backward]:!1,[Mt.Forward]:!1}};function $C(t){let{delta:e,disabled:n}=t;const r=vi(e);return Us(s=>{if(n||!r||!s)return PC;const o={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Mt.Backward]:s.x[Mt.Backward]||o.x===-1,[Mt.Forward]:s.x[Mt.Forward]||o.x===1},y:{[Mt.Backward]:s.y[Mt.Backward]||o.y===-1,[Mt.Forward]:s.y[Mt.Forward]||o.y===1}}},[n,e,r])}function FC(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Us(s=>{var o;return e==null?null:(o=r??s)!=null?o:null},[r,e])}function zC(t,e){return v.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,o=s.activators.map(i=>({eventName:i.eventName,handler:e(i.handler,r)}));return[...n,...o]},[]),[t,e])}var Ks;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Ks||(Ks={}));var Rl;(function(t){t.Optimized="optimized"})(Rl||(Rl={}));const Eh=new Map;function VC(t,e){let{dragging:n,dependencies:r,config:s}=e;const[o,i]=v.useState(null),{frequency:a,measure:l,strategy:c}=s,d=v.useRef(t),u=y(),f=Hs(u),g=v.useCallback(function(b){b===void 0&&(b=[]),!f.current&&i(S=>S===null?b:S.concat(b.filter(x=>!S.includes(x))))},[f]),m=v.useRef(null),p=Us(b=>{if(u&&!n)return Eh;if(!b||b===Eh||d.current!==t||o!=null){const S=new Map;for(let x of t){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){S.set(x.id,x.rect.current);continue}const E=x.node.current,k=E?new Kl(l(E),E):null;x.rect.current=k,k&&S.set(x.id,k)}return S}return b},[t,o,n,u,l]);return v.useEffect(()=>{d.current=t},[t]),v.useEffect(()=>{u||g()},[n,u]),v.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),v.useEffect(()=>{u||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{g(),m.current=null},a))},[a,u,g,...r]),{droppableRects:p,measureDroppableContainers:g,measuringScheduled:o!=null};function y(){switch(c){case Ks.Always:return!1;case Ks.BeforeDragging:return n;default:return!n}}}function ec(t,e){return Us(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function HC(t,e){return ec(t,e)}function UC(t){let{callback:e,disabled:n}=t;const r=bi(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function _i(t){let{callback:e,disabled:n}=t;const r=bi(e),s=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>s?.disconnect(),[s]),s}function BC(t){return new Kl(Zr(t),t)}function Mh(t,e,n){e===void 0&&(e=BC);const[r,s]=v.useState(null);function o(){s(l=>{if(!t)return null;if(t.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=e(t);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const i=UC({callback(l){if(t)for(const c of l){const{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(t)){o();break}}}}),a=_i({callback:o});return wn(()=>{o(),t?(a?.observe(t),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[t]),r}function jC(t){const e=ec(t);return fh(t,e)}const Nh=[];function WC(t){const e=v.useRef(t),n=Us(r=>t?r&&r!==Nh&&t&&e.current&&t.parentNode===e.current.parentNode?r:Ci(t):Nh,[t]);return v.useEffect(()=>{e.current=t},[t]),n}function GC(t){const[e,n]=v.useState(null),r=v.useRef(t),s=v.useCallback(o=>{const i=Yl(o.target);i&&n(a=>a?(a.set(i,Xl(i)),new Map(a)):null)},[]);return v.useEffect(()=>{const o=r.current;if(t!==o){i(o);const a=t.map(l=>{const c=Yl(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,Xl(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=t}return()=>{i(t),i(o)};function i(a){a.forEach(l=>{const c=Yl(l);c?.removeEventListener("scroll",s)})}},[s,t]),v.useMemo(()=>t.length?e?Array.from(e.values()).reduce((o,i)=>Kr(o,i),kn):xh(t):kn,[t,e])}function Oh(t,e){e===void 0&&(e=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},e),v.useEffect(()=>{const r=t!==kn;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?js(t,n.current):kn}function YC(t){v.useEffect(()=>{if(!mi)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n?.()}},t.map(e=>{let{sensor:n}=e;return n}))}function XC(t,e){return v.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:o}=r;return n[s]=i=>{o(i,e)},n},{}),[t,e])}function Th(t){return v.useMemo(()=>t?yC(t):null,[t])}const Ah=[];function KC(t,e){e===void 0&&(e=Zr);const[n]=t,r=Th(n?Yt(n):null),[s,o]=v.useState(Ah);function i(){o(()=>t.length?t.map(l=>yh(l)?r:new Kl(e(l),l)):Ah)}const a=_i({callback:i});return wn(()=>{a?.disconnect(),i(),t.forEach(l=>a?.observe(l))},[t]),s}function Dh(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Vs(e)?e:t}function qC(t){let{measure:e}=t;const[n,r]=v.useState(null),s=v.useCallback(c=>{for(const{target:d}of c)if(Vs(d)){r(u=>{const f=e(d);return u?{...u,width:f.width,height:f.height}:f});break}},[e]),o=_i({callback:s}),i=v.useCallback(c=>{const d=Dh(c);o?.disconnect(),d&&o?.observe(d),r(d?e(d):null)},[e,o]),[a,l]=yi(i);return v.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const ZC=[{sensor:Ys,options:{}},{sensor:Gs,options:{}}],QC={current:{}},Ei={draggable:{measure:gh},droppable:{measure:gh,strategy:Ks.WhileDragging,frequency:Rl.Optimized},dragOverlay:{measure:Zr}};class qs extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const JC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new qs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ki},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ei,measureDroppableContainers:ki,windowRect:null,measuringScheduled:!1},Ih={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ki,draggableNodes:new Map,over:null,measureDroppableContainers:ki},Zs=v.createContext(Ih),Lh=v.createContext(JC);function RC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qs}}}function eS(t,e){switch(e.type){case St.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case St.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case St.DragEnd:case St.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case St.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new qs(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case St.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const i=new qs(t.droppable.containers);return i.set(n,{...o,disabled:s}),{...t,droppable:{...t.droppable,containers:i}}}case St.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const o=new qs(t.droppable.containers);return o.delete(n),{...t,droppable:{...t.droppable,containers:o}}}default:return t}}function tS(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=v.useContext(Zs),o=vi(r),i=vi(n?.id);return v.useEffect(()=>{if(!e&&!r&&o&&i!=null){if(!xi(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const u=Jk(d);if(u){u.focus();break}}})}},[r,e,s,i,o]),null}function Ph(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,o)=>o({transform:s,...r}),n):n}function nS(t){return v.useMemo(()=>({draggable:{...Ei.draggable,...t?.draggable},droppable:{...Ei.droppable,...t?.droppable},dragOverlay:{...Ei.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function rS(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const o=v.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;wn(()=>{if(!i&&!a||!e){o.current=!1;return}if(o.current||!r)return;const c=e?.node.current;if(!c||c.isConnected===!1)return;const d=n(c),u=fh(d,r);if(i||(u.x=0),a||(u.y=0),o.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const f=ph(c);f&&f.scrollBy({top:u.y,left:u.x})}},[e,i,a,r,n])}const Mi=v.createContext({...kn,scaleX:1,scaleY:1});var tr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(tr||(tr={}));const tc=v.memo(function(e){var n,r,s,o;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=ZC,collisionDetection:u=fC,measuring:f,modifiers:g,...m}=e;const p=v.useReducer(eS,void 0,RC),[y,b]=p,[S,x]=sC(),[E,k]=v.useState(tr.Uninitialized),C=E===tr.Initialized,{draggable:{active:N,nodes:_,translate:w},droppable:{containers:M}}=y,O=N!=null?_.get(N):null,L=v.useRef({initial:null,translated:null}),F=v.useMemo(()=>{var $e;return N!=null?{id:N,data:($e=O?.data)!=null?$e:QC,rect:L}:null},[N,O]),$=v.useRef(null),[D,A]=v.useState(null),[T,z]=v.useState(null),H=Hs(m,Object.values(m)),W=Bs("DndDescribedBy",i),j=v.useMemo(()=>M.getEnabled(),[M]),U=nS(f),{droppableRects:B,measureDroppableContainers:G,measuringScheduled:V}=VC(j,{dragging:C,dependencies:[w.x,w.y],config:U.droppable}),K=FC(_,N),X=v.useMemo(()=>T?wi(T):null,[T]),Z=ot(),ee=HC(K,U.draggable.measure);rS({activeNode:N!=null?_.get(N):null,config:Z.layoutShiftCompensation,initialRect:ee,measure:U.draggable.measure});const ne=Mh(K,U.draggable.measure,ee),he=Mh(K?K.parentElement:null),J=v.useRef({activatorEvent:null,active:null,activeNode:K,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ce=M.getNodeFor((n=J.current.over)==null?void 0:n.id),ue=qC({measure:U.dragOverlay.measure}),ae=(r=ue.nodeRef.current)!=null?r:K,ve=C?(s=ue.rect)!=null?s:ne:null,fe=!!(ue.nodeRef.current&&ue.rect),ye=jC(fe?null:ne),ke=Th(ae?Yt(ae):null),Ue=WC(C?ce??K:null),se=KC(Ue),Oe=Ph(g,{transform:{x:w.x-ye.x,y:w.y-ye.y,scaleX:1,scaleY:1},activatorEvent:T,active:F,activeNodeRect:ne,containerNodeRect:he,draggingNodeRect:ve,over:J.current.over,overlayNodeRect:ue.rect,scrollableAncestors:Ue,scrollableAncestorRects:se,windowRect:ke}),Pe=X?Kr(X,w):null,Ie=GC(Ue),je=Oh(Ie),st=Oh(Ie,[ne]),ut=Kr(Oe,je),We=ve?pC(ve,Oe):null,et=F&&We?u({active:F,collisionRect:We,droppableRects:B,droppableContainers:j,pointerCoordinates:Pe}):null,Xe=dh(et,"id"),[te,ge]=v.useState(null),pe=fe?Oe:Kr(Oe,st),me=hC(pe,(o=te?.rect)!=null?o:null,ne),be=v.useRef(null),Be=v.useCallback(($e,Te)=>{let{sensor:He,options:De}=Te;if($.current==null)return;const Ze=_.get($.current);if(!Ze)return;const it=$e.nativeEvent,gt=new He({active:$.current,activeNode:Ze,event:it,options:De,context:J,onAbort(mt){if(!_.get(mt))return;const{onDragAbort:Dt}=H.current,Ve={id:mt};Dt?.(Ve),S({type:"onDragAbort",event:Ve})},onPending(mt,xt,Dt,Ve){if(!_.get(mt))return;const{onDragPending:ln}=H.current,nn={id:mt,constraint:xt,initialCoordinates:Dt,offset:Ve};ln?.(nn),S({type:"onDragPending",event:nn})},onStart(mt){const xt=$.current;if(xt==null)return;const Dt=_.get(xt);if(!Dt)return;const{onDragStart:Ve}=H.current,Bt={activatorEvent:it,active:{id:xt,data:Dt.data,rect:L}};On.unstable_batchedUpdates(()=>{Ve?.(Bt),k(tr.Initializing),b({type:St.DragStart,initialCoordinates:mt,active:xt}),S({type:"onDragStart",event:Bt}),A(be.current),z(it)})},onMove(mt){b({type:St.DragMove,coordinates:mt})},onEnd:tn(St.DragEnd),onCancel:tn(St.DragCancel)});be.current=gt;function tn(mt){return async function(){const{active:Dt,collisions:Ve,over:Bt,scrollAdjustedTranslate:ln}=J.current;let nn=null;if(Dt&&ln){const{cancelDrop:Nn}=H.current;nn={activatorEvent:it,active:Dt,collisions:Ve,delta:ln,over:Bt},mt===St.DragEnd&&typeof Nn=="function"&&await Promise.resolve(Nn(nn))&&(mt=St.DragCancel)}$.current=null,On.unstable_batchedUpdates(()=>{b({type:mt}),k(tr.Uninitialized),ge(null),A(null),z(null),be.current=null;const Nn=mt===St.DragEnd?"onDragEnd":"onDragCancel";if(nn){const fr=H.current[Nn];fr?.(nn),S({type:Nn,event:nn})}})}}},[_]),Se=v.useCallback(($e,Te)=>(He,De)=>{const Ze=He.nativeEvent,it=_.get(De);if($.current!==null||!it||Ze.dndKit||Ze.defaultPrevented)return;const gt={active:it};$e(He,Te.options,gt)===!0&&(Ze.dndKit={capturedBy:Te.sensor},$.current=De,Be(He,Te))},[_,Be]),ze=zC(d,Se);YC(d),wn(()=>{ne&&E===tr.Initializing&&k(tr.Initialized)},[ne,E]),v.useEffect(()=>{const{onDragMove:$e}=H.current,{active:Te,activatorEvent:He,collisions:De,over:Ze}=J.current;if(!Te||!He)return;const it={active:Te,activatorEvent:He,collisions:De,delta:{x:ut.x,y:ut.y},over:Ze};On.unstable_batchedUpdates(()=>{$e?.(it),S({type:"onDragMove",event:it})})},[ut.x,ut.y]),v.useEffect(()=>{const{active:$e,activatorEvent:Te,collisions:He,droppableContainers:De,scrollAdjustedTranslate:Ze}=J.current;if(!$e||$.current==null||!Te||!Ze)return;const{onDragOver:it}=H.current,gt=De.get(Xe),tn=gt&>.rect.current?{id:gt.id,rect:gt.rect.current,data:gt.data,disabled:gt.disabled}:null,mt={active:$e,activatorEvent:Te,collisions:He,delta:{x:Ze.x,y:Ze.y},over:tn};On.unstable_batchedUpdates(()=>{ge(tn),it?.(mt),S({type:"onDragOver",event:mt})})},[Xe]),wn(()=>{J.current={activatorEvent:T,active:F,activeNode:K,collisionRect:We,collisions:et,droppableRects:B,draggableNodes:_,draggingNode:ae,draggingNodeRect:ve,droppableContainers:M,over:te,scrollableAncestors:Ue,scrollAdjustedTranslate:ut},L.current={initial:ve,translated:We}},[F,K,et,We,_,ae,ve,B,M,te,Ue,ut]),LC({...Z,delta:w,draggingRect:We,pointerCoordinates:Pe,scrollableAncestors:Ue,scrollableAncestorRects:se});const _e=v.useMemo(()=>({active:F,activeNode:K,activeNodeRect:ne,activatorEvent:T,collisions:et,containerNodeRect:he,dragOverlay:ue,draggableNodes:_,droppableContainers:M,droppableRects:B,over:te,measureDroppableContainers:G,scrollableAncestors:Ue,scrollableAncestorRects:se,measuringConfiguration:U,measuringScheduled:V,windowRect:ke}),[F,K,ne,T,et,he,ue,_,M,B,te,G,Ue,se,U,V,ke]),Re=v.useMemo(()=>({activatorEvent:T,activators:ze,active:F,activeNodeRect:ne,ariaDescribedById:{draggable:W},dispatch:b,draggableNodes:_,over:te,measureDroppableContainers:G}),[T,ze,F,ne,b,W,_,te,G]);return v.createElement(ih.Provider,{value:x},v.createElement(Zs.Provider,{value:Re},v.createElement(Lh.Provider,{value:_e},v.createElement(Mi.Provider,{value:me},c)),v.createElement(tS,{disabled:a?.restoreFocus===!1})),v.createElement(aC,{...a,hiddenTextDescribedById:W}));function ot(){const $e=D?.autoScrollEnabled===!1,Te=typeof l=="object"?l.enabled===!1:l===!1,He=C&&!$e&&!Te;return typeof l=="object"?{...l,enabled:He}:{enabled:He}}}),sS=v.createContext(null),$h="button",oS="Draggable";function iS(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const o=Bs(oS),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:f}=v.useContext(Zs),{role:g=$h,roleDescription:m="draggable",tabIndex:p=0}=s??{},y=l?.id===e,b=v.useContext(y?Mi:sS),[S,x]=yi(),[E,k]=yi(),C=XC(i,e),N=Hs(n);wn(()=>(u.set(e,{id:e,key:o,node:S,activatorNode:E,data:N}),()=>{const w=u.get(e);w&&w.key===o&&u.delete(e)}),[u,e]);const _=v.useMemo(()=>({role:g,tabIndex:p,"aria-disabled":r,"aria-pressed":y&&g===$h?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,g,p,y,m,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:_,isDragging:y,listeners:r?void 0:C,node:S,over:f,setNodeRef:x,setActivatorNodeRef:k,transform:b}}function Fh(){return v.useContext(Lh)}const aS="Droppable",lS={timeout:25};function cS(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const o=Bs(aS),{active:i,dispatch:a,over:l,measureDroppableContainers:c}=v.useContext(Zs),d=v.useRef({disabled:n}),u=v.useRef(!1),f=v.useRef(null),g=v.useRef(null),{disabled:m,updateMeasurementsFor:p,timeout:y}={...lS,...s},b=Hs(p??r),S=v.useCallback(()=>{if(!u.current){u.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),g.current=null},y)},[y]),x=_i({callback:S,disabled:m||!i}),E=v.useCallback((_,w)=>{x&&(w&&(x.unobserve(w),u.current=!1),_&&x.observe(_))},[x]),[k,C]=yi(E),N=Hs(e);return v.useEffect(()=>{!x||!k.current||(x.disconnect(),u.current=!1,x.observe(k.current))},[k,x]),v.useEffect(()=>(a({type:St.RegisterDroppable,element:{id:r,key:o,disabled:n,node:k,rect:f,data:N}}),()=>a({type:St.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==d.current.disabled&&(a({type:St.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,a]),{active:i,rect:f,isOver:l?.id===r,node:k,over:l,setNodeRef:C}}function dS(t){let{animation:e,children:n}=t;const[r,s]=v.useState(null),[o,i]=v.useState(null),a=vi(n);return!n&&!r&&a&&s(a),wn(()=>{if(!o)return;const l=r?.key,c=r?.props.id;if(l==null||c==null){s(null);return}Promise.resolve(e(c,o)).then(()=>{s(null)})},[e,r,o]),v.createElement(v.Fragment,null,n,r?v.cloneElement(r,{ref:i}):null)}const uS={x:0,y:0,scaleX:1,scaleY:1};function fS(t){let{children:e}=t;return v.createElement(Zs.Provider,{value:Ih},v.createElement(Mi.Provider,{value:uS},e))}const hS={position:"fixed",touchAction:"none"},gS=t=>xi(t)?"transform 250ms ease":void 0,pS=v.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:o,className:i,rect:a,style:l,transform:c,transition:d=gS}=t;if(!a)return null;const u=s?c:{...c,scaleX:1,scaleY:1},f={...hS,width:a.width,height:a.height,top:a.top,left:a.left,transform:Ln.Transform.toString(u),transformOrigin:s&&r?lC(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return v.createElement(n,{className:i,style:f,ref:e},o)}),mS={duration:250,easing:"ease",keyframes:t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Ln.Transform.toString(e)},{transform:Ln.Transform.toString(n)}]},sideEffects:(t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:o,className:i}=t;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,c]of Object.entries(s))n.node.style.setProperty(l,c);i!=null&&i.active&&n.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function bS(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return bi((o,i)=>{if(e===null)return;const a=n.get(o);if(!a)return;const l=a.node.current;if(!l)return;const c=Dh(i);if(!c)return;const{transform:d}=Yt(i).getComputedStyle(i),u=hh(d);if(!u)return;const f=typeof e=="function"?e:yS(e);return wh(l,s.draggable.measure),f({active:{id:o,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:i,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:u})})}function yS(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...mS,...t};return o=>{let{active:i,dragOverlay:a,transform:l,...c}=o;if(!e)return;const d={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},u={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},f={x:l.x-d.x,y:l.y-d.y,...u},g=s({...c,active:i,dragOverlay:a,transform:{initial:l,final:f}}),[m]=g,p=g[g.length-1];if(JSON.stringify(m)===JSON.stringify(p))return;const y=r?.({active:i,dragOverlay:a,...c}),b=a.node.animate(g,{duration:e,easing:n,fill:"forwards"});return new Promise(S=>{b.onfinish=()=>{y?.(),S()}})}}let zh=0;function vS(t){return v.useMemo(()=>{if(t!=null)return zh++,zh},[t])}const xS=v.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:l,zIndex:c=999}=t;const{activatorEvent:d,active:u,activeNodeRect:f,containerNodeRect:g,draggableNodes:m,droppableContainers:p,dragOverlay:y,over:b,measuringConfiguration:S,scrollableAncestors:x,scrollableAncestorRects:E,windowRect:k}=Fh(),C=v.useContext(Mi),N=vS(u?.id),_=Ph(i,{activatorEvent:d,active:u,activeNodeRect:f,containerNodeRect:g,draggingNodeRect:y.rect,over:b,overlayNodeRect:y.rect,scrollableAncestors:x,scrollableAncestorRects:E,transform:C,windowRect:k}),w=ec(f),M=bS({config:r,draggableNodes:m,droppableContainers:p,measuringConfiguration:S}),O=w?y.setRef:void 0;return v.createElement(fS,null,v.createElement(dS,{animation:M},u&&N?v.createElement(pS,{key:N,id:u.id,ref:O,as:a,activatorEvent:d,adjustScale:e,className:l,transition:o,rect:w,style:{zIndex:c,...s},transform:_},n):null))});function Qr(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function wS(t,e){return t.reduce((n,r,s)=>{const o=e.get(r);return o&&(n[s]=o),n},Array(t.length))}function Ni(t){return t!==null&&t>=0}function kS(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function CS(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Oi=t=>{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const o=Qr(e,r,n),i=e[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},Ti={scaleX:1,scaleY:1},nc=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:o,overIndex:i}=t;const a=(e=o[n])!=null?e:r;if(!a)return null;if(s===n){const c=o[i];return c?{x:0,y:n<i?c.top+c.height-(a.top+a.height):c.top-a.top,...Ti}:null}const l=SS(o,s,n);return s>n&&s<=i?{x:0,y:-a.height-l,...Ti}:s<n&&s>=i?{x:0,y:a.height+l,...Ti}:{x:0,y:0,...Ti}};function SS(t,e,n){const r=t[e],s=t[e-1],o=t[e+1];return r?n<e?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const Vh="Sortable",Hh=v.createContext({activeIndex:-1,containerId:Vh,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Oi,disabled:{draggable:!1,droppable:!1}});function Ai(t){let{children:e,id:n,items:r,strategy:s=Oi,disabled:o=!1}=t;const{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Fh(),u=Bs(Vh,n),f=a.rect!==null,g=v.useMemo(()=>r.map(C=>typeof C=="object"&&"id"in C?C.id:C),[r]),m=i!=null,p=i?g.indexOf(i.id):-1,y=c?g.indexOf(c.id):-1,b=v.useRef(g),S=!kS(g,b.current),x=y!==-1&&p===-1||S,E=CS(o);wn(()=>{S&&m&&d(g)},[S,g,m,d]),v.useEffect(()=>{b.current=g},[g]);const k=v.useMemo(()=>({activeIndex:p,containerId:u,disabled:E,disableTransforms:x,items:g,overIndex:y,useDragOverlay:f,sortedRects:wS(g,l),strategy:s}),[p,u,E.draggable,E.droppable,x,g,y,l,f,s]);return v.createElement(Hh.Provider,{value:k},e)}const Uh=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return Qr(n,r,s).indexOf(e)},Bh=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=t;return!c||!r||a!==o&&s===i?!1:n?!0:i!==s&&e===l},_S={duration:200,easing:"ease"},jh="transform",ES=Ln.Transition.toString({property:jh,duration:0,easing:"linear"}),MS={roleDescription:"sortable"};function NS(t){let{disabled:e,index:n,node:r,rect:s}=t;const[o,i]=v.useState(null),a=v.useRef(n);return wn(()=>{if(!e&&n!==a.current&&r.current){const l=s.current;if(l){const c=Zr(r.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&i(d)}}n!==a.current&&(a.current=n)},[e,n,r,s]),v.useEffect(()=>{o&&i(null)},[o]),o}function Di(t){let{animateLayoutChanges:e=Bh,attributes:n,disabled:r,data:s,getNewIndex:o=Uh,id:i,strategy:a,resizeObserverConfig:l,transition:c=_S}=t;const{items:d,containerId:u,activeIndex:f,disabled:g,disableTransforms:m,sortedRects:p,overIndex:y,useDragOverlay:b,strategy:S}=v.useContext(Hh),x=OS(r,g),E=d.indexOf(i),k=v.useMemo(()=>({sortable:{containerId:u,index:E,items:d},...s}),[u,s,E,d]),C=v.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:N,node:_,isOver:w,setNodeRef:M}=cS({id:i,data:k,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:O,activatorEvent:L,activeNodeRect:F,attributes:$,setNodeRef:D,listeners:A,isDragging:T,over:z,setActivatorNodeRef:H,transform:W}=iS({id:i,data:k,attributes:{...MS,...n},disabled:x.draggable}),j=Kk(M,D),U=!!O,B=U&&!m&&Ni(f)&&Ni(y),G=!b&&T,V=G&&B?W:null,X=B?V??(a??S)({rects:p,activeNodeRect:F,activeIndex:f,overIndex:y,index:E}):null,Z=Ni(f)&&Ni(y)?o({id:i,items:d,activeIndex:f,overIndex:y}):E,ee=O?.id,ne=v.useRef({activeId:ee,items:d,newIndex:Z,containerId:u}),he=d!==ne.current.items,J=e({active:O,containerId:u,isDragging:T,isSorting:U,id:i,index:E,items:d,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:c,wasDragging:ne.current.activeId!=null}),ce=NS({disabled:!J,index:E,node:_,rect:N});return v.useEffect(()=>{U&&ne.current.newIndex!==Z&&(ne.current.newIndex=Z),u!==ne.current.containerId&&(ne.current.containerId=u),d!==ne.current.items&&(ne.current.items=d)},[U,Z,u,d]),v.useEffect(()=>{if(ee===ne.current.activeId)return;if(ee!=null&&ne.current.activeId==null){ne.current.activeId=ee;return}const ae=setTimeout(()=>{ne.current.activeId=ee},50);return()=>clearTimeout(ae)},[ee]),{active:O,activeIndex:f,attributes:$,data:k,rect:N,index:E,newIndex:Z,items:d,isOver:w,isSorting:U,isDragging:T,listeners:A,node:_,overIndex:y,over:z,setNodeRef:j,setActivatorNodeRef:H,setDroppableNodeRef:M,setDraggableNodeRef:D,transform:ce??X,transition:ue()};function ue(){if(ce||he&&ne.current.newIndex===E)return ES;if(!(G&&!xi(L)||!c)&&(U||J))return Ln.Transition.toString({...c,property:jh})}}function OS(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t?.draggable)!=null?n:e.draggable,droppable:(r=t?.droppable)!=null?r:e.droppable}}function Qs(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const TS=[qe.Down,qe.Right,qe.Up,qe.Left],Ii=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:o,over:i,scrollableAncestors:a}}=e;if(TS.includes(t.code)){if(t.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const f=s.get(u.id);if(f)switch(t.code){case qe.Down:r.top<f.top&&l.push(u);break;case qe.Up:r.top>f.top&&l.push(u);break;case qe.Left:r.left>f.left&&l.push(u);break;case qe.Right:r.left<f.left&&l.push(u);break}});const c=dC({collisionRect:r,droppableRects:s,droppableContainers:l});let d=dh(c,"id");if(d===i?.id&&c.length>1&&(d=c[1].id),d!=null){const u=o.get(n.id),f=o.get(d),g=f?s.get(f.id):null,m=f?.node.current;if(m&&g&&u&&f){const y=Ci(m).some((C,N)=>a[N]!==C),b=Wh(u,f),S=AS(u,f),x=y||!b?{x:0,y:0}:{x:S?r.width-g.width:0,y:S?r.height-g.height:0},E={x:g.left,y:g.top};return x.x&&x.y?E:js(E,x)}}}};function Wh(t,e){return!Qs(t)||!Qs(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function AS(t,e){return!Qs(t)||!Qs(e)||!Wh(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const DS=Object.freeze(Object.defineProperty({__proto__:null,SortableContext:Ai,arrayMove:Qr,defaultAnimateLayoutChanges:Bh,defaultNewIndexGetter:Uh,hasSortableData:Qs,rectSortingStrategy:Oi,sortableKeyboardCoordinates:Ii,useSortable:Di,verticalListSortingStrategy:nc},Symbol.toStringTag,{value:"Module"})),IS=()=>window.G7Core,Gh=({item:t,isSelected:e=!1,isExpanded:n=!1,level:r=0,onClick:s,onToggle:o,onExpandToggle:i,className:a="",selectedClassName:l="bg-blue-50 dark:bg-blue-900/30 border-blue-500",defaultClassName:c="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600",dragHandleClassName:d="text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",iconContainerClassName:u="bg-gray-100 dark:bg-gray-700",contentClassName:f="",enableDrag:g=!0,toggleDisabled:m=!1})=>{const{attributes:p,listeners:y,setNodeRef:b,transform:S,transition:x,isDragging:E}=Di({id:t.id}),k={transform:Ln.Transform.toString(S),transition:x,opacity:E?.5:1},C=r*24+12,_=`flex items-center gap-2 cursor-pointer transition-colors ${e?l:c}`,w=IS()?.style?.mergeClasses?.(_,a)??`${_} ${a}`.trim();return h.jsxs(I,{ref:b,style:k,className:w,onClick:s,children:[g&&h.jsx(I,{...p,...y,className:`flex-shrink-0 cursor-grab active:cursor-grabbing p-1 ${d}`,style:{paddingLeft:`${C}px`},children:h.jsx(re,{name:"grip-vertical",className:"w-4 h-4"})}),!g&&r>0&&h.jsx(I,{style:{paddingLeft:`${C}px`}}),g&&h.jsx(h.Fragment,{children:t.hasChildren?h.jsx(oe,{type:"button",onClick:M=>{M.stopPropagation(),i?.()},className:`flex-shrink-0 p-1 ${d}`,children:h.jsx(re,{name:n?"chevron-down":"chevron-right",className:"w-4 h-4"})}):h.jsx(I,{className:"flex-shrink-0 w-6"})}),h.jsx(I,{className:`flex-shrink-0 w-8 h-8 flex items-center justify-center rounded ${u}`,children:h.jsx(re,{name:t.icon||"file",className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:`flex-1 min-w-0 ${f}`,children:[h.jsxs(I,{className:"flex items-center gap-1",children:[h.jsx(Q,{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:t.name}),t.isModuleMenu&&h.jsx(re,{name:"cube",className:"w-2 h-2 text-gray-300 dark:text-gray-500 ml-2",title:t.moduleName})]}),h.jsx(Q,{className:"text-xs text-gray-500 dark:text-gray-400 truncate block",children:t.url})]}),h.jsx(I,{className:"flex-shrink-0",onClick:M=>M.stopPropagation(),children:h.jsx(Ua,{checked:t.isActive,onChange:()=>o?.(new MouseEvent("click")),size:"sm",disabled:m})})]})},LS=()=>window.G7Core;function Yh(t,e,n=0,r=null){const s=[];for(const o of t)s.push({item:o,depth:n,parentId:r}),o.children?.length>0&&e.has(o.id)&&s.push(...Yh(o.children,e,n+1,o.id));return s}function rc(t,e){for(const n of t){if(n.id===e)return n;if(n.children){const r=rc(n.children,e);if(r)return r}}return null}function Xh(t){const e=[];if(t.children)for(const n of t.children)e.push(n.id),e.push(...Xh(n));return e}function Kh(t,e){return t.filter(n=>n.id!==e).map(n=>n.children?.length>0?{...n,children:Kh(n.children,e)}:n)}function qh(t,e,n,r){if(n===null){const s=[...t];return s.splice(r,0,e),s}return t.map(s=>{if(s.id===n){const o=[...s.children||[]];return o.splice(r,0,e),{...s,children:o}}return s.children?.length>0?{...s,children:qh(s.children,e,n,r)}:s})}function Zh(t,e,n,r){if(e===null){const s=t.findIndex(i=>i.id===n),o=t.findIndex(i=>i.id===r);return s===-1||o===-1?t:Qr(t,s,o)}return t.map(s=>{if(s.id===e&&s.children){const o=s.children.findIndex(a=>a.id===n),i=s.children.findIndex(a=>a.id===r);return o===-1||i===-1?s:{...s,children:Qr(s.children,o,i)}}return s.children?.length>0?{...s,children:Zh(s.children,e,n,r)}:s})}function Qh(t){const e=t.map((s,o)=>({id:s.id,order:o+1})),n={},r=s=>{s.forEach(o=>{o.children?.length>0&&(n[o.id]=o.children.map((i,a)=>({id:i.id,order:a+1})),r(o.children))})};return r(t),{parent_menus:e,child_menus:n}}const PS=({items:t=[],selectedId:e,onSelect:n,onOrderChange:r,onToggleStatus:s,title:o,className:i="",listClassName:a="",childrenContainerClassName:l="bg-gray-50 dark:bg-gray-900/50",itemClassName:c="py-2.5 px-3 mx-4 my-2 rounded-lg border",itemSelectedClassName:d,itemDefaultClassName:u,titleClassName:f="px-4 py-3 border-b border-gray-200 dark:border-gray-700",enableDrag:g=!0,toggleDisabled:m=!1,id:p,editorAttrs:y})=>{const[b,S]=v.useState(new Set),[x,E]=v.useState(null),[k,C]=v.useState(t),N=v.useRef(!1),_=v.useRef(""),w=v.useRef(""),M=v.useCallback(B=>JSON.stringify(B),[]),O=v.useCallback(B=>B.map(G=>{const V=G.children?.map(K=>K.id).join(",")||"";return`${G.id}:${V}`}).join("|"),[]);v.useEffect(()=>{const B=O(t),G=M(t);if(N.current){const V=O(k);(B===V||B!==_.current)&&(N.current=!1,_.current=B,w.current=G,(B!==V||G!==M(k))&&C(t));return}G!==w.current&&(_.current=B,w.current=G,C(t))},[t,O,M,k]);const L=Wl(qr(Ys,{activationConstraint:{distance:8}}),qr(Gs,{coordinateGetter:Ii})),F=v.useCallback(B=>{if(typeof B=="string")return B;const V=LS()?.locale?.current?.()||"ko";return B[V]||B.en||Object.values(B)[0]||""},[]),$=v.useCallback(B=>{S(G=>{const V=new Set(G);return V.has(B)?V.delete(B):V.add(B),V})},[]),D=v.useCallback(B=>{n?.(B)},[n]),A=v.useCallback((B,G,V)=>{V.stopPropagation(),s?.(B,G)},[s]),T=B=>{E(B.active.id)},z=B=>{const{active:G,over:V}=B;if(E(null),!V||G.id===V.id)return;const K=W.find(Z=>Z.item.id===Number(G.id)),X=W.find(Z=>Z.item.id===Number(V.id));if(!(!K||!X))if(K.parentId===X.parentId){const Z=Zh(k,K.parentId,Number(G.id),Number(V.id));C(Z),N.current=!0,r?.(Qh(Z))}else{const Z=K.item;if(Xh(Z).includes(Number(V.id)))return;let ne=Kh(k,Z.id);const he=W.findIndex(ye=>ye.item.id===Number(G.id)),J=W.findIndex(ye=>ye.item.id===Number(V.id)),ce=he>J,ue=X.parentId;let ae;if(ue===null)ae=ne.findIndex(ye=>ye.id===Number(V.id)),ae===-1?ae=ne.length:ce||(ae+=1);else{const ke=rc(ne,ue)?.children||[];ae=ke.findIndex(Ue=>Ue.id===Number(V.id)),ae===-1?ae=ke.length:ce||(ae+=1)}const ve={...Z,parent_id:ue,children:Z.children||[]};ne=qh(ne,ve,ue,ae),C(ne),N.current=!0;const fe=Qh(ne);fe.moved_items=[{id:Z.id,new_parent_id:ue}],r?.(fe)}},H=B=>({id:B.id,name:F(B.name),slug:B.slug,url:B.url,icon:B.icon,isActive:B.is_active,isModuleMenu:!!B.module_id,moduleName:B.module?F(B.module.name):void 0,hasChildren:B.children&&B.children.length>0}),W=v.useMemo(()=>Yh(k,b),[k,b]),j=v.useMemo(()=>W.map(B=>B.item.id),[W]),U=x?rc(k,Number(x)):null;return h.jsxs(I,{className:i,id:p,...y,children:[o&&h.jsx(I,{className:f,children:h.jsx(Ir,{className:"text-sm font-medium text-gray-900 dark:text-white",children:o})}),h.jsxs(tc,{sensors:L,collisionDetection:Gl,onDragStart:T,onDragEnd:z,children:[h.jsx(Ai,{items:j,strategy:nc,children:h.jsx(I,{className:a,children:W.map(B=>h.jsx(I,{className:B.depth>0?l:"",children:h.jsx(Gh,{item:H(B.item),isSelected:e===B.item.id,isExpanded:b.has(B.item.id),level:B.depth,onClick:()=>D(B.item),onToggle:G=>A(B.item.id,B.item.is_active,G),onExpandToggle:()=>$(B.item.id),className:c,selectedClassName:d,defaultClassName:u,enableDrag:g,toggleDisabled:m})},B.item.id))})}),h.jsx(xS,{children:U?h.jsx(I,{className:"bg-white dark:bg-gray-800 shadow-lg rounded-lg border border-blue-500 p-3",children:h.jsx(I,{className:"flex items-center gap-2",children:h.jsx(I,{className:"text-sm font-medium text-gray-900 dark:text-white",children:F(U.name)})})}):null})]})]})},$S=[{value:"LayoutDashboard",label:"LayoutDashboard",faIcon:"tachometer-alt"},{value:"Settings",label:"Settings",faIcon:"cog"},{value:"Menu",label:"Menu",faIcon:"bars"},{value:"Users",label:"Users",faIcon:"users"},{value:"Package",label:"Package",faIcon:"cube"},{value:"Puzzle",label:"Puzzle",faIcon:"puzzle-piece"},{value:"FileText",label:"FileText",faIcon:"file-alt"},{value:"ShoppingCart",label:"ShoppingCart",faIcon:"shopping-cart"},{value:"MessageSquare",label:"MessageSquare",faIcon:"comment"},{value:"Home",label:"Home",faIcon:"home"},{value:"User",label:"User",faIcon:"user"},{value:"Search",label:"Search",faIcon:"search"},{value:"Bell",label:"Bell",faIcon:"bell"},{value:"Mail",label:"Mail",faIcon:"envelope"},{value:"Calendar",label:"Calendar",faIcon:"calendar"},{value:"Chart",label:"Chart",faIcon:"chart-bar"},{value:"Database",label:"Database",faIcon:"database"},{value:"Lock",label:"Lock",faIcon:"lock"},{value:"Globe",label:"Globe",faIcon:"globe"},{value:"Image",label:"Image",faIcon:"image"}],FS=({value:t,onChange:e,options:n=$S,placeholder:r,searchPlaceholder:s,noResultsText:o,className:i="",disabled:a=!1,name:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(!1),[g,m]=v.useState(""),p=v.useRef(null),y=n.find(x=>{if(!t)return!1;if(t.includes("fa-")){const E=t.replace(/^(fas|far|fab|fal|fad)\s+fa-/,"");return x.faIcon===E||x.faIcon===t}return x.value===t||x.faIcon===t}),b=n.filter(x=>x.label.toLowerCase().includes(g.toLowerCase()));v.useEffect(()=>{const x=E=>{p.current&&!p.current.contains(E.target)&&(f(!1),m(""))};if(u)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[u]);const S=x=>{const E=`fas fa-${x.faIcon}`;e?.(E),f(!1),m("")};return h.jsxs(I,{ref:p,className:`relative ${i}`,id:c,...d,children:[h.jsxs(oe,{type:"button",onClick:()=>!a&&f(!u),disabled:a,className:`
|
||
w-full flex items-center justify-between px-3 py-2
|
||
bg-white dark:bg-gray-800
|
||
border border-gray-300 dark:border-gray-600 rounded-lg
|
||
text-left text-sm
|
||
${a?"opacity-50 cursor-not-allowed":"hover:border-gray-400 dark:hover:border-gray-500"}
|
||
focus:outline-none focus:ring-2 focus:ring-blue-500
|
||
`,children:[h.jsx(I,{className:"flex items-center gap-2",children:y?h.jsxs(h.Fragment,{children:[h.jsx(re,{name:y.faIcon,className:"w-4 h-4 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"text-gray-900 dark:text-white",children:y.label})]}):h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:r})}),h.jsx(re,{name:"chevron-down",className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${u?"rotate-180":""}`})]}),l&&h.jsx("input",{type:"hidden",name:l,value:t||""}),u&&h.jsxs(I,{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-72 overflow-hidden",children:[h.jsx(I,{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:h.jsx(wt,{type:"text",value:g,onChange:x=>m(x.target.value),placeholder:s,className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white",autoFocus:!0})}),h.jsx(I,{className:"max-h-56 overflow-y-auto",children:b.length>0?b.map(x=>h.jsxs(oe,{type:"button",onClick:()=>S(x),className:`
|
||
w-full flex items-center gap-3 px-3 py-2 text-left text-sm
|
||
${y?.faIcon===x.faIcon?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}
|
||
`,children:[h.jsx(re,{name:x.faIcon,className:"w-4 h-4"}),h.jsx(Q,{children:x.label}),y?.faIcon===x.faIcon&&h.jsx(re,{name:"check",className:"w-4 h-4 ml-auto text-blue-600"})]},x.value)):h.jsx(I,{className:"px-3 py-4 text-sm text-gray-500 dark:text-gray-400 text-center",children:o})})]})]})},sc=({defaultOpen:t=!1,isOpen:e,onToggle:n,className:r="",style:s,children:o,disabled:i=!1,id:a,editorAttrs:l})=>{const[c,d]=v.useState(t),u=e!==void 0,f=u?e:c,g=v.useRef(null),[m,p]=v.useState(t?void 0:0),y=()=>{if(i)return;const S=!f;u||d(S),n?.(S)};v.useEffect(()=>{if(g.current)if(f){p(g.current.scrollHeight);const S=setTimeout(()=>{p(void 0)},300);return()=>clearTimeout(S)}else p(g.current.scrollHeight),requestAnimationFrame(()=>{p(0)})},[f]);const b={};if(v.Children.forEach(o,S=>{if(v.isValidElement(S)){const x=S.props?.slot;x==="trigger"?b.trigger=S:x==="content"&&(b.content=S)}}),!b.trigger&&!b.content){const S=v.Children.toArray(o);S.length>=2?(b.trigger=S[0],b.content=S.slice(1)):S.length===1&&(b.content=S[0])}return h.jsxs(I,{className:`border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${r}`,style:s,id:a,...l,children:[h.jsxs(oe,{type:"button",onClick:y,disabled:i,className:`w-full flex items-center justify-between p-3 text-left bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${i?"opacity-50 cursor-not-allowed":""} ${f?"border-b border-gray-200 dark:border-gray-700":""}`,"aria-expanded":f,children:[h.jsx(I,{className:"flex-1",children:b.trigger}),!b.trigger&&h.jsx("svg",{className:`w-5 h-5 text-gray-500 dark:text-gray-400 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h.jsx(I,{ref:g,className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:m!==void 0?`${m}px`:"auto"},children:h.jsx(I,{className:"bg-white dark:bg-gray-800",children:b.content})})]})},Js=window.G7Core,Jh=Js?.useControllableState,Rh=(t,e)=>window.G7Core?.t?.(t,e)??t,zS={"":"common.scope_type_all_desc",self:"common.scope_type_self_desc",role:"common.scope_type_role_desc"},VS=({options:t,value:e,onChange:n,disabled:r=!1})=>{const[s,o]=v.useState(!1),[i,a]=v.useState({}),l=v.useRef(null),c=t.find(u=>u.value===e)??t[0];v.useEffect(()=>{if(!s)return;const u=g=>{l.current&&!l.current.contains(g.target)&&o(!1)},f=()=>{if(!l.current)return;const g=l.current.getBoundingClientRect();a({position:"fixed",top:g.bottom+4,right:window.innerWidth-g.right,zIndex:9999})};return document.addEventListener("mousedown",u),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[s]);const d=v.useCallback(()=>{if(r||!l.current)return;const u=l.current.getBoundingClientRect();a({position:"fixed",top:u.bottom+4,right:window.innerWidth-u.right,zIndex:9999}),o(f=>!f)},[r]);return h.jsxs(I,{ref:l,className:"relative flex-shrink-0",children:[h.jsxs(I,{role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),u.preventDefault(),d()},onMouseDown:u=>u.stopPropagation(),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),u.preventDefault(),d()),u.key==="Escape"&&o(!1)},className:`flex items-center gap-1 text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 cursor-pointer select-none ${r?"opacity-50 cursor-not-allowed":"hover:border-blue-400 dark:hover:border-blue-500"}`,children:[h.jsx(Q,{children:c?.label??""}),h.jsx(re,{name:de.ChevronDown,className:"w-3 h-3 text-gray-400 dark:text-gray-500"})]}),s&&h.jsx(I,{style:i,className:"w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1",children:t.map(u=>{const f=u.value??"",g=zS[f],m=g?Rh(g):"",p=u.value===e;return h.jsxs(I,{role:"option","aria-selected":p,onClick:y=>{y.stopPropagation(),y.preventDefault(),n(u.value),o(!1)},onMouseDown:y=>y.stopPropagation(),className:`px-3 py-2 cursor-pointer transition-colors ${p?"bg-blue-50 dark:bg-blue-900/30":"hover:bg-gray-50 dark:hover:bg-gray-700/50"}`,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[h.jsx(Q,{className:`text-xs font-medium ${p?"text-blue-700 dark:text-blue-300":"text-gray-900 dark:text-white"}`,children:u.label}),p&&h.jsx(re,{name:de.Check,className:"w-3.5 h-3.5 text-blue-600 dark:text-blue-400"})]}),m&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:m})]},f||"__null__")})})]})},HS=(t,e)=>{if(t.length!==e.length)return!1;const n=[...t].sort((s,o)=>s.id-o.id),r=[...e].sort((s,o)=>s.id-o.id);return n.every((s,o)=>s.id===r[o].id&&s.scope_type===r[o].scope_type)},US=({data:t=[],value:e=[],onChange:n,scopeOptions:r=[],className:s="",disabled:o=!1,desktopColumns:i=2,installedModules:a=[],installedPlugins:l=[],id:c,editorAttrs:d})=>{const u=v.useCallback(M=>{if(n){const O=Js?.createChangeEvent?Js.createChangeEvent({value:M}):{target:{value:M}};n(O)}},[n]),[f,g]=Jh?Jh(e,[],u,{isEqual:HS}):(()=>{const[M,O]=v.useState(e),L=v.useRef(n);L.current=n;const F=v.useRef(!1);v.useEffect(()=>{if(F.current){F.current=!1;return}O(e)},[e]);const $=v.useCallback(D=>{F.current=!0,O(A=>{const T=typeof D=="function"?D(A):D;if(L.current){const z=Js?.createChangeEvent?Js.createChangeEvent({value:T}):{target:{value:T}};L.current(z)}return T})},[]);return[M,$]})(),m=v.useMemo(()=>new Set(f.map(M=>M.id)),[f]),p=v.useCallback(M=>M.is_assignable?[M.id]:M.children.flatMap(O=>p(O)),[]),y=v.useCallback(M=>{const O=p(M);return O.length>0&&O.every(L=>m.has(L))},[m,p]),b=v.useCallback(M=>{const O=p(M),L=O.filter(F=>m.has(F)).length;return L>0&&L<O.length},[m,p]),S=v.useCallback(M=>p(M).filter(L=>m.has(L)).length,[m,p]),x=v.useCallback((M,O)=>{o||g(L=>O?[...L,{id:M,scope_type:null}]:L.filter(F=>F.id!==M))},[o,g]),E=v.useCallback((M,O)=>{if(o)return;const L=p(M),F=new Set(L);g($=>{if(O){const D=new Set($.map(T=>T.id)),A=L.filter(T=>!D.has(T)).map(T=>({id:T,scope_type:null}));return[...$,...A]}else return $.filter(D=>!F.has(D.id))})},[o,p,g]),k=v.useCallback((M,O)=>{o||g(L=>L.map(F=>F.id===M?{...F,scope_type:O}:F))},[o,g]),C=M=>{const O=m.has(M.id),L=!!M.resource_route_key,F=O&&L&&r.length>0,$=f.find(D=>D.id===M.id)?.scope_type??null;return h.jsxs(rn,{className:`flex items-start gap-3 p-3 rounded-lg border cursor-pointer transition-colors ${O?"border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700/50"} ${o?"opacity-50 cursor-not-allowed":""}`,children:[h.jsx(wt,{type:"checkbox",checked:O,onChange:D=>{D.stopPropagation(),x(M.id,D.target.checked)},disabled:o,className:"w-4 h-4 mt-0.5 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsxs(I,{className:"flex items-center justify-between gap-2",children:[h.jsx(Q,{className:"text-sm font-medium text-gray-900 dark:text-white",children:M.name}),F&&h.jsx(VS,{options:r,value:$,onChange:D=>k(M.id,D),disabled:o})]}),M.description&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:M.description})]})]},M.id)},N=(M,O)=>{const L=y(M),F=b(M),$=S(M),D=M.children.filter(z=>z.is_assignable);if(D.length===0&&M.children.length===0)return null;const A=M.children.some(z=>!z.is_assignable),T=i===1?"grid-cols-1":i===3?"grid-cols-1 md:grid-cols-3":"grid-cols-1 md:grid-cols-2";return h.jsxs(sc,{defaultOpen:!1,className:"border-0 rounded-none",children:[h.jsxs(I,{slot:"trigger",className:"flex items-center gap-3 w-full py-2",children:[h.jsx("input",{type:"checkbox",checked:L,ref:z=>{z&&(z.indeterminate=F)},onChange:z=>{z.stopPropagation(),E(M,z.target.checked)},onClick:z=>z.stopPropagation(),onMouseDown:z=>z.stopPropagation(),disabled:o,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(re,{name:de.Folder,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:M.name}),h.jsxs(Q,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ml-1",children:[$,"/",M.leaf_count]}),h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-400 dark:text-gray-500 ml-auto"})]}),h.jsx(I,{slot:"content",className:`pl-8 grid ${T} gap-2 py-2`,children:A?M.children.map(z=>z.is_assignable?C(z):N(z)):D.map(z=>C(z))})]},M.id)},_=M=>{if(M.extension_type==="core")return"core";if(M.extension_type==="module")return"module";if(M.extension_type==="plugin")return"plugin";const O=M.extension_identifier??M.module??"";return O==="core"||!O?"core":l?.some(F=>F.identifier===O)?"plugin":"module"},w=M=>{const O=y(M),L=b(M),F=S(M),$=_(M);return h.jsxs(sc,{defaultOpen:!1,className:"mb-2",children:[h.jsxs(I,{slot:"trigger",className:"flex items-center gap-3 w-full py-2",children:[h.jsx("input",{type:"checkbox",checked:O,ref:D=>{D&&(D.indeterminate=L)},onChange:D=>{D.stopPropagation(),E(M,D.target.checked)},onClick:D=>D.stopPropagation(),onMouseDown:D=>D.stopPropagation(),disabled:o,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(re,{name:$==="core"?de.Cog:de.Cube,className:"w-5 h-5 text-gray-400 dark:text-gray-500"}),h.jsx(Q,{className:"font-medium text-gray-900 dark:text-white",children:M.name}),$!=="core"&&h.jsx(nh,{type:$,identifier:M.extension_identifier??M.module,installedModules:a,installedPlugins:l}),h.jsxs(Q,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ml-2",children:[F,"/",M.leaf_count]}),h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-400 dark:text-gray-500 ml-auto"})]}),h.jsx(I,{slot:"content",className:"pl-8 space-y-2 pb-2",children:M.children.map(D=>D.is_assignable?C(D):N(D))})]},M.id)};return t.length===0?h.jsx(I,{className:`text-sm text-gray-400 dark:text-gray-500 py-4 text-center ${s}`,id:c,...d,children:Rh("common.no_data")??"데이터가 없습니다."}):h.jsx(I,{className:`space-y-2 ${s}`,id:c,...d,children:t.map(M=>w(M))})};function BS({text:t,keyword:e}){if(!e||!t)return h.jsx(h.Fragment,{children:t});const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=t.split(new RegExp(`(${n})`,"gi"));return h.jsx(h.Fragment,{children:r.map((s,o)=>s.toLowerCase()===e.toLowerCase()?h.jsx(Q,{className:"bg-yellow-200 dark:bg-yellow-700 rounded px-0.5",children:s},o):s)})}const jS=({data:t=[],expandedIds:e=[],selectedIds:n=[],searchKeyword:r="",showProductCount:s=!1,selectable:o=!1,className:i="",onToggle:a,onSelectionChange:l,id:c,editorAttrs:d})=>{const u=v.useCallback(y=>{if(!a)return;const b=e.includes(y)?e.filter(S=>S!==y):[...e,y];a(b)},[e,a]),f=v.useCallback((y,b)=>{if(!l)return;const S=b?[...n,y]:n.filter(x=>x!==y);l(S)},[n,l]),g=v.useMemo(()=>{if(!r)return null;const y=new Set,b=S=>{for(const x of S)(x.localized_name||x.name).toLowerCase().includes(r.toLowerCase())&&y.add(x.id),x.children&&b(x.children)};return b(t),y},[t,r]),m=v.useCallback(y=>!g||g.has(y.id)?!0:(y.children??[]).some(b=>m(b)),[g]),p=(y,b=0)=>{const S=(y.children??[]).length>0,x=e.includes(y.id),E=n.includes(y.id),k=y.localized_name||y.name;return r&&!m(y)?null:h.jsxs(I,{"data-testid":`category-node-${y.id}`,children:[h.jsxs(I,{className:`flex items-center gap-2 py-1.5 px-2 rounded cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors ${b>0?"ml-"+Math.min(b*5,20):""}`,style:b>0?{marginLeft:`${b*20}px`}:void 0,children:[S?h.jsx(I,{className:"flex-shrink-0 w-5 h-5 flex items-center justify-center text-gray-400 dark:text-gray-500",onClick:()=>u(y.id),"data-testid":`toggle-${y.id}`,children:h.jsx(re,{name:x?de.CaretDown:de.CaretRight,className:"text-xs"})}):h.jsx(I,{className:"flex-shrink-0 w-5 h-5"}),o&&h.jsx(vn,{checked:E,onChange:C=>{C.stopPropagation(),f(y.id,C.target.checked)},className:"flex-shrink-0","data-testid":`checkbox-${y.id}`}),h.jsx(re,{name:de.Folder,className:`flex-shrink-0 text-sm ${S?"text-yellow-500 dark:text-yellow-400":"text-gray-400 dark:text-gray-500"}`}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300 select-none",onClick:()=>S&&u(y.id),children:h.jsx(BS,{text:k,keyword:r})}),s&&y.products_count!==void 0&&h.jsx(Q,{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400 ml-1",children:y.products_count})]}),S&&x&&h.jsx(I,{"data-testid":`children-${y.id}`,children:(y.children??[]).map(C=>p(C,b+1))})]},y.id)};return t.length===0?h.jsx(I,{className:`text-sm text-gray-400 dark:text-gray-500 py-4 text-center ${i}`,id:c,...d,children:"데이터가 없습니다."}):h.jsx(I,{className:`border border-gray-200 dark:border-gray-700 rounded-lg p-2 max-h-80 overflow-y-auto ${i}`,id:c,...d,children:t.map(y=>p(y,0))})},eg="carousel",Rs="controller",WS="navigation",GS="no-scroll",oc="portal",YS="root",tg="toolbar",XS="counter",eo="fullscreen",ng="slideshow",to="thumbnails",rg="zoom",Jr="loading",ic="playing",no="error",ro="complete",KS="placeholder",so=t=>`active-slide-${t}`,qS=so(Jr),ZS=so(ic),QS=so(no),JS=so(ro),sg="fullsize",Rr="flex_center",RS="no_scroll",og="no_scroll_padding",ac="slide",ig="slide_wrapper",e_="slide_wrapper_interactive",nr="prev",rr="next",lc="swipe",es="close",ag="onPointerDown",lg="onPointerMove",cg="onPointerUp",dg="onPointerLeave",ug="onPointerCancel",cc="onKeyDown",t_="onKeyUp",dc="onWheel",n_="Escape",r_="ArrowLeft",s_="ArrowRight",o_="button",Li="icon",fg="contain",hg="cover",gg="Unknown action type",pg="yarl__";function Ft(...t){return t.filter(Boolean).join(" ")}function Ne(t){return`${pg}${t}`}function dt(t){return`--${pg}${t}`}function gr(t,e){return`${t}${e?`_${e}`:""}`}function pr(t){return e=>gr(t,e)}function mr(t,e){var n;return(n=t?.[e])!==null&&n!==void 0?n:e}function mg(t,e,n){return mr(t,"{index} of {total}").replace(/\{index}/g,`${gc(n,e.length)+1}`).replace(/\{total}/g,`${e.length}`)}function ts(...t){return()=>{t.forEach(e=>{e()})}}function an(t,e,n){return()=>{const r=P.useContext(n);if(!r)throw new Error(`${t} must be used within a ${e}.Provider`);return r}}function uc(){return typeof window<"u"}function fc(t,e=0){const n=10**e;return Math.round((t+Number.EPSILON)*n)/n}function sr(t){return t.type===void 0||t.type==="image"}function hc(t,e){return t.imageFit===hg||t.imageFit!==fg&&e===hg}function Pi(t){return typeof t=="string"?Number.parseInt(t,10):t}function $i(t){if(typeof t=="number")return{pixel:t};if(typeof t=="string"){const e=Pi(t);return t.endsWith("%")?{percent:e}:{pixel:e}}return{pixel:0}}function i_(t,e){const n=$i(e),r=n.percent!==void 0?t.width/100*n.percent:n.pixel;return{width:Math.max(t.width-2*r,0),height:Math.max(t.height-2*r,0)}}function a_(){return(uc()?window?.devicePixelRatio:void 0)||1}function gc(t,e){return e>0?(t%e+e)%e:0}function pc(t){return t.length>0}function mc(t,e){return t[gc(e,t.length)]}function bc(t,e){return pc(t)?mc(t,e):void 0}function bg(t){return sr(t)?t.src:void 0}function Fi(t,e,n){if(!n)return t;const{buttons:r,...s}=t,o=r.findIndex(a=>a===e),i=P.isValidElement(n)?P.cloneElement(n,{key:e},null):n;if(o>=0){const a=[...r];return a.splice(o,1,i),{buttons:a,...s}}return{buttons:[i,...r],...s}}function yg(t,e,n=0){return Math.min(t.preload,Math.max(t.finite?e.length-1:Math.floor(e.length/2),n))}const l_=Number(P.version.split(".")[0])>=19;function c_(t){return{inert:l_?t:t?"":void 0}}function d_(t){t.scrollTop}const yc={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[es]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:fg,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,closeOnEscape:!0,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function un(t,e){return{name:t,component:e}}function Nt(t,e){return{module:t,children:e}}function vg(t,e,n){return t.module.name===e?n(t):t.children?[Nt(t.module,t.children.flatMap(r=>{var s;return(s=vg(r,e,n))!==null&&s!==void 0?s:[]}))]:[t]}function ns(t,e,n){return t.flatMap(r=>{var s;return(s=vg(r,e,n))!==null&&s!==void 0?s:[]})}function u_(t,e=[],n=[]){let r=t;const s=g=>{const m=[...r];for(;m.length>0;){const p=m.pop();if(p?.module.name===g)return!0;p?.children&&m.push(...p.children)}return!1},o=(g,m)=>{if(g===""){r=[Nt(m,r)];return}r=ns(r,g,p=>[Nt(m,[p])])},i=(g,m)=>{r=ns(r,g,p=>[Nt(p.module,[Nt(m,p.children)])])},a=(g,m,p)=>{r=ns(r,g,y=>{var b;return[Nt(y.module,[...p?[Nt(m)]:[],...(b=y.children)!==null&&b!==void 0?b:[],...p?[]:[Nt(m)]])]})},l=(g,m,p)=>{r=ns(r,g,y=>[...p?[Nt(m)]:[],y,...p?[]:[Nt(m)]])},c=g=>{i(Rs,g)},d=(g,m)=>{r=ns(r,g,p=>[Nt(m,p.children)])},u=g=>{r=ns(r,g,m=>m.children)},f=g=>{n.push(g)};return e.forEach(g=>{g({contains:s,addParent:o,append:i,addChild:a,addSibling:l,addModule:c,replace:d,remove:u,augment:f})}),{config:r,augmentation:g=>n.reduce((m,p)=>p(m),g)}}const xg=P.createContext(null),vc=an("useA11yContext","A11yContext",xg);function f_({children:t}){const[e,n]=P.useState(!1),[r,s]=P.useState(!1),o=P.useMemo(()=>({focusWithin:e,trackFocusWithin:(a,l)=>{const c=d=>u=>{var f;u.currentTarget.contains(u.relatedTarget)||n(d),(f=d?a:l)===null||f===void 0||f(u)};return{onFocus:c(!0),onBlur:c(!1)}},autoPlaying:r,setAutoPlaying:s}),[e,r]);return P.createElement(xg.Provider,{value:o},t)}const wg=P.createContext(null),rs=an("useDocument","DocumentContext",wg);function h_({nodeRef:t,children:e}){const n=P.useMemo(()=>{const r=o=>{var i;return((i=o||t.current)===null||i===void 0?void 0:i.ownerDocument)||document};return{getOwnerDocument:r,getOwnerWindow:o=>{var i;return((i=r(o))===null||i===void 0?void 0:i.defaultView)||window}}},[t]);return P.createElement(wg.Provider,{value:n},e)}const kg=P.createContext(null),ss=an("useEvents","EventsContext",kg);function g_({children:t}){const[e]=P.useState({});P.useEffect(()=>()=>{Object.keys(e).forEach(r=>delete e[r])},[e]);const n=P.useMemo(()=>{const r=(i,a)=>{var l;(l=e[i])===null||l===void 0||l.splice(0,e[i].length,...e[i].filter(c=>c!==a))};return{publish:(...[i,a])=>{var l;(l=e[i])===null||l===void 0||l.forEach(c=>c(a))},subscribe:(i,a)=>(e[i]||(e[i]=[]),e[i].push(a),()=>r(i,a)),unsubscribe:r}},[e]);return P.createElement(kg.Provider,{value:n},t)}const Cg=P.createContext(null),Ot=an("useLightboxProps","LightboxPropsContext",Cg);function Sg({children:t,...e}){return P.createElement(Cg.Provider,{value:e},t)}const _g=P.createContext(null),fn=an("useLightboxState","LightboxStateContext",_g),Eg=P.createContext(null),p_=an("useLightboxDispatch","LightboxDispatchContext",Eg);function m_(t,e){switch(e.type){case"swipe":{const{slides:n}=t,r=e?.increment||0,s=t.globalIndex+r,o=gc(s,n.length),i=bc(n,o),a=r||e.duration!==void 0?{increment:r,duration:e.duration,easing:e.easing}:void 0;return{slides:n,currentIndex:o,globalIndex:s,currentSlide:i,animation:a}}case"update":return e.slides!==t.slides||e.index!==t.currentIndex?{slides:e.slides,currentIndex:e.index,globalIndex:e.index,currentSlide:bc(e.slides,e.index)}:t;default:throw new Error(gg)}}function b_({slides:t,index:e,children:n}){const[r,s]=P.useReducer(m_,{slides:t,currentIndex:e,globalIndex:e,currentSlide:bc(t,e)}),[o,i]=P.useState(t),[a,l]=P.useState(e);(t!==o||e!==a)&&(i(t),l(e),s({type:"update",slides:t,index:e}));const c=P.useMemo(()=>({...r,state:r,dispatch:s}),[r,s]);return P.createElement(Eg.Provider,{value:s},P.createElement(_g.Provider,{value:c},n))}const Mg=P.createContext(null),y_=an("useRTLContext","RTLContext",Mg);function v_({isRTL:t,children:e}){const n=P.useMemo(()=>({isRTL:t}),[t]);return P.createElement(Mg.Provider,{value:n},e)}const Ng=P.createContext(null),oo=an("useTimeouts","TimeoutsContext",Ng);function x_({children:t}){const[e]=P.useState([]);P.useEffect(()=>()=>{e.forEach(r=>window.clearTimeout(r)),e.splice(0,e.length)},[e]);const n=P.useMemo(()=>{const r=i=>{e.splice(0,e.length,...e.filter(a=>a!==i))};return{setTimeout:(i,a)=>{const l=window.setTimeout(()=>{r(l),i()},a);return e.push(l),l},clearTimeout:i=>{i!==void 0&&(r(i),window.clearTimeout(i))}}},[e]);return P.createElement(Ng.Provider,{value:n},t)}const os=P.forwardRef(function({label:e,className:n,icon:r,renderIcon:s,onClick:o,style:i,...a},l){const{styles:c,labels:d}=Ot(),u=mr(d,e);return P.createElement("button",{ref:l,type:"button",title:u,"aria-label":u,className:Ft(Ne(o_),n),onClick:o,style:{...i,...c.button},...a},s?s():P.createElement(r,{className:Ne(Li),style:c.icon}))});function Og(t,e){const n=r=>P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...r},e);return n.displayName=t,n}function Zt(t,e){return Og(t,P.createElement("g",{fill:"currentColor"},P.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),e))}function w_(t,e){return Og(t,P.createElement(P.Fragment,null,P.createElement("defs",null,P.createElement("mask",{id:"strike"},P.createElement("path",{d:"M0 0h24v24H0z",fill:"white"}),P.createElement("path",{d:"M0 0L24 24",stroke:"black",strokeWidth:4}))),P.createElement("path",{d:"M0.70707 2.121320L21.878680 23.292883",stroke:"currentColor",strokeWidth:2}),P.createElement("g",{fill:"currentColor",mask:"url(#strike)"},P.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),e)))}const k_=Zt("Close",P.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),C_=Zt("Previous",P.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),S_=Zt("Next",P.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),__=Zt("Loading",P.createElement(P.Fragment,null,Array.from({length:8}).map((t,e,n)=>P.createElement("line",{key:e,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/n.length*(e+1),transform:`rotate(${360/n.length*e}, 12, 12)`})))),E_=Zt("Error",P.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),Cn=uc()?P.useLayoutEffect:P.useEffect;function xc(){const[t,e]=P.useState(!1);return P.useEffect(()=>{var n,r;const s=(n=window.matchMedia)===null||n===void 0?void 0:n.call(window,"(prefers-reduced-motion: reduce)");e(s?.matches);const o=i=>e(i.matches);return(r=s?.addEventListener)===null||r===void 0||r.call(s,"change",o),()=>{var i;return(i=s?.removeEventListener)===null||i===void 0?void 0:i.call(s,"change",o)}},[]),t}function M_(t){let e=0,n=0,r=0;const o=window.getComputedStyle(t).transform.match(/matrix.*\((.+)\)/);if(o){const i=o[1].split(",").map(Pi);i.length===6?(e=i[4],n=i[5]):i.length===16&&(e=i[12],n=i[13],r=i[14])}return{x:e,y:n,z:r}}function wc(t,e){const n=P.useRef(void 0),r=P.useRef(void 0),s=xc();return Cn(()=>{var o,i,a;if(t.current&&n.current!==void 0&&!s){const{keyframes:l,duration:c,easing:d,onfinish:u}=e(n.current,t.current.getBoundingClientRect(),M_(t.current))||{};if(l&&c){(o=r.current)===null||o===void 0||o.cancel(),r.current=void 0;try{r.current=(a=(i=t.current).animate)===null||a===void 0?void 0:a.call(i,l,{duration:c,easing:d})}catch(f){console.error(f)}r.current&&(r.current.onfinish=()=>{r.current=void 0,u?.()})}}n.current=void 0}),{prepareAnimation:o=>{n.current=o},isAnimationPlaying:()=>{var o;return((o=r.current)===null||o===void 0?void 0:o.playState)==="running"}}}function Tg(){const t=P.useRef(null),e=P.useRef(void 0),[n,r]=P.useState();return{setContainerRef:P.useCallback(o=>{t.current=o,e.current&&(e.current.disconnect(),e.current=void 0);const i=()=>{if(o){const a=window.getComputedStyle(o),l=c=>parseFloat(c)||0;r({width:Math.round(o.clientWidth-l(a.paddingLeft)-l(a.paddingRight)),height:Math.round(o.clientHeight-l(a.paddingTop)-l(a.paddingBottom))})}else r(void 0)};i(),o&&typeof ResizeObserver<"u"&&(e.current=new ResizeObserver(i),e.current.observe(o))},[]),containerRef:t,containerRect:n}}function zi(){const t=P.useRef(void 0),{setTimeout:e,clearTimeout:n}=oo();return P.useCallback((r,s)=>{n(t.current),t.current=e(r,s>0?s:0)},[e,n])}function Ge(t){const e=P.useRef(t);return Cn(()=>{e.current=t}),P.useCallback((...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Ag(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function kc(t,e){return P.useMemo(()=>t==null&&e==null?null:n=>{Ag(t,n),Ag(e,n)},[t,e])}function Dg(t,e=!1){const n=P.useRef(!1);Cn(()=>{e&&n.current&&(n.current=!1,t())},[e,t]);const r=P.useCallback(()=>{n.current=!0},[]),s=P.useCallback(()=>{n.current=!1},[]);return{onFocus:r,onBlur:s}}function Vi(){return y_().isRTL}function Ig(){const[t]=P.useState({}),e=P.useCallback((s,o)=>{var i;(i=t[s])===null||i===void 0||i.forEach(a=>{o.isPropagationStopped()||a(o)})},[t]),n=P.useMemo(()=>({onPointerDown:s=>e(ag,s),onPointerMove:s=>e(lg,s),onPointerUp:s=>e(cg,s),onPointerLeave:s=>e(dg,s),onPointerCancel:s=>e(ug,s),onKeyDown:s=>e(cc,s),onKeyUp:s=>e(t_,s),onWheel:s=>e(dc,s)}),[e]),r=P.useCallback((s,o)=>(t[s]||(t[s]=[]),t[s].unshift(o),()=>{const i=t[s];i&&i.splice(0,i.length,...i.filter(a=>a!==o))}),[t]);return{registerSensors:n,subscribeSensors:r}}function Lg(t,e){const n=P.useRef(0),r=zi(),s=Ge((...o)=>{n.current=Date.now(),t(o)});return P.useCallback((...o)=>{r(()=>{s(o)},e-(Date.now()-n.current))},[e,s,r])}const Cc=pr("slide"),Sc=pr("slide_image");function br({slide:t,offset:e,render:n,rect:r,imageFit:s,imageProps:o,onClick:i,onLoad:a,onError:l,style:c}){var d,u,f,g,m,p,y,b;const[S,x]=P.useState(Jr),{publish:E}=ss(),{setTimeout:k}=oo(),C=P.useRef(null);P.useEffect(()=>{e===0&&E(so(S))},[e,S,E]);const N=Ge(U=>{("decode"in U?U.decode():Promise.resolve()).catch(()=>{}).then(()=>{U.parentNode&&(x(ro),k(()=>{a?.(U)},0))})}),_=P.useCallback(U=>{C.current=U,U?.complete&&N(U)},[N]),w=P.useCallback(U=>{N(U.currentTarget)},[N]),M=Ge(()=>{x(no),l?.()}),O=hc(t,s),L=(U,B)=>Number.isFinite(U)?U:B,F=L(Math.max(...((u=(d=t.srcSet)===null||d===void 0?void 0:d.map(U=>U.width))!==null&&u!==void 0?u:[]).concat(t.width?[t.width]:[]).filter(Boolean)),((f=C.current)===null||f===void 0?void 0:f.naturalWidth)||0),$=L(Math.max(...((m=(g=t.srcSet)===null||g===void 0?void 0:g.map(U=>U.height))!==null&&m!==void 0?m:[]).concat(t.height?[t.height]:[]).filter(Boolean)),((p=C.current)===null||p===void 0?void 0:p.naturalHeight)||0),D=F&&$?{maxWidth:`min(${F}px, 100%)`,maxHeight:`min(${$}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},A=(y=t.srcSet)===null||y===void 0?void 0:y.slice().sort((U,B)=>U.width-B.width).map(U=>`${U.src} ${U.width}w`).join(", "),T=()=>r&&!O&&t.width&&t.height?r.height/t.height*t.width:Number.MAX_VALUE,z=A&&r&&uc()?`${Math.round(Math.min(T(),r.width))}px`:void 0,{style:H,className:W,...j}=(typeof o=="function"?o(t):o)||{};return P.createElement(P.Fragment,null,P.createElement("img",{ref:_,onLoad:w,onError:M,onClick:i,draggable:!1,className:Ft(Ne(Sc()),O&&Ne(Sc("cover")),S!==ro&&Ne(Sc("loading")),W),style:{...D,...c,...H},...j,alt:(b=t.alt)!==null&&b!==void 0?b:"",sizes:z,srcSet:A,src:t.src}),S!==ro&&P.createElement("div",{className:Ne(Cc(KS))},S===Jr&&(n?.iconLoading?n.iconLoading():P.createElement(__,{className:Ft(Ne(Li),Ne(Cc(Jr)))})),S===no&&(n?.iconError?n.iconError():P.createElement(E_,{className:Ft(Ne(Li),Ne(Cc(no)))}))))}const N_=P.forwardRef(function({className:e,children:n,onFocus:r,onBlur:s,...o},i){const a=P.useRef(null),[l,c]=P.useState(!1),{trackFocusWithin:d}=vc(),u=Ge(()=>{if(a.current){const f=window.getComputedStyle(a.current).direction==="rtl";f!==l&&c(f)}});return P.useEffect(u),P.createElement(h_,{nodeRef:a},P.createElement(v_,{isRTL:l},P.createElement("div",{ref:kc(i,a),className:Ft(Ne("root"),e),...d(r,s),...o},n)))});var zt;(function(t){t[t.NONE=0]="NONE",t[t.SWIPE=1]="SWIPE",t[t.PULL=2]="PULL",t[t.ANIMATION=3]="ANIMATION"})(zt||(zt={}));function Pg(t,e,n,r,s){P.useEffect(()=>s?()=>{}:ts(t(ag,e),t(lg,n),t(cg,r),t(dg,r),t(ug,r)),[t,e,n,r,s])}var Sn;(function(t){t[t.NONE=0]="NONE",t[t.SWIPE=1]="SWIPE",t[t.PULL=2]="PULL"})(Sn||(Sn={}));const _c=30;function O_({disableSwipeNavigation:t,closeOnBackdropClick:e},n,r,s,o,i,a,l,c,d,u,f,g,m,p,y){const b=P.useRef(0),S=P.useRef([]),x=P.useRef(void 0),E=P.useRef(0),k=P.useRef(Sn.NONE),C=P.useCallback(F=>{x.current===F.pointerId&&(x.current=void 0,k.current=Sn.NONE);const $=S.current;$.splice(0,$.length,...$.filter(D=>D.pointerId!==F.pointerId))},[]),N=P.useCallback(F=>{C(F),F.persist(),S.current.push(F)},[C]),_=P.useCallback(F=>S.current.find(({pointerId:$})=>F.pointerId===$),[]),w=Ge(F=>{N(F)}),M=(F,$)=>u&&F>$||d&&F<-$,O=Ge(F=>{const $=_(F);if($)if(x.current===F.pointerId){const D=Date.now()-E.current,A=b.current;k.current===Sn.SWIPE?Math.abs(A)>.3*s||Math.abs(A)>5&&D<o?l(A,D):c(A):k.current===Sn.PULL&&(M(A,2*_c)?m(A,D):p(A)),b.current=0,k.current=Sn.NONE}else{const{target:D}=F;e&&D instanceof HTMLElement&&D===$.target&&(D.classList.contains(Ne(ac))||D.classList.contains(Ne(ig)))&&y()}C(F)}),L=Ge(F=>{const $=_(F);if($){const D=x.current===F.pointerId;if(F.buttons===0){D&&b.current!==0?O(F):C($);return}const A=F.clientX-$.clientX,T=F.clientY-$.clientY;if(x.current===void 0){const z=H=>{N(F),x.current=F.pointerId,E.current=Date.now(),k.current=H};Math.abs(A)>Math.abs(T)&&Math.abs(A)>_c&&r(A)?t||(z(Sn.SWIPE),i()):Math.abs(T)>Math.abs(A)&&M(T,_c)&&(z(Sn.PULL),f())}else D&&(k.current===Sn.SWIPE?(b.current=A,a(A)):k.current===Sn.PULL&&(b.current=T,g(T)))}});Pg(n,w,L,O)}function T_({preventDefaultWheelX:t,preventDefaultWheelY:e}){const n=P.useRef(null),r=Ge(s=>{const o=Math.abs(s.deltaX)>Math.abs(s.deltaY);(o&&t||!o&&e||s.ctrlKey)&&s.preventDefault()});return P.useCallback(s=>{var o;s?s.addEventListener("wheel",r,{passive:!1}):(o=n.current)===null||o===void 0||o.removeEventListener("wheel",r),n.current=s},[r])}function A_(t,e,n,r,s,o,i,a,l){const c=P.useRef(0),d=P.useRef(0),u=P.useRef(void 0),f=P.useRef(void 0),g=P.useRef(0),m=P.useRef(void 0),p=P.useRef(0),{setTimeout:y,clearTimeout:b}=oo(),S=P.useCallback(()=>{u.current&&(b(u.current),u.current=void 0)},[b]),x=P.useCallback(()=>{f.current&&(b(f.current),f.current=void 0)},[b]),E=Ge(()=>{t!==zt.SWIPE&&(c.current=0,p.current=0,S(),x())});P.useEffect(E,[t,E]);const k=Ge(N=>{f.current=void 0,c.current===N&&l(c.current)}),C=Ge(N=>{if(N.ctrlKey||Math.abs(N.deltaY)>Math.abs(N.deltaX))return;const _=w=>{g.current=w,b(m.current),m.current=w>0?y(()=>{g.current=0,m.current=void 0},300):void 0};if(t===zt.NONE){if(Math.abs(N.deltaX)<=1.2*Math.abs(g.current)){_(N.deltaX);return}if(!n(-N.deltaX))return;if(d.current+=N.deltaX,S(),Math.abs(d.current)>30)d.current=0,_(0),p.current=Date.now(),o();else{const w=d.current;u.current=y(()=>{u.current=void 0,w===d.current&&(d.current=0)},s)}}else if(t===zt.SWIPE){let w=c.current-N.deltaX;if(w=Math.min(Math.abs(w),r)*Math.sign(w),c.current=w,i(w),x(),Math.abs(w)>.2*r){_(N.deltaX),a(w,Date.now()-p.current);return}f.current=y(()=>k(w),2*s)}else _(N.deltaX)});P.useEffect(()=>e(dc,C),[e,C])}const $g=pr("container"),Fg=P.createContext(null),_n=an("useController","ControllerContext",Fg);function D_({children:t,...e}){var n;const{carousel:r,animation:s,controller:o,on:i,styles:a,render:l}=e,{closeOnPullUp:c,closeOnPullDown:d,preventDefaultWheelX:u,preventDefaultWheelY:f}=o,[g,m]=P.useState(),p=fn(),y=p_(),[b,S]=P.useState(zt.NONE),x=P.useRef(0),E=P.useRef(0),k=P.useRef(1),{registerSensors:C,subscribeSensors:N}=Ig(),{subscribe:_,publish:w}=ss(),M=zi(),O=zi(),L=zi(),{containerRef:F,setContainerRef:$,containerRect:D}=Tg(),A=kc(T_({preventDefaultWheelX:u,preventDefaultWheelY:f}),$),T=P.useRef(null),z=kc(T,void 0),{getOwnerDocument:H}=rs(),W=Vi(),j=se=>(W?-1:1)*(typeof se=="number"?se:1),U=Ge(()=>{var se;return(se=F.current)===null||se===void 0?void 0:se.focus()}),B=Ge(()=>e),G=Ge(()=>p),V=P.useCallback(se=>w(nr,se),[w]),K=P.useCallback(se=>w(rr,se),[w]),X=P.useCallback(()=>w(es),[w]),Z=se=>!(r.finite&&(j(se)>0&&p.currentIndex===0||j(se)<0&&p.currentIndex===p.slides.length-1)),ee=se=>{var Oe;x.current=se,(Oe=F.current)===null||Oe===void 0||Oe.style.setProperty(dt("swipe_offset"),`${Math.round(se)}px`)},ne=se=>{var Oe,Pe;E.current=se,k.current=(()=>{const st=d&&se>0?se:c&&se<0?-se:0;return Math.min(Math.max(fc(1-st/60*(1-.5),2),.5),1)})(),(Oe=F.current)===null||Oe===void 0||Oe.style.setProperty(dt("pull_offset"),`${Math.round(se)}px`),(Pe=F.current)===null||Pe===void 0||Pe.style.setProperty(dt("pull_opacity"),`${k.current}`)},{prepareAnimation:he}=wc(T,(se,Oe,Pe)=>{if(T.current&&D)return{keyframes:[{transform:`translate(0, ${se.rect.y-Oe.y+Pe.y}px)`,opacity:se.opacity},{transform:"translate(0, 0)",opacity:1}],duration:se.duration,easing:s.easing.fade}}),J=(se,Oe)=>{if(c||d){ne(se);let Pe=0;T.current&&(Pe=s.fade*(Oe?2:1),he({rect:T.current.getBoundingClientRect(),opacity:k.current,duration:Pe})),L(()=>{ne(0),S(zt.NONE)},Pe),S(zt.ANIMATION),Oe||X()}},{prepareAnimation:ce,isAnimationPlaying:ue}=wc(T,(se,Oe,Pe)=>{var Ie;if(T.current&&D&&(!((Ie=p.animation)===null||Ie===void 0)&&Ie.duration)){const je=$i(r.spacing),st=(je.percent?je.percent*D.width/100:je.pixel)||0;return{keyframes:[{transform:`translate(${j(p.globalIndex-se.index)*(D.width+st)+se.rect.x-Oe.x+Pe.x}px, 0)`},{transform:"translate(0, 0)"}],duration:p.animation.duration,easing:p.animation.easing}}}),ae=Ge(se=>{var Oe,Pe;const Ie=se.offset||0,je=Ie?s.swipe:(Oe=s.navigation)!==null&&Oe!==void 0?Oe:s.swipe,st=!Ie&&!ue()?s.easing.navigation:s.easing.swipe;let{direction:ut}=se;const We=(Pe=se.count)!==null&&Pe!==void 0?Pe:1;let et=zt.ANIMATION,Xe=je*We;if(!ut){const ge=D?.width,pe=se.duration||0,me=ge?je/ge*Math.abs(Ie):je;We!==0?(pe<me?Xe=Xe/me*Math.max(pe,me/5):ge&&(Xe=je/ge*(ge-Math.abs(Ie))),ut=j(Ie)>0?nr:rr):Xe=je/2}let te=0;ut===nr?Z(j(1))?te=-We:(et=zt.NONE,Xe=je):ut===rr&&(Z(j(-1))?te=We:(et=zt.NONE,Xe=je)),Xe=Math.round(Xe),O(()=>{ee(0),S(zt.NONE)},Xe),T.current&&ce({rect:T.current.getBoundingClientRect(),index:p.globalIndex}),S(et),w(lc,{type:"swipe",increment:te,duration:Xe,easing:st})});P.useEffect(()=>{var se,Oe;!((se=p.animation)===null||se===void 0)&&se.increment&&(!((Oe=p.animation)===null||Oe===void 0)&&Oe.duration)&&M(()=>y({type:"swipe",increment:0}),p.animation.duration)},[p.animation,y,M]);const ve=[N,Z,D?.width||0,s.swipe,()=>S(zt.SWIPE),se=>ee(se),(se,Oe)=>ae({offset:se,duration:Oe,count:1}),se=>ae({offset:se,count:0})],fe=[()=>{d&&S(zt.PULL)},se=>ne(se),se=>J(se),se=>J(se,!0)];O_(o,...ve,c,d,...fe,X),A_(b,...ve);const ye=Ge(()=>{o.focus&&H().querySelector(`.${Ne(oc)} .${Ne($g())}`)&&U()});P.useEffect(ye,[ye]);const ke=Ge(()=>{var se;(se=i.view)===null||se===void 0||se.call(i,{index:p.currentIndex})});P.useEffect(ke,[p.globalIndex,ke]),P.useEffect(()=>ts(_(nr,se=>ae({direction:nr,...se})),_(rr,se=>ae({direction:rr,...se})),_(lc,se=>y(se))),[_,ae,y]);const Ue=P.useMemo(()=>({prev:V,next:K,close:X,focus:U,slideRect:D?i_(D,r.padding):{width:0,height:0},containerRect:D||{width:0,height:0},subscribeSensors:N,containerRef:F,setCarouselRef:z,toolbarWidth:g,setToolbarWidth:m}),[V,K,X,U,N,D,F,z,g,m,r.padding]);return P.useImperativeHandle(o.ref,()=>({prev:V,next:K,close:X,focus:U,getLightboxProps:B,getLightboxState:G}),[V,K,X,U,B,G]),P.createElement("div",{ref:A,className:Ft(Ne($g()),Ne(Rr)),style:{...b===zt.SWIPE?{[dt("swipe_offset")]:`${Math.round(x.current)}px`}:null,...b===zt.PULL?{[dt("pull_offset")]:`${Math.round(E.current)}px`,[dt("pull_opacity")]:`${k.current}`}:null,...o.touchAction!=="none"?{[dt("controller_touch_action")]:o.touchAction}:null,...a.container},tabIndex:-1,...C},D&&P.createElement(Fg.Provider,{value:Ue},t,(n=l.controls)===null||n===void 0?void 0:n.call(l)))}const I_=un(Rs,D_);function yr(t){return gr(eg,t)}function zg(t){return gr(ac,t)}function L_({slide:t,offset:e}){const n=P.useRef(null),{currentIndex:r,slides:s}=fn(),{slideRect:o,focus:i}=_n(),{render:a,carousel:{imageFit:l,imageProps:c},on:{click:d},styles:{slide:u},labels:f}=Ot(),{getOwnerDocument:g}=rs(),m=e!==0;P.useEffect(()=>{var y;m&&(!((y=n.current)===null||y===void 0)&&y.contains(g().activeElement))&&i()},[m,i,g]);const p=()=>{var y,b,S,x;let E=(y=a.slide)===null||y===void 0?void 0:y.call(a,{slide:t,offset:e,rect:o});return!E&&sr(t)&&(E=P.createElement(br,{slide:t,offset:e,render:a,rect:o,imageFit:l,imageProps:c,onClick:m?void 0:()=>d?.({index:r})})),E?P.createElement(P.Fragment,null,(b=a.slideHeader)===null||b===void 0?void 0:b.call(a,{slide:t}),((S=a.slideContainer)!==null&&S!==void 0?S:(({children:k})=>k))({slide:t,children:E}),(x=a.slideFooter)===null||x===void 0?void 0:x.call(a,{slide:t})):null};return P.createElement("div",{ref:n,className:Ft(Ne(zg()),!m&&Ne(zg("current")),Ne(Rr)),...c_(m),style:u,role:"group","aria-roledescription":mr(f,"Slide"),"aria-label":mg(f,s,r+e)},p())}function P_(){const t=Ot().styles.slide;return P.createElement("div",{className:Ne(ac),style:t})}function $_({carousel:t,labels:e}){const{slides:n,currentIndex:r,globalIndex:s}=fn(),{setCarouselRef:o}=_n(),{autoPlaying:i,focusWithin:a}=vc(),l=$i(t.spacing),c=$i(t.padding),d=yg(t,n,1),u=[];if(pc(n))for(let f=r-d;f<=r+d;f+=1){const g=mc(n,f),m=s-r+f,p=t.finite&&(f<0||f>n.length-1);u.push(p?{key:m}:{key:[`${m}`,bg(g)].filter(Boolean).join("|"),offset:f-r,slide:g})}return P.createElement("div",{ref:o,className:Ft(Ne(yr()),u.length>0&&Ne(yr("with_slides"))),style:{[`${dt(yr("slides_count"))}`]:u.length,[`${dt(yr("spacing_px"))}`]:l.pixel||0,[`${dt(yr("spacing_percent"))}`]:l.percent||0,[`${dt(yr("padding_px"))}`]:c.pixel||0,[`${dt(yr("padding_percent"))}`]:c.percent||0},role:"region","aria-live":i&&!a?"off":"polite","aria-roledescription":mr(e,"Carousel"),"aria-label":mr(e,"Photo gallery")},u.map(({key:f,slide:g,offset:m})=>g?P.createElement(L_,{key:f,slide:g,offset:m}):P.createElement(P_,{key:f})))}const F_=un(eg,$_);function Vg(){const{carousel:t}=Ot(),{slides:e,currentIndex:n}=fn(),r=e.length===0||t.finite&&n===0,s=e.length===0||t.finite&&n===e.length-1;return{prevDisabled:r,nextDisabled:s}}function Hg(t){var e;const n=Vi(),{publish:r}=ss(),{animation:s,controller:o}=Ot(),{prevDisabled:i,nextDisabled:a}=Vg(),l=((e=s.navigation)!==null&&e!==void 0?e:s.swipe)/2,c=Lg(()=>r(nr),l),d=Lg(()=>r(rr),l),u=Ge(f=>{switch(f.key){case n_:if(!o.closeOnEscape)return;r(es);break;case r_:(n?a:i)||(n?d:c)();break;case s_:(n?i:a)||(n?c:d)();break;default:return}f.stopPropagation()});P.useEffect(()=>t(cc,u),[t,u])}function Ug({label:t,icon:e,renderIcon:n,action:r,onClick:s,disabled:o,style:i}){return P.createElement(os,{label:t,icon:e,renderIcon:n,className:Ne(`navigation_${r}`),disabled:o,onClick:s,style:i,...Dg(_n().focus,o)})}function z_({render:{buttonPrev:t,buttonNext:e,iconPrev:n,iconNext:r},styles:s}){const{prev:o,next:i,subscribeSensors:a}=_n(),{prevDisabled:l,nextDisabled:c}=Vg();return Hg(a),P.createElement(P.Fragment,null,t?t():P.createElement(Ug,{label:"Previous",action:nr,icon:C_,renderIcon:n,style:s.navigationPrev,disabled:l,onClick:o}),e?e():P.createElement(Ug,{label:"Next",action:rr,icon:S_,renderIcon:r,style:s.navigationNext,disabled:c,onClick:i}))}const V_=un(WS,z_),Bg=Ne(RS),H_=Ne(og);function U_(t){return"style"in t}function jg(t,e,n){const r=window.getComputedStyle(t),s=n?"padding-left":"padding-right",o=n?r.paddingLeft:r.paddingRight,i=t.style.getPropertyValue(s);return t.style.setProperty(s,`${(Pi(o)||0)+e}px`),()=>{i?t.style.setProperty(s,i):t.style.removeProperty(s)}}function B_({noScroll:{disabled:t},children:e}){const n=Vi(),{getOwnerDocument:r,getOwnerWindow:s}=rs();return P.useEffect(()=>{if(t)return()=>{};const o=[],i=s(),{body:a,documentElement:l}=r(),c=Math.round(i.innerWidth-l.clientWidth);if(c>0){o.push(jg(a,c,n));const d=a.getElementsByTagName("*");for(let u=0;u<d.length;u+=1){const f=d[u];U_(f)&&i.getComputedStyle(f).getPropertyValue("position")==="fixed"&&!f.classList.contains(H_)&&o.push(jg(f,c,n))}}return a.classList.add(Bg),()=>{a.classList.remove(Bg),o.forEach(d=>d())}},[n,t,r,s]),P.createElement(P.Fragment,null,e)}const j_=un(GS,B_);function Wg(t){return gr(oc,t)}function Gg(t,e,n){const r=t.getAttribute(e);return t.setAttribute(e,n),()=>{r?t.setAttribute(e,r):t.removeAttribute(e)}}function W_({portal:{root:t,container:{className:e,style:n,...r}={}},animation:s,styles:o,className:i,on:a,close:l,labels:c,children:d}){const[u,f]=P.useState(!1),[g,m]=P.useState(!1),p=P.useRef([]),y=P.useRef(null),{setTimeout:b}=oo(),{subscribe:S}=ss(),E=xc()?0:s.fade;P.useEffect(()=>(f(!0),()=>{f(!1),m(!1)}),[]);const k=Ge(()=>{p.current.forEach(w=>w()),p.current=[]}),C=Ge(()=>{var w;m(!1),k(),(w=a.exiting)===null||w===void 0||w.call(a),b(()=>{var M;(M=a.exited)===null||M===void 0||M.call(a),l()},E)});P.useEffect(()=>S(es,C),[S,C]);const N=Ge(w=>{var M,O,L;d_(w),m(!0),(M=a.entering)===null||M===void 0||M.call(a);const F=(L=(O=w.parentNode)===null||O===void 0?void 0:O.children)!==null&&L!==void 0?L:[];for(let $=0;$<F.length;$+=1){const D=F[$];["TEMPLATE","SCRIPT","STYLE"].indexOf(D.tagName)===-1&&D!==w&&(p.current.push(Gg(D,"inert","")),p.current.push(Gg(D,"aria-hidden","true")))}p.current.push(()=>{var $,D;(D=($=y.current)===null||$===void 0?void 0:$.focus)===null||D===void 0||D.call($)}),b(()=>{var $;($=a.entered)===null||$===void 0||$.call(a)},E)}),_=P.useCallback(w=>{w?N(w):k()},[N,k]);return u?On.createPortal(P.createElement(N_,{ref:_,className:Ft(i,e,Ne(Wg()),Ne(og),g&&Ne(Wg("open"))),"aria-modal":!0,role:"dialog","aria-label":mr(c,"Lightbox"),style:{...s.fade!==yc.animation.fade?{[dt("fade_animation_duration")]:`${E}ms`}:null,...s.easing.fade!==yc.animation.easing.fade?{[dt("fade_animation_timing_function")]:s.easing.fade}:null,...o.root,...n},onFocus:w=>{y.current||(y.current=w.relatedTarget)},...r},d),(typeof t=="function"?t():t)||document.body):null}const G_=un(oc,W_);function Y_({children:t}){return P.createElement(P.Fragment,null,t)}const X_=un(YS,Y_);function K_(t){return gr(tg,t)}function q_({toolbar:{buttons:t},render:{buttonClose:e,iconClose:n},styles:r}){const{close:s,setToolbarWidth:o}=_n(),{setContainerRef:i,containerRect:a}=Tg();Cn(()=>{o(a?.width)},[o,a?.width]);const l=()=>e?e():P.createElement(os,{key:es,label:"Close",icon:k_,renderIcon:n,onClick:s});return P.createElement("div",{ref:i,style:r.toolbar,className:Ne(K_())},t?.map(c=>c===es?l():c))}const Z_=un(tg,q_);function Yg(t,e){var n;return P.createElement(t.module.component,{key:t.module.name,...e},(n=t.children)===null||n===void 0?void 0:n.map(r=>Yg(r,e)))}function Q_(t,e={}){const{easing:n,...r}=t,{easing:s,...o}=e;return{easing:{...n,...s},...r,...o}}function J_({carousel:t,animation:e,render:n,toolbar:r,controller:s,noScroll:o,on:i,plugins:a,slides:l,index:c,...d}){const{animation:u,carousel:f,render:g,toolbar:m,controller:p,noScroll:y,on:b,slides:S,index:x,plugins:E,...k}=yc,{config:C,augmentation:N}=u_([Nt(G_,[Nt(j_,[Nt(I_,[Nt(F_),Nt(Z_),Nt(V_)])])])],a||E),_=N({animation:Q_(u,e),carousel:{...f,...t},render:{...g,...n},toolbar:{...m,...r},controller:{...p,...s},noScroll:{...y,...o},on:{...b,...i},...k,...d});return _.open?P.createElement(Sg,{..._},P.createElement(b_,{slides:l||S,index:Pi(c||x)},P.createElement(x_,null,P.createElement(g_,null,P.createElement(f_,null,Yg(Nt(X_,C),_)))))):null}const Xg={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1,maxZoom:8};function R_(t){return Math.min(Math.max(t,Number.EPSILON),1)}function Kg(t){const{minZoom:e,...n}={...Xg,...t};return{minZoom:R_(e),...n}}function e2(t,e,n,r){const s=P.useRef(void 0),o=P.useRef(void 0),{zoom:i}=Ot().animation,a=xc(),l=Ge(()=>{var c,d,u;if((c=s.current)===null||c===void 0||c.cancel(),s.current=void 0,o.current&&r?.current){try{s.current=(u=(d=r.current).animate)===null||u===void 0?void 0:u.call(d,[{transform:o.current},{transform:`scale(${t}) translateX(${e}px) translateY(${n}px)`}],{duration:a?0:i??500,easing:s.current?"ease-out":"ease-in-out"})}catch(f){console.error(f)}o.current=void 0,s.current&&(s.current.onfinish=()=>{s.current=void 0})}});return Cn(l,[t,e,n,l]),P.useCallback(()=>{o.current=r?.current?window.getComputedStyle(r.current).transform:void 0},[r])}function t2(t,e){const{on:n}=Ot(),r=Ge(()=>{var s;e||(s=n.zoom)===null||s===void 0||s.call(n,{zoom:t})});P.useEffect(r,[t,r])}function Hi(){const{zoom:t}=Ot();return Kg(t)}function n2(t,e){var n;const r=typeof t=="function"?(n=t(e))!==null&&n!==void 0?n:Xg.maxZoom:t;return Math.max(r,1)}function r2(t,e){var n,r;let s={width:0,height:0},o={width:0,height:0};const{currentSlide:i}=fn(),{imageFit:a}=Ot().carousel,{maxZoomPixelRatio:l,maxZoom:c}=Hi();if(t&&i){const u={...i,...e};if(sr(u)){const f=hc(u,a),g=Math.max(...(((n=u.srcSet)===null||n===void 0?void 0:n.map(p=>p.width))||[]).concat(u.width?[u.width]:[])),m=Math.max(...(((r=u.srcSet)===null||r===void 0?void 0:r.map(p=>p.height))||[]).concat(u.height?[u.height]:[]));g>0&&m>0&&t.width>0&&t.height>0&&(o=f?{width:Math.round(Math.min(g,t.width/t.height*m)),height:Math.round(Math.min(m,t.height/t.width*g))}:{width:g,height:m},o={width:o.width*l,height:o.height*l},s=f?{width:Math.min(t.width,o.width,g),height:Math.min(t.height,o.height,m)}:{width:Math.round(Math.min(t.width,t.height/m*g,g)),height:Math.round(Math.min(t.height,t.width/g*m,m))})}else t.width>0&&t.height>0&&(e&&e.width>0&&e.height>0?s={width:Math.min(t.width,e.width),height:Math.min(t.height,e.height)}:s={width:t.width,height:t.height})}const d=i&&s.width?sr(i)?Math.max(fc(o.width/s.width,5),1):n2(c,i):1;return{imageRect:s,maxZoom:d}}function qg(t,e){return Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)}function Zg(t,e,n=100,r=2){return t*Math.min(1+Math.abs(e/n),r)**Math.sign(e)}function s2(t,e,n,r,s,o,i,a,l){const c=P.useRef([]),d=P.useRef(0),u=P.useRef(void 0),{globalIndex:f}=fn(),{getOwnerWindow:g}=rs(),{containerRef:m,subscribeSensors:p}=_n(),{keyboardMoveDistance:y,zoomInMultiplier:b,wheelZoomDistanceFactor:S,scrollToZoom:x,doubleTapDelay:E,doubleClickDelay:k,doubleClickMaxStops:C,pinchZoomDistanceFactor:N,pinchZoomV4:_}=Hi(),w=P.useCallback(z=>{if(m.current){const{pageX:H,pageY:W}=z,{scrollX:j,scrollY:U}=g(),{left:B,top:G,width:V,height:K}=m.current.getBoundingClientRect();return[H-B-j-V/2,W-G-U-K/2]}return[]},[m,g]),M=Ge(z=>{const{key:H,metaKey:W,ctrlKey:j}=z,U=W||j,B=()=>{z.preventDefault(),z.stopPropagation()};if(t>1){const G=(V,K)=>{B(),a(V,K)};H==="ArrowDown"?G(0,y):H==="ArrowUp"?G(0,-y):H==="ArrowLeft"?G(-y,0):H==="ArrowRight"&&G(y,0)}H==="+"||U&&H==="="?(B(),s()):H==="-"||U&&H==="_"?(B(),o()):U&&H==="0"&&(B(),i(1))}),O=Ge(z=>{if((z.ctrlKey||x)&&Math.abs(z.deltaY)>Math.abs(z.deltaX)){z.stopPropagation(),i(Zg(t,-z.deltaY,S),!0,...w(z));return}t>1&&(z.stopPropagation(),x||a(z.deltaX,z.deltaY))}),L=P.useCallback(z=>{const H=c.current;H.splice(0,H.length,...H.filter(W=>W.pointerId!==z.pointerId))},[]),F=P.useCallback(z=>{L(z),z.persist(),c.current.push(z)},[L]),$=Ge(z=>{var H;const W=c.current;if(z.pointerType==="mouse"&&z.buttons>1||!(!((H=l?.current)===null||H===void 0)&&H.contains(z.target)))return;t>1&&z.stopPropagation();const{timeStamp:j}=z;if(W.length===0&&j-d.current<(z.pointerType==="touch"?E:k)){d.current=0;const U=t>=1?t!==n?t*Math.max(n**(1/C),b):1:t!==e?t/Math.max(e**(-1/C),b):1;i(U,!1,...w(z))}else d.current=j;if(F(z),W.length===2){const U=qg(W[0],W[1]);u.current={previousDistance:U,initialDistance:Math.max(U,1),initialZoom:t}}}),D=Ge(z=>{const H=c.current,W=H.find(j=>j.pointerId===z.pointerId);if(H.length===2&&u.current){z.stopPropagation(),F(z);const j=qg(H[0],H[1]),U=_?u.current.initialZoom/u.current.initialDistance*j:Zg(t,j-u.current.previousDistance,N);i(U,!0,...H.map(B=>w(B)).reduce((B,G)=>G.map((V,K)=>B[K]+V/2))),u.current.previousDistance=j;return}t>1&&(z.stopPropagation(),W&&(H.length===1&&a((W.clientX-z.clientX)/t,(W.clientY-z.clientY)/t),F(z)))}),A=P.useCallback(z=>{const H=c.current;H.length===2&&H.find(W=>W.pointerId===z.pointerId)&&(u.current=void 0),L(z)},[L]),T=P.useCallback(()=>{const z=c.current;z.splice(0,z.length),d.current=0,u.current=void 0},[]);Pg(p,$,D,A,r),P.useEffect(T,[f,T]),P.useEffect(()=>r?()=>{}:ts(T,p(cc,M),p(dc,O)),[r,p,T,M,O])}function o2(t,e,n){const[r,s]=P.useState(1),[o,i]=P.useState(0),[a,l]=P.useState(0),c=e2(r,o,a,n),{currentSlide:d,globalIndex:u}=fn(),{containerRect:f,slideRect:g}=_n(),{minZoom:m,zoomInMultiplier:p}=Hi(),y=d&&sr(d)?d.src:void 0,b=!n?.current;Cn(()=>{s(1),i(0),l(0)},[u,y]);const S=P.useCallback((N,_,w)=>{const M=w||r,O=o-(N||0),L=a-(_||0),F=(t.width*M-g.width)/2/M,$=(t.height*M-g.height)/2/M;i(Math.min(Math.abs(O),Math.max(F,0))*Math.sign(O)),l(Math.min(Math.abs(L),Math.max($,0))*Math.sign(L))},[r,o,a,g,t.width,t.height]),x=P.useCallback((N,_,w,M)=>{const O=fc(N+.01<e?N-.01>m?N:m:e,5);_||c(),S(w?w*(1/r-1/O):0,M?M*(1/r-1/O):0,O),s(O)},[r,m,e,S,c]),E=Ge(()=>{r>1&&(r>e&&x(e,!0),S())});Cn(E,[f.width,f.height,E]);const k=P.useCallback(()=>{const N=r*p;x(r<1&&N>1?1:N)},[r,p,x]),C=P.useCallback(()=>{const N=r/p;x(r>1&&N<1?1:N)},[r,p,x]);return{zoom:r,offsetX:o,offsetY:a,disabled:b,changeOffsets:S,changeZoom:x,zoomIn:k,zoomOut:C}}const Qg=P.createContext(null),Ec=an("useZoom","ZoomControllerContext",Qg);function i2({children:t}){const[e,n]=P.useState(),{slideRect:r}=_n(),{ref:s,minZoom:o}=Hi(),{imageRect:i,maxZoom:a}=r2(r,e?.imageDimensions),{zoom:l,offsetX:c,offsetY:d,disabled:u,changeZoom:f,changeOffsets:g,zoomIn:m,zoomOut:p}=o2(i,a,e?.zoomWrapperRef);t2(l,u),s2(l,o,a,u,m,p,f,g,e?.zoomWrapperRef);const y=P.useMemo(()=>({zoom:l,minZoom:o,maxZoom:a,offsetX:c,offsetY:d,disabled:u,zoomIn:m,zoomOut:p,changeZoom:f}),[l,o,a,c,d,u,m,p,f]);P.useImperativeHandle(s,()=>y,[y]);const b=P.useMemo(()=>({...y,setZoomWrapper:n}),[y,n]);return P.createElement(Qg.Provider,{value:b},t)}const a2=Zt("ZoomIn",P.createElement(P.Fragment,null,P.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),P.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),l2=Zt("ZoomOut",P.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),Jg=P.forwardRef(function({zoomIn:e,onLoseFocus:n},r){const s=P.useRef(!1),o=P.useRef(!1),{zoom:i,minZoom:a,maxZoom:l,zoomIn:c,zoomOut:d,disabled:u}=Ec(),{render:f}=Ot(),g=u||(e?i>=l:i<=a);return P.useEffect(()=>{g&&s.current&&o.current&&n(),g||(s.current=!0)},[g,n]),P.createElement(os,{ref:r,disabled:g,label:e?"Zoom in":"Zoom out",icon:e?a2:l2,renderIcon:e?f.iconZoomIn:f.iconZoomOut,onClick:e?c:d,onFocus:()=>{o.current=!0},onBlur:()=>{o.current=!1}})});function c2(){const t=P.useRef(null),e=P.useRef(null),{focus:n}=_n(),r=P.useCallback(i=>{var a,l;!((a=i.current)===null||a===void 0)&&a.disabled?n():(l=i.current)===null||l===void 0||l.focus()},[n]),s=P.useCallback(()=>r(t),[r]),o=P.useCallback(()=>r(e),[r]);return P.createElement(P.Fragment,null,P.createElement(Jg,{zoomIn:!0,ref:t,onLoseFocus:o}),P.createElement(Jg,{ref:e,onLoseFocus:s}))}function d2(){const{render:t}=Ot(),e=Ec();return t.buttonZoom?P.createElement(P.Fragment,null,t.buttonZoom(e)):P.createElement(c2,null)}function u2(t){var e;return(((e=t.srcSet)===null||e===void 0?void 0:e.length)||0)>0}function f2({current:t,preload:e},{type:n,source:r}){switch(n){case"fetch":return t?{current:t,preload:r}:{current:r};case"done":return r===e?{current:r}:{current:t,preload:e};default:throw new Error(gg)}}function h2(t){var e,n;const[{current:r,preload:s},o]=P.useReducer(f2,{}),{slide:i,rect:a,imageFit:l,render:c,interactive:d}=t,u=i.srcSet.sort((k,C)=>k.width-C.width),f=(e=i.width)!==null&&e!==void 0?e:u[u.length-1].width,g=(n=i.height)!==null&&n!==void 0?n:u[u.length-1].height,m=hc(i,l),p=Math.max(...u.map(k=>k.width)),y=Math.min((m?Math.max:Math.min)(a.width,f*(a.height/g)),p),b=a_(),S=Ge(()=>{var k;const C=(k=u.find(N=>N.width>=y*b))!==null&&k!==void 0?k:u[u.length-1];(!r||u.findIndex(N=>N.src===r)<u.findIndex(N=>N===C))&&o({type:"fetch",source:C.src})});Cn(S,[a.width,a.height,b,S]);const x=Ge(k=>o({type:"done",source:k})),E={WebkitTransform:d?"initial":"translateZ(0)"};return m||Object.assign(E,a.width/a.height<f/g?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),P.createElement(P.Fragment,null,s&&s!==r&&P.createElement(br,{key:"preload",...t,offset:void 0,slide:{...i,src:s,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...E},onLoad:()=>x(s),render:{...c,iconLoading:()=>null,iconError:()=>null}}),r&&P.createElement(br,{key:"current",...t,slide:{...i,src:r,srcSet:void 0},style:E}))}function g2({render:t,slide:e,offset:n,rect:r}){var s;const[o,i]=P.useState(),a=P.useRef(null),l=sr(e),{zoom:c,maxZoom:d,offsetX:u,offsetY:f,setZoomWrapper:g}=Ec(),m=c>1,{carousel:p,on:y}=Ot(),{currentIndex:b}=fn();Cn(()=>{if(n!==0||l||!a.current)return()=>{};const x=()=>{const k=a.current;if(!k)return;let C=0,N=0;for(const _ of k.children)_ instanceof HTMLElement&&(C=Math.max(C,_.offsetWidth),N=Math.max(N,_.offsetHeight));i(_=>_&&_.width===C&&_.height===N?_:{width:C,height:N})};if(x(),typeof ResizeObserver>"u")return()=>{};const E=new ResizeObserver(x);for(const k of a.current.children)E.observe(k);return()=>E.disconnect()},[n,l,r]),Cn(()=>n===0?(g({zoomWrapperRef:a,imageDimensions:o}),()=>g(void 0)):()=>{},[n,o,g]);let S=(s=t.slide)===null||s===void 0?void 0:s.call(t,{slide:e,offset:n,rect:r,zoom:c,maxZoom:d});if(!S&&l){const x={slide:e,offset:n,rect:r,render:t,imageFit:p.imageFit,imageProps:p.imageProps,onClick:n===0?()=>{var E;return(E=y.click)===null||E===void 0?void 0:E.call(y,{index:b})}:void 0};S=u2(e)?P.createElement(h2,{...x,slide:e,interactive:m,rect:n===0?{width:r.width*c,height:r.height*c}:r}):P.createElement(br,{onLoad:E=>i({width:E.naturalWidth,height:E.naturalHeight}),...x})}return S?P.createElement("div",{ref:a,className:Ft(Ne(sg),Ne(Rr),Ne(ig),m&&Ne(e_)),style:n===0?{transform:`scale(${c}) translateX(${u}px) translateY(${f}px)`}:void 0},S):null}const p2=({augment:t,addModule:e})=>{t(({zoom:n,toolbar:r,render:s,controller:o,...i})=>{const a=Kg(n);return{zoom:a,toolbar:Fi(r,rg,P.createElement(d2,null)),render:{...s,slide:l=>{var c,d;return sr(l.slide)||l.slide.type!=null&&(!((c=a.supports)===null||c===void 0)&&c.includes(l.slide.type))?P.createElement(g2,{render:s,...l}):(d=s.slide)===null||d===void 0?void 0:d.call(s,l)}},controller:{...o,preventDefaultWheelY:a.scrollToZoom},...i}}),e(un(rg,i2))},m2={separator:"/",container:{}},Rg=t=>({...m2,...t});function b2({counter:t}){const{slides:e,currentIndex:n}=fn(),{separator:r,container:{className:s,...o},className:i,...a}=Rg(t);return e.length===0?null:P.createElement("div",{className:Ft(Ne("counter"),s||i),...a,...o,"aria-hidden":!0},n+1," ",r," ",e.length)}function y2({augment:t,addChild:e}){t(({counter:n,...r})=>({counter:Rg(n),...r})),e(Rs,un(XS,b2))}const v2={autoplay:!1,delay:3e3,ref:null},ep=t=>({...v2,...t}),tp=P.createContext(null),x2=an("useSlideshow","SlideshowContext",tp);function w2({slideshow:t,carousel:{finite:e},on:n,children:r}){const{autoplay:s,delay:o,ref:i}=ep(t),a=P.useRef(s),[l,c]=P.useState(s),d=P.useRef(void 0),u=P.useRef(void 0),{slides:f,currentIndex:g}=fn(),{setTimeout:m,clearTimeout:p}=oo(),{subscribe:y}=ss(),{next:b}=_n(),{setAutoPlaying:S}=vc();P.useEffect(()=>S(l),[l,S]);const x=f.length===0||e&&g===f.length-1,E=P.useCallback(()=>{!l&&!x&&c(!0)},[l,x]),k=P.useCallback(()=>{l&&c(!1)},[l]),C=P.useCallback(()=>{p(d.current),d.current=void 0},[p]),N=Ge(()=>{C(),!(!l||x||u.current===Jr||u.current===ic)&&(d.current=m(()=>{l&&(u.current=void 0,b())},o))});P.useEffect(N,[g,l,N]),P.useEffect(()=>{l&&x&&c(!1)},[g,l,x]);const _=Ge(()=>{var O;return(O=n.slideshowStart)===null||O===void 0?void 0:O.call(n)}),w=Ge(()=>{var O;return(O=n.slideshowStop)===null||O===void 0?void 0:O.call(n)});P.useEffect(()=>{l?_():a.current&&w(),a.current=l},[l,_,w]),P.useEffect(()=>ts(C,y(qS,()=>{u.current=Jr,C()}),y(ZS,()=>{u.current=ic,C()}),y(QS,()=>{u.current=no,N()}),y(JS,()=>{u.current=ro,N()})),[y,C,N]);const M=P.useMemo(()=>({playing:l,disabled:x,play:E,pause:k}),[l,x,E,k]);return P.useImperativeHandle(i,()=>M,[M]),P.createElement(tp.Provider,{value:M},r)}const k2=Zt("Play",P.createElement("path",{d:"M8 5v14l11-7z"})),C2=Zt("Pause",P.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}));function S2(){const{playing:t,disabled:e,play:n,pause:r}=x2(),{render:s}=Ot(),o=Dg(_n().focus,e);return s.buttonSlideshow?P.createElement(P.Fragment,null,s.buttonSlideshow({playing:t,disabled:e,play:n,pause:r})):P.createElement(os,{label:t?"Pause":"Play",icon:t?C2:k2,renderIcon:t?s.iconSlideshowPause:s.iconSlideshowPlay,onClick:t?r:n,disabled:e,...o})}function _2({augment:t,addModule:e}){t(({slideshow:n,toolbar:r,...s})=>({toolbar:Fi(r,ng,P.createElement(S2,null)),slideshow:ep(n),...s})),e(un(ng,w2))}const E2={auto:!1,ref:null},np=t=>({...E2,...t}),rp=P.createContext(null),M2=an("useFullscreen","FullscreenContext",rp);function N2({fullscreen:t,on:e,children:n}){const{auto:r,ref:s}=np(t),o=P.useRef(null),[i,a]=P.useState(),[l,c]=P.useState(!1),d=P.useRef(!1),{getOwnerDocument:u}=rs();Cn(()=>{var x,E,k,C;const N=u();a(!((C=(k=(E=(x=N.fullscreenEnabled)!==null&&x!==void 0?x:N.webkitFullscreenEnabled)!==null&&E!==void 0?E:N.mozFullScreenEnabled)!==null&&k!==void 0?k:N.msFullscreenEnabled)!==null&&C!==void 0&&C))},[u]);const f=P.useCallback(()=>{var x;const E=u(),k=E.fullscreenElement||E.webkitFullscreenElement||E.mozFullScreenElement||E.msFullscreenElement;return((x=k?.shadowRoot)===null||x===void 0?void 0:x.fullscreenElement)||k},[u]),g=P.useCallback(()=>{const x=o.current;try{x.requestFullscreen?x.requestFullscreen().catch(()=>{}):x.webkitRequestFullscreen?x.webkitRequestFullscreen():x.mozRequestFullScreen?x.mozRequestFullScreen():x.msRequestFullscreen&&x.msRequestFullscreen()}catch{}},[]),m=P.useCallback(()=>{if(!f())return;const x=u();try{x.exitFullscreen?x.exitFullscreen().catch(()=>{}):x.webkitExitFullscreen?x.webkitExitFullscreen():x.mozCancelFullScreen?x.mozCancelFullScreen():x.msExitFullscreen&&x.msExitFullscreen()}catch{}},[f,u]);P.useEffect(()=>{const x=u(),E=()=>{c(f()===o.current)};return ts(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(k=>(x.addEventListener(k,E),()=>x.removeEventListener(k,E))))},[f,u]);const p=Ge(()=>{var x;return(x=e.enterFullscreen)===null||x===void 0?void 0:x.call(e)}),y=Ge(()=>{var x;return(x=e.exitFullscreen)===null||x===void 0?void 0:x.call(e)});P.useEffect(()=>{l&&(d.current=!0),d.current&&(l?p:y)()},[l,p,y]);const b=Ge(()=>{var x;return(x=r?g:null)===null||x===void 0||x(),m});P.useEffect(b,[b]);const S=P.useMemo(()=>({fullscreen:l,disabled:i,enter:g,exit:m}),[l,i,g,m]);return P.useImperativeHandle(s,()=>S,[S]),P.createElement("div",{ref:o,className:Ft(Ne(eo),Ne(sg))},P.createElement(rp.Provider,{value:S},n))}const O2=Zt("EnterFullscreen",P.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),T2=Zt("ExitFullscreen",P.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function A2(){var t;const{fullscreen:e,disabled:n,enter:r,exit:s}=M2(),{render:o}=Ot();return n?null:o.buttonFullscreen?P.createElement(P.Fragment,null,(t=o.buttonFullscreen)===null||t===void 0?void 0:t.call(o,{fullscreen:e,disabled:n,enter:r,exit:s})):P.createElement(os,{disabled:n,label:e?"Exit Fullscreen":"Enter Fullscreen",icon:e?T2:O2,renderIcon:e?o.iconExitFullscreen:o.iconEnterFullscreen,onClick:e?s:r})}function D2({augment:t,contains:e,addParent:n}){t(({fullscreen:r,toolbar:s,...o})=>({toolbar:Fi(s,eo,P.createElement(A2,null)),fullscreen:np(r),...o})),n(e(to)?to:Rs,un(eo,N2))}const vr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},Mc=t=>({...vr,...t});function sp(){const{thumbnails:t}=Ot();return Mc(t)}const xr=t=>gr(to,t),Tt=t=>xr(gr("thumbnail",t)),I2=Zt("VideoThumbnail",P.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})),L2=Zt("UnknownThumbnail",P.createElement("path",{d:"M23 18V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zM8.5 12.5l2.5 3.01L14.5 11l4.5 6H5l3.5-4.5z"}));function P2({slide:t,render:e,rect:n,imageFit:r}){var s;const o=(s=e.thumbnail)===null||s===void 0?void 0:s.call(e,{slide:t,render:e,rect:n,imageFit:r});if(o)return o;const i={render:e,rect:n,imageFit:r};if(t.thumbnail)return P.createElement(br,{slide:{src:t.thumbnail},...i});if(sr(t))return P.createElement(br,{slide:t,...i});const a=Ne(Tt(Li));return t.type==="video"?P.createElement(P.Fragment,null,t.poster&&P.createElement(br,{slide:{src:t.poster},...i}),P.createElement(I2,{className:a})):P.createElement(L2,{className:a})}const $2=pr("active"),Nc=pr("fadein"),Oc=pr("fadeout"),F2=pr("placeholder"),op="delay",ip="duration";function z2({slide:t,index:e,onClick:n,fadeIn:r,fadeOut:s,placeholder:o,onLoseFocus:i}){const a=P.useRef(null),{render:l,styles:c,labels:d}=Ot(),{slides:u,globalIndex:f}=fn(),{getOwnerDocument:g}=rs(),{width:m,height:p,imageFit:y}=sp(),b={width:m,height:p},S=e===f,x=Ge(i);return P.useEffect(()=>{s&&g().activeElement===a.current&&x()},[s,x,g]),P.createElement("button",{ref:a,type:"button",className:Ft(Ne(Rr),Ne(Tt()),S&&Ne(Tt($2())),r&&Ne(Tt(Nc())),s&&Ne(Tt(Oc())),o&&Ne(Tt(F2()))),style:{...r?{[dt(Tt(Nc(ip)))]:`${r.duration}ms`,[dt(Tt(Nc(op)))]:`${r.delay}ms`}:null,...s?{[dt(Tt(Oc(ip)))]:`${s.duration}ms`,[dt(Tt(Oc(op)))]:`${s.delay}ms`}:null,...c.thumbnail},onClick:n,"aria-current":S?!0:void 0,"aria-label":mg(d,u,e)},t&&P2({slide:t,render:l,rect:b,imageFit:y}))}function ap(t){return["top","bottom"].includes(t)}function lp(t,e){return e+2*(t.border+t.padding)+t.gap}function V2(t){const{thumbnail:e,poster:n}=t||{thumbnail:"placeholder"};return typeof e=="string"&&e||typeof n=="string"&&n||t&&bg(t)||void 0}function cp({visible:t,containerRef:e}){const n=P.useRef(null),r=Vi(),{publish:s,subscribe:o}=ss(),{carousel:i,styles:a,labels:l}=Ot(),{slides:c,globalIndex:d,animation:u}=fn(),{registerSensors:f,subscribeSensors:g}=Ig();Hg(g);const m=sp(),{position:p,width:y,height:b,border:S,borderStyle:x,borderColor:E,borderRadius:k,padding:C,gap:N,vignette:_}=m,w=u?.duration!==void 0&&u?.increment||0,M=u?.duration||0,{prepareAnimation:O}=wc(n,A=>({keyframes:ap(p)?[{transform:`translateX(${(r?-1:1)*lp(m,y)*w+A}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${lp(m,b)*w+A}px)`},{transform:"translateY(0)"}],duration:M,easing:u?.easing})),L=Ge(()=>{let A=0;if(e.current&&n.current){const T=e.current.getBoundingClientRect(),z=n.current.getBoundingClientRect();A=ap(p)?z.left-T.left-(T.width-z.width)/2:z.top-T.top-(T.height-z.height)/2}O(A)});P.useEffect(()=>ts(o(lc,L)),[o,L]);const F=yg(i,c),$=[];if(pc(c))for(let A=d-F-Math.abs(w);A<=d+F+Math.abs(w);A+=1){const z=i.finite&&(A<0||A>c.length-1)||w<0&&A<d-F||w>0&&A>d+F?null:mc(c,A),H=[`${A}`,V2(z)].filter(Boolean).join("|");$.push({key:H,index:A,slide:z})}const D=A=>()=>{A>d?s(rr,{count:A-d}):A<d&&s(nr,{count:d-A})};return P.createElement("div",{className:Ft(Ne(xr("container")),Ne(Rr)),style:{...t?null:{display:"none"},...y!==vr.width?{[dt(Tt("width"))]:`${y}px`}:null,...b!==vr.height?{[dt(Tt("height"))]:`${b}px`}:null,...S!==vr.border?{[dt(Tt("border"))]:`${S}px`}:null,...x?{[dt(Tt("border_style"))]:x}:null,...E?{[dt(Tt("border_color"))]:E}:null,...k!==vr.borderRadius?{[dt(Tt("border_radius"))]:`${k}px`}:null,...C!==vr.padding?{[dt(Tt("padding"))]:`${C}px`}:null,...N!==vr.gap?{[dt(Tt("gap"))]:`${N}px`}:null,...a.thumbnailsContainer}},P.createElement("nav",{ref:n,style:a.thumbnailsTrack,className:Ft(Ne(xr("track")),Ne(Rr)),"aria-label":mr(l,"Thumbnails"),tabIndex:-1,...f},$.map(({key:A,index:T,slide:z})=>{const H=M/Math.abs(w||1),W=w>0&&T>d+F-w&&T<=d+F||w<0&&T<d-F-w&&T>=d-F?{duration:H,delay:((w>0?T-(d+F-w):d-F-w-T)-1)*H}:void 0,j=w>0&&T<d-F||w<0&&T>d+F?{duration:H,delay:(w>0?w-(d-F-T):-w-(T-(d+F)))*H}:void 0;return P.createElement(z2,{key:A,index:T,slide:z,fadeIn:W,fadeOut:j,placeholder:!z,onClick:D(T),onLoseFocus:()=>{var U;return(U=n.current)===null||U===void 0?void 0:U.focus()}})})),_&&P.createElement("div",{className:Ne(xr("vignette"))}))}const dp=P.createContext(null),H2=an("useThumbnails","ThumbnailsContext",dp);function U2({children:t,...e}){const{ref:n,position:r,hidden:s}=Mc(e.thumbnails),[o,i]=P.useState(!s),a=P.useRef(null),l=P.useMemo(()=>({visible:o,show:()=>i(!0),hide:()=>i(!1)}),[o]);return P.useImperativeHandle(n,()=>l,[l]),P.createElement(Sg,{...e},P.createElement(dp.Provider,{value:l},P.createElement("div",{ref:a,className:Ft(Ne(xr()),Ne(xr(`${r}`)))},["start","top"].includes(r)&&P.createElement(cp,{containerRef:a,visible:o}),P.createElement("div",{className:Ne(xr("wrapper"))},t),["end","bottom"].includes(r)&&P.createElement(cp,{containerRef:a,visible:o}))))}const up=()=>P.createElement(P.Fragment,null,P.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),P.createElement("path",{d:"M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z"})),B2=Zt("ThumbnailsVisible",up()),j2=w_("ThumbnailsHidden",up());function W2(){const{visible:t,show:e,hide:n}=H2(),{render:r}=Ot();return r.buttonThumbnails?P.createElement(P.Fragment,null,r.buttonThumbnails({visible:t,show:e,hide:n})):P.createElement(os,{label:t?"Hide thumbnails":"Show thumbnails",icon:t?B2:j2,renderIcon:t?r.iconThumbnailsVisible:r.iconThumbnailsHidden,onClick:t?n:e})}function G2({augment:t,contains:e,append:n,addParent:r}){t(({thumbnails:o,toolbar:i,...a})=>{const l=Mc(o);return{toolbar:Fi(i,to,l.showToggle?P.createElement(W2,null):null),thumbnails:l,...a}});const s=un(to,U2);e(eo)?n(eo,s):r(Rs,s)}const Y2=window.G7Core?.createLogger?.("Comp:ImageGallery")??{log:(...t)=>console.log("[Comp:ImageGallery]",...t),warn:(...t)=>console.warn("[Comp:ImageGallery]",...t),error:(...t)=>console.error("[Comp:ImageGallery]",...t)},Tc=window.G7Core,Ui=(t,e)=>Tc?.t?.(t,e)??t,X2=async(t,e)=>{try{const n=await Tc.api.get(t,{responseType:"blob"});if(n){const r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r)}}catch(n){Y2.error("Failed to download file:",n),Tc?.toast?.error?.(Ui("common.download_failed"))}},K2=(t,e)=>{const n=document.createElement("a");n.href=t,n.download=e,n.target="_blank",document.body.appendChild(n),n.click(),document.body.removeChild(n)},Ac=async t=>{const e=t.downloadUrl||t.src,n=t.filename||t.title||"image";t.downloadRequiresAuth?await X2(e,n):K2(e,n)},q2=({image:t,index:e,onDownload:n})=>{const[r,s]=v.useState(!1),o=async i=>{if(i.stopPropagation(),n){n(t,e);return}s(!0);try{await Ac(t)}finally{s(!1)}};return h.jsx(oe,{type:"button",onClick:o,disabled:r,className:"yarl__button flex items-center justify-center","aria-label":Ui("common.download"),title:Ui("common.download"),children:r?h.jsx(pt,{className:"fa-solid fa-spinner fa-spin text-white"}):h.jsx(pt,{className:"fa-solid fa-download text-white"})})},Bi=({images:t,isOpen:e,onClose:n,startIndex:r=0,enableZoom:s=!0,enableSlideshow:o=!1,enableFullscreen:i=!0,showCounter:a=!0,showDownload:l=!0,showThumbnails:c=!0,onDownload:d,editorAttrs:u,id:f})=>{const[g,m]=v.useState(r),p=v.useRef(r),y=t.map(x=>({src:x.src,title:x.title,description:x.description})),b=[];s&&b.push(p2),o&&b.push(_2),i&&b.push(D2),a&&b.push(y2),c&&b.push(G2);const S=t[g];if(v.useEffect(()=>{p.current=g},[g]),u){const x=(t??[]).slice(0,4);return h.jsx(I,{id:f,className:"grid grid-cols-2 gap-2 p-3 rounded-lg border border-dashed border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800",...u,children:x.length>0?x.map((E,k)=>h.jsx(yn,{src:E.thumbnail||E.src,alt:E.title||"",className:"w-full aspect-square object-cover rounded bg-gray-200 dark:bg-gray-700"},k)):h.jsxs(I,{className:"col-span-2 flex items-center justify-center py-6 text-sm text-gray-400 dark:text-gray-500",children:[h.jsx(pt,{className:"fa-regular fa-images mr-2"}),Ui("editor.component.image_gallery")]})})}return h.jsx(J_,{open:e,close:n,slides:y,index:g,plugins:b,on:{view:({index:x})=>{x!==p.current&&m(x)}},zoom:{maxZoomPixelRatio:3,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:300,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!0},carousel:{finite:!0,preload:2,padding:"16px",spacing:"30%"},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},controller:{closeOnBackdropClick:!0,closeOnPullDown:!0,closeOnPullUp:!0},thumbnails:{position:"bottom",width:120,height:80,border:2,borderRadius:4,padding:4,gap:16,showToggle:!1,vignette:!0},toolbar:{buttons:[l&&S&&h.jsx(q2,{image:S,index:g,onDownload:d},"download"),"close"].filter(Boolean)},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.9)"}}})},fp=()=>{const[t,e]=v.useState(!1),[n,r]=v.useState([]),[s,o]=v.useState(0),i=v.useCallback((l,c=0)=>{r(l),o(c),e(!0)},[]),a=v.useCallback(()=>{e(!1)},[]);return{isOpen:t,openGallery:i,closeGallery:a,galleryProps:{images:n,isOpen:t,onClose:a,startIndex:s}}};Bi.displayName="ImageGallery";const Z2=Object.freeze(Object.defineProperty({__proto__:null,ImageGallery:Bi,executeImageDownload:Ac,useImageGallery:fp},Symbol.toStringTag,{value:"Module"})),Q2=v.createContext(null),J2=({value:t,children:e})=>h.jsx(Q2.Provider,{value:t,children:e});function R2(t,e){return e.forEach((function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach((function(r){if(r!=="default"&&!(r in t)){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}}))})),Object.freeze(t)}function hp(t,e){return new Promise((function(n,r){let s;return eE(t).then((function(o){try{return s=o,n(new Blob([e.slice(0,2),s,e.slice(2)],{type:"image/jpeg"}))}catch(i){return r(i)}}),r)}))}const eE=t=>new Promise(((e,n)=>{const r=new FileReader;r.addEventListener("load",(({target:{result:s}})=>{const o=new DataView(s);let i=0;if(o.getUint16(i)!==65496)return n("not a valid JPEG");for(i+=2;;){const a=o.getUint16(i);if(a===65498)break;const l=o.getUint16(i+2);if(a===65505&&o.getUint32(i+4)===1165519206){const c=i+10;let d;switch(o.getUint16(c)){case 18761:d=!0;break;case 19789:d=!1;break;default:return n("TIFF header contains invalid endian")}if(o.getUint16(c+2,d)!==42)return n("TIFF header contains invalid version");const u=o.getUint32(c+4,d),f=c+u+2+12*o.getUint16(c+u,d);for(let g=c+u+2;g<f;g+=12)if(o.getUint16(g,d)==274){if(o.getUint16(g+2,d)!==3)return n("Orientation data type is invalid");if(o.getUint32(g+4,d)!==1)return n("Orientation data count is invalid");o.setUint16(g+8,1,d);break}return e(s.slice(i,i+2+l))}i+=2+l}return e(new Blob)})),r.readAsArrayBuffer(t)}));var ji={},tE={get exports(){return ji},set exports(t){ji=t}};(function(t){var e,n,r={};tE.exports=r,r.parse=function(s,o){for(var i=r.bin.readUshort,a=r.bin.readUint,l=0,c={},d=new Uint8Array(s),u=d.length-4;a(d,u)!=101010256;)u--;l=u,l+=4;var f=i(d,l+=4);i(d,l+=2);var g=a(d,l+=2),m=a(d,l+=4);l+=4,l=m;for(var p=0;p<f;p++){a(d,l),l+=4,l+=4,l+=4,a(d,l+=4),g=a(d,l+=4);var y=a(d,l+=4),b=i(d,l+=4),S=i(d,l+2),x=i(d,l+4);l+=6;var E=a(d,l+=8);l+=4,l+=b+S+x,r._readLocal(d,E,c,g,y,o)}return c},r._readLocal=function(s,o,i,a,l,c){var d=r.bin.readUshort,u=r.bin.readUint;u(s,o),d(s,o+=4),d(s,o+=2);var f=d(s,o+=2);u(s,o+=2),u(s,o+=4),o+=4;var g=d(s,o+=8),m=d(s,o+=2);o+=2;var p=r.bin.readUTF8(s,o,g);if(o+=g,o+=m,c)i[p]={size:l,csize:a};else{var y=new Uint8Array(s.buffer,o);if(f==0)i[p]=new Uint8Array(y.buffer.slice(o,o+a));else{if(f!=8)throw"unknown compression method: "+f;var b=new Uint8Array(l);r.inflateRaw(y,b),i[p]=b}}},r.inflateRaw=function(s,o){return r.F.inflate(s,o)},r.inflate=function(s,o){return s[0],s[1],r.inflateRaw(new Uint8Array(s.buffer,s.byteOffset+2,s.length-6),o)},r.deflate=function(s,o){o==null&&(o={level:6});var i=0,a=new Uint8Array(50+Math.floor(1.1*s.length));a[i]=120,a[i+1]=156,i+=2,i=r.F.deflateRaw(s,a,i,o.level);var l=r.adler(s,0,s.length);return a[i+0]=l>>>24&255,a[i+1]=l>>>16&255,a[i+2]=l>>>8&255,a[i+3]=l>>>0&255,new Uint8Array(a.buffer,0,i+4)},r.deflateRaw=function(s,o){o==null&&(o={level:6});var i=new Uint8Array(50+Math.floor(1.1*s.length)),a=r.F.deflateRaw(s,i,a,o.level);return new Uint8Array(i.buffer,0,a)},r.encode=function(s,o){o==null&&(o=!1);var i=0,a=r.bin.writeUint,l=r.bin.writeUshort,c={};for(var d in s){var u=!r._noNeed(d)&&!o,f=s[d],g=r.crc.crc(f,0,f.length);c[d]={cpr:u,usize:f.length,crc:g,file:u?r.deflateRaw(f):f}}for(var d in c)i+=c[d].file.length+30+46+2*r.bin.sizeUTF8(d);i+=22;var m=new Uint8Array(i),p=0,y=[];for(var d in c){var b=c[d];y.push(p),p=r._writeHeader(m,p,d,b,0)}var S=0,x=p;for(var d in c)b=c[d],y.push(p),p=r._writeHeader(m,p,d,b,1,y[S++]);var E=p-x;return a(m,p,101010256),p+=4,l(m,p+=4,S),l(m,p+=2,S),a(m,p+=2,E),a(m,p+=4,x),p+=4,p+=2,m.buffer},r._noNeed=function(s){var o=s.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(o)!=-1},r._writeHeader=function(s,o,i,a,l,c){var d=r.bin.writeUint,u=r.bin.writeUshort,f=a.file;return d(s,o,l==0?67324752:33639248),o+=4,l==1&&(o+=2),u(s,o,20),u(s,o+=2,0),u(s,o+=2,a.cpr?8:0),d(s,o+=2,0),d(s,o+=4,a.crc),d(s,o+=4,f.length),d(s,o+=4,a.usize),u(s,o+=4,r.bin.sizeUTF8(i)),u(s,o+=2,0),o+=2,l==1&&(o+=2,o+=2,d(s,o+=6,c),o+=4),o+=r.bin.writeUTF8(s,o,i),l==0&&(s.set(f,o),o+=f.length),o},r.crc={table:(function(){for(var s=new Uint32Array(256),o=0;o<256;o++){for(var i=o,a=0;a<8;a++)1&i?i=3988292384^i>>>1:i>>>=1;s[o]=i}return s})(),update:function(s,o,i,a){for(var l=0;l<a;l++)s=r.crc.table[255&(s^o[i+l])]^s>>>8;return s},crc:function(s,o,i){return 4294967295^r.crc.update(4294967295,s,o,i)}},r.adler=function(s,o,i){for(var a=1,l=0,c=o,d=o+i;c<d;){for(var u=Math.min(c+5552,d);c<u;)l+=a+=s[c++];a%=65521,l%=65521}return l<<16|a},r.bin={readUshort:function(s,o){return s[o]|s[o+1]<<8},writeUshort:function(s,o,i){s[o]=255&i,s[o+1]=i>>8&255},readUint:function(s,o){return 16777216*s[o+3]+(s[o+2]<<16|s[o+1]<<8|s[o])},writeUint:function(s,o,i){s[o]=255&i,s[o+1]=i>>8&255,s[o+2]=i>>16&255,s[o+3]=i>>24&255},readASCII:function(s,o,i){for(var a="",l=0;l<i;l++)a+=String.fromCharCode(s[o+l]);return a},writeASCII:function(s,o,i){for(var a=0;a<i.length;a++)s[o+a]=i.charCodeAt(a)},pad:function(s){return s.length<2?"0"+s:s},readUTF8:function(s,o,i){for(var a,l="",c=0;c<i;c++)l+="%"+r.bin.pad(s[o+c].toString(16));try{a=decodeURIComponent(l)}catch{return r.bin.readASCII(s,o,i)}return a},writeUTF8:function(s,o,i){for(var a=i.length,l=0,c=0;c<a;c++){var d=i.charCodeAt(c);if((4294967168&d)==0)s[o+l]=d,l++;else if((4294965248&d)==0)s[o+l]=192|d>>6,s[o+l+1]=128|d>>0&63,l+=2;else if((4294901760&d)==0)s[o+l]=224|d>>12,s[o+l+1]=128|d>>6&63,s[o+l+2]=128|d>>0&63,l+=3;else{if((4292870144&d)!=0)throw"e";s[o+l]=240|d>>18,s[o+l+1]=128|d>>12&63,s[o+l+2]=128|d>>6&63,s[o+l+3]=128|d>>0&63,l+=4}}return l},sizeUTF8:function(s){for(var o=s.length,i=0,a=0;a<o;a++){var l=s.charCodeAt(a);if((4294967168&l)==0)i++;else if((4294965248&l)==0)i+=2;else if((4294901760&l)==0)i+=3;else{if((4292870144&l)!=0)throw"e";i+=4}}return i}},r.F={},r.F.deflateRaw=function(s,o,i,a){var l=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][a],c=r.F.U,d=r.F._goodIndex;r.F._hash;var u=r.F._putsE,f=0,g=i<<3,m=0,p=s.length;if(a==0){for(;f<p;)u(o,g,f+(O=Math.min(65535,p-f))==p?1:0),g=r.F._copyExact(s,f,O,o,g+8),f+=O;return g>>>3}var y=c.lits,b=c.strt,S=c.prev,x=0,E=0,k=0,C=0,N=0,_=0;for(p>2&&(b[_=r.F._hash(s,0)]=0),f=0;f<p;f++){if(N=_,f+1<p-2){_=r.F._hash(s,f+1);var w=f+1&32767;S[w]=b[_],b[_]=w}if(m<=f){(x>14e3||E>26697)&&p-f>100&&(m<f&&(y[x]=f-m,x+=2,m=f),g=r.F._writeBlock(f==p-1||m==p?1:0,y,x,C,s,k,f-k,o,g),x=E=C=0,k=f);var M=0;f<p-2&&(M=r.F._bestMatch(s,f,S,N,Math.min(l[2],p-f),l[3]));var O=M>>>16,L=65535&M;if(M!=0){L=65535&M;var F=d(O=M>>>16,c.of0);c.lhst[257+F]++;var $=d(L,c.df0);c.dhst[$]++,C+=c.exb[F]+c.dxb[$],y[x]=O<<23|f-m,y[x+1]=L<<16|F<<8|$,x+=2,m=f+O}else c.lhst[s[f]]++;E++}}for(k==f&&s.length!=0||(m<f&&(y[x]=f-m,x+=2,m=f),g=r.F._writeBlock(1,y,x,C,s,k,f-k,o,g),x=0,E=0,x=E=C=0,k=f);(7&g)!=0;)g++;return g>>>3},r.F._bestMatch=function(s,o,i,a,l,c){var d=32767&o,u=i[d],f=d-u+32768&32767;if(u==d||a!=r.F._hash(s,o-f))return 0;for(var g=0,m=0,p=Math.min(32767,o);f<=p&&--c!=0&&u!=d;){if(g==0||s[o+g]==s[o+g-f]){var y=r.F._howLong(s,o,f);if(y>g){if(m=f,(g=y)>=l)break;f+2<y&&(y=f+2);for(var b=0,S=0;S<y-2;S++){var x=o-f+S+32768&32767,E=x-i[x]+32768&32767;E>b&&(b=E,u=x)}}}f+=(d=u)-(u=i[d])+32768&32767}return g<<16|m},r.F._howLong=function(s,o,i){if(s[o]!=s[o-i]||s[o+1]!=s[o+1-i]||s[o+2]!=s[o+2-i])return 0;var a=o,l=Math.min(s.length,o+258);for(o+=3;o<l&&s[o]==s[o-i];)o++;return o-a},r.F._hash=function(s,o){return(s[o]<<8|s[o+1])+(s[o+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(s,o,i,a,l,c,d,u,f){var g,m,p,y,b,S,x,E,k,C=r.F.U,N=r.F._putsF,_=r.F._putsE;C.lhst[256]++,m=(g=r.F.getTrees())[0],p=g[1],y=g[2],b=g[3],S=g[4],x=g[5],E=g[6],k=g[7];var w=32+((f+3&7)==0?0:8-(f+3&7))+(d<<3),M=a+r.F.contSize(C.fltree,C.lhst)+r.F.contSize(C.fdtree,C.dhst),O=a+r.F.contSize(C.ltree,C.lhst)+r.F.contSize(C.dtree,C.dhst);O+=14+3*x+r.F.contSize(C.itree,C.ihst)+(2*C.ihst[16]+3*C.ihst[17]+7*C.ihst[18]);for(var L=0;L<286;L++)C.lhst[L]=0;for(L=0;L<30;L++)C.dhst[L]=0;for(L=0;L<19;L++)C.ihst[L]=0;var F=w<M&&w<O?0:M<O?1:2;if(N(u,f,s),N(u,f+1,F),f+=3,F==0){for(;(7&f)!=0;)f++;f=r.F._copyExact(l,c,d,u,f)}else{var $,D;if(F==1&&($=C.fltree,D=C.fdtree),F==2){r.F.makeCodes(C.ltree,m),r.F.revCodes(C.ltree,m),r.F.makeCodes(C.dtree,p),r.F.revCodes(C.dtree,p),r.F.makeCodes(C.itree,y),r.F.revCodes(C.itree,y),$=C.ltree,D=C.dtree,_(u,f,b-257),_(u,f+=5,S-1),_(u,f+=5,x-4),f+=4;for(var A=0;A<x;A++)_(u,f+3*A,C.itree[1+(C.ordr[A]<<1)]);f+=3*x,f=r.F._codeTiny(E,C.itree,u,f),f=r.F._codeTiny(k,C.itree,u,f)}for(var T=c,z=0;z<i;z+=2){for(var H=o[z],W=H>>>23,j=T+(8388607&H);T<j;)f=r.F._writeLit(l[T++],$,u,f);if(W!=0){var U=o[z+1],B=U>>16,G=U>>8&255,V=255&U;_(u,f=r.F._writeLit(257+G,$,u,f),W-C.of0[G]),f+=C.exb[G],N(u,f=r.F._writeLit(V,D,u,f),B-C.df0[V]),f+=C.dxb[V],T+=W}}f=r.F._writeLit(256,$,u,f)}return f},r.F._copyExact=function(s,o,i,a,l){var c=l>>>3;return a[c]=i,a[c+1]=i>>>8,a[c+2]=255-a[c],a[c+3]=255-a[c+1],c+=4,a.set(new Uint8Array(s.buffer,o,i),c),l+(i+4<<3)},r.F.getTrees=function(){for(var s=r.F.U,o=r.F._hufTree(s.lhst,s.ltree,15),i=r.F._hufTree(s.dhst,s.dtree,15),a=[],l=r.F._lenCodes(s.ltree,a),c=[],d=r.F._lenCodes(s.dtree,c),u=0;u<a.length;u+=2)s.ihst[a[u]]++;for(u=0;u<c.length;u+=2)s.ihst[c[u]]++;for(var f=r.F._hufTree(s.ihst,s.itree,7),g=19;g>4&&s.itree[1+(s.ordr[g-1]<<1)]==0;)g--;return[o,i,f,l,d,g,a,c]},r.F.getSecond=function(s){for(var o=[],i=0;i<s.length;i+=2)o.push(s[i+1]);return o},r.F.nonZero=function(s){for(var o="",i=0;i<s.length;i+=2)s[i+1]!=0&&(o+=(i>>1)+",");return o},r.F.contSize=function(s,o){for(var i=0,a=0;a<o.length;a++)i+=o[a]*s[1+(a<<1)];return i},r.F._codeTiny=function(s,o,i,a){for(var l=0;l<s.length;l+=2){var c=s[l],d=s[l+1];a=r.F._writeLit(c,o,i,a);var u=c==16?2:c==17?3:7;c>15&&(r.F._putsE(i,a,d,u),a+=u)}return a},r.F._lenCodes=function(s,o){for(var i=s.length;i!=2&&s[i-1]==0;)i-=2;for(var a=0;a<i;a+=2){var l=s[a+1],c=a+3<i?s[a+3]:-1,d=a+5<i?s[a+5]:-1,u=a==0?-1:s[a-1];if(l==0&&c==l&&d==l){for(var f=a+5;f+2<i&&s[f+2]==l;)f+=2;(g=Math.min(f+1-a>>>1,138))<11?o.push(17,g-3):o.push(18,g-11),a+=2*g-2}else if(l==u&&c==l&&d==l){for(f=a+5;f+2<i&&s[f+2]==l;)f+=2;var g=Math.min(f+1-a>>>1,6);o.push(16,g-3),a+=2*g-2}else o.push(l,0)}return i>>>1},r.F._hufTree=function(s,o,i){var a=[],l=s.length,c=o.length,d=0;for(d=0;d<c;d+=2)o[d]=0,o[d+1]=0;for(d=0;d<l;d++)s[d]!=0&&a.push({lit:d,f:s[d]});var u=a.length,f=a.slice(0);if(u==0)return 0;if(u==1){var g=a[0].lit;return f=g==0?1:0,o[1+(g<<1)]=1,o[1+(f<<1)]=1,1}a.sort((function(E,k){return E.f-k.f}));var m=a[0],p=a[1],y=0,b=1,S=2;for(a[0]={lit:-1,f:m.f+p.f,l:m,r:p,d:0};b!=u-1;)m=y!=b&&(S==u||a[y].f<a[S].f)?a[y++]:a[S++],p=y!=b&&(S==u||a[y].f<a[S].f)?a[y++]:a[S++],a[b++]={lit:-1,f:m.f+p.f,l:m,r:p};var x=r.F.setDepth(a[b-1],0);for(x>i&&(r.F.restrictDepth(f,i,x),x=i),d=0;d<u;d++)o[1+(f[d].lit<<1)]=f[d].d;return x},r.F.setDepth=function(s,o){return s.lit!=-1?(s.d=o,o):Math.max(r.F.setDepth(s.l,o+1),r.F.setDepth(s.r,o+1))},r.F.restrictDepth=function(s,o,i){var a=0,l=1<<i-o,c=0;for(s.sort((function(u,f){return f.d==u.d?u.f-f.f:f.d-u.d})),a=0;a<s.length&&s[a].d>o;a++){var d=s[a].d;s[a].d=o,c+=l-(1<<i-d)}for(c>>>=i-o;c>0;)(d=s[a].d)<o?(s[a].d++,c-=1<<o-d-1):a++;for(;a>=0;a--)s[a].d==o&&c<0&&(s[a].d--,c++);c!=0&&console.log("debt left")},r.F._goodIndex=function(s,o){var i=0;return o[16|i]<=s&&(i|=16),o[8|i]<=s&&(i|=8),o[4|i]<=s&&(i|=4),o[2|i]<=s&&(i|=2),o[1|i]<=s&&(i|=1),i},r.F._writeLit=function(s,o,i,a){return r.F._putsF(i,a,o[s<<1]),a+o[1+(s<<1)]},r.F.inflate=function(s,o){var i=Uint8Array;if(s[0]==3&&s[1]==0)return o||new i(0);var a=r.F,l=a._bitsF,c=a._bitsE,d=a._decodeTiny,u=a.makeCodes,f=a.codes2map,g=a._get17,m=a.U,p=o==null;p&&(o=new i(s.length>>>2<<3));for(var y,b,S=0,x=0,E=0,k=0,C=0,N=0,_=0,w=0,M=0;S==0;)if(S=l(s,M,1),x=l(s,M+1,2),M+=3,x!=0){if(p&&(o=r.F._check(o,w+131072)),x==1&&(y=m.flmap,b=m.fdmap,N=511,_=31),x==2){E=c(s,M,5)+257,k=c(s,M+5,5)+1,C=c(s,M+10,4)+4,M+=14;for(var O=0;O<38;O+=2)m.itree[O]=0,m.itree[O+1]=0;var L=1;for(O=0;O<C;O++){var F=c(s,M+3*O,3);m.itree[1+(m.ordr[O]<<1)]=F,F>L&&(L=F)}M+=3*C,u(m.itree,L),f(m.itree,L,m.imap),y=m.lmap,b=m.dmap,M=d(m.imap,(1<<L)-1,E+k,s,M,m.ttree);var $=a._copyOut(m.ttree,0,E,m.ltree);N=(1<<$)-1;var D=a._copyOut(m.ttree,E,k,m.dtree);_=(1<<D)-1,u(m.ltree,$),f(m.ltree,$,y),u(m.dtree,D),f(m.dtree,D,b)}for(;;){var A=y[g(s,M)&N];M+=15&A;var T=A>>>4;if(!(T>>>8))o[w++]=T;else{if(T==256)break;var z=w+T-254;if(T>264){var H=m.ldef[T-257];z=w+(H>>>3)+c(s,M,7&H),M+=7&H}var W=b[g(s,M)&_];M+=15&W;var j=W>>>4,U=m.ddef[j],B=(U>>>4)+l(s,M,15&U);for(M+=15&U,p&&(o=r.F._check(o,w+131072));w<z;)o[w]=o[w++-B],o[w]=o[w++-B],o[w]=o[w++-B],o[w]=o[w++-B];w=z}}}else{(7&M)!=0&&(M+=8-(7&M));var G=4+(M>>>3),V=s[G-4]|s[G-3]<<8;p&&(o=r.F._check(o,w+V)),o.set(new i(s.buffer,s.byteOffset+G,V),w),M=G+V<<3,w+=V}return o.length==w?o:o.slice(0,w)},r.F._check=function(s,o){var i=s.length;if(o<=i)return s;var a=new Uint8Array(Math.max(i<<1,o));return a.set(s,0),a},r.F._decodeTiny=function(s,o,i,a,l,c){for(var d=r.F._bitsE,u=r.F._get17,f=0;f<i;){var g=s[u(a,l)&o];l+=15&g;var m=g>>>4;if(m<=15)c[f]=m,f++;else{var p=0,y=0;m==16?(y=3+d(a,l,2),l+=2,p=c[f-1]):m==17?(y=3+d(a,l,3),l+=3):m==18&&(y=11+d(a,l,7),l+=7);for(var b=f+y;f<b;)c[f]=p,f++}}return l},r.F._copyOut=function(s,o,i,a){for(var l=0,c=0,d=a.length>>>1;c<i;){var u=s[c+o];a[c<<1]=0,a[1+(c<<1)]=u,u>l&&(l=u),c++}for(;c<d;)a[c<<1]=0,a[1+(c<<1)]=0,c++;return l},r.F.makeCodes=function(s,o){for(var i,a,l,c,d=r.F.U,u=s.length,f=d.bl_count,g=0;g<=o;g++)f[g]=0;for(g=1;g<u;g+=2)f[s[g]]++;var m=d.next_code;for(i=0,f[0]=0,a=1;a<=o;a++)i=i+f[a-1]<<1,m[a]=i;for(l=0;l<u;l+=2)(c=s[l+1])!=0&&(s[l]=m[c],m[c]++)},r.F.codes2map=function(s,o,i){for(var a=s.length,l=r.F.U.rev15,c=0;c<a;c+=2)if(s[c+1]!=0)for(var d=c>>1,u=s[c+1],f=d<<4|u,g=o-u,m=s[c]<<g,p=m+(1<<g);m!=p;)i[l[m]>>>15-o]=f,m++},r.F.revCodes=function(s,o){for(var i=r.F.U.rev15,a=15-o,l=0;l<s.length;l+=2){var c=s[l]<<o-s[l+1];s[l]=i[c]>>>a}},r.F._putsE=function(s,o,i){i<<=7&o;var a=o>>>3;s[a]|=i,s[a+1]|=i>>>8},r.F._putsF=function(s,o,i){i<<=7&o;var a=o>>>3;s[a]|=i,s[a+1]|=i>>>8,s[a+2]|=i>>>16},r.F._bitsE=function(s,o,i){return(s[o>>>3]|s[1+(o>>>3)]<<8)>>>(7&o)&(1<<i)-1},r.F._bitsF=function(s,o,i){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16)>>>(7&o)&(1<<i)-1},r.F._get17=function(s,o){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16)>>>(7&o)},r.F._get25=function(s,o){return(s[o>>>3]|s[1+(o>>>3)]<<8|s[2+(o>>>3)]<<16|s[3+(o>>>3)]<<24)>>>(7&o)},r.F.U=(e=Uint16Array,n=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new n(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new n(286),dhst:new n(30),ihst:new n(19),lits:new n(15e3),strt:new e(65536),prev:new e(32768)}),(function(){for(var s=r.F.U,o=0;o<32768;o++){var i=o;i=(4278255360&(i=(4042322160&(i=(3435973836&(i=(2863311530&i)>>>1|(1431655765&i)<<1))>>>2|(858993459&i)<<2))>>>4|(252645135&i)<<4))>>>8|(16711935&i)<<8,s.rev15[o]=(i>>>16|i<<16)>>>17}function a(l,c,d){for(;c--!=0;)l.push(0,d)}for(o=0;o<32;o++)s.ldef[o]=s.of0[o]<<3|s.exb[o],s.ddef[o]=s.df0[o]<<4|s.dxb[o];a(s.fltree,144,8),a(s.fltree,112,9),a(s.fltree,24,7),a(s.fltree,8,8),r.F.makeCodes(s.fltree,9),r.F.codes2map(s.fltree,9,s.flmap),r.F.revCodes(s.fltree,9),a(s.fdtree,32,5),r.F.makeCodes(s.fdtree,5),r.F.codes2map(s.fdtree,5,s.fdmap),r.F.revCodes(s.fdtree,5),a(s.itree,19,0),a(s.ltree,286,0),a(s.dtree,30,0),a(s.ttree,320,0)})()})();var nE=R2({__proto__:null,default:ji},[ji]);const En=(function(){var t={nextZero(d,u){for(;d[u]!=0;)u++;return u},readUshort:(d,u)=>d[u]<<8|d[u+1],writeUshort(d,u,f){d[u]=f>>8&255,d[u+1]=255&f},readUint:(d,u)=>16777216*d[u]+(d[u+1]<<16|d[u+2]<<8|d[u+3]),writeUint(d,u,f){d[u]=f>>24&255,d[u+1]=f>>16&255,d[u+2]=f>>8&255,d[u+3]=255&f},readASCII(d,u,f){let g="";for(let m=0;m<f;m++)g+=String.fromCharCode(d[u+m]);return g},writeASCII(d,u,f){for(let g=0;g<f.length;g++)d[u+g]=f.charCodeAt(g)},readBytes(d,u,f){const g=[];for(let m=0;m<f;m++)g.push(d[u+m]);return g},pad:d=>d.length<2?`0${d}`:d,readUTF8(d,u,f){let g,m="";for(let p=0;p<f;p++)m+=`%${t.pad(d[u+p].toString(16))}`;try{g=decodeURIComponent(m)}catch{return t.readASCII(d,u,f)}return g}};function e(d,u,f,g){const m=u*f,p=o(g),y=Math.ceil(u*p/8),b=new Uint8Array(4*m),S=new Uint32Array(b.buffer),{ctype:x}=g,{depth:E}=g,k=t.readUshort;if(x==6){const H=m<<2;if(E==8)for(var C=0;C<H;C+=4)b[C]=d[C],b[C+1]=d[C+1],b[C+2]=d[C+2],b[C+3]=d[C+3];if(E==16)for(C=0;C<H;C++)b[C]=d[C<<1]}else if(x==2){const H=g.tabs.tRNS;if(H==null){if(E==8)for(C=0;C<m;C++){var N=3*C;S[C]=255<<24|d[N+2]<<16|d[N+1]<<8|d[N]}if(E==16)for(C=0;C<m;C++)N=6*C,S[C]=255<<24|d[N+4]<<16|d[N+2]<<8|d[N]}else{var _=H[0];const W=H[1],j=H[2];if(E==8)for(C=0;C<m;C++){var w=C<<2;N=3*C,S[C]=255<<24|d[N+2]<<16|d[N+1]<<8|d[N],d[N]==_&&d[N+1]==W&&d[N+2]==j&&(b[w+3]=0)}if(E==16)for(C=0;C<m;C++)w=C<<2,N=6*C,S[C]=255<<24|d[N+4]<<16|d[N+2]<<8|d[N],k(d,N)==_&&k(d,N+2)==W&&k(d,N+4)==j&&(b[w+3]=0)}}else if(x==3){const H=g.tabs.PLTE,W=g.tabs.tRNS,j=W?W.length:0;if(E==1)for(var M=0;M<f;M++){var O=M*y,L=M*u;for(C=0;C<u;C++){w=L+C<<2;var F=3*($=d[O+(C>>3)]>>7-((7&C)<<0)&1);b[w]=H[F],b[w+1]=H[F+1],b[w+2]=H[F+2],b[w+3]=$<j?W[$]:255}}if(E==2)for(M=0;M<f;M++)for(O=M*y,L=M*u,C=0;C<u;C++)w=L+C<<2,F=3*($=d[O+(C>>2)]>>6-((3&C)<<1)&3),b[w]=H[F],b[w+1]=H[F+1],b[w+2]=H[F+2],b[w+3]=$<j?W[$]:255;if(E==4)for(M=0;M<f;M++)for(O=M*y,L=M*u,C=0;C<u;C++)w=L+C<<2,F=3*($=d[O+(C>>1)]>>4-((1&C)<<2)&15),b[w]=H[F],b[w+1]=H[F+1],b[w+2]=H[F+2],b[w+3]=$<j?W[$]:255;if(E==8)for(C=0;C<m;C++){var $;w=C<<2,F=3*($=d[C]),b[w]=H[F],b[w+1]=H[F+1],b[w+2]=H[F+2],b[w+3]=$<j?W[$]:255}}else if(x==4){if(E==8)for(C=0;C<m;C++){w=C<<2;var D=d[A=C<<1];b[w]=D,b[w+1]=D,b[w+2]=D,b[w+3]=d[A+1]}if(E==16)for(C=0;C<m;C++){var A;w=C<<2,D=d[A=C<<2],b[w]=D,b[w+1]=D,b[w+2]=D,b[w+3]=d[A+2]}}else if(x==0)for(_=g.tabs.tRNS?g.tabs.tRNS:-1,M=0;M<f;M++){const H=M*y,W=M*u;if(E==1)for(var T=0;T<u;T++){var z=(D=255*(d[H+(T>>>3)]>>>7-(7&T)&1))==255*_?0:255;S[W+T]=z<<24|D<<16|D<<8|D}else if(E==2)for(T=0;T<u;T++)z=(D=85*(d[H+(T>>>2)]>>>6-((3&T)<<1)&3))==85*_?0:255,S[W+T]=z<<24|D<<16|D<<8|D;else if(E==4)for(T=0;T<u;T++)z=(D=17*(d[H+(T>>>1)]>>>4-((1&T)<<2)&15))==17*_?0:255,S[W+T]=z<<24|D<<16|D<<8|D;else if(E==8)for(T=0;T<u;T++)z=(D=d[H+T])==_?0:255,S[W+T]=z<<24|D<<16|D<<8|D;else if(E==16)for(T=0;T<u;T++)D=d[H+(T<<1)],z=k(d,H+(T<<1))==_?0:255,S[W+T]=z<<24|D<<16|D<<8|D}return b}function n(d,u,f,g){const m=o(d),p=Math.ceil(f*m/8),y=new Uint8Array((p+1+d.interlace)*g);return u=d.tabs.CgBI?s(u,y):r(u,y),d.interlace==0?u=i(u,d,0,f,g):d.interlace==1&&(u=(function(S,x){const E=x.width,k=x.height,C=o(x),N=C>>3,_=Math.ceil(E*C/8),w=new Uint8Array(k*_);let M=0;const O=[0,0,4,0,2,0,1],L=[0,4,0,2,0,1,0],F=[8,8,8,4,4,2,2],$=[8,8,4,4,2,2,1];let D=0;for(;D<7;){const T=F[D],z=$[D];let H=0,W=0,j=O[D];for(;j<k;)j+=T,W++;let U=L[D];for(;U<E;)U+=z,H++;const B=Math.ceil(H*C/8);i(S,x,M,H,W);let G=0,V=O[D];for(;V<k;){let K=L[D],X=M+G*B<<3;for(;K<E;){var A;if(C==1&&(A=(A=S[X>>3])>>7-(7&X)&1,w[V*_+(K>>3)]|=A<<7-((7&K)<<0)),C==2&&(A=(A=S[X>>3])>>6-(7&X)&3,w[V*_+(K>>2)]|=A<<6-((3&K)<<1)),C==4&&(A=(A=S[X>>3])>>4-(7&X)&15,w[V*_+(K>>1)]|=A<<4-((1&K)<<2)),C>=8){const Z=V*_+K*N;for(let ee=0;ee<N;ee++)w[Z+ee]=S[(X>>3)+ee]}X+=C,K+=z}G++,V+=T}H*W!=0&&(M+=W*(1+B)),D+=1}return w})(u,d)),u}function r(d,u){return s(new Uint8Array(d.buffer,2,d.length-6),u)}var s=(function(){const d={H:{}};return d.H.N=function(u,f){const g=Uint8Array;let m,p,y=0,b=0,S=0,x=0,E=0,k=0,C=0,N=0,_=0;if(u[0]==3&&u[1]==0)return f||new g(0);const w=d.H,M=w.b,O=w.e,L=w.R,F=w.n,$=w.A,D=w.Z,A=w.m,T=f==null;for(T&&(f=new g(u.length>>>2<<5));y==0;)if(y=M(u,_,1),b=M(u,_+1,2),_+=3,b!=0){if(T&&(f=d.H.W(f,N+(1<<17))),b==1&&(m=A.J,p=A.h,k=511,C=31),b==2){S=O(u,_,5)+257,x=O(u,_+5,5)+1,E=O(u,_+10,4)+4,_+=14;let H=1;for(var z=0;z<38;z+=2)A.Q[z]=0,A.Q[z+1]=0;for(z=0;z<E;z++){const U=O(u,_+3*z,3);A.Q[1+(A.X[z]<<1)]=U,U>H&&(H=U)}_+=3*E,F(A.Q,H),$(A.Q,H,A.u),m=A.w,p=A.d,_=L(A.u,(1<<H)-1,S+x,u,_,A.v);const W=w.V(A.v,0,S,A.C);k=(1<<W)-1;const j=w.V(A.v,S,x,A.D);C=(1<<j)-1,F(A.C,W),$(A.C,W,m),F(A.D,j),$(A.D,j,p)}for(;;){const H=m[D(u,_)&k];_+=15&H;const W=H>>>4;if(!(W>>>8))f[N++]=W;else{if(W==256)break;{let j=N+W-254;if(W>264){const K=A.q[W-257];j=N+(K>>>3)+O(u,_,7&K),_+=7&K}const U=p[D(u,_)&C];_+=15&U;const B=U>>>4,G=A.c[B],V=(G>>>4)+M(u,_,15&G);for(_+=15&G;N<j;)f[N]=f[N++-V],f[N]=f[N++-V],f[N]=f[N++-V],f[N]=f[N++-V];N=j}}}}else{(7&_)!=0&&(_+=8-(7&_));const H=4+(_>>>3),W=u[H-4]|u[H-3]<<8;T&&(f=d.H.W(f,N+W)),f.set(new g(u.buffer,u.byteOffset+H,W),N),_=H+W<<3,N+=W}return f.length==N?f:f.slice(0,N)},d.H.W=function(u,f){const g=u.length;if(f<=g)return u;const m=new Uint8Array(g<<1);return m.set(u,0),m},d.H.R=function(u,f,g,m,p,y){const b=d.H.e,S=d.H.Z;let x=0;for(;x<g;){const E=u[S(m,p)&f];p+=15&E;const k=E>>>4;if(k<=15)y[x]=k,x++;else{let C=0,N=0;k==16?(N=3+b(m,p,2),p+=2,C=y[x-1]):k==17?(N=3+b(m,p,3),p+=3):k==18&&(N=11+b(m,p,7),p+=7);const _=x+N;for(;x<_;)y[x]=C,x++}}return p},d.H.V=function(u,f,g,m){let p=0,y=0;const b=m.length>>>1;for(;y<g;){const S=u[y+f];m[y<<1]=0,m[1+(y<<1)]=S,S>p&&(p=S),y++}for(;y<b;)m[y<<1]=0,m[1+(y<<1)]=0,y++;return p},d.H.n=function(u,f){const g=d.H.m,m=u.length;let p,y,b,S;const x=g.j;for(var E=0;E<=f;E++)x[E]=0;for(E=1;E<m;E+=2)x[u[E]]++;const k=g.K;for(p=0,x[0]=0,y=1;y<=f;y++)p=p+x[y-1]<<1,k[y]=p;for(b=0;b<m;b+=2)S=u[b+1],S!=0&&(u[b]=k[S],k[S]++)},d.H.A=function(u,f,g){const m=u.length,p=d.H.m.r;for(let y=0;y<m;y+=2)if(u[y+1]!=0){const b=y>>1,S=u[y+1],x=b<<4|S,E=f-S;let k=u[y]<<E;const C=k+(1<<E);for(;k!=C;)g[p[k]>>>15-f]=x,k++}},d.H.l=function(u,f){const g=d.H.m.r,m=15-f;for(let p=0;p<u.length;p+=2){const y=u[p]<<f-u[p+1];u[p]=g[y]>>>m}},d.H.M=function(u,f,g){g<<=7&f;const m=f>>>3;u[m]|=g,u[m+1]|=g>>>8},d.H.I=function(u,f,g){g<<=7&f;const m=f>>>3;u[m]|=g,u[m+1]|=g>>>8,u[m+2]|=g>>>16},d.H.e=function(u,f,g){return(u[f>>>3]|u[1+(f>>>3)]<<8)>>>(7&f)&(1<<g)-1},d.H.b=function(u,f,g){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16)>>>(7&f)&(1<<g)-1},d.H.Z=function(u,f){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16)>>>(7&f)},d.H.i=function(u,f){return(u[f>>>3]|u[1+(f>>>3)]<<8|u[2+(f>>>3)]<<16|u[3+(f>>>3)]<<24)>>>(7&f)},d.H.m=(function(){const u=Uint16Array,f=Uint32Array;return{K:new u(16),j:new u(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new u(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new f(32),J:new u(512),_:[],h:new u(32),$:[],w:new u(32768),C:[],v:[],d:new u(32768),D:[],u:new u(512),Q:[],r:new u(32768),s:new f(286),Y:new f(30),a:new f(19),t:new f(15e3),k:new u(65536),g:new u(32768)}})(),(function(){const u=d.H.m;for(var f=0;f<32768;f++){let m=f;m=(2863311530&m)>>>1|(1431655765&m)<<1,m=(3435973836&m)>>>2|(858993459&m)<<2,m=(4042322160&m)>>>4|(252645135&m)<<4,m=(4278255360&m)>>>8|(16711935&m)<<8,u.r[f]=(m>>>16|m<<16)>>>17}function g(m,p,y){for(;p--!=0;)m.push(0,y)}for(f=0;f<32;f++)u.q[f]=u.S[f]<<3|u.T[f],u.c[f]=u.p[f]<<4|u.z[f];g(u._,144,8),g(u._,112,9),g(u._,24,7),g(u._,8,8),d.H.n(u._,9),d.H.A(u._,9,u.J),d.H.l(u._,9),g(u.$,32,5),d.H.n(u.$,5),d.H.A(u.$,5,u.h),d.H.l(u.$,5),g(u.Q,19,0),g(u.C,286,0),g(u.D,30,0),g(u.v,320,0)})(),d.H.N})();function o(d){return[1,null,3,1,2,null,4][d.ctype]*d.depth}function i(d,u,f,g,m){let p=o(u);const y=Math.ceil(g*p/8);let b,S;p=Math.ceil(p/8);let x=d[f],E=0;if(x>1&&(d[f]=[0,0,1][x-2]),x==3)for(E=p;E<y;E++)d[E+1]=d[E+1]+(d[E+1-p]>>>1)&255;for(let k=0;k<m;k++)if(b=f+k*y,S=b+k+1,x=d[S-1],E=0,x==0)for(;E<y;E++)d[b+E]=d[S+E];else if(x==1){for(;E<p;E++)d[b+E]=d[S+E];for(;E<y;E++)d[b+E]=d[S+E]+d[b+E-p]}else if(x==2)for(;E<y;E++)d[b+E]=d[S+E]+d[b+E-y];else if(x==3){for(;E<p;E++)d[b+E]=d[S+E]+(d[b+E-y]>>>1);for(;E<y;E++)d[b+E]=d[S+E]+(d[b+E-y]+d[b+E-p]>>>1)}else{for(;E<p;E++)d[b+E]=d[S+E]+a(0,d[b+E-y],0);for(;E<y;E++)d[b+E]=d[S+E]+a(d[b+E-p],d[b+E-y],d[b+E-p-y])}return d}function a(d,u,f){const g=d+u-f,m=g-d,p=g-u,y=g-f;return m*m<=p*p&&m*m<=y*y?d:p*p<=y*y?u:f}function l(d,u,f){f.width=t.readUint(d,u),u+=4,f.height=t.readUint(d,u),u+=4,f.depth=d[u],u++,f.ctype=d[u],u++,f.compress=d[u],u++,f.filter=d[u],u++,f.interlace=d[u],u++}function c(d,u,f,g,m,p,y,b,S){const x=Math.min(u,m),E=Math.min(f,p);let k=0,C=0;for(let D=0;D<E;D++)for(let A=0;A<x;A++)if(y>=0&&b>=0?(k=D*u+A<<2,C=(b+D)*m+y+A<<2):(k=(-b+D)*u-y+A<<2,C=D*m+A<<2),S==0)g[C]=d[k],g[C+1]=d[k+1],g[C+2]=d[k+2],g[C+3]=d[k+3];else if(S==1){var N=d[k+3]*.00392156862745098,_=d[k]*N,w=d[k+1]*N,M=d[k+2]*N,O=g[C+3]*(1/255),L=g[C]*O,F=g[C+1]*O,$=g[C+2]*O;const T=1-N,z=N+O*T,H=z==0?0:1/z;g[C+3]=255*z,g[C+0]=(_+L*T)*H,g[C+1]=(w+F*T)*H,g[C+2]=(M+$*T)*H}else if(S==2)N=d[k+3],_=d[k],w=d[k+1],M=d[k+2],O=g[C+3],L=g[C],F=g[C+1],$=g[C+2],N==O&&_==L&&w==F&&M==$?(g[C]=0,g[C+1]=0,g[C+2]=0,g[C+3]=0):(g[C]=_,g[C+1]=w,g[C+2]=M,g[C+3]=N);else if(S==3){if(N=d[k+3],_=d[k],w=d[k+1],M=d[k+2],O=g[C+3],L=g[C],F=g[C+1],$=g[C+2],N==O&&_==L&&w==F&&M==$)continue;if(N<220&&O>20)return!1}return!0}return{decode:function(u){const f=new Uint8Array(u);let g=8;const m=t,p=m.readUshort,y=m.readUint,b={tabs:{},frames:[]},S=new Uint8Array(f.length);let x,E=0,k=0;const C=[137,80,78,71,13,10,26,10];for(var N=0;N<8;N++)if(f[N]!=C[N])throw"The input is not a PNG file!";for(;g<f.length;){const D=m.readUint(f,g);g+=4;const A=m.readASCII(f,g,4);if(g+=4,A=="IHDR")l(f,g,b);else if(A=="iCCP"){for(var _=g;f[_]!=0;)_++;m.readASCII(f,g,_-g),f[_+1];const T=f.slice(_+2,g+D);let z=null;try{z=r(T)}catch{z=s(T)}b.tabs[A]=z}else if(A=="CgBI")b.tabs[A]=f.slice(g,g+4);else if(A=="IDAT"){for(N=0;N<D;N++)S[E+N]=f[g+N];E+=D}else if(A=="acTL")b.tabs[A]={num_frames:y(f,g),num_plays:y(f,g+4)},x=new Uint8Array(f.length);else if(A=="fcTL"){k!=0&&(($=b.frames[b.frames.length-1]).data=n(b,x.slice(0,k),$.rect.width,$.rect.height),k=0);const T={x:y(f,g+12),y:y(f,g+16),width:y(f,g+4),height:y(f,g+8)};let z=p(f,g+22);z=p(f,g+20)/(z==0?100:z);const H={rect:T,delay:Math.round(1e3*z),dispose:f[g+24],blend:f[g+25]};b.frames.push(H)}else if(A=="fdAT"){for(N=0;N<D-4;N++)x[k+N]=f[g+N+4];k+=D-4}else if(A=="pHYs")b.tabs[A]=[m.readUint(f,g),m.readUint(f,g+4),f[g+8]];else if(A=="cHRM")for(b.tabs[A]=[],N=0;N<8;N++)b.tabs[A].push(m.readUint(f,g+4*N));else if(A=="tEXt"||A=="zTXt"){b.tabs[A]==null&&(b.tabs[A]={});var w=m.nextZero(f,g),M=m.readASCII(f,g,w-g),O=g+D-w-1;if(A=="tEXt")F=m.readASCII(f,w+1,O);else{var L=r(f.slice(w+2,w+2+O));F=m.readUTF8(L,0,L.length)}b.tabs[A][M]=F}else if(A=="iTXt"){b.tabs[A]==null&&(b.tabs[A]={}),w=0,_=g,w=m.nextZero(f,_),M=m.readASCII(f,_,w-_);const T=f[_=w+1];var F;f[_+1],_+=2,w=m.nextZero(f,_),m.readASCII(f,_,w-_),_=w+1,w=m.nextZero(f,_),m.readUTF8(f,_,w-_),O=D-((_=w+1)-g),T==0?F=m.readUTF8(f,_,O):(L=r(f.slice(_,_+O)),F=m.readUTF8(L,0,L.length)),b.tabs[A][M]=F}else if(A=="PLTE")b.tabs[A]=m.readBytes(f,g,D);else if(A=="hIST"){const T=b.tabs.PLTE.length/3;for(b.tabs[A]=[],N=0;N<T;N++)b.tabs[A].push(p(f,g+2*N))}else if(A=="tRNS")b.ctype==3?b.tabs[A]=m.readBytes(f,g,D):b.ctype==0?b.tabs[A]=p(f,g):b.ctype==2&&(b.tabs[A]=[p(f,g),p(f,g+2),p(f,g+4)]);else if(A=="gAMA")b.tabs[A]=m.readUint(f,g)/1e5;else if(A=="sRGB")b.tabs[A]=f[g];else if(A=="bKGD")b.ctype==0||b.ctype==4?b.tabs[A]=[p(f,g)]:b.ctype==2||b.ctype==6?b.tabs[A]=[p(f,g),p(f,g+2),p(f,g+4)]:b.ctype==3&&(b.tabs[A]=f[g]);else if(A=="IEND")break;g+=D,m.readUint(f,g),g+=4}var $;return k!=0&&(($=b.frames[b.frames.length-1]).data=n(b,x.slice(0,k),$.rect.width,$.rect.height)),b.data=n(b,S,b.width,b.height),delete b.compress,delete b.interlace,delete b.filter,b},toRGBA8:function(u){const f=u.width,g=u.height;if(u.tabs.acTL==null)return[e(u.data,f,g,u).buffer];const m=[];u.frames[0].data==null&&(u.frames[0].data=u.data);const p=f*g*4,y=new Uint8Array(p),b=new Uint8Array(p),S=new Uint8Array(p);for(let E=0;E<u.frames.length;E++){const k=u.frames[E],C=k.rect.x,N=k.rect.y,_=k.rect.width,w=k.rect.height,M=e(k.data,_,w,u);if(E!=0)for(var x=0;x<p;x++)S[x]=y[x];if(k.blend==0?c(M,_,w,y,f,g,C,N,0):k.blend==1&&c(M,_,w,y,f,g,C,N,1),m.push(y.buffer.slice(0)),k.dispose!=0){if(k.dispose==1)c(b,_,w,y,f,g,C,N,0);else if(k.dispose==2)for(x=0;x<p;x++)y[x]=S[x]}}return m},_paeth:a,_copyTile:c,_bin:t}})();(function(){const{_copyTile:t}=En,{_bin:e}=En,n=En._paeth;var r={table:(function(){const _=new Uint32Array(256);for(let w=0;w<256;w++){let M=w;for(let O=0;O<8;O++)1&M?M=3988292384^M>>>1:M>>>=1;_[w]=M}return _})(),update(_,w,M,O){for(let L=0;L<O;L++)_=r.table[255&(_^w[M+L])]^_>>>8;return _},crc:(_,w,M)=>4294967295^r.update(4294967295,_,w,M)};function s(_,w,M,O){w[M]+=_[0]*O>>4,w[M+1]+=_[1]*O>>4,w[M+2]+=_[2]*O>>4,w[M+3]+=_[3]*O>>4}function o(_){return Math.max(0,Math.min(255,_))}function i(_,w){const M=_[0]-w[0],O=_[1]-w[1],L=_[2]-w[2],F=_[3]-w[3];return M*M+O*O+L*L+F*F}function a(_,w,M,O,L,F,$){$==null&&($=1);const D=O.length,A=[];for(var T=0;T<D;T++){const V=O[T];A.push([V>>>0&255,V>>>8&255,V>>>16&255,V>>>24&255])}for(T=0;T<D;T++){let V=4294967295;for(var z=0,H=0;H<D;H++){var W=i(A[T],A[H]);H!=T&&W<V&&(V=W,z=H)}}const j=new Uint32Array(L.buffer),U=new Int16Array(w*M*4),B=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(T=0;T<B.length;T++)B[T]=255*((B[T]+.5)/16-.5);for(let V=0;V<M;V++)for(let K=0;K<w;K++){var G;T=4*(V*w+K),$!=2?G=[o(_[T]+U[T]),o(_[T+1]+U[T+1]),o(_[T+2]+U[T+2]),o(_[T+3]+U[T+3])]:(W=B[4*(3&V)+(3&K)],G=[o(_[T]+W),o(_[T+1]+W),o(_[T+2]+W),o(_[T+3]+W)]),z=0;let X=16777215;for(H=0;H<D;H++){const ne=i(G,A[H]);ne<X&&(X=ne,z=H)}const Z=A[z],ee=[G[0]-Z[0],G[1]-Z[1],G[2]-Z[2],G[3]-Z[3]];$==1&&(K!=w-1&&s(ee,U,T+4,7),V!=M-1&&(K!=0&&s(ee,U,T+4*w-4,3),s(ee,U,T+4*w,5),K!=w-1&&s(ee,U,T+4*w+4,1))),F[T>>2]=z,j[T>>2]=O[z]}}function l(_,w,M,O,L){L==null&&(L={});const{crc:F}=r,$=e.writeUint,D=e.writeUshort,A=e.writeASCII;let T=8;const z=_.frames.length>1;let H,W=!1,j=33+(z?20:0);if(L.sRGB!=null&&(j+=13),L.pHYs!=null&&(j+=21),L.iCCP!=null&&(H=pako.deflate(L.iCCP),j+=21+H.length+4),_.ctype==3){for(var U=_.plte.length,B=0;B<U;B++)_.plte[B]>>>24!=255&&(W=!0);j+=8+3*U+4+(W?8+1*U+4:0)}for(var G=0;G<_.frames.length;G++)z&&(j+=38),j+=(Z=_.frames[G]).cimg.length+12,G!=0&&(j+=4);j+=12;const V=new Uint8Array(j),K=[137,80,78,71,13,10,26,10];for(B=0;B<8;B++)V[B]=K[B];if($(V,T,13),T+=4,A(V,T,"IHDR"),T+=4,$(V,T,w),T+=4,$(V,T,M),T+=4,V[T]=_.depth,T++,V[T]=_.ctype,T++,V[T]=0,T++,V[T]=0,T++,V[T]=0,T++,$(V,T,F(V,T-17,17)),T+=4,L.sRGB!=null&&($(V,T,1),T+=4,A(V,T,"sRGB"),T+=4,V[T]=L.sRGB,T++,$(V,T,F(V,T-5,5)),T+=4),L.iCCP!=null){const ee=13+H.length;$(V,T,ee),T+=4,A(V,T,"iCCP"),T+=4,A(V,T,"ICC profile"),T+=11,T+=2,V.set(H,T),T+=H.length,$(V,T,F(V,T-(ee+4),ee+4)),T+=4}if(L.pHYs!=null&&($(V,T,9),T+=4,A(V,T,"pHYs"),T+=4,$(V,T,L.pHYs[0]),T+=4,$(V,T,L.pHYs[1]),T+=4,V[T]=L.pHYs[2],T++,$(V,T,F(V,T-13,13)),T+=4),z&&($(V,T,8),T+=4,A(V,T,"acTL"),T+=4,$(V,T,_.frames.length),T+=4,$(V,T,L.loop!=null?L.loop:0),T+=4,$(V,T,F(V,T-12,12)),T+=4),_.ctype==3){for($(V,T,3*(U=_.plte.length)),T+=4,A(V,T,"PLTE"),T+=4,B=0;B<U;B++){const ee=3*B,ne=_.plte[B],he=255&ne,J=ne>>>8&255,ce=ne>>>16&255;V[T+ee+0]=he,V[T+ee+1]=J,V[T+ee+2]=ce}if(T+=3*U,$(V,T,F(V,T-3*U-4,3*U+4)),T+=4,W){for($(V,T,U),T+=4,A(V,T,"tRNS"),T+=4,B=0;B<U;B++)V[T+B]=_.plte[B]>>>24&255;T+=U,$(V,T,F(V,T-U-4,U+4)),T+=4}}let X=0;for(G=0;G<_.frames.length;G++){var Z=_.frames[G];z&&($(V,T,26),T+=4,A(V,T,"fcTL"),T+=4,$(V,T,X++),T+=4,$(V,T,Z.rect.width),T+=4,$(V,T,Z.rect.height),T+=4,$(V,T,Z.rect.x),T+=4,$(V,T,Z.rect.y),T+=4,D(V,T,O[G]),T+=2,D(V,T,1e3),T+=2,V[T]=Z.dispose,T++,V[T]=Z.blend,T++,$(V,T,F(V,T-30,30)),T+=4);const ee=Z.cimg;$(V,T,(U=ee.length)+(G==0?0:4)),T+=4;const ne=T;A(V,T,G==0?"IDAT":"fdAT"),T+=4,G!=0&&($(V,T,X++),T+=4),V.set(ee,T),T+=U,$(V,T,F(V,ne,T-ne)),T+=4}return $(V,T,0),T+=4,A(V,T,"IEND"),T+=4,$(V,T,F(V,T-4,4)),T+=4,V.buffer}function c(_,w,M){for(let O=0;O<_.frames.length;O++){const L=_.frames[O];L.rect.width;const F=L.rect.height,$=new Uint8Array(F*L.bpl+F);L.cimg=g(L.img,F,L.bpp,L.bpl,$,w,M)}}function d(_,w,M,O,L){const F=L[0],$=L[1],D=L[2],A=L[3],T=L[4],z=L[5];let H=6,W=8,j=255;for(var U=0;U<_.length;U++){const ve=new Uint8Array(_[U]);for(var B=ve.length,G=0;G<B;G+=4)j&=ve[G+3]}const V=j!=255,K=(function(fe,ye,ke,Ue,se,Oe){const Pe=[];for(var Ie=0;Ie<fe.length;Ie++){const Xe=new Uint8Array(fe[Ie]),te=new Uint32Array(Xe.buffer);var je;let ge=0,pe=0,me=ye,be=ke,Be=Ue?1:0;if(Ie!=0){const Se=Oe||Ue||Ie==1||Pe[Ie-2].dispose!=0?1:2;let ze=0,_e=1e9;for(let Re=0;Re<Se;Re++){var st=new Uint8Array(fe[Ie-1-Re]);const ot=new Uint32Array(fe[Ie-1-Re]);let $e=ye,Te=ke,He=-1,De=-1;for(let it=0;it<ke;it++)for(let gt=0;gt<ye;gt++)te[We=it*ye+gt]!=ot[We]&&(gt<$e&&($e=gt),gt>He&&(He=gt),it<Te&&(Te=it),it>De&&(De=it));He==-1&&($e=Te=He=De=0),se&&((1&$e)==1&&$e--,(1&Te)==1&&Te--);const Ze=(He-$e+1)*(De-Te+1);Ze<_e&&(_e=Ze,ze=Re,ge=$e,pe=Te,me=He-$e+1,be=De-Te+1)}st=new Uint8Array(fe[Ie-1-ze]),ze==1&&(Pe[Ie-1].dispose=2),je=new Uint8Array(me*be*4),t(st,ye,ke,je,me,be,-ge,-pe,0),Be=t(Xe,ye,ke,je,me,be,-ge,-pe,3)?1:0,Be==1?f(Xe,ye,ke,je,{x:ge,y:pe,width:me,height:be}):t(Xe,ye,ke,je,me,be,-ge,-pe,0)}else je=Xe.slice(0);Pe.push({rect:{x:ge,y:pe,width:me,height:be},img:je,blend:Be,dispose:0})}if(Ue)for(Ie=0;Ie<Pe.length;Ie++){if((et=Pe[Ie]).blend==1)continue;const Xe=et.rect,te=Pe[Ie-1].rect,ge=Math.min(Xe.x,te.x),pe=Math.min(Xe.y,te.y),me={x:ge,y:pe,width:Math.max(Xe.x+Xe.width,te.x+te.width)-ge,height:Math.max(Xe.y+Xe.height,te.y+te.height)-pe};Pe[Ie-1].dispose=1,Ie-1!=0&&u(fe,ye,ke,Pe,Ie-1,me,se),u(fe,ye,ke,Pe,Ie,me,se)}let ut=0;if(fe.length!=1)for(var We=0;We<Pe.length;We++){var et;ut+=(et=Pe[We]).rect.width*et.rect.height}return Pe})(_,w,M,F,$,D),X={},Z=[],ee=[];if(O!=0){const ve=[];for(G=0;G<K.length;G++)ve.push(K[G].img.buffer);const fe=(function(se){let Oe=0;for(var Pe=0;Pe<se.length;Pe++)Oe+=se[Pe].byteLength;const Ie=new Uint8Array(Oe);let je=0;for(Pe=0;Pe<se.length;Pe++){const st=new Uint8Array(se[Pe]),ut=st.length;for(let We=0;We<ut;We+=4){let et=st[We],Xe=st[We+1],te=st[We+2];const ge=st[We+3];ge==0&&(et=Xe=te=0),Ie[je+We]=et,Ie[je+We+1]=Xe,Ie[je+We+2]=te,Ie[je+We+3]=ge}je+=ut}return Ie.buffer})(ve),ye=p(fe,O);for(G=0;G<ye.plte.length;G++)Z.push(ye.plte[G].est.rgba);let ke=0;for(G=0;G<K.length;G++){const Ue=(he=K[G]).img.length;var ne=new Uint8Array(ye.inds.buffer,ke>>2,Ue>>2);ee.push(ne);const se=new Uint8Array(ye.abuf,ke,Ue);z&&a(he.img,he.rect.width,he.rect.height,Z,se,ne),he.img.set(se),ke+=Ue}}else for(U=0;U<K.length;U++){var he=K[U];const ve=new Uint32Array(he.img.buffer);var J=he.rect.width;for(B=ve.length,ne=new Uint8Array(B),ee.push(ne),G=0;G<B;G++){const fe=ve[G];if(G!=0&&fe==ve[G-1])ne[G]=ne[G-1];else if(G>J&&fe==ve[G-J])ne[G]=ne[G-J];else{let ye=X[fe];if(ye==null&&(X[fe]=ye=Z.length,Z.push(fe),Z.length>=300))break;ne[G]=ye}}}const ce=Z.length;for(ce<=256&&T==0&&(W=ce<=2?1:ce<=4?2:ce<=16?4:8,W=Math.max(W,A)),U=0;U<K.length;U++){(he=K[U]).rect.x,he.rect.y,J=he.rect.width;const ve=he.rect.height;let fe=he.img;new Uint32Array(fe.buffer);let ye=4*J,ke=4;if(ce<=256&&T==0){ye=Math.ceil(W*J/8);var ue=new Uint8Array(ye*ve);const Ue=ee[U];for(let se=0;se<ve;se++){G=se*ye;const Oe=se*J;if(W==8)for(var ae=0;ae<J;ae++)ue[G+ae]=Ue[Oe+ae];else if(W==4)for(ae=0;ae<J;ae++)ue[G+(ae>>1)]|=Ue[Oe+ae]<<4-4*(1&ae);else if(W==2)for(ae=0;ae<J;ae++)ue[G+(ae>>2)]|=Ue[Oe+ae]<<6-2*(3&ae);else if(W==1)for(ae=0;ae<J;ae++)ue[G+(ae>>3)]|=Ue[Oe+ae]<<7-1*(7&ae)}fe=ue,H=3,ke=1}else if(V==0&&K.length==1){ue=new Uint8Array(J*ve*3);const Ue=J*ve;for(G=0;G<Ue;G++){const se=3*G,Oe=4*G;ue[se]=fe[Oe],ue[se+1]=fe[Oe+1],ue[se+2]=fe[Oe+2]}fe=ue,H=2,ke=3,ye=3*J}he.img=fe,he.bpl=ye,he.bpp=ke}return{ctype:H,depth:W,plte:Z,frames:K}}function u(_,w,M,O,L,F,$){const D=Uint8Array,A=Uint32Array,T=new D(_[L-1]),z=new A(_[L-1]),H=L+1<_.length?new D(_[L+1]):null,W=new D(_[L]),j=new A(W.buffer);let U=w,B=M,G=-1,V=-1;for(let X=0;X<F.height;X++)for(let Z=0;Z<F.width;Z++){const ee=F.x+Z,ne=F.y+X,he=ne*w+ee,J=j[he];J==0||O[L-1].dispose==0&&z[he]==J&&(H==null||H[4*he+3]!=0)||(ee<U&&(U=ee),ee>G&&(G=ee),ne<B&&(B=ne),ne>V&&(V=ne))}G==-1&&(U=B=G=V=0),$&&((1&U)==1&&U--,(1&B)==1&&B--),F={x:U,y:B,width:G-U+1,height:V-B+1};const K=O[L];K.rect=F,K.blend=1,K.img=new Uint8Array(F.width*F.height*4),O[L-1].dispose==0?(t(T,w,M,K.img,F.width,F.height,-F.x,-F.y,0),f(W,w,M,K.img,F)):t(W,w,M,K.img,F.width,F.height,-F.x,-F.y,0)}function f(_,w,M,O,L){t(_,w,M,O,L.width,L.height,-L.x,-L.y,2)}function g(_,w,M,O,L,F,$){const D=[];let A,T=[0,1,2,3,4];F!=-1?T=[F]:(w*O>5e5||M==1)&&(T=[0]),$&&(A={level:0});const z=nE;for(var H=0;H<T.length;H++){for(let U=0;U<w;U++)m(L,_,U,O,M,T[H]);D.push(z.deflate(L,A))}let W,j=1e9;for(H=0;H<D.length;H++)D[H].length<j&&(W=H,j=D[H].length);return D[W]}function m(_,w,M,O,L,F){const $=M*O;let D=$+M;if(_[D]=F,D++,F==0)if(O<500)for(var A=0;A<O;A++)_[D+A]=w[$+A];else _.set(new Uint8Array(w.buffer,$,O),D);else if(F==1){for(A=0;A<L;A++)_[D+A]=w[$+A];for(A=L;A<O;A++)_[D+A]=w[$+A]-w[$+A-L]+256&255}else if(M==0){for(A=0;A<L;A++)_[D+A]=w[$+A];if(F==2)for(A=L;A<O;A++)_[D+A]=w[$+A];if(F==3)for(A=L;A<O;A++)_[D+A]=w[$+A]-(w[$+A-L]>>1)+256&255;if(F==4)for(A=L;A<O;A++)_[D+A]=w[$+A]-n(w[$+A-L],0,0)+256&255}else{if(F==2)for(A=0;A<O;A++)_[D+A]=w[$+A]+256-w[$+A-O]&255;if(F==3){for(A=0;A<L;A++)_[D+A]=w[$+A]+256-(w[$+A-O]>>1)&255;for(A=L;A<O;A++)_[D+A]=w[$+A]+256-(w[$+A-O]+w[$+A-L]>>1)&255}if(F==4){for(A=0;A<L;A++)_[D+A]=w[$+A]+256-n(0,w[$+A-O],0)&255;for(A=L;A<O;A++)_[D+A]=w[$+A]+256-n(w[$+A-L],w[$+A-O],w[$+A-L-O])&255}}}function p(_,w){const M=new Uint8Array(_),O=M.slice(0),L=new Uint32Array(O.buffer),F=y(O,w),$=F[0],D=F[1],A=M.length,T=new Uint8Array(A>>2);let z;if(M.length<2e7)for(var H=0;H<A;H+=4)z=b($,W=M[H]*.00392156862745098,j=M[H+1]*.00392156862745098,U=M[H+2]*.00392156862745098,B=M[H+3]*.00392156862745098),T[H>>2]=z.ind,L[H>>2]=z.est.rgba;else for(H=0;H<A;H+=4){var W=M[H]*.00392156862745098,j=M[H+1]*(1/255),U=M[H+2]*(1/255),B=M[H+3]*(1/255);for(z=$;z.left;)z=S(z.est,W,j,U,B)<=0?z.left:z.right;T[H>>2]=z.ind,L[H>>2]=z.est.rgba}return{abuf:O.buffer,inds:T,plte:D}}function y(_,w,M){M==null&&(M=1e-4);const O=new Uint32Array(_.buffer),L={i0:0,i1:_.length,bst:null,est:null,tdst:0,left:null,right:null};L.bst=k(_,L.i0,L.i1),L.est=C(L.bst);const F=[L];for(;F.length<w;){let D=0,A=0;for(var $=0;$<F.length;$++)F[$].est.L>D&&(D=F[$].est.L,A=$);if(D<M)break;const T=F[A],z=x(_,O,T.i0,T.i1,T.est.e,T.est.eMq255);if(T.i0>=z||T.i1<=z){T.est.L=0;continue}const H={i0:T.i0,i1:z,bst:null,est:null,tdst:0,left:null,right:null};H.bst=k(_,H.i0,H.i1),H.est=C(H.bst);const W={i0:z,i1:T.i1,bst:null,est:null,tdst:0,left:null,right:null};for(W.bst={R:[],m:[],N:T.bst.N-H.bst.N},$=0;$<16;$++)W.bst.R[$]=T.bst.R[$]-H.bst.R[$];for($=0;$<4;$++)W.bst.m[$]=T.bst.m[$]-H.bst.m[$];W.est=C(W.bst),T.left=H,T.right=W,F[A]=H,F.push(W)}for(F.sort(((D,A)=>A.bst.N-D.bst.N)),$=0;$<F.length;$++)F[$].ind=$;return[L,F]}function b(_,w,M,O,L){if(_.left==null)return _.tdst=(function(H,W,j,U,B){const G=W-H[0],V=j-H[1],K=U-H[2],X=B-H[3];return G*G+V*V+K*K+X*X})(_.est.q,w,M,O,L),_;const F=S(_.est,w,M,O,L);let $=_.left,D=_.right;F>0&&($=_.right,D=_.left);const A=b($,w,M,O,L);if(A.tdst<=F*F)return A;const T=b(D,w,M,O,L);return T.tdst<A.tdst?T:A}function S(_,w,M,O,L){const{e:F}=_;return F[0]*w+F[1]*M+F[2]*O+F[3]*L-_.eMq}function x(_,w,M,O,L,F){for(O-=4;M<O;){for(;E(_,M,L)<=F;)M+=4;for(;E(_,O,L)>F;)O-=4;if(M>=O)break;const $=w[M>>2];w[M>>2]=w[O>>2],w[O>>2]=$,M+=4,O-=4}for(;E(_,M,L)>F;)M-=4;return M+4}function E(_,w,M){return _[w]*M[0]+_[w+1]*M[1]+_[w+2]*M[2]+_[w+3]*M[3]}function k(_,w,M){const O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],L=[0,0,0,0],F=M-w>>2;for(let $=w;$<M;$+=4){const D=_[$]*.00392156862745098,A=_[$+1]*(1/255),T=_[$+2]*(1/255),z=_[$+3]*(1/255);L[0]+=D,L[1]+=A,L[2]+=T,L[3]+=z,O[0]+=D*D,O[1]+=D*A,O[2]+=D*T,O[3]+=D*z,O[5]+=A*A,O[6]+=A*T,O[7]+=A*z,O[10]+=T*T,O[11]+=T*z,O[15]+=z*z}return O[4]=O[1],O[8]=O[2],O[9]=O[6],O[12]=O[3],O[13]=O[7],O[14]=O[11],{R:O,m:L,N:F}}function C(_){const{R:w}=_,{m:M}=_,{N:O}=_,L=M[0],F=M[1],$=M[2],D=M[3],A=O==0?0:1/O,T=[w[0]-L*L*A,w[1]-L*F*A,w[2]-L*$*A,w[3]-L*D*A,w[4]-F*L*A,w[5]-F*F*A,w[6]-F*$*A,w[7]-F*D*A,w[8]-$*L*A,w[9]-$*F*A,w[10]-$*$*A,w[11]-$*D*A,w[12]-D*L*A,w[13]-D*F*A,w[14]-D*$*A,w[15]-D*D*A],z=T,H=N;let W=[Math.random(),Math.random(),Math.random(),Math.random()],j=0,U=0;if(O!=0)for(let G=0;G<16&&(W=H.multVec(z,W),U=Math.sqrt(H.dot(W,W)),W=H.sml(1/U,W),!(G!=0&&Math.abs(U-j)<1e-9));G++)j=U;const B=[L*A,F*A,$*A,D*A];return{Cov:T,q:B,e:W,L:j,eMq255:H.dot(H.sml(255,B),W),eMq:H.dot(W,B),rgba:(Math.round(255*B[3])<<24|Math.round(255*B[2])<<16|Math.round(255*B[1])<<8|Math.round(255*B[0])<<0)>>>0}}var N={multVec:(_,w)=>[_[0]*w[0]+_[1]*w[1]+_[2]*w[2]+_[3]*w[3],_[4]*w[0]+_[5]*w[1]+_[6]*w[2]+_[7]*w[3],_[8]*w[0]+_[9]*w[1]+_[10]*w[2]+_[11]*w[3],_[12]*w[0]+_[13]*w[1]+_[14]*w[2]+_[15]*w[3]],dot:(_,w)=>_[0]*w[0]+_[1]*w[1]+_[2]*w[2]+_[3]*w[3],sml:(_,w)=>[_*w[0],_*w[1],_*w[2],_*w[3]]};En.encode=function(w,M,O,L,F,$,D){L==null&&(L=0),D==null&&(D=!1);const A=d(w,M,O,L,[!1,!1,!1,0,D,!1]);return c(A,-1),l(A,M,O,F,$)},En.encodeLL=function(w,M,O,L,F,$,D,A){const T={ctype:0+(L==1?0:2)+(F==0?0:4),depth:$,frames:[]},z=(L+F)*$,H=z*M;for(let W=0;W<w.length;W++)T.frames.push({rect:{x:0,y:0,width:M,height:O},img:new Uint8Array(w[W]),blend:0,dispose:1,bpp:Math.ceil(z/8),bpl:Math.ceil(H/8)});return c(T,0,!0),l(T,M,O,D,A)},En.encode.compress=d,En.encode.dither=a,En.quantize=p,En.quantize.getKDtree=y,En.quantize.getNearest=b})();const gp={toArrayBuffer(t,e){const n=t.width,r=t.height,s=n<<2,o=t.getContext("2d").getImageData(0,0,n,r),i=new Uint32Array(o.data.buffer),a=(32*n+31)/32<<2,l=a*r,c=122+l,d=new ArrayBuffer(c),u=new DataView(d),f=1<<20;let g,m,p,y,b=f,S=0,x=0,E=0;function k(_){u.setUint16(x,_,!0),x+=2}function C(_){u.setUint32(x,_,!0),x+=4}function N(_){x+=_}k(19778),C(c),N(4),C(122),C(108),C(n),C(-r>>>0),k(1),k(32),C(3),C(l),C(2835),C(2835),N(8),C(16711680),C(65280),C(255),C(4278190080),C(1466527264),(function _(){for(;S<r&&b>0;){for(y=122+S*a,g=0;g<s;)b--,m=i[E++],p=m>>>24,u.setUint32(y+g,m<<8|p),g+=4;S++}E<i.length?(b=f,setTimeout(_,gp._dly)):e(d)})()},toBlob(t,e){this.toArrayBuffer(t,(n=>{e(new Blob([n],{type:"image/bmp"}))}))},_dly:9};var Qt={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},rE={[Qt.CHROME]:16384,[Qt.FIREFOX]:11180,[Qt.DESKTOP_SAFARI]:16384,[Qt.IE]:8192,[Qt.IOS]:4096,[Qt.ETC]:8192};const Dc=typeof window<"u",pp=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Wi=Dc&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),sE=(Dc||pp)&&(Wi&&Wi.getOriginalSymbol(window,"File")||typeof File<"u"&&File),mp=(Dc||pp)&&(Wi&&Wi.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function Ic(t,e,n=Date.now()){return new Promise((r=>{const s=t.split(","),o=s[0].match(/:(.*?);/)[1],i=globalThis.atob(s[1]);let a=i.length;const l=new Uint8Array(a);for(;a--;)l[a]=i.charCodeAt(a);const c=new Blob([l],{type:o});c.name=e,c.lastModified=n,r(c)}))}function bp(t){return new Promise(((e,n)=>{const r=new mp;r.onload=()=>e(r.result),r.onerror=s=>n(s),r.readAsDataURL(t)}))}function yp(t){return new Promise(((e,n)=>{const r=new Image;r.onload=()=>e(r),r.onerror=s=>n(s),r.src=t}))}function wr(){if(wr.cachedResult!==void 0)return wr.cachedResult;let t=Qt.ETC;const{userAgent:e}=navigator;return/Chrom(e|ium)/i.test(e)?t=Qt.CHROME:/iP(ad|od|hone)/i.test(e)&&/WebKit/i.test(e)?t=Qt.IOS:/Safari/i.test(e)?t=Qt.DESKTOP_SAFARI:/Firefox/i.test(e)?t=Qt.FIREFOX:(/MSIE/i.test(e)||document.documentMode)&&(t=Qt.IE),wr.cachedResult=t,wr.cachedResult}function vp(t,e){const n=wr(),r=rE[n];let s=t,o=e,i=s*o;const a=s>o?o/s:s/o;for(;i>r*r;){const l=(r+s)/2,c=(r+o)/2;l<c?(o=c,s=c*a):(o=l*a,s=l),i=s*o}return{width:s,height:o}}function Gi(t,e){let n,r;try{if(n=new OffscreenCanvas(t,e),r=n.getContext("2d"),r===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{n=document.createElement("canvas"),r=n.getContext("2d")}return n.width=t,n.height=e,[n,r]}function xp(t,e){const{width:n,height:r}=vp(t.width,t.height),[s,o]=Gi(n,r);return e&&/jpe?g/.test(e)&&(o.fillStyle="white",o.fillRect(0,0,s.width,s.height)),o.drawImage(t,0,0,s.width,s.height),s}function Yi(){return Yi.cachedResult!==void 0||(Yi.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),Yi.cachedResult}function Xi(t,e={}){return new Promise((function(n,r){let s,o;var i=function(){try{return o=xp(s,e.fileType||t.type),n([s,o])}catch(l){return r(l)}},a=function(l){try{var c=function(d){try{throw d}catch(u){return r(u)}};try{let d;return bp(t).then((function(u){try{return d=u,yp(d).then((function(f){try{return s=f,(function(){try{return i()}catch(g){return r(g)}})()}catch(g){return c(g)}}),c)}catch(f){return c(f)}}),c)}catch(d){c(d)}}catch(d){return r(d)}};try{if(Yi()||[Qt.DESKTOP_SAFARI,Qt.MOBILE_SAFARI].includes(wr()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(t).then((function(l){try{return s=l,i()}catch{return a()}}),a)}catch{a()}}))}function Ki(t,e,n,r,s=1){return new Promise((function(o,i){let a;if(e==="image/png"){let c,d,u;return c=t.getContext("2d"),{data:d}=c.getImageData(0,0,t.width,t.height),u=En.encode([d.buffer],t.width,t.height,4096*s),a=new Blob([u],{type:e}),a.name=n,a.lastModified=r,l.call(this)}{let c=function(){return l.call(this)};if(e==="image/bmp")return new Promise((d=>gp.toBlob(t,d))).then(function(d){try{return a=d,a.name=n,a.lastModified=r,c.call(this)}catch(u){return i(u)}}.bind(this),i);{let d=function(){return c.call(this)};if(typeof OffscreenCanvas=="function"&&t instanceof OffscreenCanvas)return t.convertToBlob({type:e,quality:s}).then(function(u){try{return a=u,a.name=n,a.lastModified=r,d.call(this)}catch(f){return i(f)}}.bind(this),i);{let u;return u=t.toDataURL(e,s),Ic(u,n,r).then(function(f){try{return a=f,d.call(this)}catch(g){return i(g)}}.bind(this),i)}}}function l(){return o(a)}}))}function Pn(t){t.width=0,t.height=0}function is(){return new Promise((function(t,e){let n,r,s,o;return is.cachedResult!==void 0?t(is.cachedResult):Ic("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(i){try{return n=i,Xi(n).then((function(a){try{return r=a[1],Ki(r,n.type,n.name,n.lastModified).then((function(l){try{return s=l,Pn(r),Xi(s).then((function(c){try{return o=c[0],is.cachedResult=o.width===1&&o.height===2,t(is.cachedResult)}catch(d){return e(d)}}),e)}catch(c){return e(c)}}),e)}catch(l){return e(l)}}),e)}catch(a){return e(a)}}),e)}))}function wp(t){return new Promise(((e,n)=>{const r=new mp;r.onload=s=>{const o=new DataView(s.target.result);if(o.getUint16(0,!1)!=65496)return e(-2);const i=o.byteLength;let a=2;for(;a<i;){if(o.getUint16(a+2,!1)<=8)return e(-1);const l=o.getUint16(a,!1);if(a+=2,l==65505){if(o.getUint32(a+=2,!1)!=1165519206)return e(-1);const c=o.getUint16(a+=6,!1)==18761;a+=o.getUint32(a+4,c);const d=o.getUint16(a,c);a+=2;for(let u=0;u<d;u++)if(o.getUint16(a+12*u,c)==274)return e(o.getUint16(a+12*u+8,c))}else{if((65280&l)!=65280)break;a+=o.getUint16(a,!1)}}return e(-1)},r.onerror=s=>n(s),r.readAsArrayBuffer(t)}))}function kp(t,e){const{width:n}=t,{height:r}=t,{maxWidthOrHeight:s}=e;let o,i=t;return isFinite(s)&&(n>s||r>s)&&([i,o]=Gi(n,r),n>r?(i.width=s,i.height=r/n*s):(i.width=n/r*s,i.height=s),o.drawImage(t,0,0,i.width,i.height),Pn(t)),i}function Cp(t,e){const{width:n}=t,{height:r}=t,[s,o]=Gi(n,r);switch(e>4&&e<9?(s.width=r,s.height=n):(s.width=n,s.height=r),e){case 2:o.transform(-1,0,0,1,n,0);break;case 3:o.transform(-1,0,0,-1,n,r);break;case 4:o.transform(1,0,0,-1,0,r);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,r,0);break;case 7:o.transform(0,-1,-1,0,r,n);break;case 8:o.transform(0,-1,1,0,0,n)}return o.drawImage(t,0,0,n,r),Pn(t),s}function Sp(t,e,n=0){return new Promise((function(r,s){let o,i,a,l,c,d,u,f,g,m,p,y,b,S,x,E,k,C,N,_;function w(O=5){if(e.signal&&e.signal.aborted)throw e.signal.reason;o+=O,e.onProgress(Math.min(o,100))}function M(O){if(e.signal&&e.signal.aborted)throw e.signal.reason;o=Math.min(Math.max(O,o),100),e.onProgress(o)}return o=n,i=e.maxIteration||10,a=1024*e.maxSizeMB*1024,w(),Xi(t,e).then(function(O){try{return[,l]=O,w(),c=kp(l,e),w(),new Promise((function(L,F){var $;if(!($=e.exifOrientation))return wp(t).then(function(A){try{return $=A,D.call(this)}catch(T){return F(T)}}.bind(this),F);function D(){return L($)}return D.call(this)})).then(function(L){try{return d=L,w(),is().then(function(F){try{return u=F?c:Cp(c,d),w(),f=e.initialQuality||1,g=e.fileType||t.type,Ki(u,g,t.name,t.lastModified,f).then(function($){try{{let A=function(){if(i--&&(x>a||x>b)){let z,H;return z=_?.95*N.width:N.width,H=_?.95*N.height:N.height,[k,C]=Gi(z,H),C.drawImage(N,0,0,z,H),f*=g==="image/png"?.85:.95,Ki(k,g,t.name,t.lastModified,f).then((function(W){try{return E=W,Pn(N),N=k,x=E.size,M(Math.min(99,Math.floor((S-x)/(S-a)*100))),A}catch(j){return s(j)}}),s)}return[1]},T=function(){return Pn(N),Pn(k),Pn(c),Pn(u),Pn(l),M(100),r(E)};if(m=$,w(),p=m.size>a,y=m.size>t.size,!p&&!y)return M(100),r(m);var D;return b=t.size,S=m.size,x=S,N=u,_=!e.alwaysKeepResolution&&p,(D=function(z){for(;z;){if(z.then)return void z.then(D,s);try{if(z.pop){if(z.length)return z.pop()?T.call(this):z;z=A}else z=z.call(this)}catch(H){return s(H)}}}.bind(this))(A)}}catch(A){return s(A)}}.bind(this),s)}catch($){return s($)}}.bind(this),s)}catch(F){return s(F)}}.bind(this),s)}catch(L){return s(L)}}.bind(this),s)}))}const oE=`
|
||
let scriptImported = false
|
||
self.addEventListener('message', async (e) => {
|
||
const { file, id, imageCompressionLibUrl, options } = e.data
|
||
options.onProgress = (progress) => self.postMessage({ progress, id })
|
||
try {
|
||
if (!scriptImported) {
|
||
// console.log('[worker] importScripts', imageCompressionLibUrl)
|
||
self.importScripts(imageCompressionLibUrl)
|
||
scriptImported = true
|
||
}
|
||
// console.log('[worker] self', self)
|
||
const compressedFile = await imageCompression(file, options)
|
||
self.postMessage({ file: compressedFile, id })
|
||
} catch (e) {
|
||
// console.error('[worker] error', e)
|
||
self.postMessage({ error: e.message + '\\n' + e.stack, id })
|
||
}
|
||
})
|
||
`;let Lc;function iE(t,e){return new Promise(((n,r)=>{Lc||(Lc=(function(i){const a=[];return a.push(i),URL.createObjectURL(new Blob(a))})(oE));const s=new Worker(Lc);s.addEventListener("message",(function(i){if(e.signal&&e.signal.aborted)s.terminate();else if(i.data.progress===void 0){if(i.data.error)return r(new Error(i.data.error)),void s.terminate();n(i.data.file),s.terminate()}else e.onProgress(i.data.progress)})),s.addEventListener("error",r),e.signal&&e.signal.addEventListener("abort",(()=>{r(e.signal.reason),s.terminate()})),s.postMessage({file:t,imageCompressionLibUrl:e.libURL,options:{...e,onProgress:void 0,signal:void 0}})}))}function Vt(t,e){return new Promise((function(n,r){let s,o,i,a,l,c;if(s={...e},i=0,{onProgress:a}=s,s.maxSizeMB=s.maxSizeMB||Number.POSITIVE_INFINITY,l=typeof s.useWebWorker!="boolean"||s.useWebWorker,delete s.useWebWorker,s.onProgress=g=>{i=g,typeof a=="function"&&a(i)},!(t instanceof Blob||t instanceof sE))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(t.type))return r(new Error("The file given is not an image"));if(c=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!l||typeof Worker!="function"||c)return Sp(t,s).then(function(g){try{return o=g,f.call(this)}catch(m){return r(m)}}.bind(this),r);var d=function(){try{return f.call(this)}catch(g){return r(g)}}.bind(this),u=function(g){try{return Sp(t,s).then((function(m){try{return o=m,d()}catch(p){return r(p)}}),r)}catch(m){return r(m)}};try{return s.libURL=s.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",iE(t,s).then((function(g){try{return o=g,d()}catch{return u()}}),u)}catch{u()}function f(){try{o.name=t.name,o.lastModified=t.lastModified}catch{}try{s.preserveExif&&t.type==="image/jpeg"&&(!s.fileType||s.fileType&&s.fileType===t.type)&&(o=hp(t,o))}catch{}return n(o)}}))}Vt.getDataUrlFromFile=bp,Vt.getFilefromDataUrl=Ic,Vt.loadImage=yp,Vt.drawImageInCanvas=xp,Vt.drawFileInCanvas=Xi,Vt.canvasToFile=Ki,Vt.getExifOrientation=wp,Vt.handleMaxWidthOrHeight=kp,Vt.followExifOrientation=Cp,Vt.cleanupCanvasMemory=Pn,Vt.isAutoOrientationInBrowser=is,Vt.approximateBelowMaximumCanvasSizeOfBrowser=vp,Vt.copyExifWithoutOrientation=hp,Vt.getBrowserName=wr,Vt.version="2.0.2";const aE=window.G7Core,Pc=t=>{const e=["B","KB","MB","GB"];let n=0,r=t;for(;r>=1024&&n<e.length-1;)r/=1024,n++;return`${r.toFixed(2)} ${e[n]}`},lE=t=>{if(t&&typeof t=="object"){const e=t;if(e.response?.data?.message)return e.response.data.message;if(e.response?.data?.errors){const n=Object.values(e.response.data.errors)[0];if(Array.isArray(n)&&n[0])return n[0]}if(e.message)return e.message}return t instanceof Error?t.message:"업로드 실패"},cE=t=>t?t.startsWith("image/")?"fa-file-image":t.startsWith("video/")?"fa-file-video":t.startsWith("audio/")?"fa-file-audio":t==="application/pdf"?"fa-file-pdf":t.includes("word")||t.includes("document")?"fa-file-word":t.includes("excel")||t.includes("spreadsheet")?"fa-file-excel":t.includes("zip")||t.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",At=(t,e)=>aE?.t?.(t,e)??t,_p=window.G7Core?.createLogger?.("Comp:FileUploader")??{log:(...t)=>console.log("[Comp:FileUploader]",...t),warn:(...t)=>console.warn("[Comp:FileUploader]",...t),error:(...t)=>console.error("[Comp:FileUploader]",...t)},kr=window.G7Core;function dE(t){const{attachmentableType:e,attachmentableId:n,collection:r,maxFiles:s,maxSize:o,maxConcurrentUploads:i,accept:a,imageCompression:l,roleIds:c,autoUpload:d,initialFiles:u,endpoints:f,onFilesChange:g,onUploadComplete:m,onUploadError:p,onRemove:y,onReorder:b,uploadTriggerEvent:S,confirmBeforeRemove:x,uploadParams:E}=t,[k,C]=v.useState(u),[N,_]=v.useState([]),[w,M]=v.useState(!1),O=v.useRef(null),L=v.useRef(0),F=v.useRef(new Set),$=v.useRef(new Map),D=v.useRef(null),[A,T]=v.useState(!1),[z,H]=v.useState(null),[W,j]=v.useState(!1),U=v.useRef(!1),[B,G]=v.useState([]),[V,K]=v.useState(!1),[X,Z]=v.useState(0),ee=v.useRef(0),[ne,he]=v.useState(new Map),J=v.useRef(new Map),ce=v.useRef(g);ce.current=g,v.useEffect(()=>{ce.current?.(N)},[N]),v.useEffect(()=>{if(U.current)return;const te=u.filter(me=>!F.current.has(me.id)&&(!me.hash||!F.current.has(me.hash))),ge=new Set(te.map(me=>me.id)),pe=Array.from($.current.values()).filter(me=>!ge.has(me.id)&&!F.current.has(me.id));C([...te,...pe])},[u]);const ue=v.useCallback(async te=>{const ge={maxSizeMB:l?.maxSizeMB??1,maxWidthOrHeight:l?.maxWidthOrHeight??1920,useWebWorker:!0};return await Vt(te,ge)},[l]),ae=v.useCallback(async te=>{const ge=k.length+N.length,pe=Math.max(0,s-ge),me=Array.from(te).slice(0,pe);if(te.length>pe){const be=Array.from(te).slice(pe),Be=At("attachment.upload_limit_exceeded",{max:s});p?.(Be,be[0]??te[0])}for(const be of me){if(be.size>o*1024*1024){p?.(`[${be.name}] 파일 크기(${Pc(be.size)})가 최대 허용 크기(${o}MB)를 초과합니다.`,be);continue}if(a){const Se="."+be.name.split(".").pop()?.toLowerCase();if(!a.split(",").map(_e=>_e.trim().toLowerCase()).includes(Se)){p?.(`[${be.name}] 허용되지 않는 파일 형식입니다. (허용: ${a})`,be);continue}}const Be={id:`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:be,original_filename:be.name,mime_type:be.type,size:be.size,size_formatted:Pc(be.size),status:"pending",progress:0};if(be.type.startsWith("image/")&&(Be.preview=URL.createObjectURL(be)),_(Se=>[...Se,Be]),be.type.startsWith("image/")&&l){_(Se=>Se.map(ze=>ze.id===Be.id?{...ze,status:"compressing"}:ze));try{const Se=await ue(be);_(ze=>ze.map(_e=>_e.id===Be.id?{..._e,compressedBlob:Se,size:Se.size,size_formatted:Pc(Se.size),status:"pending",progress:0}:_e))}catch{_(Se=>Se.map(ze=>ze.id===Be.id?{...ze,status:"error",error:"이미지 압축 실패"}:ze))}}}},[k.length,N.length,s,o,a,l,ue,p]),ve=v.useCallback(async te=>{const ge=new FormData,pe=te.compressedBlob?new File([te.compressedBlob],te.original_filename,{type:te.mime_type}):te.file;ge.append("file",pe),e&&ge.append("attachmentable_type",e),n&&ge.append("attachmentable_id",String(n)),ge.append("collection",r),c.forEach(me=>{ge.append("role_ids[]",String(me))}),E&&Object.entries(E).forEach(([me,be])=>{ge.append(me,be)});try{const me=await kr.api.post(f.upload,ge,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:Be=>{const Se=Math.round(Be.loaded*100/(Be.total??1));_(ze=>ze.map(_e=>_e.id===te.id?{..._e,progress:Se}:_e))}});return me?.data?.data??me?.data}catch(me){const be=lE(me);throw new Error(be)}},[e,n,r,c,f.upload]),fe=v.useCallback(async()=>{const te=N.filter(Se=>Se.status==="pending"||Se.status==="error");if(te.length===0)return D.current=k,[];const ge=[],pe=new Map,me=[...te],be=async()=>{for(;me.length>0&&L.current<i;){const Se=me.shift();L.current++,_(ze=>ze.map(_e=>_e.id===Se.id?{..._e,status:"uploading",progress:0}:_e));try{const ze=await ve(Se);if(ze)ge.push(ze),pe.set(String(Se.id),String(ze.hash)),$.current.set(ze.id,ze),_(_e=>_e.filter(Re=>Re.id!==Se.id)),C(_e=>[..._e,ze]),G(_e=>{if(_e.length===0)return _e;const Re=String(Se.id);return _e.some($e=>String($e)===Re)?_e.map($e=>String($e)===Re?String(ze.hash):$e):_e}),Se.preview&&URL.revokeObjectURL(Se.preview);else{const _e=At("attachment.upload_response_invalid");_(Re=>Re.map(ot=>ot.id===Se.id?{...ot,status:"error",error:_e}:ot)),p?.(`[${Se.original_filename}] ${_e}`,Se.file)}}catch(ze){const _e=ze instanceof Error?ze.message:"업로드 실패";_(Re=>Re.map(ot=>ot.id===Se.id?{...ot,status:"error",error:_e}:ot)),p?.(`[${Se.original_filename}] ${_e}`,Se.file)}finally{L.current--}}},Be=Array(Math.min(i,te.length)).fill(null).map(()=>be());if(await Promise.all(Be),ge.length>0){m?.(ge);const Se=[...k,...ge];if(B.length>0){const ze=B.map(ot=>pe.get(String(ot))??ot),_e=new Map(ze.map((ot,$e)=>[String(ot),$e])),Re=[...Se].sort((ot,$e)=>{const Te=_e.get(String(ot.hash))??Se.length,He=_e.get(String($e.hash))??Se.length;return Te-He}).map((ot,$e)=>({...ot,sort_order:$e,order:$e+1}));D.current=Re,f.reorder&&b&&b(Re)}else D.current=Se.map((ze,_e)=>({...ze,sort_order:_e,order:_e+1}))}else D.current=k;return ge},[N,i,ve,m,p,B,k,b,f.reorder]);v.useEffect(()=>{if(!S)return;const te=kr.componentEvent.on(S,async()=>{const ge=await fe(),pe=D.current??[...k,...ge];return{uploadedAttachments:ge,existingFiles:k,allFiles:pe}});return()=>{te()}},[S,fe,k]),v.useEffect(()=>{d&&N.some(te=>te.status==="pending")&&fe()},[d,N,fe]);const ye=v.useCallback(async te=>{j(!0);try{if(te.id&&f.delete){const pe=f.delete.replace(":id",String(te.id));await kr.api.delete(pe)}const ge=te.hash||te.id;te.id&&(F.current.add(te.id),$.current.delete(te.id)),te.hash&&F.current.add(te.hash),C(pe=>pe.filter(me=>(me.hash||me.id)!==ge)),y?.(te.hash||te.id),T(!1),H(null)}catch{_p.error("첨부파일 삭제 실패")}finally{j(!1)}},[y,f.delete]),ke=v.useCallback(async te=>{"hash"in te?x?(H(te),T(!0)):await ye(te):(te.preview&&URL.revokeObjectURL(te.preview),_(ge=>ge.filter(pe=>pe.id!==te.id)))},[x,ye]),Ue=v.useCallback(te=>{_(ge=>ge.map(pe=>pe.id===te.id?{...pe,status:"pending",error:void 0}:pe))},[]),se=v.useCallback(async te=>{const{arrayMove:ge}=await Promise.resolve().then(()=>DS),{active:pe,over:me}=te;if(!me||pe.id===me.id)return;const be=[...k,...N];let Be;if(B.length===0)Be=be;else{const Te=new Map(B.map((He,De)=>[String(He),De]));Be=[...be].sort((He,De)=>{const Ze="hash"in He?String(He.hash):String(He.id),it="hash"in De?String(De.hash):String(De.id);return(Te.get(Ze)??be.length)-(Te.get(it)??be.length)})}const Se=Be.findIndex(Te=>"hash"in Te?Te.hash===pe.id:Te.id===pe.id),ze=Be.findIndex(Te=>"hash"in Te?Te.hash===me.id:Te.id===me.id),_e=ge(Be,Se,ze);G(_e.map(Te=>"hash"in Te?Te.hash:Te.id));const Re=_e.filter(Te=>"hash"in Te),ot=_e.filter(Te=>!("hash"in Te));U.current=!0,C(Re),_(ot);const $e=Re.map((Te,He)=>({...Te,sort_order:He,order:He+1}));if(Re.length>0&&f.reorder){const Te=Re.map((He,De)=>({id:He.id,order:De+1}));try{const He=await kr.api.patch(f.reorder,{order:Te});kr.toast.success(He.message)}catch(He){const De=He instanceof Error?He.message:At("attachment.reorder_failed");kr.toast.error(De)}}b?.($e)},[k,N,B,f.reorder,b]),Oe=v.useMemo(()=>[...k,...N].filter(te=>"is_image"in te?te.is_image:te.mime_type?.startsWith("image/")??!1),[k,N]),Pe=v.useCallback(te=>{const ge=Oe.findIndex(pe=>"hash"in te&&"hash"in pe?pe.hash===te.hash:"id"in te&&"id"in pe&&!("hash"in te)&&!("hash"in pe)?pe.id===te.id:!1);ge!==-1&&(ee.current+=1,Z(ge),K(!0))},[Oe]);v.useEffect(()=>{let te=!1;return(async()=>{const pe=k.filter(be=>be.is_image),me=new Set(pe.map(be=>be.id));for(const[be,Be]of J.current)me.has(be)||(URL.revokeObjectURL(Be),J.current.delete(be));for(const be of pe){if(te)break;if(!J.current.has(be.id))try{const Be=await kr.api.get(be.download_url,{responseType:"blob"});if(!te&&Be){const Se=URL.createObjectURL(Be);J.current.set(be.id,Se),he(new Map(J.current))}}catch(Be){_p.error("Failed to load authenticated image:",Be)}}})(),()=>{te=!0}},[k]),v.useEffect(()=>()=>{J.current.forEach(te=>URL.revokeObjectURL(te)),J.current.clear()},[]);const Ie=v.useCallback(async te=>{const{executeImageDownload:ge}=await Promise.resolve().then(()=>Z2);await ge({src:te.download_url,downloadUrl:te.download_url,filename:te.original_filename,downloadRequiresAuth:!0})},[]),je=v.useMemo(()=>{const te=[...k,...N];if(B.length===0)return te;const ge=new Map(B.map((pe,me)=>[String(pe),me]));return[...te].sort((pe,me)=>{const be="hash"in pe?String(pe.hash):String(pe.id),Be="hash"in me?String(me.hash):String(me.id),Se=ge.get(be)??te.length,ze=ge.get(Be)??te.length;return Se-ze})},[k,N,B]),st=je.length,ut=st>0,We=st<s,et=v.useCallback(()=>_([]),[]),Xe=v.useCallback(()=>N,[N]);return{existingFiles:k,pendingFiles:N,isDragOver:w,setIsDragOver:M,isDeleting:W,totalCount:st,hasFiles:ut,canAddMore:We,allItems:je,imageFiles:Oe,handleFiles:ae,handleRemove:ke,handleRetry:Ue,handleUploadAll:fe,handleOpenGallery:Pe,handleDownload:Ie,handleDragEnd:se,inputRef:O,galleryOpen:V,setGalleryOpen:K,galleryStartIndex:X,galleryKeyRef:ee,confirmDialogOpen:A,setConfirmDialogOpen:T,itemToDelete:z,executeRemoveAttachment:ye,authenticatedImageUrls:ne,clear:et,getPendingFiles:Xe}}const uE=({isDragOver:t,canAddMore:e,onFiles:n,setIsDragOver:r,inputRef:s,accept:o,maxFiles:i,maxSize:a,disabled:l,children:c})=>{const d=e&&!l;return h.jsxs(I,{className:`
|
||
relative border-2 border-dashed rounded-lg transition-colors
|
||
${l?"opacity-60 cursor-not-allowed":""}
|
||
${t&&!l?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
|
||
`,onDragOver:u=>{u.preventDefault(),d&&r(!0)},onDragLeave:()=>r(!1),onDrop:u=>{u.preventDefault(),r(!1),d&&n(u.dataTransfer.files)},children:[h.jsx("input",{ref:s,type:"file",multiple:!0,accept:o,onChange:u=>u.target.files&&!l&&n(u.target.files),className:"hidden",disabled:l}),!c&&h.jsxs(I,{className:`p-8 text-center transition-colors ${l?"cursor-not-allowed":"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,onClick:()=>!l&&s.current?.click(),children:[h.jsx(pt,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),h.jsx(bt,{className:"text-sm text-gray-600 dark:text-gray-400",children:At("attachment.drop_or_click")}),h.jsxs(bt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[At("attachment.upload_limit",{maxFiles:i,maxSize:a}),o&&` (${o})`]})]}),c]})},fE=window.G7Core,hE=window.G7Core?.createLogger?.("Comp:SortableThumbnail")??{log:(...t)=>console.log("[Comp:SortableThumbnail]",...t),warn:(...t)=>console.warn("[Comp:SortableThumbnail]",...t),error:(...t)=>console.error("[Comp:SortableThumbnail]",...t)},gE=({file:t,onRemove:e,onRetry:n,onImageClick:r,onDownload:s,isPrimary:o,onPrimaryClick:i,disabled:a})=>{const{attributes:l,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:g}=Di({id:"hash"in t?t.hash:t.id}),m={transform:Ln.Transform.toString(u),transition:f,opacity:g?.5:1},p="status"in t&&t.status!==void 0,y=p?t.status:"done",b=y==="uploading",S=y==="compressing",x=y==="error",E=p?t.progress:100,k=p?t.preview:void 0,C=p?t.mime_type?.startsWith("image/")??!1:t.is_image,[N,_]=v.useState(void 0),w=!p&&C?t.download_url:void 0;v.useEffect(()=>{if(!w){_(void 0);return}let O=!0,L;return(async()=>{try{const $=await fE.api.get(w,{responseType:"blob"});O&&$&&(L=URL.createObjectURL($),_(L))}catch($){hE.error("Failed to load authenticated image:",$)}})(),()=>{O=!1,L&&URL.revokeObjectURL(L)}},[w]);const M=N;return h.jsxs(I,{ref:d,style:m,className:"relative group bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[h.jsxs(I,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${C||!p?"cursor-pointer":""}`,onClick:()=>{b||S||(C&&r?r():!p&&s&&s())},children:[k||M?h.jsx(yn,{src:k||M,alt:t.original_filename,className:"w-full h-full object-cover"}):h.jsx(pt,{className:`fa-solid ${cE(t.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(b||S)&&h.jsxs(I,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[h.jsx(I,{className:"w-3/4 h-2 bg-gray-700 rounded-full overflow-hidden",children:h.jsx(I,{className:"h-full bg-blue-500 transition-all",style:{width:`${E}%`}})}),h.jsxs(Q,{className:"text-white text-xs mt-1",children:[E,"%"]})]}),x&&h.jsx(I,{className:"absolute inset-0 bg-red-500/50 flex items-center justify-center",children:h.jsx(pt,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),i&&h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),i()},className:`absolute top-1.5 left-1.5 z-10 p-1 rounded-full transition-colors ${o?"bg-yellow-500 text-white":"bg-gray-800/50 text-gray-300 hover:bg-yellow-500 hover:text-white opacity-0 group-hover:opacity-100"}`,title:At(o?"attachment.primary_image":"attachment.set_as_primary"),children:h.jsx(pt,{className:"fa-solid fa-star text-xs"})}),h.jsxs(I,{className:`absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-start justify-end p-1 gap-1 opacity-0 group-hover:opacity-100 ${a?"hidden":""}`,children:[h.jsx(oe,{type:"button",...l,...c,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-gray-600 dark:text-gray-300 hover:bg-white cursor-grab active:cursor-grabbing",title:At("attachment.drag_to_reorder"),onClick:O=>O.stopPropagation(),children:h.jsx(pt,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&s&&h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),s()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:At("common.download"),children:h.jsx(pt,{className:"fa-solid fa-download text-sm"})}),x&&n&&h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),n()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:At("common.retry"),children:h.jsx(pt,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),e()},disabled:b||S,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:At("common.delete"),children:h.jsx(pt,{className:"fa-solid fa-times text-sm"})})]})]}),h.jsxs(I,{className:`p-2 ${!p&&s?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&s&&s()},children:[h.jsx(bt,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:t.original_filename,children:t.original_filename}),h.jsx(bt,{className:"text-xs text-gray-500 dark:text-gray-400",children:t.size_formatted})]})]})},pE=({allItems:t,canAddMore:e,totalCount:n,maxFiles:r,maxSize:s,accept:o,onRemove:i,onRetry:a,onImageClick:l,onDownload:c,onDragEnd:d,onAddClick:u,enablePrimarySelection:f,primaryFileId:g,onPrimaryChange:m,disabled:p})=>{const y=Wl(qr(Ys,{activationConstraint:{distance:8}}),qr(Gs,{coordinateGetter:Ii}));return h.jsxs(I,{className:"p-3",children:[h.jsx(tc,{sensors:y,collisionDetection:Gl,onDragEnd:d,children:h.jsx(Ai,{items:t.map(b=>"hash"in b?b.hash:b.id),strategy:Oi,children:h.jsxs(I,{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:[t.map(b=>{const S="hash"in b,x=S?b.is_image:b.mime_type?.startsWith("image/")??!1;return h.jsx(gE,{file:b,onRemove:()=>i(b),onRetry:"status"in b&&b.status==="error"?()=>a(b):void 0,onImageClick:x?()=>l(b):void 0,onDownload:S?()=>c(b):void 0,isPrimary:f&&S&&(b.hash||b.id)===g,onPrimaryClick:f&&S?()=>m?.(b.hash||b.id):void 0,disabled:p},S?b.hash:b.id)}),e&&!p&&h.jsxs(I,{className:"aspect-square flex flex-col items-center justify-center border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer hover:border-gray-400 dark:hover:border-gray-500 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:u,children:[h.jsx(pt,{className:"fa-solid fa-plus text-2xl text-gray-400 dark:text-gray-500 mb-1"}),h.jsx(Q,{className:"text-xs text-gray-500 dark:text-gray-400",children:At("common.add")})]})]})})}),h.jsxs(I,{className:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-700 flex justify-between items-center text-xs text-gray-500 dark:text-gray-400",children:[h.jsx(Q,{children:At("attachment.attached_count",{count:n,max:r})}),h.jsxs(Q,{children:[At("attachment.max_size",{size:s}),o&&` (${o})`]})]})]})},Ep=v.forwardRef(({uploadTriggerEvent:t,attachmentableType:e,attachmentableId:n,collection:r="default",maxFiles:s=10,maxSize:o=10,maxConcurrentUploads:i=3,accept:a,imageCompression:l,roleIds:c=[],autoUpload:d=!0,onFilesChange:u,onUploadComplete:f,onUploadError:g,onRemove:m,onReorder:p,initialFiles:y=[],disabled:b=!1,className:S="",confirmBeforeRemove:x=!1,confirmRemoveTitle:E,confirmRemoveMessage:k,apiEndpoints:C,uploadParams:N,enablePrimarySelection:_=!1,primaryFileId:w,onPrimaryChange:M,id:O,editorAttrs:L},F)=>{const $={upload:C?.upload??"/api/admin/attachments",delete:C?.delete??"/api/admin/attachments/:id",reorder:C?.reorder??"/api/admin/attachments/reorder"},D=dE({attachmentableType:e,attachmentableId:n,collection:r,maxFiles:s,maxSize:o,maxConcurrentUploads:i,accept:a,imageCompression:l,roleIds:c,autoUpload:d,initialFiles:y,endpoints:$,onFilesChange:u,onUploadComplete:f,onUploadError:g,onRemove:m,onReorder:p,uploadTriggerEvent:t,confirmBeforeRemove:x,uploadParams:N});v.useImperativeHandle(F,()=>({uploadAll:D.handleUploadAll,clear:D.clear,getPendingFiles:D.getPendingFiles}));const A=v.useMemo(()=>D.imageFiles.map(z=>{const H=!("hash"in z),W=z,j=z;return H?{src:W.preview||"",filename:W.original_filename,title:W.original_filename,downloadRequiresAuth:!1}:{src:D.authenticatedImageUrls.get(j.id)||j.download_url,downloadUrl:j.download_url,filename:j.original_filename,title:j.original_filename,downloadRequiresAuth:!0}}),[D.imageFiles,D.authenticatedImageUrls]),T=v.useMemo(()=>({existingFiles:D.existingFiles,pendingFiles:D.pendingFiles,isDragOver:D.isDragOver,isDeleting:D.isDeleting,maxFiles:s,maxSize:o,accept:a,endpoints:$,confirmBeforeRemove:x,totalCount:D.totalCount,hasFiles:D.hasFiles,canAddMore:D.canAddMore,allItems:D.allItems,imageFiles:D.imageFiles,handleFiles:D.handleFiles,handleRemove:D.handleRemove,handleRetry:D.handleRetry,handleUploadAll:D.handleUploadAll,handleOpenGallery:D.handleOpenGallery,handleDownload:D.handleDownload,handleDragEnd:D.handleDragEnd,setIsDragOver:D.setIsDragOver,inputRef:D.inputRef,galleryOpen:D.galleryOpen,setGalleryOpen:D.setGalleryOpen,galleryStartIndex:D.galleryStartIndex,galleryKeyRef:D.galleryKeyRef,confirmDialogOpen:D.confirmDialogOpen,setConfirmDialogOpen:D.setConfirmDialogOpen,itemToDelete:D.itemToDelete,executeRemoveAttachment:D.executeRemoveAttachment,authenticatedImageUrls:D.authenticatedImageUrls}),[D,s,o,a,$,x]);return h.jsx(J2,{value:T,children:h.jsxs(I,{id:O,className:S,...L,children:[h.jsx(uE,{isDragOver:D.isDragOver,canAddMore:D.canAddMore,onFiles:D.handleFiles,setIsDragOver:D.setIsDragOver,inputRef:D.inputRef,accept:a,maxFiles:s,maxSize:o,disabled:b,children:D.hasFiles&&h.jsx(pE,{allItems:D.allItems,canAddMore:D.canAddMore,totalCount:D.totalCount,maxFiles:s,maxSize:o,accept:a,onRemove:D.handleRemove,onRetry:D.handleRetry,onImageClick:D.handleOpenGallery,onDownload:D.handleDownload,onDragEnd:D.handleDragEnd,onAddClick:()=>D.inputRef.current?.click(),enablePrimarySelection:_,primaryFileId:w,onPrimaryChange:M,disabled:b})}),x&&h.jsx(ru,{isOpen:D.confirmDialogOpen,onClose:()=>{D.isDeleting||D.setConfirmDialogOpen(!1)},title:E??At("attachment.delete_confirm_title"),message:k??At("attachment.delete_confirm_message"),confirmText:At("common.delete"),confirmButtonVariant:"danger",onConfirm:()=>{D.itemToDelete&&D.executeRemoveAttachment(D.itemToDelete)},isLoading:D.isDeleting,loadingText:At("attachment.deleting")}),A.length>0&&D.galleryOpen&&h.jsx(Bi,{images:A,isOpen:!0,onClose:()=>D.setGalleryOpen(!1),startIndex:D.galleryStartIndex,showDownload:!0},`gallery-${D.galleryKeyRef.current}`)]})})});Ep.displayName="FileUploader";const mE=({name:t,value:e,options:n,onChange:r,disabled:s=!1,inline:o=!1,className:i="",size:a="md",label:l,error:c,id:d,editorAttrs:u})=>{const[f,g]=v.useState(()=>e??"");v.useEffect(()=>{g(e??"")},[e]);const m=S=>{const x=S.target.value;g(x),r&&!s&&r(S)},y={sm:{radio:"w-3.5 h-3.5",label:"text-xs",gap:"gap-1.5"},md:{radio:"w-4 h-4",label:"text-sm",gap:"gap-2"},lg:{radio:"w-5 h-5",label:"text-base",gap:"gap-2.5"}}[a],b=o?"flex flex-wrap items-center gap-4":"flex flex-col gap-2";return h.jsxs(I,{className:i,id:d,...u,children:[l&&h.jsx(Q,{className:`block mb-2 font-medium text-gray-700 dark:text-gray-300 ${y.label}`,children:l}),h.jsx(I,{className:b,children:n.map(S=>{const x=String(S.value)===String(f),E=s||S.disabled;return h.jsxs(rn,{className:`inline-flex items-center ${y.gap} ${E?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[h.jsx("input",{type:"radio",name:t,value:S.value,checked:x,onChange:m,disabled:E,className:`
|
||
${y.radio}
|
||
text-blue-600
|
||
bg-gray-100 dark:bg-gray-700
|
||
border-gray-300 dark:border-gray-600
|
||
focus:ring-blue-500 dark:focus:ring-blue-600
|
||
focus:ring-2
|
||
dark:ring-offset-gray-800
|
||
${E?"cursor-not-allowed":"cursor-pointer"}
|
||
`}),h.jsx(Q,{className:`
|
||
${y.label}
|
||
font-medium
|
||
text-gray-900 dark:text-gray-300
|
||
`,children:S.label})]},S.value)})}),c&&h.jsx(Q,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:c})]})},as=()=>window.G7Core,qi=(t,e)=>as()?.t?.(t,e)??t,bE=()=>as()?.locale?.supported?.()??["ko","en"],yE=()=>as()?.locale?.current?.()??"ko",Mp=t=>{const e=qi(`common.language_${t}`);return e===`common.language_${t}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[t]||t.toUpperCase():e},vE=({content:t="",value:e,onChange:n,multilingual:r=!1,isHtml:s=!1,onIsHtmlChange:o,rows:i=15,placeholder:a="",label:l,showHtmlModeToggle:c=!0,contentClassName:d="",purifyConfig:u,className:f="",name:g="content",htmlFieldName:m="content_mode",readOnly:p=!1,id:y,editorAttrs:b})=>{const S=v.useMemo(()=>bE(),[]),x=v.useMemo(()=>yE(),[]),[E,k]=v.useState(x),[C,N]=v.useState(s),[_,w]=v.useState(t),[M,O]=v.useState(e??{}),[L,F]=v.useState(!1);v.useEffect(()=>{N(s)},[s]),v.useEffect(()=>{r||w(t)},[t,r]),v.useEffect(()=>{r&&e&&O(e)},[e,r]);const $=v.useCallback(j=>{const U=j.target.value;if(w(U),n){const B=as()?.createChangeEvent?.({value:U,name:g,type:"textarea"})??{target:{name:g,value:U}};n(B)}},[n,g]),D=v.useCallback((j,U)=>{const B={...M,[j]:U};if(O(B),n){const G=as()?.createChangeEvent?.({value:B,name:g,type:"multilingual"})??{target:{name:g,value:B}};n(G)}},[n,g,M]),A=v.useCallback(j=>{const U=j.target.checked;if(N(U),U||F(!1),o){const B=as()?.createChangeEvent?.({checked:U,name:m,type:"checkbox"})??{target:{name:m,checked:U}};o(B)}},[o,m]),T=v.useCallback(()=>{F(j=>!j)},[]),z=r?M[E]??"":_,H=v.useCallback(j=>!!M[j]?.trim(),[M]),W=()=>h.jsx(I,{className:"flex flex-wrap items-center gap-2 mb-3",children:S.map(j=>{const U=j===x,B=E===j;return h.jsxs(oe,{type:"button",className:`
|
||
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
||
${B?U?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":U?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
||
`,onClick:()=>k(j),children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),h.jsx(Q,{children:Mp(j)}),U&&h.jsx(Q,{className:"text-red-500",children:"*"}),H(j)&&!B&&h.jsx(re,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"})]},j)})});return h.jsxs(I,{className:`space-y-2 ${f}`,id:y,...b,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[l&&h.jsx(rn,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:l}),h.jsxs(I,{className:"flex items-center gap-3",children:[C&&!p&&h.jsx(oe,{type:"button",onClick:T,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${L?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:qi(L?"common.preview_off":"common.preview")}),c&&h.jsxs(rn,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[h.jsx(wt,{type:"checkbox",name:m,checked:C,onChange:A,disabled:p,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(I,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:qi("common.html_mode")})]})]})]}),r&&W(),!L&&(r?S.map(j=>h.jsx(I,{className:E===j?"block":"hidden",children:h.jsx(Zn,{name:`${g}[${j}]`,value:M[j]??"",onChange:U=>D(j,U.target.value),placeholder:`${a} (${Mp(j)})`,rows:i,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${C?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})},j)):h.jsx(Zn,{name:g,value:_,onChange:$,placeholder:a,rows:i,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${C?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})),L&&h.jsx(I,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:h.jsx(Za,{content:z,isHtml:!0,className:d||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:u})})]})},Np="g7_dismissed_warnings";function Op(){try{const t=sessionStorage.getItem(Np);return t?JSON.parse(t):[]}catch{return[]}}function xE(t){try{const e=Op();e.includes(t)||(e.push(t),sessionStorage.setItem(Np,JSON.stringify(e)))}catch{}}function wE(t){switch(t){case"error":return"error";case"warning":return"warning";default:return"info"}}const kE=({warnings:t,className:e=""})=>{const[n,r]=v.useState([]);v.useEffect(()=>{r(Op())},[]);const s=v.useCallback(i=>{xE(i),r(a=>[...a,i])},[]);if(!t||t.length===0)return null;const o=t.filter(i=>!n.includes(i.id));return o.length===0?null:h.jsx(I,{className:`space-y-2 ${e}`.trim(),children:o.map(i=>h.jsx(cu,{type:wE(i.level),message:i.message,dismissible:!0,onDismiss:()=>s(i.id)},i.id))})},Tp=window.G7Core?.createLogger?.("Comp:FilterVisibility")??{log:(...t)=>console.log("[Comp:FilterVisibility]",...t),warn:(...t)=>console.warn("[Comp:FilterVisibility]",...t),error:(...t)=>console.error("[Comp:FilterVisibility]",...t)},CE=({id:t,visibleFilters:e,defaultFilters:n=[],onFilterVisibilityChange:r})=>{const[s,o]=v.useState(!1),i=v.useRef(!0),a=v.useMemo(()=>{try{const f=window.G7Core?.AuthManager?.getInstance();return f?f.getUser()?.uuid:void 0}catch{return}},[]),l=v.useMemo(()=>`g7_filters_${t}${a!==void 0?`_${a}`:""}`,[t,a]),c=v.useCallback(()=>{try{const f=localStorage.getItem(l);if(f){const g=JSON.parse(f);if(Array.isArray(g))return g}}catch(f){Tp.warn("Failed to load from localStorage:",f)}return null},[l]),d=v.useCallback(f=>{try{localStorage.setItem(l,JSON.stringify(f))}catch(g){Tp.warn("Failed to save to localStorage:",g)}},[l]),u=v.useCallback(()=>{const f=c();return f||(e&&e.length>0?e:n)},[c,e,n]);return v.useEffect(()=>{if(!s){const f=u();r&&f.length>0&&r(f),o(!0)}},[s,r,u]),v.useEffect(()=>{if(s&&e&&e.length>0){if(i.current){i.current=!1;return}d(e)}},[s,e,d]),null},SE=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...t)=>console.log("[Comp:SlotContainer]",...t),warn:(...t)=>console.warn("[Comp:SlotContainer]",...t),error:(...t)=>console.error("[Comp:SlotContainer]",...t)};function _E(t,e){return e&&t&&typeof t.id=="string"&&t.id.length>0?{...t,id:`${t.id}__${e}`}:t}const EE=({slotId:t,className:e="",emptyContent:n,style:r,id:s,children:o})=>{const[i,a]=v.useState([]),[,l]=v.useState({}),c=v.useCallback(()=>{const m=window.__slotContextValue;if(m)return m;const p=window.G7Core;return p&&p.getSlotContext?.()||null},[]),d=v.useCallback(()=>{const m=c();m&&m.isEnabled&&a(m.getSlotComponents(t))},[t,c]);v.useEffect(()=>{const m=c();return!m||!m.isEnabled?void 0:(d(),m.subscribeToSlot(t,()=>{d(),l({})}))},[t,c,d]);const u=v.useCallback(()=>{const m=window.G7Core;return m?m.getDynamicRenderer?.():null},[]);if(i.length===0)return n?h.jsx(I,{className:e,style:r,id:s,children:n}):o?h.jsx(I,{className:e,style:r,id:s,children:o}):null;const f=u(),g=window.G7Core;return!f||!g?(SE.error("G7Core or DynamicRenderer not available"),null):h.jsxs(I,{className:e,style:r,id:s,children:[i.map(m=>{const{componentDef:p,dataContext:y,parentFormContext:b,getParentComponentContext:S,translationContext:x}=m,E=_E(p,s);return h.jsx(f,{componentDef:E,dataContext:y,translationContext:x,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:S?.(),parentFormContextProp:b,isRootRenderer:!1},E.id||`slot-${t}-${m.order}`)}),o]})},Ap=(t,e)=>window.G7Core?.t?.(t,e)??t,Dp=(t,e,n)=>window.G7Core?.renderComponentLayout?.(t,e,n)??null,ME=({options:t=[],value:e,onChange:n,placeholder:r,disabled:s=!1,className:o="",maxHeight:i="320px",children:a,selectedChildren:l,__componentLayoutDefs:c,id:d,editorAttrs:u})=>{const[f,g]=v.useState(!1),m=v.useRef(null),p=v.useRef(null),y=v.useMemo(()=>e==null?null:t.find(C=>String(C.value)===String(e))||null,[t,e]);v.useEffect(()=>{const C=N=>{m.current&&!m.current.contains(N.target)&&g(!1)};return f&&document.addEventListener("mousedown",C),()=>{document.removeEventListener("mousedown",C)}},[f]),v.useEffect(()=>{const C=N=>{N.key==="Escape"&&f&&(g(!1),p.current?.focus())};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f]);const b=v.useCallback(()=>{s||g(C=>!C)},[s]),S=v.useCallback(C=>{n&&n({target:{value:C},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),p.current?.focus()},[n]),x=r??Ap("common.select"),E=()=>{if(!y)return h.jsx(Q,{className:"text-gray-400 dark:text-gray-500",children:x});if(c?.selected){const C=Dp(c.selected,{item:y,isSelected:!0},"selected");if(C)return C}return l||h.jsx(Q,{className:"truncate",children:y.label})},k=(C,N)=>h.jsxs(I,{className:"flex items-center justify-between w-full",children:[h.jsx(Q,{className:N?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-900 dark:text-white",children:C.label}),N&&h.jsx(Hn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]});return h.jsxs(I,{ref:m,className:`relative ${o}`,id:d,...u,children:[h.jsxs(oe,{ref:p,type:"button",onClick:b,disabled:s,className:`
|
||
w-full px-4 py-2.5
|
||
bg-gray-100 dark:bg-gray-700
|
||
border-0 rounded-xl
|
||
text-sm text-gray-700 dark:text-gray-200 font-medium
|
||
focus:ring-2 focus:ring-blue-500 focus:outline-none
|
||
flex items-center justify-between gap-2
|
||
text-left cursor-pointer
|
||
disabled:opacity-50 disabled:cursor-not-allowed
|
||
`,"aria-haspopup":"listbox","aria-expanded":f,children:[h.jsx(I,{className:"flex-1 min-w-0",children:E()}),h.jsx(Hn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&h.jsx(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",role:"listbox",children:h.jsx(I,{className:"overflow-auto",style:{maxHeight:i},children:t.length===0?h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:Ap("common.no_options")}):t.map((C,N)=>{const _=String(C.value)===String(e);return h.jsx(oe,{type:"button",onClick:()=>!C.disabled&&S(C.value),disabled:C.disabled,className:`
|
||
w-full px-4 py-3 text-left text-sm
|
||
hover:bg-gray-100 dark:hover:bg-gray-700
|
||
transition-colors
|
||
${_?"bg-blue-50 dark:bg-blue-900/20":""}
|
||
${C.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
||
`,role:"option","aria-selected":_,"data-item-value":C.value,"data-item-index":N,"data-item-selected":_,children:c?.item?Dp(c.item,{item:C,index:N,isSelected:_},`item-${N}`):a||k(C,_)},C.value)})})})]})};function NE(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}const OE=({value:t,checked:e=!1,icon:n,label:r,variant:s="blue",customColor:o,className:i="",style:a,onChange:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(!1),g="inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium border cursor-pointer transition-all";if(o){const b=NE(o),S=document.documentElement.classList.contains("dark");let x;return e?x={backgroundColor:o,color:"#ffffff",borderColor:o,opacity:u?.85:1}:x=b?{backgroundColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${u?S?.25:.12:S?.15:.06})`,color:o,borderColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${S?.3:.2})`}:{},h.jsxs(rn,{className:`${g} ${i}`,style:{...x,...a},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),id:c,...d,children:[h.jsx(wt,{type:"checkbox",value:t,checked:e,onChange:E=>{l?.(E)},className:"hidden"}),n&&h.jsx(re,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})}const y=e?{green:"bg-green-600 dark:bg-green-600 text-white dark:text-white border-green-700 dark:border-green-500 hover:bg-green-700 dark:hover:bg-green-500",orange:"bg-orange-600 dark:bg-orange-600 text-white dark:text-white border-orange-700 dark:border-orange-500 hover:bg-orange-700 dark:hover:bg-orange-500",yellow:"bg-yellow-600 dark:bg-yellow-600 text-white dark:text-white border-yellow-700 dark:border-yellow-500 hover:bg-yellow-700 dark:hover:bg-yellow-500",gray:"bg-gray-600 dark:bg-gray-500 text-white dark:text-white border-gray-700 dark:border-gray-400 hover:bg-gray-700 dark:hover:bg-gray-400",blue:"bg-blue-600 dark:bg-blue-600 text-white dark:text-white border-blue-700 dark:border-blue-500 hover:bg-blue-700 dark:hover:bg-blue-500"}[s]:{green:"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 hover:bg-green-100 dark:hover:bg-green-900/30",orange:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800 hover:bg-orange-100 dark:hover:bg-orange-900/30",yellow:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-600 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800 hover:bg-yellow-100 dark:hover:bg-yellow-900/30",gray:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-300 border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-600",blue:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"}[s];return h.jsxs(rn,{className:`${g} ${y} ${i}`,style:a,id:c,...d,children:[h.jsx(wt,{type:"checkbox",value:t,checked:e,onChange:b=>{l?.(b)},className:"hidden"}),n&&h.jsx(re,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})},TE=({label:t,icon:e,iconPosition:n="left",position:r="right",className:s="",style:o,children:i})=>{const[a,l]=v.useState(!1),[c,d]=v.useState({top:0,left:0}),u=v.useRef(null),f=v.useRef(null),g=v.useCallback(()=>{if(!u.current)return;const p=u.current.getBoundingClientRect(),y=224;let b=r==="right"?p.right-y:p.left;const S=p.bottom+8;b<8&&(b=8),b+y>window.innerWidth-8&&(b=window.innerWidth-y-8),d({top:S,left:b})},[r]);v.useEffect(()=>{a&&g()},[a,g]),v.useEffect(()=>{if(!a)return;const p=()=>{l(!1)};return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[a]),v.useEffect(()=>{const p=y=>{const b=y.target,S=u.current?.contains(b),x=f.current?.contains(b);!S&&!x&&l(!1)};return a&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[a]);const m=a?On.createPortal(h.jsx("div",{ref:f,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:c.top,left:c.left},onClick:()=>l(!1),children:i}),document.body):null;return h.jsxs(I,{className:`relative inline-block ${s}`,style:o,children:[h.jsxs(oe,{ref:u,onClick:()=>l(!a),className:"flex items-center gap-2",children:[n==="left"&&e&&h.jsx(re,{name:e,className:"w-4 h-4"}),t&&h.jsx(Q,{className:"text-sm font-medium",children:t}),n==="right"&&e&&h.jsx(re,{name:e,className:"w-4 h-4"})]}),m]})},AE=({label:t,icon:e,variant:n="default",disabled:r=!1,divider:s=!1,className:o="",style:i,onClick:a})=>{if(s)return h.jsx(I,{className:"h-px bg-gray-200 dark:bg-gray-700 my-1",style:i});const l=n==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",c=r?"opacity-50 cursor-not-allowed":"cursor-pointer",d=()=>{!r&&a&&a()};return h.jsxs(I,{onClick:d,className:`flex items-center gap-3 px-4 py-3 transition-colors ${l} ${c} ${o}`,style:i,children:[e&&h.jsx(re,{name:e,className:"w-4 h-4"}),t&&h.jsx(Q,{className:"text-sm font-medium",children:t})]})},DE=()=>window.G7Core,$c=v.createContext(null),Ip=()=>{const t=v.useContext($c);if(!t){const e=DE(),n=e?.locale?.current?.()||"ko",r=e?.locale?.supported?.()||["ko","en"];return{activeLocale:n,getActiveLocale:()=>e?.locale?.current?.()||"ko",supportedLocales:r,isInsideMultilingualTabPanel:!1}}return{...t,isInsideMultilingualTabPanel:!0}},IE=()=>window.G7Core,LE=({value:t,onChange:e,placeholder:n,readOnly:r,disabled:s,hasError:o})=>{const{activeLocale:i,getActiveLocale:a}=Ip(),l=typeof t=="string"?{[i]:t}:t||{},c=v.useCallback(u=>{const f=a();e({...l,[f]:u.target.value})},[l,a,e]),d=o?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500";return h.jsx(wt,{type:"text",value:l[i]||"",onChange:c,placeholder:n,readOnly:r,disabled:s,className:`w-full px-3 py-2 text-sm border ${d} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2`})},PE=(t,e)=>{if(!e)return!1;const n=e.startsWith("!"),r=n?e.slice(1):e,s=!!t[r];return n?!s:s},$E=({column:t,item:e,index:n,onValueChange:r,readOnly:s,error:o})=>{const i=e[t.key],a=s||t.readOnly||PE(e,t.readOnlyCondition)||t.disabled,l=!!o,c=l?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500",d=v.useCallback(f=>{r(t.key,f)},[t.key,r]),u=f=>h.jsxs(I,{className:"w-full",children:[f,l&&h.jsx(Q,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:o})]});switch(t.type){case"input":return u(h.jsx(wt,{type:"text",value:i||"",onChange:f=>d(f.target.value),placeholder:t.placeholder,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${t.className||""}`}));case"number":return u(h.jsx(wt,{type:"number",value:i??"",onChange:f=>d(f.target.value?Number(f.target.value):null),placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${t.className||""}`}));case"select":return u(h.jsxs(Pr,{value:i??"",onChange:f=>d(f.target.value),disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 ${t.className||""}`,children:[h.jsx("option",{value:"",children:"선택하세요"}),t.options?.map(f=>h.jsx("option",{value:f.value,disabled:f.disabled,children:f.label},f.value))]}));case"textarea":return u(h.jsx(Zn,{value:i||"",onChange:f=>d(f.target.value),placeholder:t.placeholder,readOnly:a,disabled:a,className:`w-full px-3 py-2 text-sm border ${c} rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 resize-none ${t.className||""}`,rows:2}));case"multilingual":return u(h.jsx(LE,{value:i,onChange:f=>d(f),placeholder:t.placeholder,readOnly:a,disabled:a,hasError:l}));case"custom":return t.render?h.jsx(h.Fragment,{children:t.render(e,n,d)}):h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:"-"});default:return h.jsx(Q,{className:"text-gray-900 dark:text-white text-sm",children:String(i??"")})}},FE=(t,e,n)=>{if(!t)return;if(n==="multilingual"){const o=IE()?.locale?.current?.()||"ko",i=`${e}.${o}`;return t[i]?.[0]}return t[e]?.[0]},zE=({item:t,index:e,id:n,columns:r,enableDrag:s=!0,showIndex:o=!0,canRemove:i=!0,rowActions:a,readOnly:l=!1,onValueChange:c,onRemove:d,className:u="",level:f=0,errors:g})=>{const{attributes:m,listeners:p,setNodeRef:y,transform:b,transition:S,isDragging:x}=Di({id:n,disabled:!s||l}),E={transform:Ln.Transform.toString(b),transition:S,opacity:x?.5:1},k=v.useCallback((_,w)=>{c?.(_,w)},[c]),C=v.useCallback(_=>{_.onClick?.(t,e)},[t,e]),N=f>0?{paddingLeft:`${f*24}px`}:{};return h.jsxs(I,{ref:y,style:E,className:`flex items-center gap-2 py-2 px-2 border-b border-gray-100 dark:border-gray-700 last:border-b-0 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors ${x?"bg-blue-50 dark:bg-blue-900/20 shadow-lg rounded-lg z-10":""} ${u}`,children:[s&&!l&&h.jsx(I,{...m,...p,className:"flex-shrink-0 w-6 h-6 flex items-center justify-center cursor-grab active:cursor-grabbing text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-400",style:N,children:h.jsx(re,{name:"grip-vertical",className:"w-4 h-4"})}),o&&h.jsx(I,{className:"flex-shrink-0 w-8 text-center text-sm text-gray-500 dark:text-gray-400 font-medium",children:e+1}),r.map(_=>{const w=FE(g,_.key,_.type);return h.jsx(I,{className:`flex-1 min-w-0 ${_.width||""}`,style:_.width?{flex:"none",width:_.width}:{},children:h.jsx($E,{column:_,item:t,index:e,onValueChange:k,readOnly:l,error:w})},_.key)}),a&&a.length>0&&!l&&h.jsx(I,{className:"flex-shrink-0 flex items-center gap-1",children:a.map(_=>{const w=typeof _.disabled=="function"?_.disabled(t,e):_.disabled;return h.jsx(oe,{type:"button",onClick:()=>C(_),disabled:w,className:`p-1.5 rounded transition-colors ${_.danger?"text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 hover:text-red-600":"text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-300"} disabled:opacity-50 disabled:cursor-not-allowed`,title:_.label,children:_.icon?h.jsx(re,{name:_.icon,className:"w-4 h-4"}):h.jsx(Q,{className:"text-xs",children:_.label})},_.key)})}),i&&!a&&!l&&h.jsx(I,{className:"flex-shrink-0",children:h.jsx(oe,{type:"button",onClick:d,className:"p-1.5 text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-600 dark:hover:text-gray-300 rounded transition-colors",title:"삭제",children:h.jsx(re,{name:"minus",className:"w-4 h-4"})})})]})},Lp=()=>window.G7Core,Fc=()=>`item_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,VE=t=>{const e={_id:Fc()};return t.forEach(n=>{if(n.type==="multilingual"){const s=Lp()?.locale?.all?.()||["ko","en"],o={};s.forEach(i=>{o[i]=""}),e[n.key]=o}else n.type==="number"?e[n.key]=null:(n.type,e[n.key]="")}),e},HE=(t,e)=>{if(!t)return{};const n=`fields.${e}.`,r={};return Object.keys(t).forEach(s=>{if(s.startsWith(n)){const o=s.substring(n.length);r[o]=t[s]}}),r},UE=({items:t=[],columns:e,onChange:n,onAddItem:r,onRemoveItem:s,onReorder:o,addLabel:i="항목 추가",enableDrag:a=!0,showIndex:l=!0,minItems:c=0,maxItems:d,rowActions:u,emptyMessage:f="항목이 없습니다.",className:g="",headerClassName:m="",rowClassName:p="",name:y,readOnly:b=!1,createDefaultItem:S,childrenKey:x,itemIdKey:E="_id",errors:k,id:C,editorAttrs:N})=>{const _=v.useRef(null),w=v.useRef([]),M=v.useRef(null),O=v.useMemo(()=>{let j=!1;for(const U of t)if(U[E]==null){j=!0;break}return j?t.map(U=>U[E]!=null?U:{...U,[E]:Fc()}):t},[t,E]);w.current=O,v.useEffect(()=>{M.current=null},[O]);const L=v.useCallback(j=>String(j[E]??""),[E]);v.useEffect(()=>{if(y){const j=Lp();j?.form&&(_.current=j.form)}},[y]);const F=Wl(qr(Ys,{activationConstraint:{distance:8}}),qr(Gs,{coordinateGetter:Ii})),$=v.useMemo(()=>O.map(j=>L(j)),[O,L]),D=v.useCallback(j=>{const{active:U,over:B}=j;if(B&&U.id!==B.id){const G=M.current??w.current,V=G.map(Z=>String(Z[E]??"")),K=V.indexOf(String(U.id)),X=V.indexOf(String(B.id));if(K!==-1&&X!==-1){const Z=Qr([...G],K,X);M.current=Z,n?.(Z),o?.(Z)}}},[n,o,E]),A=v.useCallback((j,U,B)=>{const V=[...M.current??w.current];V[j]={...V[j],[U]:B},M.current=V,n?.(V)},[n]),T=v.useCallback(()=>{const j=M.current??w.current;if(d&&j.length>=d)return;if(r){r();return}const U=S?S():VE(e);U[E]||(U[E]=Fc());const B=[...j,U];M.current=B,n?.(B)},[d,r,S,e,E,n]),z=v.useCallback(j=>{const U=M.current??w.current;if(U.length<=c)return;const B=U[j];if(s){s(j,B);return}const G=U.filter((V,K)=>K!==j);M.current=G,n?.(G)},[c,s,n]),H=O.length>c,W=!d||O.length<d;return h.jsxs(I,{className:`dynamic-field-list ${g}`,id:C,...N,children:[h.jsxs(I,{className:`flex items-center gap-2 py-2 px-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50 rounded-t-lg ${m}`,children:[a&&!b&&h.jsx(I,{className:"flex-shrink-0 w-6"}),l&&h.jsx(I,{className:"flex-shrink-0 w-8 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase",children:"#"}),e.map(j=>h.jsxs(I,{className:`flex-1 min-w-0 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase ${j.width||""}`,style:j.width?{flex:"none",width:j.width}:{},children:[j.label,j.required&&h.jsx(Q,{className:"text-red-500 dark:text-red-400 ml-0.5",children:"*"})]},j.key)),(u||!b&&H)&&h.jsx(I,{className:"flex-shrink-0 w-8"})]}),O.length>0?h.jsx(tc,{sensors:F,collisionDetection:Gl,onDragEnd:D,children:h.jsx(Ai,{items:$,strategy:nc,children:h.jsx(I,{className:"border-x border-gray-200 dark:border-gray-700",children:O.map((j,U)=>{const B=L(j),G=HE(k,U);return h.jsx(zE,{id:B,item:j,index:U,columns:e,enableDrag:a,showIndex:l,canRemove:H,rowActions:u,readOnly:b,onValueChange:(V,K)=>A(U,V,K),onRemove:()=>z(U),className:p,errors:G},B)})})})}):h.jsx(I,{className:"border-x border-gray-200 dark:border-gray-700 py-8 text-center text-gray-500 dark:text-gray-400 text-sm",children:f}),!b&&W&&h.jsx(I,{className:"relative border border-gray-200 dark:border-gray-700 border-t-0 rounded-b-lg",children:h.jsx(I,{className:"flex items-center justify-center py-2",children:h.jsxs(oe,{type:"button",onClick:T,className:"flex items-center gap-1.5 px-4 py-1.5 text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[h.jsx(re,{name:"plus",className:"w-4 h-4"}),h.jsx(Q,{children:i})]})})}),(b||!W)&&O.length>0&&h.jsx(I,{className:"border-x border-b border-gray-200 dark:border-gray-700 rounded-b-lg h-1"})]})},Pp=()=>window.G7Core,BE=()=>Pp()?.locale?.supported?.()??["ko","en"],jE=()=>Pp()?.locale?.current?.()??"ko",WE={ko:"한국어",en:"English",ja:"日本語",zh:"中文"},GE=({children:t,className:e="",style:n,variant:r="default",defaultLocale:s,onLocaleChange:o,locales:i})=>{const a=v.useMemo(()=>i&&i.length>0?i:BE(),[i]),[l,c]=v.useState(s||jE());v.useEffect(()=>{if(a.length>0&&!a.includes(l)){const p=a[0];c(p),o?.(p)}},[a,l,o]);const d=v.useRef(l);d.current=l;const u=v.useCallback(()=>d.current,[]),f=v.useCallback(p=>{c(p),o?.(p)},[o]),g=v.useMemo(()=>({activeLocale:l,getActiveLocale:u,supportedLocales:a}),[l,u,a]),m=p=>{const y=p===l,b="px-4 py-2 text-sm font-medium transition-all";return r==="pills"?y?`${b} bg-blue-600 text-white rounded-lg`:`${b} text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg`:r==="underline"?y?`${b} text-blue-600 dark:text-blue-400 border-b-2 border-blue-600 dark:border-blue-400`:`${b} text-gray-600 dark:text-gray-400 border-b-2 border-transparent hover:border-gray-300 dark:hover:border-gray-500`:y?`${b} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-b-2 border-blue-600`:`${b} text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-700 border-b-2 border-transparent`};return h.jsxs(I,{className:e,style:n,children:[h.jsx(Lo,{className:"flex gap-1 border-b border-gray-200 dark:border-gray-700 mb-4",children:a.map(p=>h.jsx(oe,{type:"button",onClick:()=>f(p),className:m(p),children:h.jsx(Q,{children:WE[p]||p})},p))}),h.jsx($c.Provider,{value:g,children:t})]})},YE=({label:t,required:e=!1,error:n,helperText:r,className:s="",labelClassName:o="",children:i,horizontal:a=!1,labelWidth:l="w-1/3",id:c,editorAttrs:d})=>{const u=a?`flex items-start gap-4 ${s}`:`space-y-1 ${s}`,f=a?`${l} flex-shrink-0 pt-2`:"",g=a?"flex-1":"";return h.jsxs(I,{className:u,id:c,...d,children:[t&&h.jsx(I,{className:f,children:h.jsxs(rn,{className:`block text-sm font-medium text-gray-700 dark:text-gray-300 ${o}`,children:[t,e&&h.jsx("span",{className:"ml-1 text-red-500 dark:text-red-400",children:"*"})]})}),h.jsxs(I,{className:`${g} ${n?"form-field-error":""}`.trim(),children:[i,r&&!n&&h.jsx(I,{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r}),n&&h.jsx(I,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:n})]})]})};function io(t){return t+.5|0}const or=(t,e,n)=>Math.max(Math.min(t,n),e);function ao(t){return or(io(t*2.55),0,255)}function ir(t){return or(io(t*255),0,255)}function Wn(t){return or(io(t/2.55)/100,0,1)}function $p(t){return or(io(t*100),0,100)}const hn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zc=[..."0123456789ABCDEF"],XE=t=>zc[t&15],KE=t=>zc[(t&240)>>4]+zc[t&15],Zi=t=>(t&240)>>4===(t&15),qE=t=>Zi(t.r)&&Zi(t.g)&&Zi(t.b)&&Zi(t.a);function ZE(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&hn[t[1]]*17,g:255&hn[t[2]]*17,b:255&hn[t[3]]*17,a:e===5?hn[t[4]]*17:255}:(e===7||e===9)&&(n={r:hn[t[1]]<<4|hn[t[2]],g:hn[t[3]]<<4|hn[t[4]],b:hn[t[5]]<<4|hn[t[6]],a:e===9?hn[t[7]]<<4|hn[t[8]]:255})),n}const QE=(t,e)=>t<255?e(t):"";function JE(t){var e=qE(t)?XE:KE;return t?"#"+e(t.r)+e(t.g)+e(t.b)+QE(t.a,e):void 0}const RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fp(t,e,n){const r=e*Math.min(n,1-n),s=(o,i=(o+t/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function eM(t,e,n){const r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function tM(t,e,n){const r=Fp(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)r[s]*=1-e-n,r[s]+=e;return r}function nM(t,e,n,r,s){return t===s?(e-n)/r+(e<n?6:0):e===s?(n-t)/r+2:(t-e)/r+4}function Vc(t){const n=t.r/255,r=t.g/255,s=t.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let l,c,d;return o!==i&&(d=o-i,c=a>.5?d/(2-o-i):d/(o+i),l=nM(n,r,s,d,o),l=l*60+.5),[l|0,c||0,a]}function Hc(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(ir)}function Uc(t,e,n){return Hc(Fp,t,e,n)}function rM(t,e,n){return Hc(tM,t,e,n)}function sM(t,e,n){return Hc(eM,t,e,n)}function zp(t){return(t%360+360)%360}function oM(t){const e=RE.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?ao(+e[5]):ir(+e[5]));const s=zp(+e[2]),o=+e[3]/100,i=+e[4]/100;return e[1]==="hwb"?r=rM(s,o,i):e[1]==="hsv"?r=sM(s,o,i):r=Uc(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function iM(t,e){var n=Vc(t);n[0]=zp(n[0]+e),n=Uc(n),t.r=n[0],t.g=n[1],t.b=n[2]}function aM(t){if(!t)return;const e=Vc(t),n=e[0],r=$p(e[1]),s=$p(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${s}%, ${Wn(t.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const Vp={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Hp={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function lM(){const t={},e=Object.keys(Hp),n=Object.keys(Vp);let r,s,o,i,a;for(r=0;r<e.length;r++){for(i=a=e[r],s=0;s<n.length;s++)o=n[s],a=a.replace(o,Vp[o]);o=parseInt(Hp[i],16),t[a]=[o>>16&255,o>>8&255,o&255]}return t}let Qi;function cM(t){Qi||(Qi=lM(),Qi.transparent=[0,0,0,0]);const e=Qi[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const dM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function uM(t){const e=dM.exec(t);let n=255,r,s,o;if(e){if(e[7]!==r){const i=+e[7];n=e[8]?ao(i):or(i*255,0,255)}return r=+e[1],s=+e[3],o=+e[5],r=255&(e[2]?ao(r):or(r,0,255)),s=255&(e[4]?ao(s):or(s,0,255)),o=255&(e[6]?ao(o):or(o,0,255)),{r,g:s,b:o,a:n}}}function fM(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Wn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Bc=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,ls=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function hM(t,e,n){const r=ls(Wn(t.r)),s=ls(Wn(t.g)),o=ls(Wn(t.b));return{r:ir(Bc(r+n*(ls(Wn(e.r))-r))),g:ir(Bc(s+n*(ls(Wn(e.g))-s))),b:ir(Bc(o+n*(ls(Wn(e.b))-o))),a:t.a+n*(e.a-t.a)}}function Ji(t,e,n){if(t){let r=Vc(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,e===0?360:1)),r=Uc(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Up(t,e){return t&&Object.assign(e||{},t)}function Bp(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=ir(t[3]))):(e=Up(t,{r:0,g:0,b:0,a:1}),e.a=ir(e.a)),e}function gM(t){return t.charAt(0)==="r"?uM(t):oM(t)}class lo{constructor(e){if(e instanceof lo)return e;const n=typeof e;let r;n==="object"?r=Bp(e):n==="string"&&(r=ZE(e)||cM(e)||gM(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=Up(this._rgb);return e&&(e.a=Wn(e.a)),e}set rgb(e){this._rgb=Bp(e)}rgbString(){return this._valid?fM(this._rgb):void 0}hexString(){return this._valid?JE(this._rgb):void 0}hslString(){return this._valid?aM(this._rgb):void 0}mix(e,n){if(e){const r=this.rgb,s=e.rgb;let o;const i=n===o?.5:n,a=2*i-1,l=r.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,r.r=255&c*r.r+o*s.r+.5,r.g=255&c*r.g+o*s.g+.5,r.b=255&c*r.b+o*s.b+.5,r.a=i*r.a+(1-i)*s.a,this.rgb=r}return this}interpolate(e,n){return e&&(this._rgb=hM(this._rgb,e._rgb,n)),this}clone(){return new lo(this.rgb)}alpha(e){return this._rgb.a=ir(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=io(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Ji(this._rgb,2,e),this}darken(e){return Ji(this._rgb,2,-e),this}saturate(e){return Ji(this._rgb,1,e),this}desaturate(e){return Ji(this._rgb,1,-e),this}rotate(e){return iM(this._rgb,e),this}}function Gn(){}const pM=(()=>{let t=0;return()=>t++})();function lt(t){return t==null}function _t(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Qe(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function gn(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function $n(t,e){return gn(t)?t:e}function Je(t,e){return typeof t>"u"?e:t}const mM=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,jp=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ht(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function at(t,e,n,r){let s,o,i;if(_t(t))for(o=t.length,s=0;s<o;s++)e.call(n,t[s],s);else if(Qe(t))for(i=Object.keys(t),o=i.length,s=0;s<o;s++)e.call(n,t[i[s]],i[s])}function Ri(t,e){let n,r,s,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(s=t[n],o=e[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ea(t){if(_t(t))return t.map(ea);if(Qe(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let s=0;for(;s<r;++s)e[n[s]]=ea(t[n[s]]);return e}return t}function Wp(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function bM(t,e,n,r){if(!Wp(t))return;const s=e[t],o=n[t];Qe(s)&&Qe(o)?co(s,o,r):e[t]=ea(o)}function co(t,e,n){const r=_t(e)?e:[e],s=r.length;if(!Qe(t))return t;n=n||{};const o=n.merger||bM;let i;for(let a=0;a<s;++a){if(i=r[a],!Qe(i))continue;const l=Object.keys(i);for(let c=0,d=l.length;c<d;++c)o(l[c],t,i,n)}return t}function uo(t,e){return co(t,e,{merger:yM})}function yM(t,e,n){if(!Wp(t))return;const r=e[t],s=n[t];Qe(r)&&Qe(s)?uo(r,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=ea(s))}const Gp={"":t=>t,x:t=>t.x,y:t=>t.y};function vM(t){const e=t.split("."),n=[];let r="";for(const s of e)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function xM(t){const e=vM(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function Cr(t,e){return(Gp[e]||(Gp[e]=xM(e)))(t)}function jc(t){return t.charAt(0).toUpperCase()+t.slice(1)}const fo=t=>typeof t<"u",ar=t=>typeof t=="function",Yp=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function wM(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const ct=Math.PI,Ct=2*ct,ta=Number.POSITIVE_INFINITY,kM=ct/180,Et=ct/2,Sr=ct/4,Xp=ct*2/3,Kp=Math.log10,lr=Math.sign;function na(t,e,n){return Math.abs(t-e)<n}function qp(t){const e=Math.round(t);t=na(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Kp(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function CM(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((s,o)=>s-o).pop(),e}function SM(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function ra(t){return!SM(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function _M(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function EM(t,e,n){let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Yn(t){return t*(ct/180)}function MM(t){return t*(180/ct)}function Zp(t){if(!gn(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Qp(t,e){const n=e.x-t.x,r=e.y-t.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*ct&&(o+=Ct),{angle:o,distance:s}}function NM(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Fn(t){return(t%Ct+Ct)%Ct}function sa(t,e,n,r){const s=Fn(t),o=Fn(e),i=Fn(n),a=Fn(o-s),l=Fn(i-s),c=Fn(s-o),d=Fn(s-i);return s===o||s===i||r&&o===i||a>l&&c<d}function Jt(t,e,n){return Math.max(e,Math.min(n,t))}function OM(t){return Jt(t,-32768,32767)}function _r(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function Wc(t,e,n){n=n||(i=>t[i]<e);let r=t.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const Gc=(t,e,n,r)=>Wc(t,n,r?s=>{const o=t[s][e];return o<n||o===n&&t[s+1][e]===n}:s=>t[s][e]<n),TM=(t,e,n)=>Wc(t,n,r=>t[r][e]>=n);function AM(t,e,n){let r=0,s=t.length;for(;r<s&&t[r]<e;)r++;for(;s>r&&t[s-1]>n;)s--;return r>0||s<t.length?t.slice(r,s):t}const Jp=["push","pop","shift","splice","unshift"];function DM(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Jp.forEach(n=>{const r="_onData"+jc(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function Rp(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(e);s!==-1&&r.splice(s,1),!(r.length>0)&&(Jp.forEach(o=>{delete t[o]}),delete t._chartjs)}function e0(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const t0=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function n0(t,e){let n=[],r=!1;return function(...s){n=s,r||(r=!0,t0.call(window,()=>{r=!1,t.apply(e,n)}))}}function IM(t,e){let n;return function(...r){return e?(clearTimeout(n),n=setTimeout(t,e,r)):t.apply(this,r),e}}const Yc=t=>t==="start"?"left":t==="end"?"right":"center",Ht=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,LM=(t,e,n,r)=>t===(r?"left":"right")?n:t==="center"?(e+n)/2:e,oa=t=>t===0||t===1,r0=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Ct/n)),s0=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Ct/n)+1,ho={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Et)+1,easeOutSine:t=>Math.sin(t*Et),easeInOutSine:t=>-.5*(Math.cos(ct*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>oa(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>oa(t)?t:r0(t,.075,.3),easeOutElastic:t=>oa(t)?t:s0(t,.075,.3),easeInOutElastic(t){return oa(t)?t:t<.5?.5*r0(t*2,.1125,.45):.5+.5*s0(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-ho.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?ho.easeInBounce(t*2)*.5:ho.easeOutBounce(t*2-1)*.5+.5};function o0(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function i0(t){return o0(t)?t:new lo(t)}function Xc(t){return o0(t)?t:new lo(t).saturate(.5).darken(.1).hexString()}const PM=["x","y","borderWidth","radius","tension"],$M=["color","borderColor","backgroundColor"];function FM(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:$M},numbers:{type:"number",properties:PM}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function zM(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const a0=new Map;function VM(t,e){e=e||{};const n=t+JSON.stringify(e);let r=a0.get(n);return r||(r=new Intl.NumberFormat(t,e),a0.set(n,r)),r}function Kc(t,e,n){return VM(e,n).format(t)}const HM={values(t){return _t(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const r=this.chart.options.locale;let s,o=t;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=UM(t,n)}const i=Kp(Math.abs(o)),a=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Kc(t,r,l)}};function UM(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var l0={formatters:HM};function BM(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:l0.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Er=Object.create(null),qc=Object.create(null);function go(t,e){if(!e)return t;const n=e.split(".");for(let r=0,s=n.length;r<s;++r){const o=n[r];t=t[o]||(t[o]=Object.create(null))}return t}function Zc(t,e,n){return typeof e=="string"?co(go(t,e),n):co(go(t,""),e)}class jM{constructor(e,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>Xc(s.backgroundColor),this.hoverBorderColor=(r,s)=>Xc(s.borderColor),this.hoverColor=(r,s)=>Xc(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(n)}set(e,n){return Zc(this,e,n)}get(e){return go(this,e)}describe(e,n){return Zc(qc,e,n)}override(e,n){return Zc(Er,e,n)}route(e,n,r,s){const o=go(this,e),i=go(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=i[s];return Qe(l)?Object.assign({},c,l):Je(l,c)},set(l){this[a]=l}}})}apply(e){e.forEach(n=>n(this))}}var vt=new jM({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[FM,zM,BM]);function WM(t){return!t||lt(t.size)||lt(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function c0(t,e,n,r,s){let o=e[s];return o||(o=e[s]=t.measureText(s).width,n.push(s)),o>r&&(r=o),r}function Mr(t,e,n){const r=t.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((e-s)*r)/r+s}function d0(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function u0(t,e,n,r){f0(t,e,n,r,null)}function f0(t,e,n,r,s){let o,i,a,l,c,d,u,f;const g=e.pointStyle,m=e.rotation,p=e.radius;let y=(m||0)*kM;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(n,r),t.rotate(y),t.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),t.restore();return}if(!(isNaN(p)||p<=0)){switch(t.beginPath(),g){default:s?t.ellipse(n,r,s/2,p,0,0,Ct):t.arc(n,r,p,0,Ct),t.closePath();break;case"triangle":d=s?s/2:p,t.moveTo(n+Math.sin(y)*d,r-Math.cos(y)*p),y+=Xp,t.lineTo(n+Math.sin(y)*d,r-Math.cos(y)*p),y+=Xp,t.lineTo(n+Math.sin(y)*d,r-Math.cos(y)*p),t.closePath();break;case"rectRounded":c=p*.516,l=p-c,i=Math.cos(y+Sr)*l,u=Math.cos(y+Sr)*(s?s/2-c:l),a=Math.sin(y+Sr)*l,f=Math.sin(y+Sr)*(s?s/2-c:l),t.arc(n-u,r-a,c,y-ct,y-Et),t.arc(n+f,r-i,c,y-Et,y),t.arc(n+u,r+a,c,y,y+Et),t.arc(n-f,r+i,c,y+Et,y+ct),t.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,d=s?s/2:l,t.rect(n-d,r-l,2*d,2*l);break}y+=Sr;case"rectRot":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+f,r-i),t.lineTo(n+u,r+a),t.lineTo(n-f,r+i),t.closePath();break;case"crossRot":y+=Sr;case"cross":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+u,r+a),t.moveTo(n+f,r-i),t.lineTo(n-f,r+i);break;case"star":u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+u,r+a),t.moveTo(n+f,r-i),t.lineTo(n-f,r+i),y+=Sr,u=Math.cos(y)*(s?s/2:p),i=Math.cos(y)*p,a=Math.sin(y)*p,f=Math.sin(y)*(s?s/2:p),t.moveTo(n-u,r-a),t.lineTo(n+u,r+a),t.moveTo(n+f,r-i),t.lineTo(n-f,r+i);break;case"line":i=s?s/2:Math.cos(y)*p,a=Math.sin(y)*p,t.moveTo(n-i,r-a),t.lineTo(n+i,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(y)*(s?s/2:p),r+Math.sin(y)*p);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function h0(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Qc(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Jc(t){t.restore()}function GM(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),lt(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function YM(t,e,n,r,s){if(s.strikethrough||s.underline){const o=t.measureText(r),i=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=s.decorationWidth||2,t.moveTo(i,d),t.lineTo(a,d),t.stroke()}}function XM(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function po(t,e,n,r,s,o={}){const i=_t(e)?e:[e],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(t.save(),t.font=s.string,GM(t,o),l=0;l<i.length;++l)c=i[l],o.backdrop&&XM(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),lt(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,n,r,o.maxWidth)),t.fillText(c,n,r,o.maxWidth),YM(t,n,r,c,o),r+=Number(s.lineHeight);t.restore()}function ia(t,e){const{x:n,y:r,w:s,h:o,radius:i}=e;t.arc(n+i.topLeft,r+i.topLeft,i.topLeft,1.5*ct,ct,!0),t.lineTo(n,r+o-i.bottomLeft),t.arc(n+i.bottomLeft,r+o-i.bottomLeft,i.bottomLeft,ct,Et,!0),t.lineTo(n+s-i.bottomRight,r+o),t.arc(n+s-i.bottomRight,r+o-i.bottomRight,i.bottomRight,Et,0,!0),t.lineTo(n+s,r+i.topRight),t.arc(n+s-i.topRight,r+i.topRight,i.topRight,0,-Et,!0),t.lineTo(n+i.topLeft,r)}const KM=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,qM=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ZM(t,e){const n=(""+t).match(KM);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const QM=t=>+t||0;function Rc(t,e){const n={},r=Qe(e),s=r?Object.keys(e):e,o=Qe(t)?r?i=>Je(t[i],t[e[i]]):i=>t[i]:()=>t;for(const i of s)n[i]=QM(o(i));return n}function g0(t){return Rc(t,{top:"y",right:"x",bottom:"y",left:"x"})}function cs(t){return Rc(t,["topLeft","topRight","bottomLeft","bottomRight"])}function pn(t){const e=g0(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ut(t,e){t=t||{},e=e||vt.font;let n=Je(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let r=Je(t.style,e.style);r&&!(""+r).match(qM)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:Je(t.family,e.family),lineHeight:ZM(Je(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:Je(t.weight,e.weight),string:""};return s.string=WM(s),s}function aa(t,e,n,r){let s,o,i;for(s=0,o=t.length;s<o;++s)if(i=t[s],i!==void 0&&i!==void 0)return i}function JM(t,e,n){const{min:r,max:s}=t,o=jp(e,(s-r)/2),i=(a,l)=>n&&a===0?0:a+l;return{min:i(r,-Math.abs(o)),max:i(s,o)}}function ds(t,e){return Object.assign(Object.create(t),e)}function ed(t,e=[""],n,r,s=()=>t[0]){const o=n||t;typeof r>"u"&&(r=v0("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:r,_getTarget:s,override:a=>ed([a,...t],e,o,r)};return new Proxy(i,{deleteProperty(a,l){return delete a[l],delete a._keys,delete t[0][l],!0},get(a,l){return m0(a,l,()=>iN(l,e,t,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,l){return x0(a).includes(l)},ownKeys(a){return x0(a)},set(a,l,c){const d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function us(t,e,n,r){const s={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:p0(t,r),setContext:o=>us(t,o,n,r),override:o=>us(t.override(o),e,n,r)};return new Proxy(s,{deleteProperty(o,i){return delete o[i],delete t[i],!0},get(o,i,a){return m0(o,i,()=>eN(o,i,a))},getOwnPropertyDescriptor(o,i){return o._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(o,i,a){return t[i]=a,delete o[i],!0}})}function p0(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:r=e.indexable,_allKeys:s=e.allKeys}=t;return{allKeys:s,scriptable:n,indexable:r,isScriptable:ar(n)?n:()=>n,isIndexable:ar(r)?r:()=>r}}const RM=(t,e)=>t?t+jc(e):e,td=(t,e)=>Qe(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function m0(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=n();return t[e]=r,r}function eN(t,e,n){const{_proxy:r,_context:s,_subProxy:o,_descriptors:i}=t;let a=r[e];return ar(a)&&i.isScriptable(e)&&(a=tN(e,a,t,n)),_t(a)&&a.length&&(a=nN(e,a,t,i.isIndexable)),td(e,a)&&(a=us(a,s,o&&o[e],i)),a}function tN(t,e,n,r){const{_proxy:s,_context:o,_subProxy:i,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let l=e(o,i||r);return a.delete(t),td(t,l)&&(l=nd(s._scopes,s,t,l)),l}function nN(t,e,n,r){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;if(typeof o.index<"u"&&r(t))return e[o.index%e.length];if(Qe(e[0])){const l=e,c=s._scopes.filter(d=>d!==l);e=[];for(const d of l){const u=nd(c,s,t,d);e.push(us(u,o,i&&i[t],a))}}return e}function b0(t,e,n){return ar(t)?t(e,n):t}const rN=(t,e)=>t===!0?e:typeof t=="string"?Cr(e,t):void 0;function sN(t,e,n,r,s){for(const o of e){const i=rN(n,o);if(i){t.add(i);const a=b0(i._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(i===!1&&typeof r<"u"&&n!==r)return null}return!1}function nd(t,e,n,r){const s=e._rootScopes,o=b0(e._fallback,n,r),i=[...t,...s],a=new Set;a.add(r);let l=y0(a,i,n,o||n,r);return l===null||typeof o<"u"&&o!==n&&(l=y0(a,i,o,l,r),l===null)?!1:ed(Array.from(a),[""],s,o,()=>oN(e,n,r))}function y0(t,e,n,r,s){for(;n;)n=sN(t,e,n,r,s);return n}function oN(t,e,n){const r=t._getTarget();e in r||(r[e]={});const s=r[e];return _t(s)&&Qe(n)?n:s||{}}function iN(t,e,n,r){let s;for(const o of e)if(s=v0(RM(o,t),n),typeof s<"u")return td(t,s)?nd(n,r,t,s):s}function v0(t,e){for(const n of e){if(!n)continue;const r=n[t];if(typeof r<"u")return r}}function x0(t){let e=t._keys;return e||(e=t._keys=aN(t._scopes)),e}function aN(t){const e=new Set;for(const n of t)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))e.add(r);return Array.from(e)}function rd(){return typeof window<"u"&&typeof document<"u"}function sd(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function la(t,e,n){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[n])):r=t,r}const ca=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function lN(t,e){return ca(t).getPropertyValue(e)}const cN=["top","right","bottom","left"];function Nr(t,e,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=cN[s];r[o]=parseFloat(t[e+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const dN=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function uN(t,e){const n=t.touches,r=n&&n.length?n[0]:t,{offsetX:s,offsetY:o}=r;let i=!1,a,l;if(dN(s,o,t.target))a=s,l=o;else{const c=e.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,i=!0}return{x:a,y:l,box:i}}function Or(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:r}=e,s=ca(n),o=s.boxSizing==="border-box",i=Nr(s,"padding"),a=Nr(s,"border","width"),{x:l,y:c,box:d}=uN(t,n),u=i.left+(d&&a.left),f=i.top+(d&&a.top);let{width:g,height:m}=e;return o&&(g-=i.width+a.width,m-=i.height+a.height),{x:Math.round((l-u)/g*n.width/r),y:Math.round((c-f)/m*n.height/r)}}function fN(t,e,n){let r,s;if(e===void 0||n===void 0){const o=t&&sd(t);if(!o)e=t.clientWidth,n=t.clientHeight;else{const i=o.getBoundingClientRect(),a=ca(o),l=Nr(a,"border","width"),c=Nr(a,"padding");e=i.width-c.width-l.width,n=i.height-c.height-l.height,r=la(a.maxWidth,o,"clientWidth"),s=la(a.maxHeight,o,"clientHeight")}}return{width:e,height:n,maxWidth:r||ta,maxHeight:s||ta}}const cr=t=>Math.round(t*10)/10;function hN(t,e,n,r){const s=ca(t),o=Nr(s,"margin"),i=la(s.maxWidth,t,"clientWidth")||ta,a=la(s.maxHeight,t,"clientHeight")||ta,l=fN(t,e,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const f=Nr(s,"border","width"),g=Nr(s,"padding");c-=g.width+f.width,d-=g.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,r?c/r:d-o.height),c=cr(Math.min(c,i,l.maxWidth)),d=cr(Math.min(d,a,l.maxHeight)),c&&!d&&(d=cr(c/2)),(e!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=cr(Math.floor(d*r))),{width:c,height:d}}function w0(t,e,n){const r=e||1,s=cr(t.height*r),o=cr(t.width*r);t.height=cr(t.height),t.width=cr(t.width);const i=t.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==s||i.width!==o?(t.currentDevicePixelRatio=r,i.height=s,i.width=o,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const gN=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};rd()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function k0(t,e){const n=lN(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const pN=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},mN=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function fs(t,e,n){return t?pN(e,n):mN()}function C0(t,e){let n,r;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function S0(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function da(t,e,n){return t.options.clip?t[n]:e[n]}function bN(t,e){const{xScale:n,yScale:r}=t;return n&&r?{left:da(n,e,"left"),right:da(n,e,"right"),top:da(r,e,"top"),bottom:da(r,e,"bottom")}:e}function yN(t,e){const n=e._clip;if(n.disabled)return!1;const r=bN(e,t.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:r.bottom+(n.bottom===!0?0:n.bottom)}}class vN{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:e,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=t0.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,l;for(;i>=0;--i)l=o[i],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,e,"progress")),o.length||(r.running=!1,this._notify(s,r,e,"complete"),r.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Xn=new vN;const _0="transparent",xN={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=i0(t||_0),s=r.valid&&i0(e||_0);return s&&s.valid?s.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class wN{constructor(e,n,r,s){const o=n[r];s=aa([e.to,s,o,e.from]);const i=aa([e.from,o,s]);this._active=!0,this._fn=e.fn||xN[e.type||typeof i],this._easing=ho[e.easing]||ho.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=aa([e.to,n,s,e.from]),this._from=aa([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let l;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/r%2,l=i&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class E0{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Qe(e))return;const n=Object.keys(vt.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!Qe(o))return;const i={};for(const a of n)i[a]=o[a];(_t(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(e,n){const r=n.options,s=CN(e,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&kN(e.options.$animations,r).then(()=>{e.options=r},()=>{}),o}_createAnimations(e,n){const r=this._properties,s=[],o=e.$animations||(e.$animations={}),i=Object.keys(n),a=Date.now();let l;for(l=i.length-1;l>=0;--l){const c=i[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(e,n));continue}const d=n[c];let u=o[c];const f=r.get(c);if(u)if(f&&u.active()){u.update(f,d,a);continue}else u.cancel();if(!f||!f.duration){e[c]=d;continue}o[c]=u=new wN(f,e,c,d),s.push(u)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return Xn.add(this._chart,r),!0}}function kN(t,e){const n=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=t[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function CN(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function M0(t,e){const n=t&&t.options||{},r=n.reverse,s=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:r?o:s,end:r?s:o}}function SN(t,e,n){if(n===!1)return!1;const r=M0(t,n),s=M0(e,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function _N(t){let e,n,r,s;return Qe(t)?(e=t.top,n=t.right,r=t.bottom,s=t.left):e=n=r=s=t,{top:e,right:n,bottom:r,left:s,disabled:t===!1}}function N0(t,e){const n=[],r=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].index);return n}function O0(t,e,n,r={}){const s=t.keys,o=r.mode==="single";let i,a,l,c;if(e===null)return;let d=!1;for(i=0,a=s.length;i<a;++i){if(l=+s[i],l===n){if(d=!0,r.all)continue;break}c=t.values[l],gn(c)&&(o||e===0||lr(e)===lr(c))&&(e+=c)}return!d&&!r.all?0:e}function EN(t,e){const{iScale:n,vScale:r}=e,s=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",i=Object.keys(t),a=new Array(i.length);let l,c,d;for(l=0,c=i.length;l<c;++l)d=i[l],a[l]={[s]:d,[o]:t[d]};return a}function od(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function MN(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function NN(t){const{min:e,max:n,minDefined:r,maxDefined:s}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function ON(t,e,n){const r=t[e]||(t[e]={});return r[n]||(r[n]={})}function T0(t,e,n,r){for(const s of e.getMatchingVisibleMetas(r).reverse()){const o=t[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function A0(t,e){const{chart:n,_cachedMeta:r}=t,s=n._stacks||(n._stacks={}),{iScale:o,vScale:i,index:a}=r,l=o.axis,c=i.axis,d=MN(o,i,r),u=e.length;let f;for(let g=0;g<u;++g){const m=e[g],{[l]:p,[c]:y}=m,b=m._stacks||(m._stacks={});f=b[c]=ON(s,d,p),f[a]=y,f._top=T0(f,i,!0,r.type),f._bottom=T0(f,i,!1,r.type);const S=f._visualValues||(f._visualValues={});S[a]=y}}function id(t,e){const n=t.scales;return Object.keys(n).filter(r=>n[r].axis===e).shift()}function TN(t,e){return ds(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function AN(t,e,n){return ds(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function mo(t,e){const n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const s of e){const o=s._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const ad=t=>t==="reset"||t==="none",D0=(t,e)=>e?t:Object.assign({},t),DN=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:N0(n,!0),values:null};class hs{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=od(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&mo(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(u,f,g,m)=>u==="x"?f:u==="r"?m:g,o=n.xAxisID=Je(r.xAxisID,id(e,"x")),i=n.yAxisID=Je(r.yAxisID,id(e,"y")),a=n.rAxisID=Je(r.rAxisID,id(e,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,i,a),d=n.vAxisID=s(l,i,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Rp(this._data,this),e._stacked&&mo(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),r=this._data;if(Qe(n)){const s=this._cachedMeta;this._data=EN(n,s)}else if(r!==n){if(r){Rp(r,this);const s=this._cachedMeta;mo(s),s._parsed=[]}n&&Object.isExtensible(n)&&DM(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=od(n.vScale,n),n.stack!==r.stack&&(s=!0,mo(n),n.stack=r.stack),this._resyncElements(e),(s||o!==n._stacked)&&(A0(this,n._parsed),n._stacked=od(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:r,_data:s}=this,{iScale:o,_stacked:i}=r,a=o.axis;let l=e===0&&n===s.length?!0:r._sorted,c=e>0&&r._parsed[e-1],d,u,f;if(this._parsing===!1)r._parsed=s,r._sorted=!0,f=s;else{_t(s[e])?f=this.parseArrayData(r,s,e,n):Qe(s[e])?f=this.parseObjectData(r,s,e,n):f=this.parsePrimitiveData(r,s,e,n);const g=()=>u[a]===null||c&&u[a]<c[a];for(d=0;d<n;++d)r._parsed[d+e]=u=f[d],l&&(g()&&(l=!1),c=u);r._sorted=l}i&&A0(this,f)}parsePrimitiveData(e,n,r,s){const{iScale:o,vScale:i}=e,a=o.axis,l=i.axis,c=o.getLabels(),d=o===i,u=new Array(s);let f,g,m;for(f=0,g=s;f<g;++f)m=f+r,u[f]={[a]:d||o.parse(c[m],m),[l]:i.parse(n[m],m)};return u}parseArrayData(e,n,r,s){const{xScale:o,yScale:i}=e,a=new Array(s);let l,c,d,u;for(l=0,c=s;l<c;++l)d=l+r,u=n[d],a[l]={x:o.parse(u[0],d),y:i.parse(u[1],d)};return a}parseObjectData(e,n,r,s){const{xScale:o,yScale:i}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,u,f,g;for(d=0,u=s;d<u;++d)f=d+r,g=n[f],c[d]={x:o.parse(Cr(g,a),f),y:i.parse(Cr(g,l),f)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,r){const s=this.chart,o=this._cachedMeta,i=n[e.axis],a={keys:N0(s,!0),values:n._stacks[e.axis]._visualValues};return O0(a,i,o.index,{mode:r})}updateRangeFromParsed(e,n,r,s){const o=r[n.axis];let i=o===null?NaN:o;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,i=O0(s,o,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,n){const r=this._cachedMeta,s=r._parsed,o=r._sorted&&e===r.iScale,i=s.length,a=this._getOtherScale(e),l=DN(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=NN(a);let f,g;function m(){g=s[f];const p=g[a.axis];return!gn(g[e.axis])||d>p||u<p}for(f=0;f<i&&!(!m()&&(this.updateRangeFromParsed(c,e,g,l),o));++f);if(o){for(f=i-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,e,g,l);break}}return c}getAllParsedValues(e){const n=this._cachedMeta._parsed,r=[];let s,o,i;for(s=0,o=n.length;s<o;++s)i=n[s][e.axis],gn(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,r=n.iScale,s=n.vScale,o=this.getParsed(e);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=_N(Je(this.options.clip,SN(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],o=n.chartArea,i=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(e,o,a,l),d=a;d<a+l;++d){const u=s[d];u.hidden||(u.active&&c?i.push(u):u.draw(e,o))}for(d=0;d<i.length;++d)i[d].draw(e,o)}getStyle(e,n){const r=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,n,r){const s=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const i=this._cachedMeta.data[e];o=i.$context||(i.$context=AN(this.getContext(),e,i)),o.parsed=this.getParsed(e),o.raw=s.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=TN(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",r){const s=n==="active",o=this._cachedDataOpts,i=e+"-"+n,a=o[i],l=this.enableOptionSharing&&fo(r);if(a)return D0(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,e),u=s?[`${e}Hover`,"hover",e,""]:[e,""],f=c.getOptionScopes(this.getDataset(),d),g=Object.keys(vt.elements[e]),m=()=>this.getContext(r,s,n),p=c.resolveNamedOptions(f,g,m,u);return p.$shared&&(p.$shared=l,o[i]=Object.freeze(D0(p,l))),p}_resolveAnimations(e,n,r){const s=this.chart,o=this._cachedDataOpts,i=`animation-${n}`,a=o[i];if(a)return a;let l;if(s.options.animation!==!1){const d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(f,this.getContext(e,r,n))}const c=new E0(s,l&&l.animations);return l&&l._cacheable&&(o[i]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||ad(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const r=this.resolveDataElementOptions(e,n),s=this._sharedOptions,o=this.getSharedOptions(r),i=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:i}}updateElement(e,n,r,s){ad(s)?Object.assign(e,r):this._resolveAnimations(n,s).update(e,r)}updateSharedOptions(e,n,r){e&&!ad(n)&&this._resolveAnimations(void 0,n).update(e,r)}_setStyle(e,n,r,s){e.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(e,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(e,n,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,n,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=r.length,o=n.length,i=Math.min(o,s);i&&this.parse(0,i),o>s?this._insertElements(s,o-s,e):o<s&&this._removeElements(o,s-o)}_insertElements(e,n,r=!0){const s=this._cachedMeta,o=s.data,i=e+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=i;a--)c[a]=c[a-n]};for(l(o),a=e;a<i;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(e,n),r&&this.updateElements(o,e,n,"reset")}updateElements(e,n,r,s){}_removeElements(e,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(e,n);r._stacked&&mo(r,s)}r.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,r,s]=e;this[n](r,s)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Fe(hs,"defaults",{}),Fe(hs,"datasetElementType",null),Fe(hs,"dataElementType",null);function IN(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let r=[];for(let s=0,o=n.length;s<o;s++)r=r.concat(n[s].controller.getAllParsedValues(t));t._cache.$bar=e0(r.sort((s,o)=>s-o))}return t._cache.$bar}function LN(t){const e=t.iScale,n=IN(e,t.type);let r=e._length,s,o,i,a;const l=()=>{i===32767||i===-32768||(fo(a)&&(r=Math.min(r,Math.abs(i-a)||r)),a=i)};for(s=0,o=n.length;s<o;++s)i=e.getPixelForValue(n[s]),l();for(a=void 0,s=0,o=e.ticks.length;s<o;++s)i=e.getPixelForTick(s),l();return r}function PN(t,e,n,r){const s=n.barThickness;let o,i;return lt(s)?(o=e.min*n.categoryPercentage,i=n.barPercentage):(o=s*r,i=1),{chunk:o/r,ratio:i,start:e.pixels[t]-o/2}}function $N(t,e,n,r){const s=e.pixels,o=s[t];let i=t>0?s[t-1]:null,a=t<s.length-1?s[t+1]:null;const l=n.categoryPercentage;i===null&&(i=o-(a===null?e.end-e.start:a-o)),a===null&&(a=o+o-i);const c=o-(o-Math.min(i,a))/2*l;return{chunk:Math.abs(a-i)/2*l/r,ratio:n.barPercentage,start:c}}function FN(t,e,n,r){const s=n.parse(t[0],r),o=n.parse(t[1],r),i=Math.min(s,o),a=Math.max(s,o);let l=i,c=a;Math.abs(i)>Math.abs(a)&&(l=a,c=i),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:s,end:o,min:i,max:a}}function I0(t,e,n,r){return _t(t)?FN(t,e,n,r):e[n.axis]=n.parse(t,r),e}function L0(t,e,n,r){const s=t.iScale,o=t.vScale,i=s.getLabels(),a=s===o,l=[];let c,d,u,f;for(c=n,d=n+r;c<d;++c)f=e[c],u={},u[s.axis]=a||s.parse(i[c],c),l.push(I0(f,u,o,c));return l}function ld(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function zN(t,e,n){return t!==0?lr(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function VN(t){let e,n,r,s,o;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(s="end",o="start"):(s="start",o="end"),{start:n,end:r,reverse:e,top:s,bottom:o}}function HN(t,e,n,r){let s=e.borderSkipped;const o={};if(!s){t.borderSkipped=o;return}if(s===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:a,reverse:l,top:c,bottom:d}=VN(t);s==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?s=c:(n._bottom||0)===r?s=d:(o[P0(d,i,a,l)]=!0,s=c)),o[P0(s,i,a,l)]=!0,t.borderSkipped=o}function P0(t,e,n,r){return r?(t=UN(t,e,n),t=$0(t,n,e)):t=$0(t,e,n),t}function UN(t,e,n){return t===e?n:t===n?e:t}function $0(t,e,n){return t==="start"?e:t==="end"?n:t}function BN(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class ua extends hs{parsePrimitiveData(e,n,r,s){return L0(e,n,r,s)}parseArrayData(e,n,r,s){return L0(e,n,r,s)}parseObjectData(e,n,r,s){const{iScale:o,vScale:i}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=i.axis==="x"?a:l,u=[];let f,g,m,p;for(f=r,g=r+s;f<g;++f)p=n[f],m={},m[o.axis]=o.parse(Cr(p,c),f),u.push(I0(Cr(p,d),m,i,f));return u}updateRangeFromParsed(e,n,r,s){super.updateRangeFromParsed(e,n,r,s);const o=r._custom;o&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:r,vScale:s}=n,o=this.getParsed(e),i=o._custom,a=ld(i)?"["+i.start+", "+i.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,r,s){const o=s==="reset",{index:i,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,s);for(let g=n;g<n+r;g++){const m=this.getParsed(g),p=o||lt(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,d),b=(m._stacks||{})[a.axis],S={horizontal:c,base:p.base,enableBorderRadius:!b||ld(m._custom)||i===b._top||i===b._bottom,x:c?p.head:y.center,y:c?y.center:p.head,height:c?y.size:Math.abs(p.size),width:c?Math.abs(p.size):y.size};f&&(S.options=u||this.resolveDataElementOptions(g,e[g].active?"active":s));const x=S.options||e[g].options;HN(S,x,b,i),BN(S,x,d.ratio),this.updateElement(e[g],g,S,s)}}_getStacks(e,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=r.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=d=>{const u=d._parsed.find(g=>g[r.axis]===l),f=u&&u[d.vScale.axis];if(lt(f)||isNaN(f))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((o===!1||i.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&i.push(d.stack),d.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(r=>e[r].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[Je(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,r){const s=this._getStacks(e,r),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const e=this.options,n=this._cachedMeta,r=n.iScale,s=[];let o,i;for(o=0,i=n.data.length;o<i;++o)s.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=e.barThickness;return{min:a||LN(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:o,minBarLength:i}}=this,a=o||0,l=this.getParsed(e),c=l._custom,d=ld(c);let u=l[n.axis],f=0,g=r?this.applyStack(n,l,r):u,m,p;g!==u&&(f=g-u,g=u),d&&(u=c.barStart,g=c.barEnd-c.barStart,u!==0&&lr(u)!==lr(c.barEnd)&&(f=0),f+=u);const y=!lt(o)&&!d?o:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(e)?m=n.getPixelForValue(f+g):m=b,p=m-b,Math.abs(p)<i){p=zN(p,n,a)*i,u===a&&(b-=p/2);const S=n.getPixelForDecimal(0),x=n.getPixelForDecimal(1),E=Math.min(S,x),k=Math.max(S,x);b=Math.max(Math.min(b,k),E),m=b+p,r&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(m)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const S=lr(p)*n.getLineWidthForValue(a)/2;b+=S,p-=S}return{size:p,base:b,head:m,center:m+p/2}}_calculateBarIndexPixels(e,n){const r=n.scale,s=this.options,o=s.skipNull,i=Je(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const d=o?this._getStackCount(e):n.stackCount,u=s.barThickness==="flex"?$N(e,n,s,d*c):PN(e,n,s,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,g=this._getAxis().indexOf(Je(f,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0)+g;a=u.start+u.chunk*m+u.chunk/2,l=Math.min(i,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.axis],e),l=Math.min(i,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,n=e.vScale,r=e.data,s=r.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}Fe(ua,"id","bar"),Fe(ua,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Fe(ua,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function jN(t,e,n){let r=1,s=1,o=0,i=0;if(e<Ct){const a=t,l=a+e,c=Math.cos(a),d=Math.sin(a),u=Math.cos(l),f=Math.sin(l),g=(x,E,k)=>sa(x,a,l,!0)?1:Math.max(E,E*n,k,k*n),m=(x,E,k)=>sa(x,a,l,!0)?-1:Math.min(E,E*n,k,k*n),p=g(0,c,u),y=g(Et,d,f),b=m(ct,c,u),S=m(ct+Et,d,f);r=(p-b)/2,s=(y-S)/2,o=-(p+b)/2,i=-(y+S)/2}return{ratioX:r,ratioY:s,offsetX:o,offsetY:i}}class bo extends hs{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let o=l=>+r[l];if(Qe(r[e])){const{key:l="value"}=this._parsing;o=c=>+Cr(r[c],l)}let i,a;for(i=e,a=e+n;i<a;++i)s._parsed[i]=o(i)}}_getRotation(){return Yn(this.options.rotation-90)}_getCircumference(){return Yn(this.options.circumference)}_getRotationExtents(){let e=Ct,n=-Ct;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,o=s._getRotation(),i=s._getCircumference();e=Math.min(e,o),n=Math.max(n,o+i)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,o=s.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-i)/2,0),l=Math.min(mM(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:m,offsetY:p}=jN(u,d,l),y=(r.width-i)/f,b=(r.height-i)/g,S=Math.max(Math.min(y,b)/2,0),x=jp(this.options.radius,S),E=Math.max(x*l,0),k=(x-E)/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=p*x,s.total=this.calculateTotal(),this.outerRadius=x-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*c,0),this.updateElements(o,0,o.length,e)}_circumference(e,n){const r=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*o/Ct)}updateElements(e,n,r,s){const o=s==="reset",i=this.chart,a=i.chartArea,c=i.options.animation,d=(a.left+a.right)/2,u=(a.top+a.bottom)/2,f=o&&c.animateScale,g=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:p,includeOptions:y}=this._getSharedOptions(n,s);let b=this._getRotation(),S;for(S=0;S<n;++S)b+=this._circumference(S,o);for(S=n;S<n+r;++S){const x=this._circumference(S,o),E=e[S],k={x:d+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:m,innerRadius:g};y&&(k.options=p||this.resolveDataElementOptions(S,E.active?"active":s)),b+=x,this.updateElement(E,S,k,s)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let r=0,s;for(s=0;s<n.length;s++){const o=e._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?Ct*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],o=Kc(n._parsed[e],r.options.locale);return{label:s[e]||"",value:o}}getMaxBorderWidth(e){let n=0;const r=this.chart;let s,o,i,a,l;if(!e){for(s=0,o=r.data.datasets.length;s<o;++s)if(r.isDatasetVisible(s)){i=r.getDatasetMeta(s),e=i.data,a=i.controller;break}}if(!e)return 0;for(s=0,o=e.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let r=0,s=e.length;r<s;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(e){return Math.max(Je(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Fe(bo,"id","doughnut"),Fe(bo,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),Fe(bo,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),Fe(bo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data,{labels:{pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const u=e.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:o,hidden:!e.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:r,borderRadius:i&&(a||u.borderRadius),index:c}}):[]}},onClick(e,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});function Tr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class cd{constructor(e){Fe(this,"options");this.options=e||{}}static override(e){Object.assign(cd.prototype,e)}init(){}formats(){return Tr()}parse(){return Tr()}format(){return Tr()}add(){return Tr()}diff(){return Tr()}startOf(){return Tr()}endOf(){return Tr()}}var WN={_date:cd};function GN(t,e,n,r){const{controller:s,data:o,_sorted:i}=t,a=s._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&i&&o.length){const c=a._reversePixels?TM:Gc;if(r){if(s._sharedOptions){const d=o[0],u=typeof d.getRange=="function"&&d.getRange(e);if(u){const f=c(o,e,n-u),g=c(o,e,n+u);return{lo:f.lo,hi:g.hi}}}}else{const d=c(o,e,n);if(l){const{vScale:u}=s._cachedMeta,{_parsed:f}=t,g=f.slice(0,d.lo+1).reverse().findIndex(p=>!lt(p[u.axis]));d.lo-=Math.max(0,g);const m=f.slice(d.hi).findIndex(p=>!lt(p[u.axis]));d.hi+=Math.max(0,m)}return d}}return{lo:0,hi:o.length-1}}function fa(t,e,n,r,s){const o=t.getSortedVisibleDatasetMetas(),i=n[e];for(let a=0,l=o.length;a<l;++a){const{index:c,data:d}=o[a],{lo:u,hi:f}=GN(o[a],e,i,s);for(let g=u;g<=f;++g){const m=d[g];m.skip||r(m,c,g)}}}function YN(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(r,s){const o=e?Math.abs(r.x-s.x):0,i=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}function dd(t,e,n,r,s){const o=[];return!s&&!t.isPointInArea(e)||fa(t,n,e,function(a,l,c){!s&&!h0(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function XN(t,e,n,r){let s=[];function o(i,a,l){const{startAngle:c,endAngle:d}=i.getProps(["startAngle","endAngle"],r),{angle:u}=Qp(i,{x:e.x,y:e.y});sa(u,c,d)&&s.push({element:i,datasetIndex:a,index:l})}return fa(t,n,e,o),s}function KN(t,e,n,r,s,o){let i=[];const a=YN(n);let l=Number.POSITIVE_INFINITY;function c(d,u,f){const g=d.inRange(e.x,e.y,s);if(r&&!g)return;const m=d.getCenterPoint(s);if(!(!!o||t.isPointInArea(m))&&!g)return;const y=a(e,m);y<l?(i=[{element:d,datasetIndex:u,index:f}],l=y):y===l&&i.push({element:d,datasetIndex:u,index:f})}return fa(t,n,e,c),i}function ud(t,e,n,r,s,o){return!o&&!t.isPointInArea(e)?[]:n==="r"&&!r?XN(t,e,n,s):KN(t,e,n,r,s,o)}function F0(t,e,n,r,s){const o=[],i=n==="x"?"inXRange":"inYRange";let a=!1;return fa(t,n,e,(l,c,d)=>{l[i]&&l[i](e[n],s)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(e.x,e.y,s))}),r&&!a?[]:o}var qN={modes:{index(t,e,n,r){const s=Or(e,t),o=n.axis||"x",i=n.includeInvisible||!1,a=n.intersect?dd(t,s,o,r,i):ud(t,s,o,!1,r,i),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(t,e,n,r){const s=Or(e,t),o=n.axis||"xy",i=n.includeInvisible||!1;let a=n.intersect?dd(t,s,o,r,i):ud(t,s,o,!1,r,i);if(a.length>0){const l=a[0].datasetIndex,c=t.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(t,e,n,r){const s=Or(e,t),o=n.axis||"xy",i=n.includeInvisible||!1;return dd(t,s,o,r,i)},nearest(t,e,n,r){const s=Or(e,t),o=n.axis||"xy",i=n.includeInvisible||!1;return ud(t,s,o,n.intersect,r,i)},x(t,e,n,r){const s=Or(e,t);return F0(t,s,"x",n.intersect,r)},y(t,e,n,r){const s=Or(e,t);return F0(t,s,"y",n.intersect,r)}}};const z0=["left","top","right","bottom"];function yo(t,e){return t.filter(n=>n.pos===e)}function V0(t,e){return t.filter(n=>z0.indexOf(n.pos)===-1&&n.box.axis===e)}function vo(t,e){return t.sort((n,r)=>{const s=e?r:n,o=e?n:r;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ZN(t){const e=[];let n,r,s,o,i,a;for(n=0,r=(t||[]).length;n<r;++n)s=t[n],{position:o,options:{stack:i,stackWeight:a=1}}=s,e.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:i&&o+i,stackWeight:a});return e}function QN(t){const e={};for(const n of t){const{stack:r,pos:s,stackWeight:o}=n;if(!r||!z0.includes(s))continue;const i=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return e}function JN(t,e){const n=QN(t),{vBoxMaxWidth:r,hBoxMaxHeight:s}=e;let o,i,a;for(o=0,i=t.length;o<i;++o){a=t[o];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&e.availableWidth,a.height=s):(a.width=r,a.height=d?d*s:l&&e.availableHeight)}return n}function RN(t){const e=ZN(t),n=vo(e.filter(c=>c.box.fullSize),!0),r=vo(yo(e,"left"),!0),s=vo(yo(e,"right")),o=vo(yo(e,"top"),!0),i=vo(yo(e,"bottom")),a=V0(e,"x"),l=V0(e,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:s.concat(l).concat(i).concat(a),chartArea:yo(e,"chartArea"),vertical:r.concat(s).concat(l),horizontal:o.concat(i).concat(a)}}function H0(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function U0(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function eO(t,e,n,r){const{pos:s,box:o}=n,i=t.maxPadding;if(!Qe(s)){n.size&&(t[s]-=n.size);const u=r[n.stack]||{size:0,count:1};u.size=Math.max(u.size,n.horizontal?o.height:o.width),n.size=u.size/u.count,t[s]+=n.size}o.getPadding&&U0(i,o.getPadding());const a=Math.max(0,e.outerWidth-H0(i,t,"left","right")),l=Math.max(0,e.outerHeight-H0(i,t,"top","bottom")),c=a!==t.w,d=l!==t.h;return t.w=a,t.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function tO(t){const e=t.maxPadding;function n(r){const s=Math.max(e[r]-t[r],0);return t[r]+=s,s}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function nO(t,e){const n=e.maxPadding;function r(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(i=>{o[i]=Math.max(e[i],n[i])}),o}return r(t?["left","right"]:["top","bottom"])}function xo(t,e,n,r){const s=[];let o,i,a,l,c,d;for(o=0,i=t.length,c=0;o<i;++o){a=t[o],l=a.box,l.update(a.width||e.w,a.height||e.h,nO(a.horizontal,e));const{same:u,other:f}=eO(e,n,a,r);c|=u&&s.length,d=d||f,l.fullSize||s.push(a)}return c&&xo(s,e,n,r)||d}function ha(t,e,n,r,s){t.top=n,t.left=e,t.right=e+r,t.bottom=n+s,t.width=r,t.height=s}function B0(t,e,n,r){const s=n.padding;let{x:o,y:i}=e;for(const a of t){const l=a.box,c=r[a.stack]||{placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const u=e.w*d,f=c.size||l.height;fo(c.start)&&(i=c.start),l.fullSize?ha(l,s.left,i,n.outerWidth-s.right-s.left,f):ha(l,e.left+c.placed,i,u,f),c.start=i,c.placed+=u,i=l.bottom}else{const u=e.h*d,f=c.size||l.width;fo(c.start)&&(o=c.start),l.fullSize?ha(l,o,s.top,f,n.outerHeight-s.bottom-s.top):ha(l,o,e.top+c.placed,f,u),c.start=o,c.placed+=u,o=l.right}}e.x=o,e.y=i}var mn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,r){if(!t)return;const s=pn(t.options.layout.padding),o=Math.max(e-s.width,0),i=Math.max(n-s.height,0),a=RN(t.boxes),l=a.vertical,c=a.horizontal;at(t.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const d=l.reduce((p,y)=>y.box.options&&y.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:n,padding:s,availableWidth:o,availableHeight:i,vBoxMaxWidth:o/2/d,hBoxMaxHeight:i/2}),f=Object.assign({},s);U0(f,pn(r));const g=Object.assign({maxPadding:f,w:o,h:i,x:s.left,y:s.top},s),m=JN(l.concat(c),u);xo(a.fullSize,g,u,m),xo(l,g,u,m),xo(c,g,u,m)&&xo(l,g,u,m),tO(g),B0(a.leftAndTop,g,u,m),g.x+=g.w,g.y+=g.h,B0(a.rightAndBottom,g,u,m),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},at(a.chartArea,p=>{const y=p.box;Object.assign(y,t.chartArea),y.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class j0{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,r){}removeEventListener(e,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,r,s){return n=Math.max(0,n||e.width),r=r||e.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(e){return!0}updateConfig(e){}}class rO extends j0{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ga="$chartjs",sO={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},W0=t=>t===null||t==="";function oO(t,e){const n=t.style,r=t.getAttribute("height"),s=t.getAttribute("width");if(t[ga]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",W0(s)){const o=k0(t,"width");o!==void 0&&(t.width=o)}if(W0(r))if(t.style.height==="")t.height=t.width/(e||2);else{const o=k0(t,"height");o!==void 0&&(t.height=o)}return t}const G0=gN?{passive:!0}:!1;function iO(t,e,n){t&&t.addEventListener(e,n,G0)}function aO(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,G0)}function lO(t,e){const n=sO[t.type]||t.type,{x:r,y:s}=Or(t,e);return{type:n,chart:e,native:t,x:r!==void 0?r:null,y:s!==void 0?s:null}}function pa(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function cO(t,e,n){const r=t.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||pa(a.addedNodes,r),i=i&&!pa(a.removedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function dO(t,e,n){const r=t.canvas,s=new MutationObserver(o=>{let i=!1;for(const a of o)i=i||pa(a.removedNodes,r),i=i&&!pa(a.addedNodes,r);i&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const wo=new Map;let Y0=0;function X0(){const t=window.devicePixelRatio;t!==Y0&&(Y0=t,wo.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function uO(t,e){wo.size||window.addEventListener("resize",X0),wo.set(t,e)}function fO(t){wo.delete(t),wo.size||window.removeEventListener("resize",X0)}function hO(t,e,n){const r=t.canvas,s=r&&sd(r);if(!s)return;const o=n0((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),i=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return i.observe(s),uO(t,o),i}function fd(t,e,n){n&&n.disconnect(),e==="resize"&&fO(t)}function gO(t,e,n){const r=t.canvas,s=n0(o=>{t.ctx!==null&&n(lO(o,t))},t);return iO(r,e,s),s}class pO extends j0{acquireContext(e,n){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(oO(e,n),r):null}releaseContext(e){const n=e.canvas;if(!n[ga])return!1;const r=n[ga].initial;["height","width"].forEach(o=>{const i=r[o];lt(i)?n.removeAttribute(o):n.setAttribute(o,i)});const s=r.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[ga],!0}addEventListener(e,n,r){this.removeEventListener(e,n);const s=e.$proxies||(e.$proxies={}),i={attach:cO,detach:dO,resize:hO}[n]||gO;s[n]=i(e,n,r)}removeEventListener(e,n){const r=e.$proxies||(e.$proxies={}),s=r[n];if(!s)return;({attach:fd,detach:fd,resize:fd}[n]||aO)(e,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,r,s){return hN(e,n,r,s)}isAttached(e){const n=e&&sd(e);return!!(n&&n.isConnected)}}function mO(t){return!rd()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?rO:pO}let Ar=(Ta=class{constructor(){Fe(this,"x");Fe(this,"y");Fe(this,"active",!1);Fe(this,"options");Fe(this,"$animations")}tooltipPosition(e){const{x:n,y:r}=this.getProps(["x","y"],e);return{x:n,y:r}}hasValue(){return ra(this.x)&&ra(this.y)}getProps(e,n){const r=this.$animations;if(!n||!r)return this;const s={};return e.forEach(o=>{s[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),s}},Fe(Ta,"defaults",{}),Fe(Ta,"defaultRoutes"),Ta);function bO(t,e){const n=t.options.ticks,r=yO(t),s=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?xO(e):[],i=o.length,a=o[0],l=o[i-1],c=[];if(i>s)return wO(e,c,o,i/s),c;const d=vO(o,e,s);if(i>0){let u,f;const g=i>1?Math.round((l-a)/(i-1)):null;for(ma(e,c,d,lt(g)?0:a-g,a),u=0,f=i-1;u<f;u++)ma(e,c,d,o[u],o[u+1]);return ma(e,c,d,l,lt(g)?e.length:l+g),c}return ma(e,c,d),c}function yO(t){const e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),s=t._maxLength/n;return Math.floor(Math.min(r,s))}function vO(t,e,n){const r=kO(t),s=e.length/n;if(!r)return Math.max(s,1);const o=CM(r);for(let i=0,a=o.length-1;i<a;i++){const l=o[i];if(l>s)return l}return Math.max(s,1)}function xO(t){const e=[];let n,r;for(n=0,r=t.length;n<r;n++)t[n].major&&e.push(n);return e}function wO(t,e,n,r){let s=0,o=n[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===o&&(e.push(t[i]),s++,o=n[s*r])}function ma(t,e,n,r,s){const o=Je(r,0),i=Math.min(Je(s,t.length),t.length);let a=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-r,n=l/Math.floor(l/n)),d=o;d<0;)a++,d=Math.round(o+a*n);for(c=Math.max(o,0);c<i;c++)c===d&&(e.push(t[c]),a++,d=Math.round(o+a*n))}function kO(t){const e=t.length;let n,r;if(e<2)return!1;for(r=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==r)return!1;return r}const CO=t=>t==="left"?"right":t==="right"?"left":t,K0=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,q0=(t,e)=>Math.min(e||t,t);function Z0(t,e){const n=[],r=t.length/e,s=t.length;let o=0;for(;o<s;o+=r)n.push(t[Math.floor(o)]);return n}function SO(t,e,n){const r=t.ticks.length,s=Math.min(e,r-1),o=t._startPixel,i=t._endPixel,a=1e-6;let l=t.getPixelForTick(s),c;if(!(n&&(r===1?c=Math.max(l-o,i-l):e===0?c=(t.getPixelForTick(1)-l)/2:c=(l-t.getPixelForTick(s-1))/2,l+=s<e?c:-c,l<o-a||l>i+a)))return l}function _O(t,e){at(t,n=>{const r=n.gc,s=r.length/2;let o;if(s>e){for(o=0;o<s;++o)delete n.data[r[o]];r.splice(0,s)}})}function ko(t){return t.drawTicks?t.tickLength:0}function Q0(t,e){if(!t.display)return 0;const n=Ut(t.font,e),r=pn(t.padding);return(_t(t.text)?t.text.length:1)*n.lineHeight+r.height}function EO(t,e){return ds(t,{scale:e,type:"scale"})}function MO(t,e,n){return ds(t,{tick:n,index:e,type:"tick"})}function NO(t,e,n){let r=Yc(t);return(n&&e!=="right"||!n&&e==="right")&&(r=CO(r)),r}function OO(t,e,n,r){const{top:s,left:o,bottom:i,right:a,chart:l}=t,{chartArea:c,scales:d}=l;let u=0,f,g,m;const p=i-s,y=a-o;if(t.isHorizontal()){if(g=Ht(r,o,a),Qe(n)){const b=Object.keys(n)[0],S=n[b];m=d[b].getPixelForValue(S)+p-e}else n==="center"?m=(c.bottom+c.top)/2+p-e:m=K0(t,n,e);f=a-o}else{if(Qe(n)){const b=Object.keys(n)[0],S=n[b];g=d[b].getPixelForValue(S)-y+e}else n==="center"?g=(c.left+c.right)/2-y+e:g=K0(t,n,e);m=Ht(r,i,s),u=n==="left"?-Et:Et}return{titleX:g,titleY:m,maxWidth:f,rotation:u}}class gs extends Ar{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return e=$n(e,Number.POSITIVE_INFINITY),n=$n(n,Number.NEGATIVE_INFINITY),r=$n(r,Number.POSITIVE_INFINITY),s=$n(s,Number.NEGATIVE_INFINITY),{min:$n(e,r),max:$n(n,s),minDefined:gn(e),maxDefined:gn(n)}}getMinMax(e){let{min:n,max:r,minDefined:s,maxDefined:o}=this.getUserBounds(),i;if(s&&o)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)i=a[l].controller.getMinMax(this,e),s||(n=Math.min(n,i.min)),o||(r=Math.max(r,i.max));return n=o&&n>r?r:n,r=s&&n>r?n:r,{min:$n(n,$n(r,n)),max:$n(r,$n(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ht(this.options.beforeUpdate,[this])}update(e,n,r){const{beginAtZero:s,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=JM(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Z0(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=bO(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,e=!e),this._startPixel=n,this._endPixel=r,this._reversePixels=e,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ht(this.options.afterUpdate,[this])}beforeSetDimensions(){ht(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ht(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ht(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ht(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let r,s,o;for(r=0,s=e.length;r<s;r++)o=e[r],o.label=ht(n.callback,[o.value,r,e],this)}afterTickToLabelConversion(){ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,r=q0(this.ticks.length,e.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let i=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),u=d.widest.width,f=d.highest.height,g=Jt(this.chart.width-u,0,this.maxWidth);a=e.offset?this.maxWidth/r:g/(r-1),u+6>a&&(a=g/(r-(e.offset?.5:1)),l=this.maxHeight-ko(e.grid)-n.padding-Q0(e.title,this.chart.options.font),c=Math.sqrt(u*u+f*f),i=MM(Math.min(Math.asin(Jt((d.highest.height+6)/a,-1,1)),Math.asin(Jt(l/c,-1,1))-Math.asin(Jt(f/c,-1,1)))),i=Math.max(s,Math.min(o,i))),this.labelRotation=i}afterCalculateLabelRotation(){ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ht(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const l=Q0(s,n.options.font);if(a?(e.width=this.maxWidth,e.height=ko(o)+l):(e.height=this.maxHeight,e.width=ko(o)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:u,highest:f}=this._getLabelSizes(),g=r.padding*2,m=Yn(this.labelRotation),p=Math.cos(m),y=Math.sin(m);if(a){const b=r.mirror?0:y*u.width+p*f.height;e.height=Math.min(this.maxHeight,e.height+b+g)}else{const b=r.mirror?0:p*u.width+y*f.height;e.width=Math.min(this.maxWidth,e.width+b+g)}this._calculatePadding(c,d,y,p)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,r,s){const{ticks:{align:o,padding:i},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*e.width,g=r*n.height):(f=r*e.height,g=s*n.width):o==="start"?g=n.width:o==="end"?f=e.width:o!=="inner"&&(f=e.width/2,g=n.width/2),this.paddingLeft=Math.max((f-d+i)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-u+i)*this.width/(this.width-u),0)}else{let d=n.height/2,u=e.height/2;o==="start"?(d=0,u=e.height):o==="end"&&(d=n.height,u=0),this.paddingTop=d+i,this.paddingBottom=u+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ht(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,r;for(n=0,r=e.length;n<r;n++)lt(e[n].label)&&(e.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Z0(r,n)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,r){const{ctx:s,_longestTextCache:o}=this,i=[],a=[],l=Math.floor(n/q0(n,r));let c=0,d=0,u,f,g,m,p,y,b,S,x,E,k;for(u=0;u<n;u+=l){if(m=e[u].label,p=this._resolveTickFontOptions(u),s.font=y=p.string,b=o[y]=o[y]||{data:{},gc:[]},S=p.lineHeight,x=E=0,!lt(m)&&!_t(m))x=c0(s,b.data,b.gc,x,m),E=S;else if(_t(m))for(f=0,g=m.length;f<g;++f)k=m[f],!lt(k)&&!_t(k)&&(x=c0(s,b.data,b.gc,x,k),E+=S);i.push(x),a.push(E),c=Math.max(x,c),d=Math.max(E,d)}_O(o,n);const C=i.indexOf(c),N=a.indexOf(d),_=w=>({width:i[w]||0,height:a[w]||0});return{first:_(0),last:_(n-1),widest:_(C),highest:_(N),widths:i,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return OM(this._alignToPixels?Mr(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const r=n[e];return r.$context||(r.$context=MO(this.getContext(),e,r))}return this.$context||(this.$context=EO(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Yn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),i=e.autoSkipPadding||0,a=o?o.widest.width+i:0,l=o?o.highest.height+i:0;return this.isHorizontal()?l*r>a*s?a/r:l/s:l*s<a*r?l/r:a/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,r=this.chart,s=this.options,{grid:o,position:i,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),f=ko(o),g=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,y=p/2,b=function(A){return Mr(r,A,p)};let S,x,E,k,C,N,_,w,M,O,L,F;if(i==="top")S=b(this.bottom),N=this.bottom-f,w=S-y,O=b(e.top)+y,F=e.bottom;else if(i==="bottom")S=b(this.top),O=e.top,F=b(e.bottom)-y,N=S+y,w=this.top+f;else if(i==="left")S=b(this.right),C=this.right-f,_=S-y,M=b(e.left)+y,L=e.right;else if(i==="right")S=b(this.left),M=e.left,L=b(e.right)-y,C=S+y,_=this.left+f;else if(n==="x"){if(i==="center")S=b((e.top+e.bottom)/2+.5);else if(Qe(i)){const A=Object.keys(i)[0],T=i[A];S=b(this.chart.scales[A].getPixelForValue(T))}O=e.top,F=e.bottom,N=S+y,w=N+f}else if(n==="y"){if(i==="center")S=b((e.left+e.right)/2);else if(Qe(i)){const A=Object.keys(i)[0],T=i[A];S=b(this.chart.scales[A].getPixelForValue(T))}C=S-y,_=C-f,M=e.left,L=e.right}const $=Je(s.ticks.maxTicksLimit,u),D=Math.max(1,Math.ceil(u/$));for(x=0;x<u;x+=D){const A=this.getContext(x),T=o.setContext(A),z=a.setContext(A),H=T.lineWidth,W=T.color,j=z.dash||[],U=z.dashOffset,B=T.tickWidth,G=T.tickColor,V=T.tickBorderDash||[],K=T.tickBorderDashOffset;E=SO(this,x,l),E!==void 0&&(k=Mr(r,E,H),c?C=_=M=L=k:N=w=O=F=k,g.push({tx1:C,ty1:N,tx2:_,ty2:w,x1:M,y1:O,x2:L,y2:F,width:H,color:W,borderDash:j,borderDashOffset:U,tickWidth:B,tickColor:G,tickBorderDash:V,tickBorderDashOffset:K}))}return this._ticksLength=u,this._borderValue=S,g}_computeLabelItems(e){const n=this.axis,r=this.options,{position:s,ticks:o}=r,i=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=o,f=ko(r.grid),g=f+d,m=u?-d:g,p=-Yn(this.labelRotation),y=[];let b,S,x,E,k,C,N,_,w,M,O,L,F="middle";if(s==="top")C=this.bottom-m,N=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+m,N=this._getXAxisLabelAlignment();else if(s==="left"){const D=this._getYAxisLabelAlignment(f);N=D.textAlign,k=D.x}else if(s==="right"){const D=this._getYAxisLabelAlignment(f);N=D.textAlign,k=D.x}else if(n==="x"){if(s==="center")C=(e.top+e.bottom)/2+g;else if(Qe(s)){const D=Object.keys(s)[0],A=s[D];C=this.chart.scales[D].getPixelForValue(A)+g}N=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")k=(e.left+e.right)/2-g;else if(Qe(s)){const D=Object.keys(s)[0],A=s[D];k=this.chart.scales[D].getPixelForValue(A)}N=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const $=this._getLabelSizes();for(b=0,S=a.length;b<S;++b){x=a[b],E=x.label;const D=o.setContext(this.getContext(b));_=this.getPixelForTick(b)+o.labelOffset,w=this._resolveTickFontOptions(b),M=w.lineHeight,O=_t(E)?E.length:1;const A=O/2,T=D.color,z=D.textStrokeColor,H=D.textStrokeWidth;let W=N;i?(k=_,N==="inner"&&(b===S-1?W=this.options.reverse?"left":"right":b===0?W=this.options.reverse?"right":"left":W="center"),s==="top"?c==="near"||p!==0?L=-O*M+M/2:c==="center"?L=-$.highest.height/2-A*M+M:L=-$.highest.height+M/2:c==="near"||p!==0?L=M/2:c==="center"?L=$.highest.height/2-A*M:L=$.highest.height-O*M,u&&(L*=-1),p!==0&&!D.showLabelBackdrop&&(k+=M/2*Math.sin(p))):(C=_,L=(1-O)*M/2);let j;if(D.showLabelBackdrop){const U=pn(D.backdropPadding),B=$.heights[b],G=$.widths[b];let V=L-U.top,K=0-U.left;switch(F){case"middle":V-=B/2;break;case"bottom":V-=B;break}switch(N){case"center":K-=G/2;break;case"right":K-=G;break;case"inner":b===S-1?K-=G:b>0&&(K-=G/2);break}j={left:K,top:V,width:G+U.width,height:B+U.height,color:D.backdropColor}}y.push({label:E,font:w,textOffset:L,options:{rotation:p,color:T,strokeColor:z,strokeWidth:H,textAlign:W,textBaseline:F,translation:[k,C],backdrop:j}})}return y}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Yn(this.labelRotation))return e==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:r,mirror:s,padding:o}}=this.options,i=this._getLabelSizes(),a=e+o,l=i.widest.width;let c,d;return n==="left"?s?(d=this.right+o,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+o,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:r,top:s,width:o,height:i}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(r,s,o,i),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===e);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,i;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,i=s.length;o<i;++o){const l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:r,grid:s}}=this,o=r.setContext(this.getContext()),i=r.display?o.width:0;if(!i)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,u,f;this.isHorizontal()?(c=Mr(e,this.left,i)-i/2,d=Mr(e,this.right,a)+a/2,u=f=l):(u=Mr(e,this.top,i)-i/2,f=Mr(e,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,u),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&Qc(r,s);const o=this.getLabelItems(e);for(const i of o){const a=i.options,l=i.font,c=i.label,d=i.textOffset;po(r,c,0,d,l,a)}s&&Jc(r)}drawTitle(){const{ctx:e,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const o=Ut(r.font),i=pn(r.padding),a=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Qe(n)?(l+=i.bottom,_t(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=i.top;const{titleX:c,titleY:d,maxWidth:u,rotation:f}=OO(this,l,n,a);po(e,r.text,0,0,o,{color:r.color,maxWidth:u,rotation:f,textAlign:NO(a,n,s),textBaseline:"middle",translation:[c,d]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,r=Je(e.grid&&e.grid.z,-1),s=Je(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==gs.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let o,i;for(o=0,i=n.length;o<i;++o){const a=n[o];a[r]===this.id&&(!e||a.type===e)&&s.push(a)}return s}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return Ut(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ba{constructor(e,n,r){this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let r;DO(n)&&(r=this.register(n));const s=this.items,o=e.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in s||(s[o]=e,TO(e,i,r),this.override&&vt.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const n=this.items,r=e.id,s=this.scope;r in n&&delete n[r],s&&r in vt[s]&&(delete vt[s][r],this.override&&delete Er[r])}}function TO(t,e,n){const r=co(Object.create(null),[n?vt.get(n):{},vt.get(e),t.defaults]);vt.set(e,r),t.defaultRoutes&&AO(e,t.defaultRoutes),t.descriptors&&vt.describe(e,t.descriptors)}function AO(t,e){Object.keys(e).forEach(n=>{const r=n.split("."),s=r.pop(),o=[t].concat(r).join("."),i=e[n].split("."),a=i.pop(),l=i.join(".");vt.route(o,s,l,a)})}function DO(t){return"id"in t&&"defaults"in t}class IO{constructor(){this.controllers=new ba(hs,"datasets",!0),this.elements=new ba(Ar,"elements"),this.plugins=new ba(Object,"plugins"),this.scales=new ba(gs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,r){[...n].forEach(s=>{const o=r||this._getRegistryForType(s);r||o.isForType(s)||o===this.plugins&&s.id?this._exec(e,o,s):at(s,i=>{const a=r||this._getRegistryForType(i);this._exec(e,a,i)})})}_exec(e,n,r){const s=jc(e);ht(r["before"+s],[],r),n[e](r),ht(r["after"+s],[],r)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(e))return r}return this.plugins}_get(e,n,r){const s=n.get(e);if(s===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return s}}var zn=new IO;class LO{constructor(){this._init=void 0}notify(e,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const o=s?this._descriptors(e).filter(s):this._descriptors(e),i=this._notify(o,e,n,r);return n==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),i}_notify(e,n,r,s){s=s||{};for(const o of e){const i=o.plugin,a=i[r],l=[n,s,o.options];if(ht(a,l,i)===!1&&s.cancelable)return!1}return!0}invalidate(){lt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const r=e&&e.config,s=Je(r.options&&r.options.plugins,{}),o=PO(r);return s===!1&&!n?[]:FO(e,o,s,n)}_notifyStateChanges(e){const n=this._oldCache||[],r=this._cache,s=(o,i)=>o.filter(a=>!i.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,r),e,"stop"),this._notify(s(r,n),e,"start")}}function PO(t){const e={},n=[],r=Object.keys(zn.plugins.items);for(let o=0;o<r.length;o++)n.push(zn.getPlugin(r[o]));const s=t.plugins||[];for(let o=0;o<s.length;o++){const i=s[o];n.indexOf(i)===-1&&(n.push(i),e[i.id]=!0)}return{plugins:n,localIds:e}}function $O(t,e){return!e&&t===!1?null:t===!0?{}:t}function FO(t,{plugins:e,localIds:n},r,s){const o=[],i=t.getContext();for(const a of e){const l=a.id,c=$O(r[l],s);c!==null&&o.push({plugin:a,options:zO(t.config,{plugin:a,local:n[l]},c,i)})}return o}function zO(t,{plugin:e,local:n},r,s){const o=t.pluginScopeKeys(e),i=t.getOptionScopes(r,o);return n&&e.defaults&&i.push(e.defaults),t.createResolver(i,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function hd(t,e){const n=vt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function VO(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function HO(t,e){return t===e?"_index_":"_value_"}function J0(t){if(t==="x"||t==="y"||t==="r")return t}function UO(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function gd(t,...e){if(J0(t))return t;for(const n of e){const r=n.axis||UO(n.position)||t.length>1&&J0(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function R0(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function BO(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(n.length)return R0(t,"x",n[0])||R0(t,"y",n[0])}return{}}function jO(t,e){const n=Er[t.type]||{scales:{}},r=e.scales||{},s=hd(t.type,e),o=Object.create(null);return Object.keys(r).forEach(i=>{const a=r[i];if(!Qe(a))return console.error(`Invalid scale configuration for scale: ${i}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const l=gd(i,a,BO(i,t),vt.scales[a.type]),c=HO(l,s),d=n.scales||{};o[i]=uo(Object.create(null),[{axis:l},a,d[l],d[c]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,l=i.indexAxis||hd(a,e),d=(Er[a]||{}).scales||{};Object.keys(d).forEach(u=>{const f=VO(u,l),g=i[f+"AxisID"]||f;o[g]=o[g]||Object.create(null),uo(o[g],[{axis:f},r[g],d[u]])})}),Object.keys(o).forEach(i=>{const a=o[i];uo(a,[vt.scales[a.type],vt.scale])}),o}function em(t){const e=t.options||(t.options={});e.plugins=Je(e.plugins,{}),e.scales=jO(t,e)}function tm(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function WO(t){return t=t||{},t.data=tm(t.data),em(t),t}const nm=new Map,rm=new Set;function ya(t,e){let n=nm.get(t);return n||(n=e(),nm.set(t,n),rm.add(n)),n}const Co=(t,e,n)=>{const r=Cr(e,n);r!==void 0&&t.add(r)};class GO{constructor(e){this._config=WO(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=tm(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),em(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ya(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return ya(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return ya(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,r=this.type;return ya(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const r=this._scopeCache;let s=r.get(e);return(!s||n)&&(s=new Map,r.set(e,s)),s}getOptionScopes(e,n,r){const{options:s,type:o}=this,i=this._cachedScopes(e,r),a=i.get(n);if(a)return a;const l=new Set;n.forEach(d=>{e&&(l.add(e),d.forEach(u=>Co(l,e,u))),d.forEach(u=>Co(l,s,u)),d.forEach(u=>Co(l,Er[o]||{},u)),d.forEach(u=>Co(l,vt,u)),d.forEach(u=>Co(l,qc,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),rm.has(n)&&i.set(n,c),c}chartOptionScopes(){const{options:e,type:n}=this;return[e,Er[n]||{},vt.datasets[n]||{},{type:n},vt,qc]}resolveNamedOptions(e,n,r,s=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=sm(this._resolverCache,e,s);let l=i;if(XO(i,n)){o.$shared=!1,r=ar(r)?r():r;const c=this.createResolver(e,r,a);l=us(i,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(e,n,r=[""],s){const{resolver:o}=sm(this._resolverCache,e,r);return Qe(n)?us(o,n,void 0,s):o}}function sm(t,e,n){let r=t.get(e);r||(r=new Map,t.set(e,r));const s=n.join();let o=r.get(s);return o||(o={resolver:ed(e,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,o)),o}const YO=t=>Qe(t)&&Object.getOwnPropertyNames(t).some(e=>ar(t[e]));function XO(t,e){const{isScriptable:n,isIndexable:r}=p0(t);for(const s of e){const o=n(s),i=r(s),a=(i||o)&&t[s];if(o&&(ar(a)||YO(a))||i&&_t(a))return!0}return!1}var KO="4.5.1";const qO=["top","bottom","left","right","chartArea"];function om(t,e){return t==="top"||t==="bottom"||qO.indexOf(t)===-1&&e==="x"}function im(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function am(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ht(n&&n.onComplete,[t],e)}function ZO(t){const e=t.chart,n=e.options.animation;ht(n&&n.onProgress,[t],e)}function lm(t){return rd()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const va={},cm=t=>{const e=lm(t);return Object.values(va).filter(n=>n.canvas===e).pop()};function QO(t,e,n){const r=Object.keys(t);for(const s of r){const o=+s;if(o>=e){const i=t[s];delete t[s],(n>0||o>e)&&(t[o+n]=i)}}}function JO(t,e,n,r){return!n||t.type==="mouseout"?null:r?e:t}let So=(ur=class{static register(...e){zn.add(...e),dm()}static unregister(...e){zn.remove(...e),dm()}constructor(e,n){const r=this.config=new GO(n),s=lm(e),o=cm(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||mO(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,i.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=pM(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new LO,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=IM(u=>this.update(u),i.resizeDelay||0),this._dataChanges=[],va[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Xn.listen(this,"complete",am),Xn.listen(this,"progress",ZO),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:r,height:s,_aspectRatio:o}=this;return lt(e)?n&&o?o:s?r/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return zn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():w0(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return d0(this.canvas,this.ctx),this}stop(){return Xn.stop(this),this}resize(e,n){Xn.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const r=this.options,s=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(s,e,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,w0(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),ht(r.onResize,[this,i],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};at(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const e=this.options,n=e.scales,r=this.scales,s=Object.keys(r).reduce((i,a)=>(i[a]=!1,i),{});let o=[];n&&(o=o.concat(Object.keys(n).map(i=>{const a=n[i],l=gd(i,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),at(o,i=>{const a=i.options,l=a.id,c=gd(l,a),d=Je(a.type,i.dtype);(a.position===void 0||om(a.position,c)!==om(i.dposition))&&(a.position=i.dposition),s[l]=!0;let u=null;if(l in r&&r[l].type===d)u=r[l];else{const f=zn.getScale(d);u=new f({id:l,type:d,ctx:this.ctx,chart:this}),r[u.id]=u}u.init(a,e)}),at(s,(i,a)=>{i||delete r[a]}),at(r,i=>{mn.configure(this,i,i.options),mn.addBox(this,i)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,r=e.length;if(e.sort((s,o)=>s.index-o.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);e.splice(n,r-n)}this._sortedMetasets=e.slice(0).sort(im("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((r,s)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const o=n[r];let i=this.getDatasetMeta(r);const a=o.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=a,i.indexAxis=o.indexAxis||hd(a,this.options),i.order=o.order||0,i.index=r,i.label=""+o.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const l=zn.getController(a),{datasetElementType:c,dataElementType:d}=vt.datasets[a];Object.assign(l,{dataElementType:zn.getElement(d),datasetElementType:c&&zn.getElement(c)}),i.controller=new l(this,r),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){at(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:u}=this.getDatasetMeta(c),f=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(f),i=Math.max(+u.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),s||at(o,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(im("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){at(this.scales,e=>{mn.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!Yp(n,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:o}of n){const i=r==="_removeElements"?-o:o;QO(e,s,i)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(e.filter(i=>i[0]===o).map((i,a)=>a+","+i.splice(1).join(","))),s=r(0);for(let o=1;o<n;o++)if(!Yp(s,r(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mn.update(this,this.width,this.height,e);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],at(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,ar(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const r=this.getDatasetMeta(e),s={meta:r,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Xn.has(this)?this.attached&&!Xn.running(this)&&Xn.start(this):(this.draw(),am({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,r=[];let s,o;for(s=0,o=n.length;s<o;++s){const i=n[s];(!e||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,r={meta:e,index:e.index,cancelable:!0},s=yN(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&Qc(n,s),e.controller.draw(),s&&Jc(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return h0(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,r,s){const o=qN.modes[n];return typeof o=="function"?o(this,e,r,s):[]}getDatasetMeta(e){const n=this.data.datasets[e],r=this._metasets;let s=r.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=ds(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(e,n){const r=this.getDatasetMeta(e);r.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,r){const s=r?"show":"hide",o=this.getDatasetMeta(e),i=o.controller._resolveAnimations(void 0,s);fo(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),i.update(o,{visible:r}),this.update(a=>a.datasetIndex===e?s:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Xn.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),d0(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete va[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,r=(o,i)=>{n.addEventListener(this,o,i),e[o]=i},s=(o,i,a)=>{o.offsetX=i,o.offsetY=a,this._eventHandler(o)};at(this.options.events,o=>r(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),e[l]=c},s=(l,c)=>{e[l]&&(n.removeEventListener(this,l,c),delete e[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let i;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",i)};i=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():i()}unbindEvents(){at(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},at(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,r){const s=r?"set":"remove";let o,i,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){i=e[a];const c=i&&this.getDatasetMeta(i.datasetIndex).controller;c&&c[s+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],r=e.map(({datasetIndex:o,index:i})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[i],index:i}});!Ri(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(e,n,r){return this._plugins.notify(this,e,n,r)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,r){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),i=o(n,e),a=r?e:o(e,n);i.length&&this.updateHoverStyle(i,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(e,n){const r={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},s=i=>(i.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const o=this._handleEvent(e,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(o||r.changed)&&this.render(),this}_handleEvent(e,n,r){const{_active:s=[],options:o}=this,i=n,a=this._getActiveElements(e,s,r,i),l=wM(e),c=JO(e,this._lastEvent,r,l);r&&(this._lastEvent=null,ht(o.onHover,[e,a,this],this),l&&ht(o.onClick,[e,a,this],this));const d=!Ri(a,s);return(d||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,d}_getActiveElements(e,n,r,s){if(e.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,s)}},Fe(ur,"defaults",vt),Fe(ur,"instances",va),Fe(ur,"overrides",Er),Fe(ur,"registry",zn),Fe(ur,"version",KO),Fe(ur,"getChart",cm),ur);function dm(){return at(So.instances,t=>t._plugins.invalidate())}function RO(t,e,n){const{startAngle:r,x:s,y:o,outerRadius:i,innerRadius:a,options:l}=e,{borderWidth:c,borderJoinStyle:d}=l,u=Math.min(c/i,Fn(r-n));if(t.beginPath(),t.arc(s,o,i-c/2,r+u/2,n-u/2),a>0){const f=Math.min(c/a,Fn(r-n));t.arc(s,o,a+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,i*Fn(r-n));if(d==="round")t.arc(s,o,f,n-ct/2,r+ct/2,!0);else if(d==="bevel"){const g=2*f*f,m=-g*Math.cos(n+ct/2)+s,p=-g*Math.sin(n+ct/2)+o,y=g*Math.cos(r+ct/2)+s,b=g*Math.sin(r+ct/2)+o;t.lineTo(m,p),t.lineTo(y,b)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function eT(t,e,n){const{startAngle:r,pixelMargin:s,x:o,y:i,outerRadius:a,innerRadius:l}=e;let c=s/a;t.beginPath(),t.arc(o,i,a,r-c,n+c),l>s?(c=s/l,t.arc(o,i,l,n+c,r-c,!0)):t.arc(o,i,s,n+Et,r-Et),t.closePath(),t.clip()}function tT(t){return Rc(t,["outerStart","outerEnd","innerStart","innerEnd"])}function nT(t,e,n,r){const s=tT(t.options.borderRadius),o=(n-e)/2,i=Math.min(o,r*e/2),a=l=>{const c=(n-Math.min(o,l))*r/2;return Jt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Jt(s.innerStart,0,i),innerEnd:Jt(s.innerEnd,0,i)}}function ps(t,e,n,r){return{x:n+t*Math.cos(e),y:r+t*Math.sin(e)}}function xa(t,e,n,r,s,o){const{x:i,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=e,u=Math.max(e.outerRadius+r+n-c,0),f=d>0?d+r+n+c:0;let g=0;const m=s-l;if(r){const D=d>0?d-r:0,A=u>0?u-r:0,T=(D+A)/2,z=T!==0?m*T/(T+r):m;g=(m-z)/2}const p=Math.max(.001,m*u-n/ct)/u,y=(m-p)/2,b=l+y+g,S=s-y-g,{outerStart:x,outerEnd:E,innerStart:k,innerEnd:C}=nT(e,f,u,S-b),N=u-x,_=u-E,w=b+x/N,M=S-E/_,O=f+k,L=f+C,F=b+k/O,$=S-C/L;if(t.beginPath(),o){const D=(w+M)/2;if(t.arc(i,a,u,w,D),t.arc(i,a,u,D,M),E>0){const H=ps(_,M,i,a);t.arc(H.x,H.y,E,M,S+Et)}const A=ps(L,S,i,a);if(t.lineTo(A.x,A.y),C>0){const H=ps(L,$,i,a);t.arc(H.x,H.y,C,S+Et,$+Math.PI)}const T=(S-C/f+(b+k/f))/2;if(t.arc(i,a,f,S-C/f,T,!0),t.arc(i,a,f,T,b+k/f,!0),k>0){const H=ps(O,F,i,a);t.arc(H.x,H.y,k,F+Math.PI,b-Et)}const z=ps(N,b,i,a);if(t.lineTo(z.x,z.y),x>0){const H=ps(N,w,i,a);t.arc(H.x,H.y,x,b-Et,w)}}else{t.moveTo(i,a);const D=Math.cos(w)*u+i,A=Math.sin(w)*u+a;t.lineTo(D,A);const T=Math.cos(M)*u+i,z=Math.sin(M)*u+a;t.lineTo(T,z)}t.closePath()}function rT(t,e,n,r,s){const{fullCircles:o,startAngle:i,circumference:a}=e;let l=e.endAngle;if(o){xa(t,e,n,r,l,s);for(let c=0;c<o;++c)t.fill();isNaN(a)||(l=i+(a%Ct||Ct))}return xa(t,e,n,r,l,s),t.fill(),l}function sT(t,e,n,r,s){const{fullCircles:o,startAngle:i,circumference:a,options:l}=e,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:f,borderRadius:g}=l,m=l.borderAlign==="inner";if(!c)return;t.setLineDash(u||[]),t.lineDashOffset=f,m?(t.lineWidth=c*2,t.lineJoin=d||"round"):(t.lineWidth=c,t.lineJoin=d||"bevel");let p=e.endAngle;if(o){xa(t,e,n,r,p,s);for(let y=0;y<o;++y)t.stroke();isNaN(a)||(p=i+(a%Ct||Ct))}m&&eT(t,e,p),l.selfJoin&&p-i>=ct&&g===0&&d!=="miter"&&RO(t,e,p),o||(xa(t,e,n,r,p,s),t.stroke())}class _o extends Ar{constructor(n){super();Fe(this,"circumference");Fe(this,"endAngle");Fe(this,"fullCircles");Fe(this,"innerRadius");Fe(this,"outerRadius");Fe(this,"pixelMargin");Fe(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,s){const o=this.getProps(["x","y"],s),{angle:i,distance:a}=Qp(o,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,m=Je(f,c-l),p=sa(i,l,c)&&l!==c,y=m>=Ct||p,b=_r(a,d+g,u+g);return y&&b}getCenterPoint(n){const{x:r,y:s,startAngle:o,endAngle:i,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,u=(o+i)/2,f=(a+l+d+c)/2;return{x:r+Math.cos(u)*f,y:s+Math.sin(u)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:s}=this,o=(r.offset||0)/4,i=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(ct,s||0)),d=o*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,rT(n,this,d,i,a),sT(n,this,d,i,a),n.restore()}}Fe(_o,"id","arc"),Fe(_o,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),Fe(_o,"defaultRoutes",{backgroundColor:"backgroundColor"}),Fe(_o,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function um(t,e){const{x:n,y:r,base:s,width:o,height:i}=t.getProps(["x","y","base","width","height"],e);let a,l,c,d,u;return t.horizontal?(u=i/2,a=Math.min(n,s),l=Math.max(n,s),c=r-u,d=r+u):(u=o/2,a=n-u,l=n+u,c=Math.min(r,s),d=Math.max(r,s)),{left:a,top:c,right:l,bottom:d}}function dr(t,e,n,r){return t?0:Jt(e,n,r)}function oT(t,e,n){const r=t.options.borderWidth,s=t.borderSkipped,o=g0(r);return{t:dr(s.top,o.top,0,n),r:dr(s.right,o.right,0,e),b:dr(s.bottom,o.bottom,0,n),l:dr(s.left,o.left,0,e)}}function iT(t,e,n){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),s=t.options.borderRadius,o=cs(s),i=Math.min(e,n),a=t.borderSkipped,l=r||Qe(s);return{topLeft:dr(!l||a.top||a.left,o.topLeft,0,i),topRight:dr(!l||a.top||a.right,o.topRight,0,i),bottomLeft:dr(!l||a.bottom||a.left,o.bottomLeft,0,i),bottomRight:dr(!l||a.bottom||a.right,o.bottomRight,0,i)}}function aT(t){const e=um(t),n=e.right-e.left,r=e.bottom-e.top,s=oT(t,n/2,r/2),o=iT(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:o},inner:{x:e.left+s.l,y:e.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function pd(t,e,n,r){const s=e===null,o=n===null,a=t&&!(s&&o)&&um(t,r);return a&&(s||_r(e,a.left,a.right))&&(o||_r(n,a.top,a.bottom))}function lT(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function cT(t,e){t.rect(e.x,e.y,e.w,e.h)}function md(t,e,n={}){const r=t.x!==n.x?-e:0,s=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-r,i=(t.y+t.h!==n.y+n.h?e:0)-s;return{x:t.x+r,y:t.y+s,w:t.w+o,h:t.h+i,radius:t.radius}}class wa extends Ar{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:o,outer:i}=aT(this),a=lT(i.radius)?ia:cT;e.save(),(i.w!==o.w||i.h!==o.h)&&(e.beginPath(),a(e,md(i,n,o)),e.clip(),a(e,md(o,-n,i)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,md(o,n)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,n,r){return pd(this,e,n,r)}inXRange(e,n){return pd(this,e,null,n)}inYRange(e,n){return pd(this,null,e,n)}getCenterPoint(e){const{x:n,y:r,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(n+s)/2:n,y:o?r:(r+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Fe(wa,"id","bar"),Fe(wa,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Fe(wa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const fm=(t,e)=>{let{boxHeight:n=e,boxWidth:r=e}=t;return t.usePointStyle&&(n=Math.min(n,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(e,n)}},dT=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class hm extends Ar{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,r){this.maxWidth=e,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=ht(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(r=>e.filter(r,this.chart.data))),e.sort&&(n=n.sort((r,s)=>e.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,s=Ut(r.font),o=s.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=fm(r,o);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(i,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(i,s,a,l)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(d,e.maxHeight||this.maxHeight)}_fitRows(e,n,r,s){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a;let u=e;o.textAlign="left",o.textBaseline="middle";let f=-1,g=-d;return this.legendItems.forEach((m,p)=>{const y=r+n/2+o.measureText(m.text).width;(p===0||c[c.length-1]+y+2*a>i)&&(u+=d,c[c.length-(p>0?0:1)]=0,g+=d,f++),l[p]={left:0,top:g,row:f,width:y,height:s},c[c.length-1]+=y+a}),u}_fitCols(e,n,r,s){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=i-e;let u=a,f=0,g=0,m=0,p=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:S,itemHeight:x}=uT(r,n,o,y,s);b>0&&g+x+2*a>d&&(u+=f+a,c.push({width:f,height:g}),m+=f+a,p++,f=g=0),l[b]={left:m,top:g,col:p,width:S,height:x},f=Math.max(f,S),g+=x+a}),u+=f,c.push({width:f,height:g}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:o}}=this,i=fs(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ht(r,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Ht(r,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+e+s,c.left=i.leftForLtr(i.x(l),c.width),l+=c.width+s}else{let a=0,l=Ht(r,this.top+e+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Ht(r,this.top+e+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=i.leftForLtr(i.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Qc(e,this),this._draw(),Jc(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:r,ctx:s}=this,{align:o,labels:i}=e,a=vt.color,l=fs(e.rtl,this.left,this.width),c=Ut(i.font),{padding:d}=i,u=c.size,f=u/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:p,itemHeight:y}=fm(i,u),b=function(C,N,_){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;s.save();const w=Je(_.lineWidth,1);if(s.fillStyle=Je(_.fillStyle,a),s.lineCap=Je(_.lineCap,"butt"),s.lineDashOffset=Je(_.lineDashOffset,0),s.lineJoin=Je(_.lineJoin,"miter"),s.lineWidth=w,s.strokeStyle=Je(_.strokeStyle,a),s.setLineDash(Je(_.lineDash,[])),i.usePointStyle){const M={radius:p*Math.SQRT2/2,pointStyle:_.pointStyle,rotation:_.rotation,borderWidth:w},O=l.xPlus(C,m/2),L=N+f;f0(s,M,O,L,i.pointStyleWidth&&m)}else{const M=N+Math.max((u-p)/2,0),O=l.leftForLtr(C,m),L=cs(_.borderRadius);s.beginPath(),Object.values(L).some(F=>F!==0)?ia(s,{x:O,y:M,w:m,h:p,radius:L}):s.rect(O,M,m,p),s.fill(),w!==0&&s.stroke()}s.restore()},S=function(C,N,_){po(s,_.text,C,N+y/2,c,{strikethrough:_.hidden,textAlign:l.textAlign(_.textAlign)})},x=this.isHorizontal(),E=this._computeTitleHeight();x?g={x:Ht(o,this.left+d,this.right-r[0]),y:this.top+d+E,line:0}:g={x:this.left+d,y:Ht(o,this.top+E+d,this.bottom-n[0].height),line:0},C0(this.ctx,e.textDirection);const k=y+d;this.legendItems.forEach((C,N)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const _=s.measureText(C.text).width,w=l.textAlign(C.textAlign||(C.textAlign=i.textAlign)),M=m+f+_;let O=g.x,L=g.y;l.setWidth(this.width),x?N>0&&O+M+d>this.right&&(L=g.y+=k,g.line++,O=g.x=Ht(o,this.left+d,this.right-r[g.line])):N>0&&L+k>this.bottom&&(O=g.x=O+n[g.line].width+d,g.line++,L=g.y=Ht(o,this.top+E+d,this.bottom-n[g.line].height));const F=l.x(O);if(b(F,L,C),O=LM(w,O+m+f,x?O+M:this.right,e.rtl),S(l.x(O),L,C),x)g.x+=M+d;else if(typeof C.text!="string"){const $=c.lineHeight;g.y+=gm(C,$)+d}else g.y+=k}),S0(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,r=Ut(n.font),s=pn(n.padding);if(!n.display)return;const o=fs(e.rtl,this.left,this.width),i=this.ctx,a=n.position,l=r.size/2,c=s.top+l;let d,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,u=Ht(e.align,u,this.right-f);else{const m=this.columnSizes.reduce((p,y)=>Math.max(p,y.height),0);d=c+Ht(e.align,this.top,this.bottom-m-e.labels.padding-this._computeTitleHeight())}const g=Ht(a,u,u+f);i.textAlign=o.textAlign(Yc(a)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=r.string,po(i,n.text,g,d,r)}_computeTitleHeight(){const e=this.options.title,n=Ut(e.font),r=pn(e.padding);return e.display?n.lineHeight+r.height:0}_getLegendItemAt(e,n){let r,s,o;if(_r(e,this.left,this.right)&&_r(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(s=o[r],_r(e,s.left,s.left+s.width)&&_r(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(e){const n=this.options;if(!gT(e.type,n))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=dT(s,r);s&&!o&&ht(n.onLeave,[e,s,this],this),this._hoveredItem=r,r&&!o&&ht(n.onHover,[e,r,this],this)}else r&&ht(n.onClick,[e,r,this],this)}}function uT(t,e,n,r,s){const o=fT(r,t,e,n),i=hT(s,r,e.lineHeight);return{itemWidth:o,itemHeight:i}}function fT(t,e,n,r){let s=t.text;return s&&typeof s!="string"&&(s=s.reduce((o,i)=>o.length>i.length?o:i)),e+n.size/2+r.measureText(s).width}function hT(t,e,n){let r=t;return typeof e.text!="string"&&(r=gm(e,n)),r}function gm(t,e){const n=t.text?t.text.length:0;return e*n}function gT(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var pm={id:"legend",_element:hm,start(t,e,n){const r=t.legend=new hm({ctx:t.ctx,options:n,chart:t});mn.configure(t,r,n),mn.addBox(t,r)},stop(t){mn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const r=t.legend;mn.configure(t,r,n),r.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const r=e.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),e.hidden=!0):(s.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:o,useBorderRadius:i,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=pn(c.borderWidth);return{text:e[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:i&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class mm extends Ar{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const s=_t(r.text)?r.text.length:1;this._padding=pn(r.padding);const o=s*Ut(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:r,bottom:s,right:o,options:i}=this,a=i.align;let l=0,c,d,u;return this.isHorizontal()?(d=Ht(a,r,o),u=n+e,c=o-r):(i.position==="left"?(d=r+e,u=Ht(a,s,n),l=ct*-.5):(d=o-e,u=Ht(a,n,s),l=ct*.5),c=s-n),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const r=Ut(n.font),o=r.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);po(e,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Yc(n.align),textBaseline:"middle",translation:[i,a]})}}function pT(t,e){const n=new mm({ctx:t.ctx,options:e,chart:t});mn.configure(t,n,e),mn.addBox(t,n),t.titleBlock=n}var mT={id:"title",_element:mm,start(t,e,n){pT(t,n)},stop(t){const e=t.titleBlock;mn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const r=t.titleBlock;mn.configure(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eo={average(t){if(!t.length)return!1;let e,n,r=new Set,s=0,o=0;for(e=0,n=t.length;e<n;++e){const a=t[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),s+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:s/o}},nearest(t,e){if(!t.length)return!1;let n=e.x,r=e.y,s=Number.POSITIVE_INFINITY,o,i,a;for(o=0,i=t.length;o<i;++o){const l=t[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=NM(e,c);d<s&&(s=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Vn(t,e){return e&&(_t(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Kn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
||
`)>-1?t.split(`
|
||
`):t}function bT(t,e){const{element:n,datasetIndex:r,index:s}=e,o=t.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:t,label:i,parsed:o.getParsed(s),raw:t.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function bm(t,e){const n=t.chart.ctx,{body:r,footer:s,title:o}=t,{boxWidth:i,boxHeight:a}=e,l=Ut(e.bodyFont),c=Ut(e.titleFont),d=Ut(e.footerFont),u=o.length,f=s.length,g=r.length,m=pn(e.padding);let p=m.height,y=0,b=r.reduce((E,k)=>E+k.before.length+k.lines.length+k.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){const E=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*E+(b-g)*l.lineHeight+(b-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let S=0;const x=function(E){y=Math.max(y,n.measureText(E).width+S)};return n.save(),n.font=c.string,at(t.title,x),n.font=l.string,at(t.beforeBody.concat(t.afterBody),x),S=e.displayColors?i+2+e.boxPadding:0,at(r,E=>{at(E.before,x),at(E.lines,x),at(E.after,x)}),S=0,n.font=d.string,at(t.footer,x),n.restore(),y+=m.width,{width:y,height:p}}function yT(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function vT(t,e,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(t==="left"&&s+o+i>e.width||t==="right"&&s-o-i<0)return!0}function xT(t,e,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:l}}=t;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=i-o/2&&(c="right"),vT(c,t,e,n)&&(c="center"),c}function ym(t,e,n){const r=n.yAlign||e.yAlign||yT(t,n);return{xAlign:n.xAlign||e.xAlign||xT(t,e,n,r),yAlign:r}}function wT(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function kT(t,e,n){let{y:r,height:s}=t;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function vm(t,e,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=t,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=cs(i);let m=wT(e,a);const p=kT(e,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(d,f)+s:a==="right"&&(m+=Math.max(u,g)+s),{x:Jt(m,0,r.width-e.width),y:Jt(p,0,r.height-e.height)}}function ka(t,e,n){const r=pn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function xm(t){return Vn([],Kn(t))}function CT(t,e,n){return ds(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function wm(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const km={beforeTitle:Gn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:Gn,beforeBody:Gn,beforeLabel:Gn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return lt(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Gn,afterBody:Gn,beforeFooter:Gn,footer:Gn,afterFooter:Gn};function Rt(t,e,n,r){const s=t[e].call(n,r);return typeof s>"u"?km[e].call(n,r):s}class bd extends Ar{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new E0(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=CT(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=Rt(r,"beforeTitle",this,e),o=Rt(r,"title",this,e),i=Rt(r,"afterTitle",this,e);let a=[];return a=Vn(a,Kn(s)),a=Vn(a,Kn(o)),a=Vn(a,Kn(i)),a}getBeforeBody(e,n){return xm(Rt(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,s=[];return at(e,o=>{const i={before:[],lines:[],after:[]},a=wm(r,o);Vn(i.before,Kn(Rt(a,"beforeLabel",this,o))),Vn(i.lines,Rt(a,"label",this,o)),Vn(i.after,Kn(Rt(a,"afterLabel",this,o))),s.push(i)}),s}getAfterBody(e,n){return xm(Rt(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,s=Rt(r,"beforeFooter",this,e),o=Rt(r,"footer",this,e),i=Rt(r,"afterFooter",this,e);let a=[];return a=Vn(a,Kn(s)),a=Vn(a,Kn(o)),a=Vn(a,Kn(i)),a}_createItems(e){const n=this._active,r=this.chart.data,s=[],o=[],i=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(bT(this.chart,n[l]));return e.filter&&(a=a.filter((d,u,f)=>e.filter(d,u,f,r))),e.itemSort&&(a=a.sort((d,u)=>e.itemSort(d,u,r))),at(a,d=>{const u=wm(e.callbacks,d);s.push(Rt(u,"labelColor",this,d)),o.push(Rt(u,"labelPointStyle",this,d)),i.push(Rt(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=a,a}update(e,n){const r=this.options.setContext(this.getContext()),s=this._active;let o,i=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Eo[r.position].call(this,s,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const l=this._size=bm(this,r),c=Object.assign({},a,l),d=ym(this.chart,r,c),u=vm(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,s){const o=this.getCaretPosition(e,r,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(e,n,r){const{xAlign:s,yAlign:o}=this,{caretSize:i,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=cs(a),{x:f,y:g}=e,{width:m,height:p}=n;let y,b,S,x,E,k;return o==="center"?(E=g+p/2,s==="left"?(y=f,b=y-i,x=E+i,k=E-i):(y=f+m,b=y+i,x=E-i,k=E+i),S=y):(s==="left"?b=f+Math.max(l,d)+i:s==="right"?b=f+m-Math.max(c,u)-i:b=this.caretX,o==="top"?(x=g,E=x-i,y=b-i,S=b+i):(x=g+p,E=x+i,y=b+i,S=b-i),k=x),{x1:y,x2:b,x3:S,y1:x,y2:E,y3:k}}drawTitle(e,n,r){const s=this.title,o=s.length;let i,a,l;if(o){const c=fs(r.rtl,this.x,this.width);for(e.x=ka(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",i=Ut(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=i.string,l=0;l<o;++l)n.fillText(s[l],c.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a,l+1===o&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,n,r,s,o){const i=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,d=Ut(o.bodyFont),u=ka(this,"left",o),f=s.x(u),g=l<d.lineHeight?(d.lineHeight-l)/2:0,m=n.y+g;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,b=m+l/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,u0(e,p,y,b),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,u0(e,p,y,b)}else{e.lineWidth=Qe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const p=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),b=cs(i.borderRadius);Object.values(b).some(S=>S!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,ia(e,{x:p,y:m,w:c,h:l,radius:b}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),ia(e,{x:y,y:m+1,w:c-2,h:l-2,radius:b}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(p,m,c,l),e.strokeRect(p,m,c,l),e.fillStyle=i.backgroundColor,e.fillRect(y,m+1,c-2,l-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:s}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,u=Ut(r.bodyFont);let f=u.lineHeight,g=0;const m=fs(r.rtl,this.x,this.width),p=function(_){n.fillText(_,m.x(e.x+g),e.y+f/2),e.y+=f+o},y=m.textAlign(i);let b,S,x,E,k,C,N;for(n.textAlign=i,n.textBaseline="middle",n.font=u.string,e.x=ka(this,y,r),n.fillStyle=r.bodyColor,at(this.beforeBody,p),g=a&&y!=="right"?i==="center"?c/2+d:c+2+d:0,E=0,C=s.length;E<C;++E){for(b=s[E],S=this.labelTextColors[E],n.fillStyle=S,at(b.before,p),x=b.lines,a&&x.length&&(this._drawColorBox(n,e,E,m,r),f=Math.max(u.lineHeight,l)),k=0,N=x.length;k<N;++k)p(x[k]),f=u.lineHeight;at(b.after,p)}g=0,f=u.lineHeight,at(this.afterBody,p),e.y-=o}drawFooter(e,n,r){const s=this.footer,o=s.length;let i,a;if(o){const l=fs(r.rtl,this.x,this.width);for(e.x=ka(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",i=Ut(r.footerFont),n.fillStyle=r.footerColor,n.font=i.string,a=0;a<o;++a)n.fillText(s[a],l.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+r.footerSpacing}}drawBackground(e,n,r,s){const{xAlign:o,yAlign:i}=this,{x:a,y:l}=e,{width:c,height:d}=r,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:m}=cs(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+u,l),i==="top"&&this.drawCaret(e,n,r,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),i==="center"&&o==="right"&&this.drawCaret(e,n,r,s),n.lineTo(a+c,l+d-m),n.quadraticCurveTo(a+c,l+d,a+c-m,l+d),i==="bottom"&&this.drawCaret(e,n,r,s),n.lineTo(a+g,l+d),n.quadraticCurveTo(a,l+d,a,l+d-g),i==="center"&&o==="left"&&this.drawCaret(e,n,r,s),n.lineTo(a,l+u),n.quadraticCurveTo(a,l,a+u,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,s=r&&r.x,o=r&&r.y;if(s||o){const i=Eo[e.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=bm(this,e),l=Object.assign({},i,this._size),c=ym(n,e,l),d=vm(e,l,c,n);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=pn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(e.save(),e.globalAlpha=r,this.drawBackground(o,e,s,n),C0(e,n.textDirection),o.y+=i.top,this.drawTitle(o,e,n),this.drawBody(o,e,n),this.drawFooter(o,e,n),S0(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,s=e.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Ri(r,s),i=this._positionChanged(s,n);(o||i)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],i=this._getActiveElements(e,o,n,r),a=this._positionChanged(i,e),l=n||!Ri(i,o)||a;return l&&(this._active=i,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),l}_getActiveElements(e,n,r,s){const o=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const i=this.chart.getElementsAtEventForMode(e,o.mode,o,r);return o.reverse&&i.reverse(),i}_positionChanged(e,n){const{caretX:r,caretY:s,options:o}=this,i=Eo[o.position].call(this,e,n);return i!==!1&&(r!==i.x||s!==i.y)}}Fe(bd,"positioners",Eo);var Cm={id:"tooltip",_element:bd,positioners:Eo,afterInit(t,e,n){n&&(t.tooltip=new bd({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:km},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ST=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function _T(t,e,n,r){const s=t.indexOf(e);if(s===-1)return ST(t,e,n,r);const o=t.lastIndexOf(e);return s!==o?n:s}const ET=(t,e)=>t===null?null:Jt(Math.round(t),0,e);function Sm(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class yd extends gs{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:o}of n)r[s]===o&&r.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(lt(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:_T(r,e,Je(n,e),this._addedLabels),ET(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,s=[];let o=this.getLabels();o=e===0&&n===o.length-1?o:o.slice(e,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=e;i<=n;i++)s.push({value:i});return s}getLabelForValue(e){return Sm.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Fe(yd,"id","category"),Fe(yd,"defaults",{ticks:{callback:Sm}});function MT(t,e){const n=[],{bounds:s,step:o,min:i,max:a,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:f}=t,g=o||1,m=d-1,{min:p,max:y}=e,b=!lt(i),S=!lt(a),x=!lt(c),E=(y-p)/(u+1);let k=qp((y-p)/m/g)*g,C,N,_,w;if(k<1e-14&&!b&&!S)return[{value:p},{value:y}];w=Math.ceil(y/k)-Math.floor(p/k),w>m&&(k=qp(w*k/m/g)*g),lt(l)||(C=Math.pow(10,l),k=Math.ceil(k*C)/C),s==="ticks"?(N=Math.floor(p/k)*k,_=Math.ceil(y/k)*k):(N=p,_=y),b&&S&&o&&_M((a-i)/o,k/1e3)?(w=Math.round(Math.min((a-i)/k,d)),k=(a-i)/w,N=i,_=a):x?(N=b?i:N,_=S?a:_,w=c-1,k=(_-N)/w):(w=(_-N)/k,na(w,Math.round(w),k/1e3)?w=Math.round(w):w=Math.ceil(w));const M=Math.max(Zp(k),Zp(N));C=Math.pow(10,lt(l)?M:l),N=Math.round(N*C)/C,_=Math.round(_*C)/C;let O=0;for(b&&(f&&N!==i?(n.push({value:i}),N<i&&O++,na(Math.round((N+O*k)*C)/C,i,_m(i,E,t))&&O++):N<i&&O++);O<w;++O){const L=Math.round((N+O*k)*C)/C;if(S&&L>a)break;n.push({value:L})}return S&&f&&_!==a?n.length&&na(n[n.length-1].value,a,_m(a,E,t))?n[n.length-1].value=a:n.push({value:a}):(!S||_===a)&&n.push({value:_}),n}function _m(t,e,{horizontal:n,minRotation:r}){const s=Yn(r),o=(n?Math.sin(s):Math.cos(s))||.001,i=.75*e*(""+t).length;return Math.min(e/o,i)}class NT extends gs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return lt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:o}=this;const i=l=>s=n?s:l,a=l=>o=r?o:l;if(e){const l=lr(s),c=lr(o);l<0&&c<0?a(0):l>0&&c>0&&i(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),e||i(s-l)}this.min=s,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,i=MT(s,o);return e.bounds==="ticks"&&EM(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const s=(r-n)/Math.max(e.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return Kc(e,this.chart.options.locale,this.options.ticks.format)}}class vd extends NT{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=gn(e)?e:0,this.max=gn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=Yn(this.options.ticks.minRotation),s=(e?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Fe(vd,"id","linear"),Fe(vd,"defaults",{ticks:{callback:l0.formatters.numeric}});const Ca={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},en=Object.keys(Ca);function Em(t,e){return t-e}function Mm(t,e){if(lt(e))return null;const n=t._adapter,{parser:r,round:s,isoWeekday:o}=t._parseOpts;let i=e;return typeof r=="function"&&(i=r(i)),gn(i)||(i=typeof r=="string"?n.parse(i,r):n.parse(i)),i===null?null:(s&&(i=s==="week"&&(ra(o)||o===!0)?n.startOf(i,"isoWeek",o):n.startOf(i,s)),+i)}function Nm(t,e,n,r){const s=en.length;for(let o=en.indexOf(t);o<s-1;++o){const i=Ca[en[o]],a=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-e)/(a*i.size))<=r)return en[o]}return en[s-1]}function OT(t,e,n,r,s){for(let o=en.length-1;o>=en.indexOf(n);o--){const i=en[o];if(Ca[i].common&&t._adapter.diff(s,r,i)>=e-1)return i}return en[n?en.indexOf(n):0]}function TT(t){for(let e=en.indexOf(t)+1,n=en.length;e<n;++e)if(Ca[en[e]].common)return en[e]}function Om(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:s}=Wc(n,e),o=n[r]>=e?n[r]:n[s];t[o]=!0}}function AT(t,e,n,r){const s=t._adapter,o=+s.startOf(e[0].value,r),i=e[e.length-1].value;let a,l;for(a=o;a<=i;a=+s.add(a,1,r))l=n[a],l>=0&&(e[l].major=!0);return e}function Tm(t,e,n){const r=[],s={},o=e.length;let i,a;for(i=0;i<o;++i)a=e[i],s[a]=i,r.push({value:a,major:!1});return o===0||!n?r:AT(t,r,s,n)}class Sa extends gs{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const r=e.time||(e.time={}),s=this._adapter=new WN._date(e.adapters.date);s.init(n),uo(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:Mm(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:s,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function l(c){!i&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!i||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=gn(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),o=gn(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,i=this.max,a=AM(s,o,i);return this._unit=n.unit||(r.autoSkip?Nm(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):OT(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:TT(this._unit),this.initOffsets(s),e.reverse&&a.reverse(),Tm(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,s,o;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?r=o:r=(o-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;n=Jt(n,0,i),r=Jt(r,0,i),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,s=this.options,o=s.time,i=o.unit||Nm(o.minUnit,n,r,this._getLabelCapacity(n)),a=Je(s.ticks.stepSize,1),l=i==="week"?o.isoWeekday:!1,c=ra(l)||l===!0,d={};let u=n,f,g;if(c&&(u=+e.startOf(u,"isoWeek",l)),u=+e.startOf(u,c?"day":i),e.diff(r,n,i)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+i);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(f=u,g=0;f<r;f=+e.add(f,a,i),g++)Om(d,f,m);return(f===r||s.bounds==="ticks"||g===1)&&Om(d,f,m),Object.keys(d).sort(Em).map(p=>+p)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,o=this._unit,i=n||s[o];return this._adapter.format(e,i)}_tickFormatFunction(e,n,r,s){const o=this.options,i=o.ticks.callback;if(i)return ht(i,[e,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],u=c&&a[c],f=r[n],g=c&&u&&f&&f.major;return this._adapter.format(e,s||(g?u:d))}generateTickLabels(e){let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,s=Yn(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),i=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*i,h:r*i+a*o}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,o=this._tickFormatFunction(e,0,Tm(this,[e],this._majorUnit),s),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)e.push(Mm(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return e0(e.sort(Em))}}Fe(Sa,"id","time"),Fe(Sa,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function _a(t,e,n){let r=0,s=t.length-1,o,i,a,l;n?(e>=t[r].pos&&e<=t[s].pos&&({lo:r,hi:s}=Gc(t,"pos",e)),{pos:o,time:a}=t[r],{pos:i,time:l}=t[s]):(e>=t[r].time&&e<=t[s].time&&({lo:r,hi:s}=Gc(t,"time",e)),{time:o,pos:a}=t[r],{time:i,pos:l}=t[s]);const c=i-o;return c?a+(l-a)*(e-o)/c:a}class Am extends Sa{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=_a(n,this.min),this._tableRange=_a(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,s=[],o=[];let i,a,l,c,d;for(i=0,a=e.length;i<a;++i)c=e[i],c>=n&&c<=r&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(i=0,a=s.length;i<a;++i)d=s[i+1],l=s[i-1],c=s[i],Math.round((d+l)/2)!==c&&o.push({time:c,pos:i/(a-1)});return o}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,o)=>s-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(_a(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return _a(this._table,r*this._tableRange+this._minPos,!0)}}Fe(Am,"id","timeseries"),Fe(Am,"defaults",Sa.defaults);const Dm="label";function Im(t,e){typeof t=="function"?t(e):t&&(t.current=e)}function DT(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function Lm(t,e){t.labels=e}function Pm(t,e,n=Dm){const r=[];t.datasets=e.map(s=>{const o=t.datasets.find(i=>i[n]===s[n]);return!o||!s.data||r.includes(o)?{...s}:(r.push(o),Object.assign(o,s),o)})}function IT(t,e=Dm){const n={labels:[],datasets:[]};return Lm(n,t.labels),Pm(n,t.datasets,e),n}function LT(t,e){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:o,type:i,data:a,options:l,plugins:c=[],fallbackContent:d,updateMode:u,...f}=t,g=v.useRef(null),m=v.useRef(null),p=()=>{g.current&&(m.current=new So(g.current,{type:i,data:IT(a,o),options:l&&{...l},plugins:c}),Im(e,m.current))},y=()=>{Im(e,null),m.current&&(m.current.destroy(),m.current=null)};return v.useEffect(()=>{!s&&m.current&&l&&DT(m.current,l)},[s,l]),v.useEffect(()=>{!s&&m.current&&Lm(m.current.config.data,a.labels)},[s,a.labels]),v.useEffect(()=>{!s&&m.current&&a.datasets&&Pm(m.current.config.data,a.datasets,o)},[s,a.datasets]),v.useEffect(()=>{m.current&&(s?(y(),setTimeout(p)):m.current.update(u))},[s,l,a.labels,a.datasets,u]),v.useEffect(()=>{m.current&&(y(),setTimeout(p))},[i]),v.useEffect(()=>(p(),()=>y()),[]),h.jsx("canvas",{ref:g,role:"img",height:n,width:r,...f,children:d})}const PT=v.forwardRef(LT);function $m(t,e){return So.register(e),v.forwardRef((n,r)=>h.jsx(PT,{...n,ref:r,type:t}))}const $T=$m("bar",ua),FT=$m("doughnut",bo);So.register(yd,vd,wa,mT,Cm,pm);const zT=({labels:t,datasets:e,height:n=200,showLegend:r=!1,showGrid:s=!1,showYGrid:o=!1,showYAxis:i=!1,className:a="",id:l,editorAttrs:c})=>{const d=v.useMemo(()=>({labels:t??[],datasets:(e??[]).map((m,p)=>({label:m.label,data:m.data,backgroundColor:m.backgroundColor||(p===0?"#7C3AED":"#DDD6FE"),borderRadius:m.borderRadius??4,barThickness:16,maxBarThickness:20,yAxisID:m.yAxisID??"y"}))}),[t,e]),u=v.useMemo(()=>(e??[]).some(m=>m.yAxisID==="y1"),[e]),f=v.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:750,easing:"easeOutQuart"},animations:{x:{duration:0},y:{from:m=>{if(m.type==="data")return m.chart.scales.y.getPixelForValue(0)}}},transitions:{active:{animation:{duration:200}},resize:{animation:{duration:0}}},plugins:{legend:{display:r,position:"top"},tooltip:{backgroundColor:"#1e293b",titleColor:"#fff",bodyColor:"#fff",padding:12,cornerRadius:8}},scales:{x:{grid:{display:s},border:{display:!1},ticks:{color:"#94a3b8",font:{size:11}}},y:{type:"linear",position:"left",grid:{display:o,color:"#e2e8f0"},border:{display:!1},ticks:{display:i,color:"#94a3b8",font:{size:11},padding:8},beginAtZero:!0,grace:"5%"},...u?{y1:{type:"linear",position:"right",grid:{display:!1},border:{display:!1},ticks:{display:i,color:"#94a3b8",font:{size:11},padding:8},beginAtZero:!0,grace:"5%"}}:{}}}),[r,s,o,i,u]),g=typeof n=="number"?n:/^\d+$/.test(String(n))?`${n}px`:n;return h.jsx("div",{className:`bar-chart-container ${a}`,style:{height:g},id:l,...c,children:h.jsx($T,{data:d,options:f})})},VT=v.memo(zT,(t,e)=>JSON.stringify(t.labels)===JSON.stringify(e.labels)&&JSON.stringify(t.datasets)===JSON.stringify(e.datasets)&&t.height===e.height&&t.showLegend===e.showLegend&&t.showGrid===e.showGrid&&t.showYGrid===e.showYGrid&&t.showYAxis===e.showYAxis&&t.className===e.className&&t.id===e.id&&t.editorAttrs===e.editorAttrs);So.register(_o,Cm,pm);const HT=({data:t,centerLabel:e,centerValue:n,size:r=200,cutout:s="70%",showLegend:o=!1,className:i="",id:a,editorAttrs:l})=>{const c=v.useMemo(()=>({labels:(t??[]).map(f=>f.name),datasets:[{data:(t??[]).map(f=>f.value),backgroundColor:(t??[]).map(f=>f.color),borderWidth:0,hoverOffset:4}]}),[t]),d=v.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,cutout:s,plugins:{legend:{display:o},tooltip:{backgroundColor:"#1e293b",titleColor:"#fff",bodyColor:"#fff",padding:12,cornerRadius:8,callbacks:{label:f=>` $${f.parsed.toLocaleString()}`}}}}),[s,o]),u=typeof r=="number"?r:/^\d+$/.test(String(r))?`${r}px`:r;return h.jsx("div",{className:`donut-chart-wrapper ${i}`,id:a,...l,children:h.jsxs("div",{className:"relative",style:{width:u,height:u},children:[h.jsx(FT,{data:c,options:d}),(e||n)&&h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[e&&h.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:e}),n&&h.jsx("span",{className:"text-lg font-bold text-slate-900 dark:text-white",children:n})]})]})})},UT=({id:t,className:e,style:n,children:r,editorAttrs:s})=>h.jsx("div",{id:t,className:e,style:n,...s,children:r}),BT=({children:t,cols:e=1,responsive:n,gap:r,rowGap:s,colGap:o,autoRows:i,autoCols:a,flow:l="row",className:c="",style:d,onClick:u,id:f,editorAttrs:g})=>{const m=["grid"];if(e&&m.push(`grid-cols-${e}`),n&&(n.sm&&m.push(`sm:grid-cols-${n.sm}`),n.md&&m.push(`md:grid-cols-${n.md}`),n.lg&&m.push(`lg:grid-cols-${n.lg}`),n.xl&&m.push(`xl:grid-cols-${n.xl}`),n["2xl"]&&m.push(`2xl:grid-cols-${n["2xl"]}`)),r!==void 0&&r>0&&m.push(`gap-${r}`),s!==void 0&&s>0&&m.push(`gap-y-${s}`),o!==void 0&&o>0&&m.push(`gap-x-${o}`),i){const y={auto:"auto-rows-auto",min:"auto-rows-min",max:"auto-rows-max",fr:"auto-rows-fr"};m.push(y[i])}if(a){const y={auto:"auto-cols-auto",min:"auto-cols-min",max:"auto-cols-max",fr:"auto-cols-fr"};m.push(y[a])}const p={row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"};return m.push(p[l]),c&&m.push(c),h.jsx(I,{className:m.join(" "),style:d,onClick:u,id:f,...g,children:t})},jT=({children:t,direction:e="row",justify:n="start",align:r="stretch",wrap:s="nowrap",gap:o=0,grow:i=!1,shrink:a=!0,className:l="",style:c,onClick:d,id:u,editorAttrs:f})=>{const g=["flex"],m={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"};g.push(m[e]);const p={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};g.push(p[s]);const y={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};g.push(y[n]);const b={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};return g.push(b[r]),o>0&&g.push(`gap-${o}`),i===!0?g.push("flex-grow"):typeof i=="number"&&i>0&&g.push(`flex-grow-${i}`),a===!1?g.push("shrink-0"):a===!0?g.push("flex-shrink"):typeof a=="number"&&a>0&&g.push(`flex-shrink-${a}`),l&&g.push(l),h.jsx(I,{className:g.join(" "),style:c,onClick:d,id:u,...f,children:t})},WT=({title:t,subtitle:e,children:n,padding:r="none",background:s="none",maxWidth:o,centered:i=!1,border:a=!1,shadow:l="none",rounded:c=!1,className:d="",style:u,onClick:f,id:g,editorAttrs:m})=>{const p=[],y={none:"",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"};y[r]&&p.push(y[r]);const b={none:"",white:"bg-white dark:bg-gray-700",gray:"bg-gray-50 dark:bg-gray-800",primary:"bg-blue-50 dark:bg-blue-900/20",secondary:"bg-gray-50 dark:bg-gray-800"};if(s!=="none"&&p.push(b[s]),o){const x={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"};p.push(x[o])}i&&p.push("mx-auto"),a&&p.push("border","border-gray-200","dark:border-gray-700");const S={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"};return l!=="none"&&p.push(S[l]),c&&p.push("rounded-lg"),d&&p.push(d),h.jsxs(Od,{className:p.join(" "),style:u,onClick:f,id:g,...m,children:[(t||e)&&h.jsxs("div",{className:"mb-4",children:[t&&h.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:t}),e&&h.jsx("p",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:e})]}),n]})},GT=({leftWidth:t="250px",rightWidth:e="300px",leftSlot:n,centerSlot:r,rightSlot:s,className:o="",style:i,id:a,editorAttrs:l})=>{const c=`flex flex-row w-full h-full ${o}`.trim(),d={width:t,flexShrink:0},u={flex:1,minWidth:0},f={width:e,flexShrink:0};return h.jsxs(I,{className:c,style:i,id:a,...l,children:[h.jsx(I,{className:"flex flex-col",style:d,children:n}),h.jsx(I,{className:"flex flex-col",style:u,children:r}),h.jsx(I,{className:"flex flex-col",style:f,children:s})]})},YT={language:"json",theme:"vs-dark",options:{automaticLayout:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,fontSize:14,tabSize:2,formatOnPaste:!0,formatOnType:!0,wordWrap:"on",folding:!0,lineNumbers:"on",renderWhitespace:"selection"}},Fm=[{uri:`${window.location.origin}/schemas/layout.json`,fileMatch:["*layout*.json"],schema:{type:"object",properties:{version:{type:"string"},endpoint:{type:"string"},components:{type:"array"}},required:["version","endpoint","components"]}}],XT={"vs/nls":{availableLanguages:{"*":"ko"}}};function KT(t){t.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:Fm,enableSchemaRequest:!0,schemaValidation:"error",schemaRequest:"error"})}const qT={identifier:"sirsoft-admin_basic",vendor:"sirsoft",name:{ko:"Admin Basic",en:"Admin Basic"},version:"1.0.4",license:"MIT",description:{ko:"그누보드7 기본 관리자 템플릿",en:"Gnuboard7 default admin template"},type:"admin",locales:["ko","en"],author:{name:"sirsoft",email:"contact@sirsoft.com",url:"https://sirsoft.com"},release_date:"2026-05-15",g7_version:">=7.0.0",dependencies:{modules:{},plugins:{}},assets:{css:["assets/css/main.css","assets/css/ui-system.css"],js:["dist/components.js"],fonts:["assets/fonts/"],images:["assets/images/"]},components:{basic:["a","button","checkbox","div","form","h1","h2","h3","hr","icon","img","input","label","li","nav","p","section","select","span","svg","table","tbody","td","textarea","th","thead","tr","ul"],composite:["action-menu","admin-footer","admin-header","admin-sidebar","alert-dialog","breadcrumb","card","confirm-dialog","data-grid","dialog","dropdown","empty-state","filter-group","icon-button","loading-spinner","modal","page-header","pagination","product-card","search-bar","stat-card","status-badge","tab-navigation","template-card","toast"],layout:["container","flex","grid","section"]},preview:{thumbnail:"preview/thumbnail.png",screenshots:["preview/screenshot1.png","preview/screenshot2.png"]},error_config:{layouts:{401:"errors/401",403:"errors/403",404:"errors/404",500:"errors/500",503:"errors/503",maintenance:"errors/maintenance"}},github_url:"https://github.com/gnuboard/g7-template-sirsoft-admin_basic",github_changelog_url:"https://github.com/gnuboard/g7-template-sirsoft-admin_basic/blob/main/CHANGELOG.md",externals:[{id:"fontawesome",type:"style",url:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css",preconnect:"https://cdnjs.cloudflare.com"},{id:"pretendard",type:"webfont",url:"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css",preconnect:"https://cdn.jsdelivr.net",crossorigin:"anonymous"},{id:"flag-icons",type:"style",url:"https://cdn.jsdelivr.net/npm/flag-icons@7.2.3/css/flag-icons.min.css"}]},qn=window.G7Core?.createLogger?.("Handler:SetTheme")??{log:(...t)=>console.log("[Handler:SetTheme]",...t),warn:(...t)=>console.warn("[Handler:SetTheme]",...t),error:(...t)=>console.error("[Handler:SetTheme]",...t)},xd=["auto","light","dark"],zm="g7_color_scheme",ZT=t=>t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,Ea=t=>{const e=ZT(t);document.documentElement.setAttribute("data-theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};function QT(){try{const t=localStorage.getItem(zm),e=t&&xd.includes(t)?t:"auto";Ea(e);try{window.G7Core?.state?.setGlobal?.({theme:e})}catch(n){qn.warn("Failed to set global theme state:",n)}qn.log("Initial theme applied:",e)}catch(t){qn.warn("Failed to load initial theme:",t),Ea("auto")}}async function JT(t,e){const n=t?.target;if(n&&typeof n=="string"&&xd.includes(n)){Ea(n);try{window.G7Core?.state?.setGlobal?.({theme:n})}catch(r){qn.warn("Failed to set global theme state:",r)}return}QT()}async function RT(t,e){let n;if(t?.target&&typeof t.target=="string"&&!t.target.includes("{{")&&(n=t.target),!n||typeof n!="string"){qn.warn("Invalid theme:",n);return}if(!xd.includes(n)){qn.warn("Unsupported theme:",n);return}const r=n;try{localStorage.setItem(zm,r)}catch(s){qn.error("Failed to save theme to localStorage:",s);return}Ea(r);try{window.G7Core?.state?.setGlobal?.({theme:r})}catch(s){qn.warn("Failed to set global theme state:",s)}qn.log("Theme changed to:",r)}const Mo=window.G7Core?.createLogger?.("Handler:InitMenu")??{log:(...t)=>console.log("[Handler:InitMenu]",...t),warn:(...t)=>console.warn("[Handler:InitMenu]",...t),error:(...t)=>console.error("[Handler:InitMenu]",...t)};function Vm(t,e){for(const n of t){if(n.slug===e)return n;if(n.children&&n.children.length>0){const r=Vm(n.children,e);if(r)return r}}return null}function Hm(t){return new URLSearchParams(window.location.search).get(t)}function e5(t){return window.G7Core?.state?.getDataSource?.(t)}async function t5(t,e=30,n=100){for(let r=0;r<e;r++){const o=e5(t)?.data;if(Array.isArray(o)&&o.length>0)return o;await new Promise(i=>setTimeout(i,n))}return null}async function n5(t,e){const n=window.G7Core,r=Hm("menu"),s=Hm("mode");if(!r){Mo.log("[initMenuFromUrl] No menu parameter in URL");return}if(!n?.state?.set){Mo.warn("[initMenuFromUrl] G7Core.state.set not available");return}const o=await t5("menus");if(!o){Mo.warn("[initMenuFromUrl] menus data not available after waiting");return}const i=Vm(o,r);if(!i){Mo.warn("[initMenuFromUrl] Menu not found with slug:",r);return}const a=s==="edit"?"edit":"view";n.state.set({selectedMenuId:i.id,selectedMenu:i,panelMode:a}),a==="edit"&&n.state.set({formData:{name:i.name,slug:i.slug,url:i.url,icon:i.icon,parent_id:i.parent_id,module_id:i.module_id,is_active:i.is_active}}),Mo.log("[initMenuFromUrl] Menu initialized from URL:",{slug:r,mode:a,menuId:i.id})}const Xt=window.G7Core?.createLogger?.("Handler:FilterVisibility")??{log:(...t)=>console.log("[Handler:FilterVisibility]",...t),warn:(...t)=>console.warn("[Handler:FilterVisibility]",...t),error:(...t)=>console.error("[Handler:FilterVisibility]",...t)},Ma="g7_filter_visibility_";async function r5(t,e){const{storageKey:n,defaultFilters:r=[],stateKey:s="visibleFilters"}=t?.params||{};if(!n){Xt.warn("[initFilterVisibility] storageKey is required");return}const o=`${Ma}${n}`;try{const i=localStorage.getItem(o);let a;if(i){const l=JSON.parse(i);Array.isArray(l)?(a=l,Xt.log(`[initFilterVisibility] Loaded from localStorage: ${a.join(", ")}`)):(a=r,Xt.warn("[initFilterVisibility] Invalid saved data format, using defaults"))}else a=r,Xt.log(`[initFilterVisibility] No saved data, using defaults: ${r.join(", ")}`);e?.setState&&e.setState({[s]:a})}catch(i){Xt.error("[initFilterVisibility] Failed to load filter visibility:",i),e?.setState&&e.setState({[s]:r})}}async function s5(t,e){const{storageKey:n,filters:r}=t?.params||{};if(!n){Xt.warn("[saveFilterVisibility] storageKey is required");return}if(!Array.isArray(r)){Xt.warn("[saveFilterVisibility] filters must be an array");return}const s=`${Ma}${n}`;try{localStorage.setItem(s,JSON.stringify(r)),Xt.log(`[saveFilterVisibility] Saved to localStorage: ${r.join(", ")}`)}catch(o){Xt.error("[saveFilterVisibility] Failed to save filter visibility:",o)}}async function o5(t,e){const{storageKey:n,filterId:r,stateKey:s="visibleFilters"}=t?.params||{};if(!n||!r){Xt.warn("[toggleFilterVisibility] storageKey and filterId are required");return}const o=e?.state?.[s]||[];let i;o.includes(r)?i=o.filter(l=>l!==r):i=[...o,r],e?.setState&&e.setState({[s]:i});const a=`${Ma}${n}`;try{localStorage.setItem(a,JSON.stringify(i)),Xt.log(`[toggleFilterVisibility] Toggled ${r}: ${i.join(", ")}`)}catch(l){Xt.error("[toggleFilterVisibility] Failed to save:",l)}}async function i5(t,e){const{storageKey:n,defaultFilters:r=[],stateKey:s="visibleFilters"}=t?.params||{};if(!n){Xt.warn("[resetFilterVisibility] storageKey is required");return}const o=`${Ma}${n}`;try{localStorage.setItem(o,JSON.stringify(r)),e?.setState&&e.setState({[s]:r}),Xt.log(`[resetFilterVisibility] Reset to defaults: ${r.join(", ")}`)}catch(i){Xt.error("[resetFilterVisibility] Failed to reset:",i)}}const ms=window.G7Core?.createLogger?.("Handler:MultilingualTag")??{log:(...t)=>console.log("[Handler:MultilingualTag]",...t),warn:(...t)=>console.warn("[Handler:MultilingualTag]",...t),error:(...t)=>console.error("[Handler:MultilingualTag]",...t)};async function a5(t,e){const n=window.G7Core;if(!n){ms.error("G7Core not available");return}const r=n.state?.getGlobal?.()?.multilingualTagEdit;if(!r){ms.warn("No multilingualTagEdit state found"),n.modal?.close?.();return}const{fieldName:s,editingIndex:o,values:i,statePath:a,currentTags:l}=r;if(!Object.values(i||{}).some(g=>typeof g=="string"&&g.trim()!=="")){ms.warn("No values to save"),n.modal?.close?.(),wd(n);return}const d=Array.isArray(l)?l:[];let u;o==null?u=[...d,i]:u=d.map((g,m)=>m===o?i:g);const f=a||(s?.startsWith("form.")?s:`form.${s}`);n.state?.setParentLocal?.({[f]:u}),n.modal?.close?.(),wd(n)}async function l5(t,e){const n=window.G7Core;if(!n){ms.error("G7Core not available");return}n.modal?.close?.(),wd(n)}async function c5(t,e){const n=window.G7Core;if(!n){ms.error("G7Core not available");return}const r=t?.params?.locale;if(!r){ms.warn("No locale specified");return}const s=e?.event;let o="";s?.target?.value!==void 0?o=s.target.value:s?.value!==void 0&&(o=s.value);const a=(n.state?.getGlobal?.()||{}).multilingualTagEdit||{},l={...a.values||{},[r]:o};n.dispatch?.({handler:"setState",params:{target:"global",multilingualTagEdit:{...a,values:l}}})}function wd(t){t.dispatch?.({handler:"setState",params:{target:"global",multilingualTagEdit:null}})}function Um(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),i=String(t.getSeconds()).padStart(2,"0");return`${e}-${n}-${r}T${s}:${o}:${i}`}function d5(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59),r=Um(n),s=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);switch(t){case"today":break;case"week":s.setDate(s.getDate()-6);break;case"month":s.setMonth(s.getMonth()-1);break;case"3months":s.setMonth(s.getMonth()-3);break;case"6months":s.setMonth(s.getMonth()-6);break;case"1year":s.setFullYear(s.getFullYear()-1);break}return{startDate:Um(s),endDate:r}}function u5(t){const{preset:e}=t.params||{preset:"today"},{startDate:n,endDate:r}=d5(e);return{startDate:n,endDate:r,preset:e}}const No=window.G7Core?.createLogger?.("Handler:Sidebar")??{log:(...t)=>console.log("[Handler:Sidebar]",...t),warn:(...t)=>console.warn("[Handler:Sidebar]",...t),error:(...t)=>console.error("[Handler:Sidebar]",...t)},Bm="g7_admin_sidebar_collapsed";function jm(){try{return localStorage.getItem(Bm)==="1"}catch{return!1}}function f5(t){try{localStorage.setItem(Bm,t?"1":"0")}catch(e){No.error("Failed to save sidebar state to localStorage:",e)}try{window.G7Core?.state?.setGlobal?.({sidebarCollapsed:t})}catch(e){No.warn("Failed to set global sidebar state:",e)}}function Wm(){const t=jm();try{window.G7Core?.state?.setGlobal?.({sidebarCollapsed:t})}catch(e){No.warn("Failed to restore sidebar state:",e)}No.log("Initial sidebar collapsed state restored:",t)}async function h5(t,e){Wm()}async function g5(t,e){const r=!(()=>{try{return!!window.G7Core?.state?.getGlobal?.()?.sidebarCollapsed}catch{return jm()}})();f5(r),No.log("Sidebar collapsed toggled to:",r)}const kd=window.G7Core?.createLogger?.("Handler:DownloadAttachment")??{log:(...t)=>console.log("[Handler:DownloadAttachment]",...t),warn:(...t)=>console.warn("[Handler:DownloadAttachment]",...t),error:(...t)=>console.error("[Handler:DownloadAttachment]",...t)};async function p5(t,e){const n=window.G7Core,{url:r,filename:s}=t?.params||{};if(!r){kd.warn("다운로드 URL 이 없어 요청을 건너뜁니다.");return}if(!n?.api?.get){kd.error("G7Core.api.get 이 초기화되지 않아 다운로드를 실행할 수 없습니다.");return}try{const o=await n.api.get(r,{responseType:"blob"});if(o){const i=URL.createObjectURL(o),a=document.createElement("a");a.href=i,a.download=s||"",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}}catch(o){kd.error("첨부파일 다운로드 실패",o),n?.toast?.error?.(n?.t?.("common.download_failed")??"Download failed")}}const Na=window.G7Core?.createLogger?.("Handler:DetectAssetUrlMode")??{log:(...t)=>console.log("[Handler:DetectAssetUrlMode]",...t),warn:(...t)=>console.warn("[Handler:DetectAssetUrlMode]",...t),error:(...t)=>console.error("[Handler:DetectAssetUrlMode]",...t)},m5="G7_ASSET_PROBE_OK";async function Gm(t){try{const e=await fetch(t,{cache:"no-store",credentials:"omit"});if(!e.ok)return!1;const n=e.headers.get("content-type")??"";return/javascript|ecmascript/i.test(n)?(await e.text()).includes(m5):!1}catch{return!1}}async function Ym(){const[t,e]=await Promise.all([Gm("/api/system/asset-probe.js"),Gm("/api/system/asset-probe")]);return t&&e?"extension":!t&&e?"extensionless":"unavailable"}function b5(){return window.G7Config?.settings?.general?.asset_url_mode??"extension"}async function y5(t){try{const e=await Ym();if(e==="unavailable")return;const n=b5();if(e===n)return;window.G7Core?.state?.setGlobal?.({assetUrlModeDrift:{detected:e,stored:n}})}catch(e){Na.warn("자산 URL 방식 대조 실패 (대시보드 동작에는 영향 없음):",e)}}async function v5(t,e){const n=window.G7Core,r=e?.setState??n?.state?.setLocal,s=o=>{typeof r=="function"?r({asset_url_mode_detect_status:o}):Na.warn("setState 를 찾지 못해 감지 상태를 폼에 반영하지 못했습니다")};try{s("detecting");const o=await Ym();if(o==="unavailable"){s("unavailable");return}typeof r=="function"?r({"general.asset_url_mode":o,asset_url_mode_detect_status:o}):Na.warn("setState 를 찾지 못해 감지 결과를 폼에 반영하지 못했습니다")}catch(o){Na.error("자산 URL 방식 감지 실패:",o),s("unavailable")}}const Oa={detectAssetUrlMode:v5,checkAssetUrlModeDrift:y5,setTheme:RT,initTheme:JT,scrollToSection:eu,initMenuFromUrl:n5,initFilterVisibility:r5,saveFilterVisibility:s5,toggleFilterVisibility:o5,resetFilterVisibility:i5,saveMultilingualTag:a5,cancelMultilingualTag:l5,updateMultilingualTagValue:c5,setDateRange:u5,toggleSidebar:g5,initSidebar:h5,downloadAttachment:p5},Oo=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic:IdentityLauncher")??{log:(...t)=>console.log("[Template:sirsoft-admin_basic:IdentityLauncher]",...t),warn:(...t)=>console.warn("[Template:sirsoft-admin_basic:IdentityLauncher]",...t),error:(...t)=>console.error("[Template:sirsoft-admin_basic:IdentityLauncher]",...t)};function x5(){const e=window.G7Core?.api?.getToken?.()??null;return e?{Authorization:`Bearer ${e}`}:{}}function w5(){try{const t=typeof window<"u"?window.localStorage?.getItem("g7_locale"):null;return t?{"Accept-Language":t}:{}}catch{return{}}}async function k5(t,e=null){const n={purpose:t.purpose};t.provider_id&&(n.provider_id=t.provider_id),e&&(n.target=e);const r=t.challenge_start_url||"/api/identity/challenges",s=await fetch(r,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...w5(),...x5()},body:JSON.stringify(n)}),o=await s.json().catch(()=>null);if(!s.ok||!o?.success){const a=o?.message??`Challenge 시작 실패 (HTTP ${s.status})`;throw new Error(a)}const i=o.data??o;return{id:i.id,expires_at:i.expires_at,render_hint:i.render_hint??t.render_hint??"text_code",public_payload:i.public_payload,redirect_url:i.redirect_url,max_attempts:typeof i.max_attempts=="number"?i.max_attempts:void 0}}async function C5(t){const e=window.G7Core,n=e?.identity;if(!e?.dispatch||!e?.state||!n)return Oo.error("G7Core 또는 G7Core.identity 가 초기화되지 않아 launcher 를 실행할 수 없습니다."),{status:"failed",failureCode:"G7_NOT_READY"};if(t.render_hint==="external_redirect"||t.redirect_url)return n.redirectExternally(t);const r=t.target&&(t.target.email||t.target.phone)?t.target:null;let s;try{s=await k5(t,r)}catch(m){Oo.error("Challenge 시작 실패:",m);try{await e.dispatch({handler:"toast",params:{type:"error",message:m instanceof Error?m.message:"본인인증 시작에 실패했습니다."}})}catch{}return{status:"failed",failureCode:"CHALLENGE_START_FAILED",reason:m instanceof Error?m.message:String(m)}}if(s.redirect_url)return n.redirectExternally({...t,render_hint:"external_redirect",redirect_url:s.redirect_url});const o=s.expires_at?new Date(s.expires_at).getTime():0,i=o>0?Math.max(0,Math.floor((o-Date.now())/1e3)):0,a=typeof s.max_attempts=="number"?s.max_attempts:0;e.state.set({identityChallenge:{policy_key:t.policy_key,purpose:t.purpose,provider_id:t.provider_id??null,render_hint:s.render_hint,challenge_id:s.id,expires_at:s.expires_at,public_payload:s.public_payload??{},target:r,code:"",error:null,attempts:0,maxAttempts:a,remainingSeconds:i,resendCooldown:0}});let l=o,c=0;const d=window.setInterval(()=>{const m=l>0?Math.max(0,Math.floor((l-Date.now())/1e3)):0;c=Math.max(0,c-1),e.state.set({identityChallenge:{remainingSeconds:m,resendCooldown:c}})},1e3);let u=null;try{u=e.state.subscribe?.(m=>{const p=m?.identityChallenge?.expires_at;if(typeof p=="string"){const b=new Date(p).getTime();Number.isFinite(b)&&b!==l&&(l=b)}const y=m?.identityChallenge?.resendCooldown;typeof y=="number"&&y>c&&(c=y)})??null}catch{}const f=n.createDeferred();try{await e.dispatch({handler:"openModal",target:"identity-challenge-modal"})}catch(m){return Oo.error("openModal 실패 — 풀페이지로 폴백:",m),window.clearInterval(d),u?.(),n.redirectExternally({...t,render_hint:"external_redirect",redirect_url:`/admin/identity/challenge?challenge_id=${encodeURIComponent(s.id)}&return=${encodeURIComponent(window.location.href)}`})}const g=await f;return window.clearInterval(d),u?.(),g}function S5(){const t=window.G7Core?.identity;if(!t?.setLauncher){Oo.warn("G7Core.identity 가 아직 초기화되지 않아 launcher 등록을 건너뜁니다. 코어 부트스트랩 순서를 확인하세요.");return}t.setLauncher(C5),Oo.log("IDV launcher registered (sirsoft-admin_basic)")}function _5(t){const e=t.icons;return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object"&&typeof n.value=="string"):[]}function E5(t,e){const n=t.label;return typeof n=="string"?n.startsWith("$t:")?e(n.slice(3)):n:t.value}function M5(t,e,n){if(n==="")return!0;const r=n.toLowerCase();return t.value.toLowerCase().includes(r)||e.toLowerCase().includes(r)?!0:(t.keywords??[]).some(s=>s.toLowerCase().includes(r))}function N5({entry:t}){const e=t.preview;return e?.html?h.jsx("span",{className:"g7le-icon-preview",dangerouslySetInnerHTML:{__html:e.html},style:Sd}):e?.className?h.jsx("span",{className:`g7le-icon-preview ${e.className}`,style:Sd}):h.jsx("i",{className:`fas fa-${t.value}`,style:Sd,"aria-hidden":"true"})}function O5({control:t,value:e,onChange:n,t:r}){const s=_5(t),o=e==null?"":String(e),i=typeof t.iconColumns=="number"?t.iconColumns:6,a=t.iconSearchPlaceholder,l=typeof a=="string"&&a.startsWith("$t:")?r(a.slice(3)):r("layout_editor.icon_picker.search_placeholder"),[c,d]=v.useState("");if(s.length===0)return h.jsx("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Xm,children:h.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-free","data-testid":"g7le-widget-icon-picker-free",value:o,placeholder:r("layout_editor.icon_picker.free_input_hint"),onChange:g=>n(g.target.value===""?void 0:g.target.value),style:Km})});const u=g=>E5(g,r),f=s.filter(g=>M5(g,u(g),c));return h.jsxs("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Xm,children:[h.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-search","data-testid":"g7le-widget-icon-picker-search",value:c,placeholder:l,onChange:g=>d(g.target.value),style:Km}),h.jsxs("div",{className:"g7le-icon-grid","data-testid":"g7le-widget-icon-picker-grid",style:{...T5,gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`},children:[h.jsx("button",{type:"button","data-testid":"g7le-icon-cell-none",title:r("layout_editor.icon_picker.none"),onClick:()=>n(void 0),"aria-pressed":o==="",style:o===""?qm:Cd,children:h.jsx("span",{style:A5,children:"—"})}),f.map(g=>{const m=g.value===o;return h.jsx("button",{type:"button","data-testid":`g7le-icon-cell-${g.value}`,title:u(g),"aria-pressed":m,onClick:()=>n(g.value),style:m?qm:Cd,children:h.jsx(N5,{entry:g})},g.value)})]}),f.length===0&&h.jsx("div",{"data-testid":"g7le-widget-icon-picker-empty",style:D5,children:r("layout_editor.icon_picker.no_results")})]})}const Xm={display:"flex",flexDirection:"column",gap:6,width:"100%"},Km={padding:"5px 8px",fontSize:12,border:"1px solid #cbd5e1",borderRadius:6,width:"100%"},T5={display:"grid",gap:4,maxHeight:220,overflowY:"auto",padding:2},Cd={display:"flex",alignItems:"center",justifyContent:"center",minHeight:34,padding:4,border:"1px solid #e2e8f0",borderRadius:6,background:"#fff",cursor:"pointer"},qm={...Cd,border:"2px solid #2563eb",background:"#eff6ff"},Sd={display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:16,lineHeight:1},A5={fontSize:10,color:"#475569",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},D5={fontSize:11,color:"#94a3b8",fontStyle:"italic",padding:"4px 2px"},Zm=130,Mn=20;function I5(t){const e=t?.arrayProp;return typeof e=="string"&&e?e:"tabs"}function L5(t){let e=0;for(const n of t){const r=typeof n.id=="number"?n.id:Number(n.id);Number.isFinite(r)&&r>e&&(e=r)}return e+1}function P5({node:t,params:e,cellBoxes:n,t:r,onPatchNode:s}){const o=I5(e),i=v.useMemo(()=>{const g=(t.props??{})[o];return typeof g=="string"||!Array.isArray(g)?null:g},[t,o]),a=v.useMemo(()=>{const g=new Map,m=`props.${o}.`;for(const p of n??[]){if(!p.path.startsWith(m))continue;const y=Number(p.path.slice(m.length));Number.isInteger(y)&&g.set(y,{top:p.top,left:p.left,width:p.width,height:p.height})}return g},[n,o]),l=v.useCallback(g=>{const m=t.props??{};s({...t,props:{...m,[o]:g}})},[t,o,s]),c=v.useCallback(g=>{if(!i)return;const p={id:L5(i),label:r("editor.tabnav_inplace.new_tab")},y=i.slice();y.splice(g,0,p),l(y)},[i,l,r]),d=v.useCallback(g=>{if(!i)return;const m=i.slice();m.splice(g,1),l(m)},[i,l]),u=v.useCallback((g,m)=>{if(!i)return;const p=g+m;if(p<0||p>=i.length)return;const y=i.slice(),[b]=y.splice(g,1);y.splice(p,0,b),l(y)},[i,l]);if(!i||a.size===0)return null;const f={position:"absolute",width:Mn,height:Mn,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,lineHeight:1,border:"1px solid rgba(0,0,0,0.15)",borderRadius:4,background:"#ffffff",color:"#1f2937",cursor:"pointer",boxShadow:"0 1px 2px rgba(0,0,0,0.18)",pointerEvents:"auto",padding:0,zIndex:Zm};return h.jsx("div",{className:"g7le-tabnav-inplace","data-testid":"g7le-tabnav-inplace",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:Zm},children:i.map((g,m)=>{const p=a.get(m);if(!p)return null;const y=p.left+p.width;return h.jsxs("div",{"data-testid":`g7le-tabnav-aff-${m}`,children:[h.jsx("button",{type:"button","data-testid":`g7le-tabnav-remove-${m}`,title:r("editor.tabnav_inplace.remove"),"aria-label":r("editor.tabnav_inplace.remove"),style:{...f,left:y-Mn/2,top:p.top-Mn/2,color:"#b91c1c"},onClick:b=>{b.preventDefault(),b.stopPropagation(),d(m)},children:"✕"}),m>0&&h.jsx("button",{type:"button","data-testid":`g7le-tabnav-move-left-${m}`,title:r("editor.tabnav_inplace.move_left"),"aria-label":r("editor.tabnav_inplace.move_left"),style:{...f,left:p.left,top:p.top+p.height-Mn/2},onClick:b=>{b.preventDefault(),b.stopPropagation(),u(m,-1)},children:"◀"}),m<i.length-1&&h.jsx("button",{type:"button","data-testid":`g7le-tabnav-move-right-${m}`,title:r("editor.tabnav_inplace.move_right"),"aria-label":r("editor.tabnav_inplace.move_right"),style:{...f,left:y-Mn,top:p.top+p.height-Mn/2},onClick:b=>{b.preventDefault(),b.stopPropagation(),u(m,1)},children:"▶"}),m===0&&h.jsx("button",{type:"button","data-testid":"g7le-tabnav-add-0",title:r("editor.tabnav_inplace.add"),"aria-label":r("editor.tabnav_inplace.add"),style:{...f,left:p.left-Mn,top:p.top+p.height/2-Mn/2,color:"#15803d"},onClick:b=>{b.preventDefault(),b.stopPropagation(),c(0)},children:"+"}),h.jsx("button",{type:"button","data-testid":`g7le-tabnav-add-${m+1}`,title:r("editor.tabnav_inplace.add"),"aria-label":r("editor.tabnav_inplace.add"),style:{...f,left:y-Mn/2,top:p.top+p.height/2-Mn/2,color:"#15803d"},onClick:b=>{b.preventDefault(),b.stopPropagation(),c(m+1)},children:"+"})]},`tab-aff-${g.id}-${m}`)})})}const _d=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic:EditorWidgets")??{log:(...t)=>console.log("[Template:sirsoft-admin_basic:EditorWidgets]",...t),warn:(...t)=>console.warn("[Template:sirsoft-admin_basic:EditorWidgets]",...t)};function $5(){if(typeof window>"u")return;const t=window.G7Core?.layoutEditor;if(!t?.registerWidget){_d.warn("G7Core.layoutEditor 미노출 — icon-picker 위젯 등록 보류");return}t.registerWidget("icon-picker",O5),_d.log("편집기 위젯 'icon-picker' 등록됨(Font Awesome 검색 그리드)"),t.registerCanvasOverlay&&(t.registerCanvasOverlay("tabnav",P5),_d.log("편집기 캔버스 오버레이 'tabnav' 등록됨(TabNavigation 탭 인플레이스)"))}const Ed=window.G7Core?.createLogger?.("Template:sirsoft-admin_basic")??{log:(...t)=>console.log("[Template:sirsoft-admin_basic]",...t),warn:(...t)=>console.warn("[Template:sirsoft-admin_basic]",...t),error:(...t)=>console.error("[Template:sirsoft-admin_basic]",...t)};typeof window<"u"&&(window.G7TemplateHandlers=Oa);function Qm(){if(typeof window<"u"){let t=0;const e=50,n=()=>{const r=window.G7Core?.getActionDispatcher?.();r?(Object.entries(Oa).forEach(([s,o])=>{r.registerHandler(s,o)}),Ed.log(`${Object.keys(Oa).length} custom handler(s) registered:`,Object.keys(Oa)),S5(),Wm()):(t++,t<=e?(Ed.warn(`ActionDispatcher not found, retrying... (${t}/${e})`),setTimeout(n,100)):Ed.error("Failed to register handlers: ActionDispatcher not available after maximum retries"))};document.readyState==="complete"?n():window.addEventListener("load",n)}}return $5(),Qm(),R.A=Lr,R.Accordion=sc,R.ActionMenu=bs,R.AdminFooter=_y,R.AdminHeader=wy,R.AdminSidebar=xy,R.Alert=cu,R.AlertDialog=uy,R.Badge=Pd,R.BarChart=VT,R.Breadcrumb=ou,R.Button=oe,R.Card=pb,R.CardGrid=Kb,R.CategoryTree=jS,R.Checkbox=vn,R.ChipCheckbox=OE,R.Code=ub,R.CodeEditor=Uv,R.ColumnSelector=Kv,R.ConfirmDialog=ru,R.Container=UT,R.DataGrid=jb,R.Dialog=nu,R.Div=I,R.DonutChart=HT,R.Dropdown=Zb,R.DropdownButton=TE,R.DropdownMenuItem=AE,R.DynamicFieldList=UE,R.EmptyState=by,R.ExtensionBadge=nh,R.FileInput=Md,R.FileUploader=Ep,R.FilterGroup=ey,R.FilterVisibilitySelector=CE,R.Flex=jT,R.Form=Pa,R.FormField=YE,R.Fragment=hb,R.Grid=BT,R.H1=Da,R.H2=Qn,R.H3=Ir,R.H4=Nd,R.Hr=gb,R.HtmlContent=Za,R.HtmlEditor=vE,R.I=pt,R.Icon=re,R.IconButton=ly,R.IconName=de,R.IconSelect=FS,R.ImageGallery=Bi,R.Img=yn,R.Input=wt,R.Label=rn,R.LanguageSelector=Sy,R.LayoutEditorHeader=Ty,R.LayoutFileList=Ay,R.LayoutHistoryPanel=jv,R.LayoutWarnings=kE,R.Li=La,R.LoadingSpinner=vy,R.LoginForm=Wv,R.Modal=Uo,R.MultilingualInput=Ha,R.MultilingualLocaleContext=$c,R.MultilingualTabPanel=GE,R.MultilingualTagInput=Gk,R.Nav=Lo,R.NotificationCenter=ky,R.Ol=sb,R.Optgroup=lb,R.Option=ab,R.P=bt,R.PageHeader=Ey,R.PageLoading=Jv,R.PageTransitionIndicator=Zv,R.Pagination=Po,R.PermissionTree=US,R.Pre=fb,R.ProductCard=Qb,R.RadioGroup=mE,R.RichSelect=ME,R.SearchBar=Rb,R.SearchableDropdown=Yk,R.Section=Od,R.SectionHeader=Ny,R.SectionLayout=WT,R.Select=Pr,R.SlotContainer=EE,R.SortableMenuItem=Gh,R.SortableMenuList=PS,R.Span=Q,R.StatCard=Jb,R.StatusBadge=$o,R.Svg=Hn,R.TabNavigation=ty,R.TabNavigationScroll=iy,R.Table=$a,R.TagInput=Bk,R.TagSelect=Xk,R.Tbody=za,R.Td=Kt,R.TemplateCard=Oy,R.Textarea=Zn,R.Tfoot=Va,R.Th=$r,R.Thead=Fa,R.ThemeToggle=Yv,R.ThreeColumnLayout=GT,R.Toast=py,R.Toggle=Ua,R.Tr=Jn,R.Ul=Ia,R.UnifiedIcon=db,R.UserProfile=Cy,R.VersionList=_u,R.configureJSONLanguageService=KT,R.defaultJSONSchemas=Fm,R.executeImageDownload=Ac,R.initTemplate=Qm,R.jsonEditorDefaults=YT,R.monacoInitOptions=XT,R.templateMetadata=qT,R.useCurrentMultilingualLocale=Ip,R.useImageGallery=fp,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),R})({},ReactJSXRuntime,React,ReactDOM);
|