@lateralus-ai/shipping-ui 2.0.0-dev.24 → 2.0.0-dev.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +24 -12
- package/dist/primitives/Switch.d.ts +2 -1
- package/package.json +1 -1
- package/src/primitives/Switch.tsx +15 -5
package/dist/index.cjs
CHANGED
|
@@ -77,7 +77,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
77
77
|
66.67% { opacity: 1; transform: scale(1.25); }
|
|
78
78
|
83.33% { opacity: 0.3; transform: scale(1); }
|
|
79
79
|
}
|
|
80
|
-
`})]}),qt=({value:e,className:t})=>a.jsx("span",{className:y("inline-flex min-w-5 items-center justify-center rounded-full bg-blue-600 px-1.5 py-0.5 text-footnote-em text-white",t),"aria-label":`Count: ${e}`,children:e>99?"99+":e}),ac=({checked:e,onChange:t,disabled:r=!1,className:n,...o})=>a.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:r,onClick:c=>{c.stopPropagation(),t(!e)},className:y("relative inline-flex h-4 w-9 shrink-0 items-center rounded-full transition-colors","disabled:cursor-not-allowed disabled:opacity-50",e?"bg-grey-900":"bg-grey-200",n),...o,children:a.jsx("span",{className:y("inline-block size-3.5 rounded-full bg-white shadow-raise2 transition-transform",e?"translate-x-[18px]":"translate-x-0.5")})}),$3={blue:"bg-meta-blue text-meta-onBlue",green:"bg-meta-green text-meta-onGreen",red:"bg-meta-red text-meta-onRed",orange:"bg-meta-orange text-meta-onOrange",purple:"bg-meta-purple text-meta-onPurple",grey:"bg-grey-100 text-display-on-light-secondary"},de=({color:e,type:t="label",children:r,className:n})=>a.jsx("span",{className:y("inline-flex shrink-0 items-center justify-center text-footnote-em leading-none",t==="label"&&"rounded-full px-1.5 py-0.5",t==="icon"&&"size-5 rounded-full [&>svg]:size-3",$3[e],n),children:r}),eA=({children:e,icon:t,className:r})=>a.jsxs("div",{className:y("flex items-start gap-2 rounded-control bg-meta-blue px-3 py-2 text-caption-2 text-meta-on-blue",r),role:"note",children:[t&&a.jsx("span",{className:"shrink-0 pt-0.5 [&>svg]:size-4",children:t}),a.jsx("span",{children:e})]}),h1=({name:e,children:t})=>{const r=({className:n,...o})=>a.jsx("svg",{width:120,height:120,viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":e,className:y("shrink-0",n),...o,children:t});return r.displayName=e,r},tA=h1({name:"Workflows",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"20",y:"24",width:"32",height:"24",rx:"6",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("rect",{x:"68",y:"24",width:"32",height:"24",rx:"6",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("rect",{x:"44",y:"72",width:"32",height:"24",rx:"6",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M52 48v12M68 48v12M52 60h16",stroke:"var(--blue-400)",strokeWidth:"1.5",strokeLinecap:"round"})]})}),rA=h1({name:"Upload",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"28",y:"36",width:"64",height:"48",rx:"8",fill:"var(--grey-100)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("path",{d:"M60 52v20M52 60l8-8 8 8",stroke:"var(--blue-600)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("rect",{x:"36",y:"28",width:"48",height:"8",rx:"4",fill:"var(--grey-200)"})]})}),nA=h1({name:"Processing",children:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"60",cy:"60",r:"28",fill:"var(--blue-50)",stroke:"var(--blue-100)",strokeWidth:"1.5"}),a.jsx("path",{d:"M60 36a24 24 0 0 1 20.78 12",stroke:"var(--blue-600)",strokeWidth:"3",strokeLinecap:"round"}),a.jsx("circle",{cx:"60",cy:"60",r:"4",fill:"var(--blue-600)"})]})}),aA=h1({name:"Invite",children:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"48",cy:"52",r:"16",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("circle",{cx:"76",cy:"52",r:"12",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M64 52h8M68 48v8",stroke:"var(--grey-700)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("rect",{x:"32",y:"76",width:"56",height:"20",rx:"6",fill:"var(--grey-100)",stroke:"var(--grey-200)",strokeWidth:"1.5"})]})}),oA=h1({name:"Creation",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"32",y:"28",width:"56",height:"64",rx:"8",fill:"var(--grey-50)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("path",{d:"M44 48h32M44 60h24M44 72h28",stroke:"var(--grey-300)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("circle",{cx:"84",cy:"36",r:"12",fill:"var(--blue-600)"}),a.jsx("path",{d:"M84 30v12M78 36h12",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]})}),cA=h1({name:"Completed tasks",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"28",y:"32",width:"64",height:"12",rx:"4",fill:"var(--green-100)"}),a.jsx("rect",{x:"28",y:"52",width:"64",height:"12",rx:"4",fill:"var(--green-100)"}),a.jsx("rect",{x:"28",y:"72",width:"48",height:"12",rx:"4",fill:"var(--grey-100)"}),a.jsx("circle",{cx:"36",cy:"38",r:"4",fill:"var(--green-700)"}),a.jsx("circle",{cx:"36",cy:"58",r:"4",fill:"var(--green-700)"}),a.jsx("circle",{cx:"36",cy:"78",r:"4",fill:"var(--grey-300)"}),a.jsx("path",{d:"M34 38l1.5 1.5 3-3M34 58l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),sA=h1({name:"Workflow created",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"24",y:"40",width:"72",height:"40",rx:"8",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M40 60h40M52 48v24",stroke:"var(--blue-400)",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"84",cy:"32",r:"14",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M79 32l3 3 6-6",stroke:"var(--green-700)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),iA=h1({name:"Audit preparation",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"36",y:"24",width:"48",height:"64",rx:"6",fill:"var(--grey-50)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("rect",{x:"44",y:"36",width:"32",height:"4",rx:"2",fill:"var(--orange-50)"}),a.jsx("rect",{x:"44",y:"48",width:"24",height:"4",rx:"2",fill:"var(--grey-200)"}),a.jsx("rect",{x:"44",y:"60",width:"28",height:"4",rx:"2",fill:"var(--grey-200)"}),a.jsx("path",{d:"M28 88h64",stroke:"var(--grey-300)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("path",{d:"M52 76v12M68 76v12",stroke:"var(--grey-400)",strokeWidth:"2",strokeLinecap:"round"})]})}),AA=h1({name:"Port state control",children:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M24 80h72",stroke:"var(--blue-400)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("path",{d:"M36 80V52l24-16 24 16v28",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("rect",{x:"52",y:"60",width:"16",height:"20",rx:"2",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("circle",{cx:"72",cy:"44",r:"8",fill:"var(--orange-50)",stroke:"var(--orange-700)",strokeWidth:"1.5"})]})}),lA=h1({name:"RightShip inspection",children:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M30 72c0-16 13.5-28 30-28s30 12 30 28",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("rect",{x:"46",y:"44",width:"28",height:"16",rx:"4",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M42 72h36",stroke:"var(--grey-400)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("circle",{cx:"78",cy:"36",r:"6",fill:"var(--green-700)"})]})}),uA=h1({name:"Internal audit",children:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"60",cy:"52",r:"24",fill:"var(--purple-100)",stroke:"var(--purple-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M60 40v16M52 52h16",stroke:"var(--purple-700)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("rect",{x:"32",y:"80",width:"56",height:"8",rx:"4",fill:"var(--grey-200)"}),a.jsx("rect",{x:"40",y:"72",width:"40",height:"4",rx:"2",fill:"var(--grey-300)"})]})}),dA=h1({name:"Questions done",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"32",y:"28",width:"56",height:"64",rx:"8",fill:"var(--grey-50)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("circle",{cx:"44",cy:"48",r:"6",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M42 48l1.5 1.5 3-3",stroke:"var(--green-700)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("rect",{x:"56",y:"44",width:"24",height:"4",rx:"2",fill:"var(--grey-200)"}),a.jsx("circle",{cx:"44",cy:"68",r:"6",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M42 68l1.5 1.5 3-3",stroke:"var(--green-700)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("rect",{x:"56",y:"64",width:"20",height:"4",rx:"2",fill:"var(--grey-200)"})]})}),pA={idle:"border-divider-primary bg-white",hover:"border-grey-300 bg-white",disabled:"border-divider-primary bg-grey-50 text-display-on-light-quaternary cursor-not-allowed",edit:"border-accent-on-light bg-white ring-1 ring-accent-on-light"},gA=({label:e,value:t="",placeholder:r,error:n,state:o="idle",onChange:c,disabled:s,className:i,id:l,...u})=>{const d=w.useId(),p=l??d,g=s??o==="disabled",x=g?"disabled":o,C=!!n;return a.jsxs("div",{className:y("flex w-full flex-col gap-1",i),children:[e&&a.jsx("label",{htmlFor:p,className:"text-caption-2-em text-display-on-light-secondary",children:e}),a.jsx("input",{id:p,type:"text",value:t,placeholder:r,disabled:g,"data-state":x,onChange:m=>c==null?void 0:c(m.target.value),className:y("h-10 w-full rounded-control border px-3 text-body text-display-on-light-primary outline-none transition-colors placeholder:text-display-on-light-quaternary","hover:border-grey-300 focus:border-accent-on-light focus:ring-1 focus:ring-accent-on-light","data-[state=hover]:border-grey-300","data-[state=edit]:border-accent-on-light data-[state=edit]:ring-1 data-[state=edit]:ring-accent-on-light","data-[state=disabled]:border-divider-primary data-[state=disabled]:bg-grey-50 data-[state=disabled]:text-display-on-light-quaternary",C&&"border-red-500 ring-1 ring-red-500",!C&&pA[x]),...u}),n&&a.jsx("span",{className:"text-footnote text-red-500",children:n})]})},xA={idle:"border-divider-primary bg-white",hover:"border-grey-300 bg-white",edit:"border-accent-on-light bg-white ring-1 ring-accent-on-light"},CA=({label:e,value:t="",placeholder:r,state:n="idle",onChange:o,disabled:c,className:s,id:i,rows:l=4,...u})=>{const d=w.useId(),p=i??d;return a.jsxs("div",{className:y("flex w-full flex-col gap-1",s),children:[e&&a.jsx("label",{htmlFor:p,className:"text-caption-2-em text-display-on-light-secondary",children:e}),a.jsx("textarea",{id:p,value:t,placeholder:r,disabled:c,rows:l,"data-state":n,onChange:g=>o==null?void 0:o(g.target.value),className:y("min-h-[96px] w-full resize-y rounded-control border px-3 py-2 text-body text-display-on-light-primary outline-none transition-colors placeholder:text-display-on-light-quaternary","hover:border-grey-300 focus:border-accent-on-light focus:ring-1 focus:ring-accent-on-light","data-[state=hover]:border-grey-300","data-[state=edit]:border-accent-on-light data-[state=edit]:ring-1 data-[state=edit]:ring-accent-on-light",c&&"cursor-not-allowed border-divider-primary bg-grey-50 text-display-on-light-quaternary",!c&&xA[n]),...u})]})},mA={text:{on:"On",off:"Off"},binary:{on:"Yes",off:"No"}},jA=({type:e,state:t,onChange:r,disabled:n=!1,className:o})=>{const c=t==="on",{on:s,off:i}=mA[e],l=u=>{n||r==null||r(u)};return a.jsxs("div",{role:"group","aria-label":`${e} input type`,"data-type":e,"data-state":t,className:y("inline-flex rounded-control border border-divider-primary bg-white p-0.5",n&&"opacity-50",o),children:[a.jsx("button",{type:"button",disabled:n,"aria-pressed":!c,onClick:()=>l("off"),className:y("min-w-12 rounded-[6px] px-3 py-1.5 text-caption-2 transition-colors",c?"text-display-on-light-secondary hover:bg-grey-100":"bg-grey-900 text-display-on-dark-primary"),children:i}),a.jsx("button",{type:"button",disabled:n,"aria-pressed":c,onClick:()=>l("on"),className:y("min-w-12 rounded-[6px] px-3 py-1.5 text-caption-2 transition-colors",c?"bg-grey-900 text-display-on-dark-primary":"text-display-on-light-secondary hover:bg-grey-100"),children:s})]})},fA={blue:"bg-meta-blue",green:"bg-meta-green",red:"bg-meta-red",orange:"bg-meta-orange",purple:"bg-meta-purple",grey:"bg-grey-400"},yA=({variant:e,label:t,avatar:r,icon:n,dotColor:o="blue",onRemove:c,className:s})=>a.jsxs("span",{"data-variant":e,className:y("inline-flex h-8 max-w-full items-center gap-1.5 rounded-control border border-divider-primary bg-white px-2 text-caption-2 text-display-on-light-primary",s),children:[e==="avatar"&&r&&a.jsx(S1,{chief:r.chief,initials:r.initials,size:18}),e==="multiple"&&a.jsx(S2,{count:2}),e==="icon"&&n&&a.jsx("span",{className:"shrink-0 text-display-on-light-secondary [&>svg]:size-4",children:n}),e==="dot"&&a.jsx("span",{className:y("size-2 shrink-0 rounded-full",fA[o])}),a.jsx("span",{className:"truncate",children:t}),c&&a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":`Remove ${t}`,onClick:c,className:"size-6 [&>svg]:size-3",children:a.jsx(bt,{size:"xs"})})]}),OA=({checked:e=!1,indeterminate:t=!1,disabled:r=!1,label:n,onChange:o,className:c,id:s,...i})=>{const l=w.useId(),u=s??l,d=w.useRef(null);w.useEffect(()=>{d.current&&(d.current.indeterminate=t)},[t]);const p=e||t;return a.jsxs("label",{htmlFor:u,"data-checked":e,"data-indeterminate":t,"data-disabled":r,className:y("inline-flex cursor-pointer items-center gap-2",r&&"cursor-not-allowed opacity-50",c),children:[a.jsxs("span",{className:"relative inline-flex shrink-0",children:[a.jsx("input",{ref:d,id:u,type:"checkbox",checked:e,disabled:r,onChange:g=>o==null?void 0:o(g.target.checked),className:"peer sr-only",...i}),a.jsxs("span",{"aria-hidden":!0,className:y("flex size-4 items-center justify-center rounded-sm border transition-colors","border-divider-secondary bg-white","peer-hover:border-grey-400 peer-hover:bg-grey-50",p&&"border-blue-600 bg-blue-600","peer-focus-visible:ring-2 peer-focus-visible:ring-accent-on-light peer-focus-visible:ring-offset-1","peer-disabled:border-divider-primary peer-disabled:bg-grey-50"),children:[e&&!t&&a.jsx(Pt,{size:"xs",className:"text-white"}),t&&a.jsx(Vt,{size:"small",className:"text-white"})]})]}),n&&a.jsx("span",{className:"text-body text-display-on-light-primary",children:n})]})},VA=({label:e,state:t="idle",className:r,...n})=>a.jsxs("button",{type:"button",role:"tab","aria-selected":t==="active","data-state":t,className:y("relative inline-flex items-center px-3 py-2 text-caption-2 transition-colors","text-display-on-light-secondary hover:text-display-on-light-primary","data-[state=active]:text-display-on-light-primary data-[state=active]:text-caption-2-em",r),...n,children:[e,t==="active"&&a.jsx("span",{"aria-hidden":!0,className:"absolute inset-x-0 -bottom-px h-0.5 rounded-full bg-grey-900"})]});var Xr="Tabs",[vA]=Ie(Xr,[hr]),oc=hr(),[bA,F2]=vA(Xr),cc=A.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:c,orientation:s="horizontal",dir:i,activationMode:l="automatic",...u}=e,d=r2(i),[p,g]=Hr({prop:n,onChange:o,defaultProp:c??"",caller:Xr});return a.jsx(bA,{scope:r,baseId:ye(),value:p,onValueChange:g,orientation:s,dir:d,activationMode:l,children:a.jsx(g1.div,{dir:d,"data-orientation":s,...u,ref:t})})});cc.displayName=Xr;var sc="TabsList",ic=A.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,c=F2(sc,r),s=oc(r);return a.jsx(Fo,{asChild:!0,...s,orientation:c.orientation,dir:c.dir,loop:n,children:a.jsx(g1.div,{role:"tablist","aria-orientation":c.orientation,...o,ref:t})})});ic.displayName=sc;var Ac="TabsTrigger",lc=A.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...c}=e,s=F2(Ac,r),i=oc(r),l=pc(s.baseId,n),u=gc(s.baseId,n),d=n===s.value;return a.jsx(Do,{asChild:!0,...i,focusable:!o,active:d,children:a.jsx(g1.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...c,ref:t,onMouseDown:E(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:E(e.onKeyDown,p=>{o||p.target!==p.currentTarget||[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:E(e.onFocus,()=>{const p=s.activationMode!=="manual";!d&&!o&&p&&s.onValueChange(n)})})})});lc.displayName=Ac;var uc="TabsContent",dc=A.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:c,...s}=e,i=F2(uc,r),l=pc(i.baseId,n),u=gc(i.baseId,n),d=n===i.value,p=A.useRef(d);return A.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),a.jsx(ne,{present:o||d,children:({present:g})=>a.jsx(g1.div,{"data-state":d?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&c})})});dc.displayName=uc;function pc(e,t){return`${e}-trigger-${t}`}function gc(e,t){return`${e}-content-${t}`}var IA=cc,xc=ic,Cc=lc,mc=dc;const D2=w.createContext({type:"tabs",appearance:"soft"}),jc=({type:e="tabs",appearance:t="soft",className:r,children:n,...o})=>a.jsx(D2.Provider,{value:{type:e,appearance:t},children:a.jsx(IA,{className:y("flex flex-col",r),"data-type":e,"data-appearance":e==="pills"?t:void 0,...o,children:n})}),G2=w.forwardRef(({className:e,...t},r)=>{const{type:n}=w.useContext(D2);return a.jsx(xc,{ref:r,className:y("flex items-center",n==="tabs"&&"gap-6 border-b border-divider-primary",n==="pills"&&"gap-2",e),...t})});G2.displayName=xc.displayName;const B2=w.forwardRef(({className:e,children:t,...r},n)=>{const{type:o,appearance:c}=w.useContext(D2);return a.jsx(Cc,{ref:n,className:y("inline-flex items-center justify-center gap-2.5 transition-colors outline-none","disabled:pointer-events-none disabled:opacity-50",o==="tabs"&&["relative h-12 gap-2 px-0 py-0 text-caption-2 text-display-on-light-secondary","hover:text-display-on-light-primary","data-[state=active]:text-caption-2-em data-[state=active]:text-display-on-light-primary","data-[state=active]:after:absolute data-[state=active]:after:inset-x-0 data-[state=active]:after:-bottom-px","data-[state=active]:after:h-0.5 data-[state=active]:after:rounded-full data-[state=active]:after:bg-grey-900"],o==="pills"&&c==="soft"&&["min-h-9 rounded-full px-3 py-1 text-caption-2-em","bg-grey-100 text-display-on-light-secondary","hover:bg-grey-200","data-[state=active]:bg-accent-bg-light data-[state=active]:text-display-on-light-primary"],o==="pills"&&c==="solid"&&["min-h-9 rounded-full px-3 py-1 text-caption-2-em","bg-grey-100 text-display-on-light-tertiary","hover:bg-grey-200 hover:text-display-on-light-primary","data-[state=active]:bg-blue-600 data-[state=active]:text-white","data-[state=active]:hover:bg-blue-600"],e),...r,children:t})});B2.displayName=Cc.displayName;const X2=w.forwardRef(({className:e,...t},r)=>a.jsx(mc,{ref:r,className:y("outline-none",e),...t}));X2.displayName=mc.displayName;const PA=({variant:e="standard",title:t,actions:r,className:n})=>a.jsxs("header",{"data-variant":e,className:y("flex w-full items-center justify-between gap-4",e==="standard"&&"border-b border-divider-primary px-6 py-4",e==="nested"&&"px-4 py-3",n),children:[a.jsx("h2",{className:y("text-display-on-light-primary",e==="standard"&&"font-heading text-heading",e==="nested"&&"text-subheader-em"),children:t}),r&&a.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]});function kA({icon:e,title:t,crumbs:r,actions:n,className:o}){const c=!!(r!=null&&r.length);return a.jsxs("div",{"data-variant":c?"nested":"standard",className:y("flex w-full shrink-0 items-center justify-between gap-4","min-h-10",o),children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e!=null&&a.jsx("span",{className:"inline-flex size-6 shrink-0 items-center justify-center [&>svg]:size-6",children:e}),c?a.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0",children:a.jsxs("ol",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[r.map(s=>a.jsxs("li",{className:"contents",children:[a.jsx("a",{href:s.href,onClick:s.onClick,className:"truncate text-caption-1-em text-display-on-light-secondary transition-colors hover:text-display-on-light-primary",children:s.label}),a.jsx("span",{"aria-hidden":!0,className:"text-caption-1-em text-display-on-light-secondary",children:"/"})]},`${s.href}-${s.label}`)),a.jsx("li",{"aria-current":"page",className:"min-w-0 truncate text-caption-1-em text-display-on-light-primary",children:t})]})}):a.jsx("h1",{className:"min-w-0 truncate text-caption-1-em text-display-on-light-primary",children:t})]}),n!=null&&a.jsx("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}function zA({className:e,...t}){return a.jsx("div",{className:y("flex h-full min-h-0 flex-col",e),...t})}function HA({className:e,...t}){return a.jsx("div",{className:y("min-h-0 flex-1 overflow-y-auto",e),...t})}const MA=Object.assign(kA,{Shell:zA,Body:HA});function KA({className:e,...t}){return a.jsx("div",{className:y("flex min-h-0 flex-1 flex-col gap-2 overflow-hidden rounded-lg bg-grey-100 p-1",e),...t})}function NA({className:e,...t}){return a.jsx("div",{className:y("flex shrink-0 items-start gap-8 pl-10 pr-2 py-1","text-caption-2-em text-display-on-light-secondary",e),...t})}function SA({className:e,...t}){return a.jsx("div",{className:y("flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto rounded bg-grey-50 p-1",e),...t})}const hA=Object.assign(KA,{Header:NA,Body:SA}),qA={chat:a.jsx(It,{className:"size-4"}),issue:a.jsx(Te,{className:"size-4"}),report:a.jsx(Or,{className:"size-4"})},fc=({variant:e,type:t,state:r="idle",title:n="Title",subtitle:o,count:c,trailing:s,icon:i,onClick:l,className:u,meta:d})=>{const p=e??t??"chat",g=typeof l=="function",x=C=>{l&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),l())};return a.jsxs("div",{role:g?"button":void 0,tabIndex:g?0:void 0,"data-variant":p,"data-state":r,onClick:l,onKeyDown:x,className:y("group flex w-full items-center gap-4 rounded-control p-2 text-left transition-colors","hover:bg-[rgba(38,36,32,0.04)]",r==="active"&&"bg-[rgba(38,36,32,0.04)]",g&&"cursor-pointer",u),children:[a.jsx("span",{className:"shrink-0 text-display-on-light-secondary",children:i??qA[p]??a.jsx(Vr,{className:"size-4"})}),a.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("span",{className:"flex min-h-6 w-full items-center gap-4",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate text-caption-1-em text-display-on-light-primary",children:n}),typeof c=="number"&&c>0&&a.jsx("span",{className:"inline-flex min-h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-red-600 px-0.5 text-footnote-em text-white","aria-label":`${c} unread`,children:c>99?"99+":c}),d!=null&&typeof c!="number"&&a.jsx("span",{className:"shrink-0 text-footnote text-display-on-light-quaternary",children:d})]}),o!=null&&o!==!1||s?a.jsxs("span",{className:"flex min-h-6 w-full items-center gap-4",children:[o!=null&&o!==!1?a.jsx("span",{className:"min-w-0 flex-1 truncate text-caption-2 text-display-on-light-secondary",children:o}):a.jsx("span",{className:"min-w-0 flex-1"}),s!=null&&a.jsx("span",{className:"inline-flex size-5 shrink-0 items-center justify-center",onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),children:s})]}):null]})]})},UA=({illustration:e,title:t,description:r,action:n,className:o})=>a.jsxs("div",{className:y("flex max-w-sm flex-col items-center gap-4 px-6 py-10 text-center",o),children:[e&&a.jsx("div",{className:"shrink-0",children:e}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("h3",{className:"text-subheader-em text-display-on-light-primary",children:t}),r&&a.jsx("p",{className:"text-body text-display-on-light-secondary",children:r})]}),n&&a.jsx(Re,{hierarchy:n.hierarchy??"primary",onClick:n.onClick,icon:n.icon,startIcon:n.startIcon,children:n.children})]});var Zr="Dialog",[yc]=Ie(Zr),[wA,B1]=yc(Zr),Oc=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:c,modal:s=!0}=e,i=A.useRef(null),l=A.useRef(null),[u,d]=Hr({prop:n,defaultProp:o??!1,onChange:c,caller:Zr});return a.jsx(wA,{scope:t,triggerRef:i,contentRef:l,contentId:ye(),titleId:ye(),descriptionId:ye(),open:u,onOpenChange:d,onOpenToggle:A.useCallback(()=>d(p=>!p),[d]),modal:s,children:r})};Oc.displayName=Zr;var Vc="DialogTrigger",vc=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(Vc,r),c=O1(t,o.triggerRef);return a.jsx(g1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":E2(o.open),...n,ref:c,onClick:E(e.onClick,o.onOpenToggle)})});vc.displayName=Vc;var Z2="DialogPortal",[TA,bc]=yc(Z2,{forceMount:void 0}),Ic=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,c=B1(Z2,t);return a.jsx(TA,{scope:t,forceMount:r,children:A.Children.map(n,s=>a.jsx(ne,{present:r||c.open,children:a.jsx(b2,{asChild:!0,container:o,children:s})}))})};Ic.displayName=Z2;var dr="DialogOverlay",Y2=A.forwardRef((e,t)=>{const r=bc(dr,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,c=B1(dr,e.__scopeDialog);return c.modal?a.jsx(ne,{present:n||c.open,children:a.jsx(RA,{...o,ref:t})}):null});Y2.displayName=dr;var WA=pt("DialogOverlay.RemoveScroll"),RA=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(dr,r),c=b9(),s=O1(t,c);return a.jsx(Ur,{as:WA,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(g1.div,{"data-state":E2(o.open),...n,ref:s,style:{pointerEvents:"auto",...n.style}})})}),De="DialogContent",L2=A.forwardRef((e,t)=>{const r=bc(De,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,c=B1(De,e.__scopeDialog);return a.jsx(ne,{present:n||c.open,children:c.modal?a.jsx(FA,{...o,ref:t}):a.jsx(DA,{...o,ref:t})})});L2.displayName=De;var FA=A.forwardRef((e,t)=>{const r=B1(De,e.__scopeDialog),n=A.useRef(null),o=O1(t,r.contentRef,n);return A.useEffect(()=>{const c=n.current;if(c)return I2(c)},[]),a.jsx(Pc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:E(e.onCloseAutoFocus,c=>{var s;c.preventDefault(),(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,c=>{const s=c.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&c.preventDefault()}),onFocusOutside:E(e.onFocusOutside,c=>c.preventDefault())})}),DA=A.forwardRef((e,t)=>{const r=B1(De,e.__scopeDialog),n=A.useRef(!1),o=A.useRef(!1);return a.jsx(Pc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,c),c.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),c.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:c=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,c),c.defaultPrevented||(n.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=c.target;((u=r.triggerRef.current)==null?void 0:u.contains(s))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),Pc=A.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:c,...s}=e,i=B1(De,r);return uo(),a.jsx(a.Fragment,{children:a.jsx(o2,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:c,children:a.jsx(a2,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":E2(i.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>i.onOpenChange(!1)})})})}),kc="DialogTitle",J2=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(kc,r);return a.jsx(g1.h2,{id:o.titleId,...n,ref:t})});J2.displayName=kc;var zc="DialogDescription",Q2=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(zc,r);return a.jsx(g1.p,{id:o.descriptionId,...n,ref:t})});Q2.displayName=zc;var Hc="DialogClose",Mc=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(Hc,r);return a.jsx(g1.button,{type:"button",...n,ref:t,onClick:E(e.onClick,()=>o.onOpenChange(!1))})});Mc.displayName=Hc;function E2(e){return e?"open":"closed"}const Kc=Oc,GA=vc,BA=Mc,Nc=Ic,_2=w.forwardRef(({className:e,...t},r)=>a.jsx(Y2,{ref:r,className:y("fixed inset-0 z-[999] bg-grey-900/65 transition-opacity","data-[state=open]:animate-in data-[state=open]:fade-in","data-[state=closed]:animate-out data-[state=closed]:fade-out",e),...t}));_2.displayName=Y2.displayName;const $2=w.forwardRef(({className:e,children:t,showOverlay:r=!0,overlayClassName:n,...o},c)=>a.jsxs(Nc,{children:[r&&a.jsx(_2,{className:n}),a.jsx(L2,{ref:c,className:y("fixed left-1/2 top-1/2 z-[999] w-full max-w-xl -translate-x-1/2 -translate-y-1/2","overflow-hidden rounded-xl border border-divider-primary bg-background-primary shadow-raise3","outline-none","data-[state=open]:animate-in data-[state=open]:fade-in-90","data-[state=closed]:animate-out data-[state=closed]:fade-out",e),...o,children:t})]}));$2.displayName=L2.displayName;const e5=w.forwardRef(({className:e,...t},r)=>a.jsx(J2,{ref:r,className:y("text-subheader-em text-display-on-light-primary",e),...t}));e5.displayName=J2.displayName;const t5=w.forwardRef(({className:e,...t},r)=>a.jsx(Q2,{ref:r,className:y("text-caption-2 text-display-on-light-secondary",e),...t}));t5.displayName=Q2.displayName;const XA=({children:e,className:t})=>a.jsx("div",{className:y("shrink-0",t),children:e}),Sc=({children:e,className:t})=>a.jsx("div",{className:y("min-h-0 overflow-auto",t),children:e}),ZA=({onClose:e,right:t,children:r})=>a.jsxs("div",{className:"flex items-center gap-2 rounded-t-xl bg-background-secondary px-2 py-3",children:[a.jsx("div",{className:"grow text-subheader-em text-display-on-light-primary",children:r}),a.jsxs("div",{className:"flex items-center gap-4",children:[t,a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":"Close",onClick:e,children:a.jsx(bt,{size:"small"})})]})]}),YA=({children:e,className:t})=>a.jsx("div",{className:y("w-full overflow-auto",t),children:e}),r5={Header:ZA,Body:YA},hc=(e=100,t=50,r=990,n=10)=>{const[o,c]=w.useState(e);return[o,{...{zoomIn:()=>c(l=>Math.min(l+n,r)),zoomOut:()=>c(l=>Math.max(l-n,t)),reset:()=>c(e),zoomToValue:l=>c(Math.max(t,Math.min(l,r)))},handleWheel:l=>{l.preventDefault();const u=l.deltaY>0?-n:n;c(d=>Math.max(t,Math.min(d+u,r)))}}]},qc=()=>{const[e,t]=w.useState(0);return[e,{rotateClockwise:()=>t(n=>(n+90)%360),rotateCounterClockwise:()=>t(n=>(n-90+360)%360)}]},Uc=()=>{const[e,t]=w.useState({x:0,y:0}),[r,n]=w.useState(!1),[o,c]=w.useState({x:0,y:0});return[{pan:e,isDragging:r},{handleMouseDown:d=>{n(!0),c({x:d.clientX-e.x,y:d.clientY-e.y})},handleMouseMove:d=>{r&&t({x:d.clientX-o.x,y:d.clientY-o.y})},handleMouseUp:()=>{n(!1)},reset:()=>t({x:0,y:0})}]},wc=(e=0,t=1)=>{const[r,n]=w.useState(t),[o,c]=w.useState(e),s={nextPage:w.useCallback(()=>{n(i=>i<o?i+1:i)},[o]),prevPage:w.useCallback(()=>{n(i=>Math.max(i-1,1))},[]),goToPage:w.useCallback(i=>{n(()=>Math.max(1,Math.min(i,o)))},[o]),setTotalPages:w.useCallback(i=>{c(i),n(l=>Math.min(l,i))},[])};return[{currentPage:r,totalPages:o},s]},st="flex h-8 w-8 items-center justify-center rounded-control border border-divider-primary bg-white text-display-on-light-secondary hover:bg-background-secondary disabled:opacity-50",LA=({className:e,canvasClassName:t,mainCanvasClassname:r,initialPage:n=1,onClose:o,totalPages:c,getImageSrc:s,documentUrl:i,title:l="PDF Viewer"})=>{const[u,d]=hc(),[p,g]=qc(),[{pan:x,isDragging:C},m]=Uc(),[{currentPage:f},O]=wc(c,n),[v,I]=w.useState("");w.useEffect(()=>{(async()=>{const z=await s(f);I(z)})()},[f,s]);const V=()=>{i&&window.open(i,"_blank","noopener,noreferrer")};return a.jsxs("div",{className:y("flex h-full flex-col rounded-t-lg shadow-raise2",e),children:[a.jsx(r5.Header,{onClose:o,right:i?a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":"Open",onClick:V,children:a.jsx(yr,{size:"small"})}):void 0,children:l}),a.jsxs("div",{className:y("grid h-full grow overflow-hidden",t),children:[a.jsx("div",{className:y("col-start-1 row-start-1 flex items-center justify-center overflow-hidden bg-background-tertiary p-8",C?"cursor-grabbing":"cursor-grab",r),onMouseDown:m.handleMouseDown,onMouseMove:m.handleMouseMove,onMouseUp:m.handleMouseUp,onMouseLeave:m.handleMouseUp,children:v&&a.jsx("img",{src:v,alt:`Page ${f}`,style:{transform:`translate(${x.x}px, ${x.y}px) rotate(${p}deg) scale(${u/100})`},className:"max-w-full",draggable:!1})}),a.jsxs("div",{className:"z-10 col-start-1 row-start-1 flex items-center justify-between gap-3 self-start bg-background-secondary p-2 shadow",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:st,onClick:O.prevPage,disabled:f===1,"aria-label":"Previous page",children:a.jsx(j1,{direction:"left",size:"small"})}),a.jsx("input",{className:"h-8 w-14 rounded-control border border-divider-primary bg-white text-center text-caption-2",value:f,onChange:P=>{const z=parseInt(P.target.value,10);isNaN(z)||O.goToPage(z)},type:"number",min:1,max:c}),a.jsxs("span",{className:"px-2 text-caption-2",children:["of ",c]}),a.jsx("button",{type:"button",className:st,onClick:O.nextPage,disabled:f===c,"aria-label":"Next page",children:a.jsx(j1,{direction:"right",size:"small"})})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:st,onClick:d.zoomOut,"aria-label":"Zoom out",children:a.jsx(Vt,{size:"small"})}),a.jsxs("span",{className:"w-14 text-center text-caption-2",children:[u,"%"]}),a.jsx("button",{type:"button",className:st,onClick:d.zoomIn,"aria-label":"Zoom in",children:a.jsx(Be,{size:"small"})}),a.jsx("button",{type:"button",className:st,onClick:g.rotateCounterClockwise,"aria-label":"Rotate",children:a.jsx(j1,{direction:"left",size:"small"})})]})]})]})]})};ar.pdfjs.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${ar.pdfjs.version}/build/pdf.worker.min.mjs`;const it="flex h-8 w-8 items-center justify-center rounded-control border border-divider-primary bg-white text-display-on-light-secondary hover:bg-background-secondary disabled:opacity-50",JA=({onClose:e,src:t,title:r="PDF Viewer",className:n,onOpen:o})=>{const[c,s]=hc(),[i,l]=qc(),[{currentPage:u,totalPages:d},p]=wc(),[{pan:g,isDragging:x},C]=Uc(),[m,f]=w.useState(1),O=w.useRef(null);w.useEffect(()=>{const V=()=>{if(!O.current)return;const z=O.current.offsetWidth/612;f(z*(c/100))};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[c]);const v=V=>{if(o==null||o(V),V.defaultPrevented||!t){V.preventDefault();return}window.open(t,"_blank","noopener,noreferrer")},I=a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":"Open in new tab",onClick:v,children:a.jsx(yr,{size:"small"})});return a.jsxs("div",{className:y("flex h-full flex-col rounded-t-lg shadow-raise2",n),ref:O,children:[a.jsx(r5.Header,{onClose:e,right:I,children:r}),a.jsxs("div",{className:"grid h-full grow overflow-hidden shadow",children:[a.jsx("div",{className:y("col-start-1 row-start-1 mt-8 flex h-full items-center justify-center overflow-hidden bg-background-tertiary p-8 select-none",x?"cursor-grabbing":"cursor-grab"),onMouseDown:C.handleMouseDown,onMouseMove:C.handleMouseMove,onMouseUp:C.handleMouseUp,onMouseLeave:C.handleMouseUp,style:{userSelect:"none"},children:a.jsx("div",{style:{transform:`translate(${g.x}px, ${g.y}px)`,transition:x?"none":"transform 0.1s",pointerEvents:"none",maxWidth:"650px"},children:a.jsx(ar.Document,{externalLinkRel:"noopener noreferrer",externalLinkTarget:"_blank",file:t,onLoadSuccess:({numPages:V})=>p.setTotalPages(V),scale:m,rotate:i,children:a.jsx(ar.Page,{pageNumber:u,renderTextLayer:!0,renderAnnotationLayer:!0})})})}),a.jsxs("div",{className:"z-10 col-start-1 row-start-1 flex w-full flex-wrap items-center justify-between gap-3 self-start bg-background-secondary p-2 shadow",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:it,onClick:p.prevPage,disabled:u===1,"aria-label":"Previous page",children:a.jsx(j1,{direction:"left",size:"small"})}),a.jsx("input",{className:"h-8 w-14 rounded-control border border-divider-primary bg-white px-1 py-1 text-center text-caption-2 text-display-on-light-primary",value:u,onChange:V=>{const P=parseInt(V.target.value,10);isNaN(P)||p.goToPage(P)},type:"number",min:"1",max:d}),a.jsxs("span",{className:"px-2 text-caption-2 text-display-on-light-secondary",children:["of ",d]}),a.jsx("button",{type:"button",className:it,onClick:p.nextPage,disabled:u===d,"aria-label":"Next page",children:a.jsx(j1,{direction:"right",size:"small"})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:it,onClick:s.zoomOut,"aria-label":"Zoom out",children:a.jsx(Vt,{size:"small"})}),a.jsxs("button",{type:"button",className:"h-8 w-14 rounded-control border border-divider-primary bg-white text-center text-caption-2 text-display-on-light-primary hover:bg-background-secondary",onClick:()=>{s.reset(),C.reset()},children:[c,"%"]}),a.jsx("button",{type:"button",className:it,onClick:s.zoomIn,"aria-label":"Zoom in",children:a.jsx(Be,{size:"small"})})]}),a.jsx("div",{className:"h-6 w-px bg-divider-primary"}),a.jsx("button",{type:"button",className:it,onClick:l.rotateCounterClockwise,"aria-label":"Rotate counter-clockwise",children:a.jsx(j1,{direction:"left",size:"small"})})]})]})]})]})};class QA{constructor(t={}){tt(this,"checkboxData");tt(this,"schema");tt(this,"finalGeneration");tt(this,"name","CheckboxModule");this.checkboxData=t.checkboxData||{},this.schema=t.schema,this.finalGeneration=t.finalGeneration||!1}parse(t){return null}postparse(t){return t}render(t,r){return t}postrender(t,r){return!!(r&&r.contentType&&r.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")?(()=>{try{const o=t.map(s=>{const i=typeof s=="string",l=s&&typeof s=="object"&&s.value,u=()=>i&&s,d=()=>!i&&l&&s.value,p=()=>!i&&!l&&String(s);return u()||d()||p()}).join("");return[this.processCheckboxPatterns(o)]}catch{return t}})():t}processCheckboxPatterns(t){try{const r=/<w:bookmarkStart[^>]*w:name="(Check\d+)"[^>]*\/>/gi;r.lastIndex=0;const n=[];let o;for(;(o=r.exec(t))!==null;)n.push(o[1]);return n.length>0?(()=>{const s=()=>(n.forEach(d=>{const g=this.getCheckboxState(d)?"1":"0",x=new RegExp(`(<w:fldChar w:fldCharType="begin">.*?<w:name w:val="${d}".*?<w:default w:val=")([01])(".*?</w:fldChar>)`,"gs");t=t.replace(x,`$1${g}$3`)}),t),i=()=>(r.lastIndex=0,t.replace(r,(d,p)=>{try{return`<w:r><w:t>${`|||${this.getCheckboxState(p)?"☑":"☐"}|||checkbox:${p}|||`}</w:t></w:r><w:bookmarkStart w:name="${p}" w:id="0"/>`}catch{return d}})),l=()=>this.finalGeneration&&s(),u=()=>!this.finalGeneration&&i();return l()||u()})():t}catch{return t}}getCheckboxState(t){const r=!!this.schema,n=()=>!r&&(this.checkboxData[t]||!1),o=()=>r&&(()=>{const c=Object.entries(this.schema.properties||{}).find(([s,i])=>{const u=i.docx_mapping,d=u&&u.type==="checkbox",p=u&&u.type==="radio"&&u.mapping,g=d&&u.name===t,x=d&&u.true_name===t,C=d&&u.false_name===t,m=p&&u.mapping.find(f=>f.name===t);return g||x||C||!!m});return c?(()=>{const[s,i]=c,u=i.docx_mapping,d=u&&u.type==="checkbox"&&u.name===t,p=u&&u.type==="checkbox"&&u.true_name===t,g=u&&u.type==="checkbox"&&u.false_name===t,x=u&&u.type==="radio"&&u.mapping&&u.mapping.find(O=>O.name===t),C=()=>(d||p)&&this.checkboxData[s]===!0,m=()=>g&&this.checkboxData[s]===!1,f=()=>x&&this.checkboxData[s]===x.value;return C()||m()||f()||!1})():this.checkboxData[t]||!1})();return n()||o()||!1}updateCheckboxData(t){this.checkboxData={...this.checkboxData,...t}}}let P1={},la={};const EA=({docxUrl:e,schema:t,onDataChange:r,initialData:n,onSaveRef:o,readonly:c=!1})=>{const[s,i]=w.useState([]),[l,u]=w.useState(!0),[d,p]=w.useState(null),[g,x]=w.useState(0),C=w.useRef(null),m=w.useCallback(k=>{const b=/\{([^}]+)\}/g,K=[];let U;for(;(U=b.exec(k))!==null;)K.push(U[1]);return[...new Set(K)]},[]),f=w.useCallback((k,b)=>{P1={...P1,[k]:b},I(k,b),r==null||r(P1)},[r]),O=w.useCallback((k,b)=>{!Object.entries(t.properties||{}).find(([U,D])=>{var e1;const L=D.docx_mapping,s1=(L==null?void 0:L.type)==="checkbox"&&L.name===k;s1&&f(U,b);const c1=(L==null?void 0:L.type)==="checkbox"&&L.true_name===k,_=(L==null?void 0:L.type)==="checkbox"&&L.false_name===k;c1&&f(U,b),_&&f(U,!b);const J=(L==null?void 0:L.type)==="radio"&&((e1=L.mapping)==null?void 0:e1.find(i1=>i1.name===k));return J&&f(U,J.value),s1||c1||_||!!J})&&f(k,b)},[f,t]),v=w.useCallback((k,b)=>{const K=la[k];return!(b===K||b===""&&K==null||K===""&&b==null)},[]),I=w.useCallback((k,b)=>{const K=!!C.current,U=v(k,b);K&&C.current.querySelectorAll(`[data-field-path="${k}"]`).forEach(r1=>{const L=U?"field-edited":"field-original",s1=U?"field-original":"field-edited";r1.classList.remove(s1),r1.classList.add(L)})},[v]),V=w.useCallback(()=>{!!C.current&&Object.entries(P1).forEach(([b,K])=>{I(b,K)})},[I]),P=w.useCallback(async()=>{r==null||r(P1),x(k=>k+1)},[r]);w.useEffect(()=>{o&&(o.current=P)},[P,o]);const z=w.useCallback(async k=>{try{const K=await(await fetch(e)).arrayBuffer(),U=new O5(K),D={};Object.entries(k).forEach(([_,J])=>{(typeof J=="boolean"||J==="true"||J==="false")&&(D[_]=J===!0||J==="true")});const r1=new y5(U,{paragraphLoop:!0,linebreaks:!0,nullGetter:_=>`||| |||${_.value||"unknown_field"}|||`,modules:[new QA({checkboxData:D,schema:t,finalGeneration:!1})]}),L={},s1="__NEWLINE__";return Object.entries(k).forEach(([_,J])=>{if(J!=null&&J!==""){let e1=J;typeof J=="string"&&(e1=J.replace(/\n/g,s1)),L[_]=`|||${e1}|||${_}|||`}else L[_]=null}),r1.render(L),r1.getZip().generate({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}catch(b){throw console.error("Error processing document:",b),new Error(b instanceof Error?b.message:"Failed to process document")}},[e,t]),H=w.useCallback((k,b,K,U)=>{const D=document.createElement("span");D.className="inline-field-container",D.setAttribute("data-field-path",k);const r1=c,L=b||P1[k]||"",s1=()=>{const d1=K.type==="boolean"?(()=>{const $=document.createElement("span");return $.textContent=L==="true"||P1[k]===!0?"☑":"☐",$.className="inline-checkbox-readonly",$})():(()=>{const $="__NEWLINE__",f1=String(L).replace(new RegExp($,"g"),`
|
|
80
|
+
`})]}),qt=({value:e,className:t})=>a.jsx("span",{className:y("inline-flex min-w-5 items-center justify-center rounded-full bg-blue-600 px-1.5 py-0.5 text-footnote-em text-white",t),"aria-label":`Count: ${e}`,children:e>99?"99+":e}),ac=({checked:e,onChange:t,disabled:r=!1,className:n,...o})=>a.jsxs("button",{type:"button",role:"switch","aria-checked":e,disabled:r,onClick:c=>{c.stopPropagation(),t(!e)},className:y("relative inline-flex h-6 w-9 shrink-0 items-center","disabled:cursor-not-allowed disabled:opacity-50",n),...o,children:[a.jsx("span",{"aria-hidden":!0,className:y("pointer-events-none absolute inset-x-0 top-1/2 h-4 -translate-y-1/2 rounded-full transition-colors",e?"bg-grey-900":"bg-grey-400")}),a.jsx("span",{"aria-hidden":!0,className:y("relative inline-block size-6 rounded-full border border-solid shadow-raise2 transition-[transform,border-color,background-color]",e?"translate-x-3 border-grey-900 bg-white":"translate-x-0 border-grey-400 bg-grey-50")})]}),$3={blue:"bg-meta-blue text-meta-onBlue",green:"bg-meta-green text-meta-onGreen",red:"bg-meta-red text-meta-onRed",orange:"bg-meta-orange text-meta-onOrange",purple:"bg-meta-purple text-meta-onPurple",grey:"bg-grey-100 text-display-on-light-secondary"},de=({color:e,type:t="label",children:r,className:n})=>a.jsx("span",{className:y("inline-flex shrink-0 items-center justify-center text-footnote-em leading-none",t==="label"&&"rounded-full px-1.5 py-0.5",t==="icon"&&"size-5 rounded-full [&>svg]:size-3",$3[e],n),children:r}),eA=({children:e,icon:t,className:r})=>a.jsxs("div",{className:y("flex items-start gap-2 rounded-control bg-meta-blue px-3 py-2 text-caption-2 text-meta-on-blue",r),role:"note",children:[t&&a.jsx("span",{className:"shrink-0 pt-0.5 [&>svg]:size-4",children:t}),a.jsx("span",{children:e})]}),h1=({name:e,children:t})=>{const r=({className:n,...o})=>a.jsx("svg",{width:120,height:120,viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":e,className:y("shrink-0",n),...o,children:t});return r.displayName=e,r},tA=h1({name:"Workflows",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"20",y:"24",width:"32",height:"24",rx:"6",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("rect",{x:"68",y:"24",width:"32",height:"24",rx:"6",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("rect",{x:"44",y:"72",width:"32",height:"24",rx:"6",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M52 48v12M68 48v12M52 60h16",stroke:"var(--blue-400)",strokeWidth:"1.5",strokeLinecap:"round"})]})}),rA=h1({name:"Upload",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"28",y:"36",width:"64",height:"48",rx:"8",fill:"var(--grey-100)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("path",{d:"M60 52v20M52 60l8-8 8 8",stroke:"var(--blue-600)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("rect",{x:"36",y:"28",width:"48",height:"8",rx:"4",fill:"var(--grey-200)"})]})}),nA=h1({name:"Processing",children:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"60",cy:"60",r:"28",fill:"var(--blue-50)",stroke:"var(--blue-100)",strokeWidth:"1.5"}),a.jsx("path",{d:"M60 36a24 24 0 0 1 20.78 12",stroke:"var(--blue-600)",strokeWidth:"3",strokeLinecap:"round"}),a.jsx("circle",{cx:"60",cy:"60",r:"4",fill:"var(--blue-600)"})]})}),aA=h1({name:"Invite",children:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"48",cy:"52",r:"16",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("circle",{cx:"76",cy:"52",r:"12",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M64 52h8M68 48v8",stroke:"var(--grey-700)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("rect",{x:"32",y:"76",width:"56",height:"20",rx:"6",fill:"var(--grey-100)",stroke:"var(--grey-200)",strokeWidth:"1.5"})]})}),oA=h1({name:"Creation",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"32",y:"28",width:"56",height:"64",rx:"8",fill:"var(--grey-50)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("path",{d:"M44 48h32M44 60h24M44 72h28",stroke:"var(--grey-300)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("circle",{cx:"84",cy:"36",r:"12",fill:"var(--blue-600)"}),a.jsx("path",{d:"M84 30v12M78 36h12",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]})}),cA=h1({name:"Completed tasks",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"28",y:"32",width:"64",height:"12",rx:"4",fill:"var(--green-100)"}),a.jsx("rect",{x:"28",y:"52",width:"64",height:"12",rx:"4",fill:"var(--green-100)"}),a.jsx("rect",{x:"28",y:"72",width:"48",height:"12",rx:"4",fill:"var(--grey-100)"}),a.jsx("circle",{cx:"36",cy:"38",r:"4",fill:"var(--green-700)"}),a.jsx("circle",{cx:"36",cy:"58",r:"4",fill:"var(--green-700)"}),a.jsx("circle",{cx:"36",cy:"78",r:"4",fill:"var(--grey-300)"}),a.jsx("path",{d:"M34 38l1.5 1.5 3-3M34 58l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),sA=h1({name:"Workflow created",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"24",y:"40",width:"72",height:"40",rx:"8",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M40 60h40M52 48v24",stroke:"var(--blue-400)",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"84",cy:"32",r:"14",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M79 32l3 3 6-6",stroke:"var(--green-700)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),iA=h1({name:"Audit preparation",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"36",y:"24",width:"48",height:"64",rx:"6",fill:"var(--grey-50)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("rect",{x:"44",y:"36",width:"32",height:"4",rx:"2",fill:"var(--orange-50)"}),a.jsx("rect",{x:"44",y:"48",width:"24",height:"4",rx:"2",fill:"var(--grey-200)"}),a.jsx("rect",{x:"44",y:"60",width:"28",height:"4",rx:"2",fill:"var(--grey-200)"}),a.jsx("path",{d:"M28 88h64",stroke:"var(--grey-300)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("path",{d:"M52 76v12M68 76v12",stroke:"var(--grey-400)",strokeWidth:"2",strokeLinecap:"round"})]})}),AA=h1({name:"Port state control",children:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M24 80h72",stroke:"var(--blue-400)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("path",{d:"M36 80V52l24-16 24 16v28",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5",strokeLinejoin:"round"}),a.jsx("rect",{x:"52",y:"60",width:"16",height:"20",rx:"2",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("circle",{cx:"72",cy:"44",r:"8",fill:"var(--orange-50)",stroke:"var(--orange-700)",strokeWidth:"1.5"})]})}),lA=h1({name:"RightShip inspection",children:a.jsxs(a.Fragment,{children:[a.jsx("path",{d:"M30 72c0-16 13.5-28 30-28s30 12 30 28",fill:"var(--blue-50)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("rect",{x:"46",y:"44",width:"28",height:"16",rx:"4",fill:"var(--blue-100)",stroke:"var(--blue-600)",strokeWidth:"1.5"}),a.jsx("path",{d:"M42 72h36",stroke:"var(--grey-400)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("circle",{cx:"78",cy:"36",r:"6",fill:"var(--green-700)"})]})}),uA=h1({name:"Internal audit",children:a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"60",cy:"52",r:"24",fill:"var(--purple-100)",stroke:"var(--purple-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M60 40v16M52 52h16",stroke:"var(--purple-700)",strokeWidth:"2",strokeLinecap:"round"}),a.jsx("rect",{x:"32",y:"80",width:"56",height:"8",rx:"4",fill:"var(--grey-200)"}),a.jsx("rect",{x:"40",y:"72",width:"40",height:"4",rx:"2",fill:"var(--grey-300)"})]})}),dA=h1({name:"Questions done",children:a.jsxs(a.Fragment,{children:[a.jsx("rect",{x:"32",y:"28",width:"56",height:"64",rx:"8",fill:"var(--grey-50)",stroke:"var(--grey-300)",strokeWidth:"1.5"}),a.jsx("circle",{cx:"44",cy:"48",r:"6",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M42 48l1.5 1.5 3-3",stroke:"var(--green-700)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("rect",{x:"56",y:"44",width:"24",height:"4",rx:"2",fill:"var(--grey-200)"}),a.jsx("circle",{cx:"44",cy:"68",r:"6",fill:"var(--green-100)",stroke:"var(--green-700)",strokeWidth:"1.5"}),a.jsx("path",{d:"M42 68l1.5 1.5 3-3",stroke:"var(--green-700)",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("rect",{x:"56",y:"64",width:"20",height:"4",rx:"2",fill:"var(--grey-200)"})]})}),pA={idle:"border-divider-primary bg-white",hover:"border-grey-300 bg-white",disabled:"border-divider-primary bg-grey-50 text-display-on-light-quaternary cursor-not-allowed",edit:"border-accent-on-light bg-white ring-1 ring-accent-on-light"},gA=({label:e,value:t="",placeholder:r,error:n,state:o="idle",onChange:c,disabled:s,className:i,id:l,...u})=>{const d=w.useId(),p=l??d,g=s??o==="disabled",x=g?"disabled":o,C=!!n;return a.jsxs("div",{className:y("flex w-full flex-col gap-1",i),children:[e&&a.jsx("label",{htmlFor:p,className:"text-caption-2-em text-display-on-light-secondary",children:e}),a.jsx("input",{id:p,type:"text",value:t,placeholder:r,disabled:g,"data-state":x,onChange:m=>c==null?void 0:c(m.target.value),className:y("h-10 w-full rounded-control border px-3 text-body text-display-on-light-primary outline-none transition-colors placeholder:text-display-on-light-quaternary","hover:border-grey-300 focus:border-accent-on-light focus:ring-1 focus:ring-accent-on-light","data-[state=hover]:border-grey-300","data-[state=edit]:border-accent-on-light data-[state=edit]:ring-1 data-[state=edit]:ring-accent-on-light","data-[state=disabled]:border-divider-primary data-[state=disabled]:bg-grey-50 data-[state=disabled]:text-display-on-light-quaternary",C&&"border-red-500 ring-1 ring-red-500",!C&&pA[x]),...u}),n&&a.jsx("span",{className:"text-footnote text-red-500",children:n})]})},xA={idle:"border-divider-primary bg-white",hover:"border-grey-300 bg-white",edit:"border-accent-on-light bg-white ring-1 ring-accent-on-light"},CA=({label:e,value:t="",placeholder:r,state:n="idle",onChange:o,disabled:c,className:s,id:i,rows:l=4,...u})=>{const d=w.useId(),p=i??d;return a.jsxs("div",{className:y("flex w-full flex-col gap-1",s),children:[e&&a.jsx("label",{htmlFor:p,className:"text-caption-2-em text-display-on-light-secondary",children:e}),a.jsx("textarea",{id:p,value:t,placeholder:r,disabled:c,rows:l,"data-state":n,onChange:g=>o==null?void 0:o(g.target.value),className:y("min-h-[96px] w-full resize-y rounded-control border px-3 py-2 text-body text-display-on-light-primary outline-none transition-colors placeholder:text-display-on-light-quaternary","hover:border-grey-300 focus:border-accent-on-light focus:ring-1 focus:ring-accent-on-light","data-[state=hover]:border-grey-300","data-[state=edit]:border-accent-on-light data-[state=edit]:ring-1 data-[state=edit]:ring-accent-on-light",c&&"cursor-not-allowed border-divider-primary bg-grey-50 text-display-on-light-quaternary",!c&&xA[n]),...u})]})},mA={text:{on:"On",off:"Off"},binary:{on:"Yes",off:"No"}},jA=({type:e,state:t,onChange:r,disabled:n=!1,className:o})=>{const c=t==="on",{on:s,off:i}=mA[e],l=u=>{n||r==null||r(u)};return a.jsxs("div",{role:"group","aria-label":`${e} input type`,"data-type":e,"data-state":t,className:y("inline-flex rounded-control border border-divider-primary bg-white p-0.5",n&&"opacity-50",o),children:[a.jsx("button",{type:"button",disabled:n,"aria-pressed":!c,onClick:()=>l("off"),className:y("min-w-12 rounded-[6px] px-3 py-1.5 text-caption-2 transition-colors",c?"text-display-on-light-secondary hover:bg-grey-100":"bg-grey-900 text-display-on-dark-primary"),children:i}),a.jsx("button",{type:"button",disabled:n,"aria-pressed":c,onClick:()=>l("on"),className:y("min-w-12 rounded-[6px] px-3 py-1.5 text-caption-2 transition-colors",c?"bg-grey-900 text-display-on-dark-primary":"text-display-on-light-secondary hover:bg-grey-100"),children:s})]})},fA={blue:"bg-meta-blue",green:"bg-meta-green",red:"bg-meta-red",orange:"bg-meta-orange",purple:"bg-meta-purple",grey:"bg-grey-400"},yA=({variant:e,label:t,avatar:r,icon:n,dotColor:o="blue",onRemove:c,className:s})=>a.jsxs("span",{"data-variant":e,className:y("inline-flex h-8 max-w-full items-center gap-1.5 rounded-control border border-divider-primary bg-white px-2 text-caption-2 text-display-on-light-primary",s),children:[e==="avatar"&&r&&a.jsx(S1,{chief:r.chief,initials:r.initials,size:18}),e==="multiple"&&a.jsx(S2,{count:2}),e==="icon"&&n&&a.jsx("span",{className:"shrink-0 text-display-on-light-secondary [&>svg]:size-4",children:n}),e==="dot"&&a.jsx("span",{className:y("size-2 shrink-0 rounded-full",fA[o])}),a.jsx("span",{className:"truncate",children:t}),c&&a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":`Remove ${t}`,onClick:c,className:"size-6 [&>svg]:size-3",children:a.jsx(bt,{size:"xs"})})]}),OA=({checked:e=!1,indeterminate:t=!1,disabled:r=!1,label:n,onChange:o,className:c,id:s,...i})=>{const l=w.useId(),u=s??l,d=w.useRef(null);w.useEffect(()=>{d.current&&(d.current.indeterminate=t)},[t]);const p=e||t;return a.jsxs("label",{htmlFor:u,"data-checked":e,"data-indeterminate":t,"data-disabled":r,className:y("inline-flex cursor-pointer items-center gap-2",r&&"cursor-not-allowed opacity-50",c),children:[a.jsxs("span",{className:"relative inline-flex shrink-0",children:[a.jsx("input",{ref:d,id:u,type:"checkbox",checked:e,disabled:r,onChange:g=>o==null?void 0:o(g.target.checked),className:"peer sr-only",...i}),a.jsxs("span",{"aria-hidden":!0,className:y("flex size-4 items-center justify-center rounded-sm border transition-colors","border-divider-secondary bg-white","peer-hover:border-grey-400 peer-hover:bg-grey-50",p&&"border-blue-600 bg-blue-600","peer-focus-visible:ring-2 peer-focus-visible:ring-accent-on-light peer-focus-visible:ring-offset-1","peer-disabled:border-divider-primary peer-disabled:bg-grey-50"),children:[e&&!t&&a.jsx(Pt,{size:"xs",className:"text-white"}),t&&a.jsx(Vt,{size:"small",className:"text-white"})]})]}),n&&a.jsx("span",{className:"text-body text-display-on-light-primary",children:n})]})},VA=({label:e,state:t="idle",className:r,...n})=>a.jsxs("button",{type:"button",role:"tab","aria-selected":t==="active","data-state":t,className:y("relative inline-flex items-center px-3 py-2 text-caption-2 transition-colors","text-display-on-light-secondary hover:text-display-on-light-primary","data-[state=active]:text-display-on-light-primary data-[state=active]:text-caption-2-em",r),...n,children:[e,t==="active"&&a.jsx("span",{"aria-hidden":!0,className:"absolute inset-x-0 -bottom-px h-0.5 rounded-full bg-grey-900"})]});var Xr="Tabs",[vA]=Ie(Xr,[hr]),oc=hr(),[bA,F2]=vA(Xr),cc=A.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:c,orientation:s="horizontal",dir:i,activationMode:l="automatic",...u}=e,d=r2(i),[p,g]=Hr({prop:n,onChange:o,defaultProp:c??"",caller:Xr});return a.jsx(bA,{scope:r,baseId:ye(),value:p,onValueChange:g,orientation:s,dir:d,activationMode:l,children:a.jsx(g1.div,{dir:d,"data-orientation":s,...u,ref:t})})});cc.displayName=Xr;var sc="TabsList",ic=A.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,c=F2(sc,r),s=oc(r);return a.jsx(Fo,{asChild:!0,...s,orientation:c.orientation,dir:c.dir,loop:n,children:a.jsx(g1.div,{role:"tablist","aria-orientation":c.orientation,...o,ref:t})})});ic.displayName=sc;var Ac="TabsTrigger",lc=A.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...c}=e,s=F2(Ac,r),i=oc(r),l=pc(s.baseId,n),u=gc(s.baseId,n),d=n===s.value;return a.jsx(Do,{asChild:!0,...i,focusable:!o,active:d,children:a.jsx(g1.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...c,ref:t,onMouseDown:E(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:E(e.onKeyDown,p=>{o||p.target!==p.currentTarget||[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:E(e.onFocus,()=>{const p=s.activationMode!=="manual";!d&&!o&&p&&s.onValueChange(n)})})})});lc.displayName=Ac;var uc="TabsContent",dc=A.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:o,children:c,...s}=e,i=F2(uc,r),l=pc(i.baseId,n),u=gc(i.baseId,n),d=n===i.value,p=A.useRef(d);return A.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),a.jsx(ne,{present:o||d,children:({present:g})=>a.jsx(g1.div,{"data-state":d?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&c})})});dc.displayName=uc;function pc(e,t){return`${e}-trigger-${t}`}function gc(e,t){return`${e}-content-${t}`}var IA=cc,xc=ic,Cc=lc,mc=dc;const D2=w.createContext({type:"tabs",appearance:"soft"}),jc=({type:e="tabs",appearance:t="soft",className:r,children:n,...o})=>a.jsx(D2.Provider,{value:{type:e,appearance:t},children:a.jsx(IA,{className:y("flex flex-col",r),"data-type":e,"data-appearance":e==="pills"?t:void 0,...o,children:n})}),G2=w.forwardRef(({className:e,...t},r)=>{const{type:n}=w.useContext(D2);return a.jsx(xc,{ref:r,className:y("flex items-center",n==="tabs"&&"gap-6 border-b border-divider-primary",n==="pills"&&"gap-2",e),...t})});G2.displayName=xc.displayName;const B2=w.forwardRef(({className:e,children:t,...r},n)=>{const{type:o,appearance:c}=w.useContext(D2);return a.jsx(Cc,{ref:n,className:y("inline-flex items-center justify-center gap-2.5 transition-colors outline-none","disabled:pointer-events-none disabled:opacity-50",o==="tabs"&&["relative h-12 gap-2 px-0 py-0 text-caption-2 text-display-on-light-secondary","hover:text-display-on-light-primary","data-[state=active]:text-caption-2-em data-[state=active]:text-display-on-light-primary","data-[state=active]:after:absolute data-[state=active]:after:inset-x-0 data-[state=active]:after:-bottom-px","data-[state=active]:after:h-0.5 data-[state=active]:after:rounded-full data-[state=active]:after:bg-grey-900"],o==="pills"&&c==="soft"&&["min-h-9 rounded-full px-3 py-1 text-caption-2-em","bg-grey-100 text-display-on-light-secondary","hover:bg-grey-200","data-[state=active]:bg-accent-bg-light data-[state=active]:text-display-on-light-primary"],o==="pills"&&c==="solid"&&["min-h-9 rounded-full px-3 py-1 text-caption-2-em","bg-grey-100 text-display-on-light-tertiary","hover:bg-grey-200 hover:text-display-on-light-primary","data-[state=active]:bg-blue-600 data-[state=active]:text-white","data-[state=active]:hover:bg-blue-600"],e),...r,children:t})});B2.displayName=Cc.displayName;const X2=w.forwardRef(({className:e,...t},r)=>a.jsx(mc,{ref:r,className:y("outline-none",e),...t}));X2.displayName=mc.displayName;const PA=({variant:e="standard",title:t,actions:r,className:n})=>a.jsxs("header",{"data-variant":e,className:y("flex w-full items-center justify-between gap-4",e==="standard"&&"border-b border-divider-primary px-6 py-4",e==="nested"&&"px-4 py-3",n),children:[a.jsx("h2",{className:y("text-display-on-light-primary",e==="standard"&&"font-heading text-heading",e==="nested"&&"text-subheader-em"),children:t}),r&&a.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]});function kA({icon:e,title:t,crumbs:r,actions:n,className:o}){const c=!!(r!=null&&r.length);return a.jsxs("div",{"data-variant":c?"nested":"standard",className:y("flex w-full shrink-0 items-center justify-between gap-4","min-h-10",o),children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[e!=null&&a.jsx("span",{className:"inline-flex size-6 shrink-0 items-center justify-center [&>svg]:size-6",children:e}),c?a.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0",children:a.jsxs("ol",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[r.map(s=>a.jsxs("li",{className:"contents",children:[a.jsx("a",{href:s.href,onClick:s.onClick,className:"truncate text-caption-1-em text-display-on-light-secondary transition-colors hover:text-display-on-light-primary",children:s.label}),a.jsx("span",{"aria-hidden":!0,className:"text-caption-1-em text-display-on-light-secondary",children:"/"})]},`${s.href}-${s.label}`)),a.jsx("li",{"aria-current":"page",className:"min-w-0 truncate text-caption-1-em text-display-on-light-primary",children:t})]})}):a.jsx("h1",{className:"min-w-0 truncate text-caption-1-em text-display-on-light-primary",children:t})]}),n!=null&&a.jsx("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}function zA({className:e,...t}){return a.jsx("div",{className:y("flex h-full min-h-0 flex-col",e),...t})}function HA({className:e,...t}){return a.jsx("div",{className:y("min-h-0 flex-1 overflow-y-auto",e),...t})}const MA=Object.assign(kA,{Shell:zA,Body:HA});function KA({className:e,...t}){return a.jsx("div",{className:y("flex min-h-0 flex-1 flex-col gap-2 overflow-hidden rounded-lg bg-grey-100 p-1",e),...t})}function NA({className:e,...t}){return a.jsx("div",{className:y("flex shrink-0 items-start gap-8 pl-10 pr-2 py-1","text-caption-2-em text-display-on-light-secondary",e),...t})}function SA({className:e,...t}){return a.jsx("div",{className:y("flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto rounded bg-grey-50 p-1",e),...t})}const hA=Object.assign(KA,{Header:NA,Body:SA}),qA={chat:a.jsx(It,{className:"size-4"}),issue:a.jsx(Te,{className:"size-4"}),report:a.jsx(Or,{className:"size-4"})},fc=({variant:e,type:t,state:r="idle",title:n="Title",subtitle:o,count:c,trailing:s,icon:i,onClick:l,className:u,meta:d})=>{const p=e??t??"chat",g=typeof l=="function",x=C=>{l&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),l())};return a.jsxs("div",{role:g?"button":void 0,tabIndex:g?0:void 0,"data-variant":p,"data-state":r,onClick:l,onKeyDown:x,className:y("group flex w-full items-center gap-4 rounded-control p-2 text-left transition-colors","hover:bg-[rgba(38,36,32,0.04)]",r==="active"&&"bg-[rgba(38,36,32,0.04)]",g&&"cursor-pointer",u),children:[a.jsx("span",{className:"shrink-0 text-display-on-light-secondary",children:i??qA[p]??a.jsx(Vr,{className:"size-4"})}),a.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsxs("span",{className:"flex min-h-6 w-full items-center gap-4",children:[a.jsx("span",{className:"min-w-0 flex-1 truncate text-caption-1-em text-display-on-light-primary",children:n}),typeof c=="number"&&c>0&&a.jsx("span",{className:"inline-flex min-h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-red-600 px-0.5 text-footnote-em text-white","aria-label":`${c} unread`,children:c>99?"99+":c}),d!=null&&typeof c!="number"&&a.jsx("span",{className:"shrink-0 text-footnote text-display-on-light-quaternary",children:d})]}),o!=null&&o!==!1||s?a.jsxs("span",{className:"flex min-h-6 w-full items-center gap-4",children:[o!=null&&o!==!1?a.jsx("span",{className:"min-w-0 flex-1 truncate text-caption-2 text-display-on-light-secondary",children:o}):a.jsx("span",{className:"min-w-0 flex-1"}),s!=null&&a.jsx("span",{className:"inline-flex size-5 shrink-0 items-center justify-center",onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),children:s})]}):null]})]})},UA=({illustration:e,title:t,description:r,action:n,className:o})=>a.jsxs("div",{className:y("flex max-w-sm flex-col items-center gap-4 px-6 py-10 text-center",o),children:[e&&a.jsx("div",{className:"shrink-0",children:e}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("h3",{className:"text-subheader-em text-display-on-light-primary",children:t}),r&&a.jsx("p",{className:"text-body text-display-on-light-secondary",children:r})]}),n&&a.jsx(Re,{hierarchy:n.hierarchy??"primary",onClick:n.onClick,icon:n.icon,startIcon:n.startIcon,children:n.children})]});var Zr="Dialog",[yc]=Ie(Zr),[wA,B1]=yc(Zr),Oc=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:c,modal:s=!0}=e,i=A.useRef(null),l=A.useRef(null),[u,d]=Hr({prop:n,defaultProp:o??!1,onChange:c,caller:Zr});return a.jsx(wA,{scope:t,triggerRef:i,contentRef:l,contentId:ye(),titleId:ye(),descriptionId:ye(),open:u,onOpenChange:d,onOpenToggle:A.useCallback(()=>d(p=>!p),[d]),modal:s,children:r})};Oc.displayName=Zr;var Vc="DialogTrigger",vc=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(Vc,r),c=O1(t,o.triggerRef);return a.jsx(g1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":E2(o.open),...n,ref:c,onClick:E(e.onClick,o.onOpenToggle)})});vc.displayName=Vc;var Z2="DialogPortal",[TA,bc]=yc(Z2,{forceMount:void 0}),Ic=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,c=B1(Z2,t);return a.jsx(TA,{scope:t,forceMount:r,children:A.Children.map(n,s=>a.jsx(ne,{present:r||c.open,children:a.jsx(b2,{asChild:!0,container:o,children:s})}))})};Ic.displayName=Z2;var dr="DialogOverlay",Y2=A.forwardRef((e,t)=>{const r=bc(dr,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,c=B1(dr,e.__scopeDialog);return c.modal?a.jsx(ne,{present:n||c.open,children:a.jsx(RA,{...o,ref:t})}):null});Y2.displayName=dr;var WA=pt("DialogOverlay.RemoveScroll"),RA=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(dr,r),c=b9(),s=O1(t,c);return a.jsx(Ur,{as:WA,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(g1.div,{"data-state":E2(o.open),...n,ref:s,style:{pointerEvents:"auto",...n.style}})})}),De="DialogContent",L2=A.forwardRef((e,t)=>{const r=bc(De,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,c=B1(De,e.__scopeDialog);return a.jsx(ne,{present:n||c.open,children:c.modal?a.jsx(FA,{...o,ref:t}):a.jsx(DA,{...o,ref:t})})});L2.displayName=De;var FA=A.forwardRef((e,t)=>{const r=B1(De,e.__scopeDialog),n=A.useRef(null),o=O1(t,r.contentRef,n);return A.useEffect(()=>{const c=n.current;if(c)return I2(c)},[]),a.jsx(Pc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:E(e.onCloseAutoFocus,c=>{var s;c.preventDefault(),(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,c=>{const s=c.detail.originalEvent,i=s.button===0&&s.ctrlKey===!0;(s.button===2||i)&&c.preventDefault()}),onFocusOutside:E(e.onFocusOutside,c=>c.preventDefault())})}),DA=A.forwardRef((e,t)=>{const r=B1(De,e.__scopeDialog),n=A.useRef(!1),o=A.useRef(!1);return a.jsx(Pc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,c),c.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),c.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:c=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,c),c.defaultPrevented||(n.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=c.target;((u=r.triggerRef.current)==null?void 0:u.contains(s))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),Pc=A.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:c,...s}=e,i=B1(De,r);return uo(),a.jsx(a.Fragment,{children:a.jsx(o2,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:c,children:a.jsx(a2,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":E2(i.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>i.onOpenChange(!1)})})})}),kc="DialogTitle",J2=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(kc,r);return a.jsx(g1.h2,{id:o.titleId,...n,ref:t})});J2.displayName=kc;var zc="DialogDescription",Q2=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(zc,r);return a.jsx(g1.p,{id:o.descriptionId,...n,ref:t})});Q2.displayName=zc;var Hc="DialogClose",Mc=A.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=B1(Hc,r);return a.jsx(g1.button,{type:"button",...n,ref:t,onClick:E(e.onClick,()=>o.onOpenChange(!1))})});Mc.displayName=Hc;function E2(e){return e?"open":"closed"}const Kc=Oc,GA=vc,BA=Mc,Nc=Ic,_2=w.forwardRef(({className:e,...t},r)=>a.jsx(Y2,{ref:r,className:y("fixed inset-0 z-[999] bg-grey-900/65 transition-opacity","data-[state=open]:animate-in data-[state=open]:fade-in","data-[state=closed]:animate-out data-[state=closed]:fade-out",e),...t}));_2.displayName=Y2.displayName;const $2=w.forwardRef(({className:e,children:t,showOverlay:r=!0,overlayClassName:n,...o},c)=>a.jsxs(Nc,{children:[r&&a.jsx(_2,{className:n}),a.jsx(L2,{ref:c,className:y("fixed left-1/2 top-1/2 z-[999] w-full max-w-xl -translate-x-1/2 -translate-y-1/2","overflow-hidden rounded-xl border border-divider-primary bg-background-primary shadow-raise3","outline-none","data-[state=open]:animate-in data-[state=open]:fade-in-90","data-[state=closed]:animate-out data-[state=closed]:fade-out",e),...o,children:t})]}));$2.displayName=L2.displayName;const e5=w.forwardRef(({className:e,...t},r)=>a.jsx(J2,{ref:r,className:y("text-subheader-em text-display-on-light-primary",e),...t}));e5.displayName=J2.displayName;const t5=w.forwardRef(({className:e,...t},r)=>a.jsx(Q2,{ref:r,className:y("text-caption-2 text-display-on-light-secondary",e),...t}));t5.displayName=Q2.displayName;const XA=({children:e,className:t})=>a.jsx("div",{className:y("shrink-0",t),children:e}),Sc=({children:e,className:t})=>a.jsx("div",{className:y("min-h-0 overflow-auto",t),children:e}),ZA=({onClose:e,right:t,children:r})=>a.jsxs("div",{className:"flex items-center gap-2 rounded-t-xl bg-background-secondary px-2 py-3",children:[a.jsx("div",{className:"grow text-subheader-em text-display-on-light-primary",children:r}),a.jsxs("div",{className:"flex items-center gap-4",children:[t,a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":"Close",onClick:e,children:a.jsx(bt,{size:"small"})})]})]}),YA=({children:e,className:t})=>a.jsx("div",{className:y("w-full overflow-auto",t),children:e}),r5={Header:ZA,Body:YA},hc=(e=100,t=50,r=990,n=10)=>{const[o,c]=w.useState(e);return[o,{...{zoomIn:()=>c(l=>Math.min(l+n,r)),zoomOut:()=>c(l=>Math.max(l-n,t)),reset:()=>c(e),zoomToValue:l=>c(Math.max(t,Math.min(l,r)))},handleWheel:l=>{l.preventDefault();const u=l.deltaY>0?-n:n;c(d=>Math.max(t,Math.min(d+u,r)))}}]},qc=()=>{const[e,t]=w.useState(0);return[e,{rotateClockwise:()=>t(n=>(n+90)%360),rotateCounterClockwise:()=>t(n=>(n-90+360)%360)}]},Uc=()=>{const[e,t]=w.useState({x:0,y:0}),[r,n]=w.useState(!1),[o,c]=w.useState({x:0,y:0});return[{pan:e,isDragging:r},{handleMouseDown:d=>{n(!0),c({x:d.clientX-e.x,y:d.clientY-e.y})},handleMouseMove:d=>{r&&t({x:d.clientX-o.x,y:d.clientY-o.y})},handleMouseUp:()=>{n(!1)},reset:()=>t({x:0,y:0})}]},wc=(e=0,t=1)=>{const[r,n]=w.useState(t),[o,c]=w.useState(e),s={nextPage:w.useCallback(()=>{n(i=>i<o?i+1:i)},[o]),prevPage:w.useCallback(()=>{n(i=>Math.max(i-1,1))},[]),goToPage:w.useCallback(i=>{n(()=>Math.max(1,Math.min(i,o)))},[o]),setTotalPages:w.useCallback(i=>{c(i),n(l=>Math.min(l,i))},[])};return[{currentPage:r,totalPages:o},s]},st="flex h-8 w-8 items-center justify-center rounded-control border border-divider-primary bg-white text-display-on-light-secondary hover:bg-background-secondary disabled:opacity-50",LA=({className:e,canvasClassName:t,mainCanvasClassname:r,initialPage:n=1,onClose:o,totalPages:c,getImageSrc:s,documentUrl:i,title:l="PDF Viewer"})=>{const[u,d]=hc(),[p,g]=qc(),[{pan:x,isDragging:C},m]=Uc(),[{currentPage:f},O]=wc(c,n),[v,I]=w.useState("");w.useEffect(()=>{(async()=>{const z=await s(f);I(z)})()},[f,s]);const V=()=>{i&&window.open(i,"_blank","noopener,noreferrer")};return a.jsxs("div",{className:y("flex h-full flex-col rounded-t-lg shadow-raise2",e),children:[a.jsx(r5.Header,{onClose:o,right:i?a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":"Open",onClick:V,children:a.jsx(yr,{size:"small"})}):void 0,children:l}),a.jsxs("div",{className:y("grid h-full grow overflow-hidden",t),children:[a.jsx("div",{className:y("col-start-1 row-start-1 flex items-center justify-center overflow-hidden bg-background-tertiary p-8",C?"cursor-grabbing":"cursor-grab",r),onMouseDown:m.handleMouseDown,onMouseMove:m.handleMouseMove,onMouseUp:m.handleMouseUp,onMouseLeave:m.handleMouseUp,children:v&&a.jsx("img",{src:v,alt:`Page ${f}`,style:{transform:`translate(${x.x}px, ${x.y}px) rotate(${p}deg) scale(${u/100})`},className:"max-w-full",draggable:!1})}),a.jsxs("div",{className:"z-10 col-start-1 row-start-1 flex items-center justify-between gap-3 self-start bg-background-secondary p-2 shadow",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:st,onClick:O.prevPage,disabled:f===1,"aria-label":"Previous page",children:a.jsx(j1,{direction:"left",size:"small"})}),a.jsx("input",{className:"h-8 w-14 rounded-control border border-divider-primary bg-white text-center text-caption-2",value:f,onChange:P=>{const z=parseInt(P.target.value,10);isNaN(z)||O.goToPage(z)},type:"number",min:1,max:c}),a.jsxs("span",{className:"px-2 text-caption-2",children:["of ",c]}),a.jsx("button",{type:"button",className:st,onClick:O.nextPage,disabled:f===c,"aria-label":"Next page",children:a.jsx(j1,{direction:"right",size:"small"})})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:st,onClick:d.zoomOut,"aria-label":"Zoom out",children:a.jsx(Vt,{size:"small"})}),a.jsxs("span",{className:"w-14 text-center text-caption-2",children:[u,"%"]}),a.jsx("button",{type:"button",className:st,onClick:d.zoomIn,"aria-label":"Zoom in",children:a.jsx(Be,{size:"small"})}),a.jsx("button",{type:"button",className:st,onClick:g.rotateCounterClockwise,"aria-label":"Rotate",children:a.jsx(j1,{direction:"left",size:"small"})})]})]})]})]})};ar.pdfjs.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${ar.pdfjs.version}/build/pdf.worker.min.mjs`;const it="flex h-8 w-8 items-center justify-center rounded-control border border-divider-primary bg-white text-display-on-light-secondary hover:bg-background-secondary disabled:opacity-50",JA=({onClose:e,src:t,title:r="PDF Viewer",className:n,onOpen:o})=>{const[c,s]=hc(),[i,l]=qc(),[{currentPage:u,totalPages:d},p]=wc(),[{pan:g,isDragging:x},C]=Uc(),[m,f]=w.useState(1),O=w.useRef(null);w.useEffect(()=>{const V=()=>{if(!O.current)return;const z=O.current.offsetWidth/612;f(z*(c/100))};return V(),window.addEventListener("resize",V),()=>window.removeEventListener("resize",V)},[c]);const v=V=>{if(o==null||o(V),V.defaultPrevented||!t){V.preventDefault();return}window.open(t,"_blank","noopener,noreferrer")},I=a.jsx(k1,{hierarchy:"quaternary",size:"small","aria-label":"Open in new tab",onClick:v,children:a.jsx(yr,{size:"small"})});return a.jsxs("div",{className:y("flex h-full flex-col rounded-t-lg shadow-raise2",n),ref:O,children:[a.jsx(r5.Header,{onClose:e,right:I,children:r}),a.jsxs("div",{className:"grid h-full grow overflow-hidden shadow",children:[a.jsx("div",{className:y("col-start-1 row-start-1 mt-8 flex h-full items-center justify-center overflow-hidden bg-background-tertiary p-8 select-none",x?"cursor-grabbing":"cursor-grab"),onMouseDown:C.handleMouseDown,onMouseMove:C.handleMouseMove,onMouseUp:C.handleMouseUp,onMouseLeave:C.handleMouseUp,style:{userSelect:"none"},children:a.jsx("div",{style:{transform:`translate(${g.x}px, ${g.y}px)`,transition:x?"none":"transform 0.1s",pointerEvents:"none",maxWidth:"650px"},children:a.jsx(ar.Document,{externalLinkRel:"noopener noreferrer",externalLinkTarget:"_blank",file:t,onLoadSuccess:({numPages:V})=>p.setTotalPages(V),scale:m,rotate:i,children:a.jsx(ar.Page,{pageNumber:u,renderTextLayer:!0,renderAnnotationLayer:!0})})})}),a.jsxs("div",{className:"z-10 col-start-1 row-start-1 flex w-full flex-wrap items-center justify-between gap-3 self-start bg-background-secondary p-2 shadow",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:it,onClick:p.prevPage,disabled:u===1,"aria-label":"Previous page",children:a.jsx(j1,{direction:"left",size:"small"})}),a.jsx("input",{className:"h-8 w-14 rounded-control border border-divider-primary bg-white px-1 py-1 text-center text-caption-2 text-display-on-light-primary",value:u,onChange:V=>{const P=parseInt(V.target.value,10);isNaN(P)||p.goToPage(P)},type:"number",min:"1",max:d}),a.jsxs("span",{className:"px-2 text-caption-2 text-display-on-light-secondary",children:["of ",d]}),a.jsx("button",{type:"button",className:it,onClick:p.nextPage,disabled:u===d,"aria-label":"Next page",children:a.jsx(j1,{direction:"right",size:"small"})})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",className:it,onClick:s.zoomOut,"aria-label":"Zoom out",children:a.jsx(Vt,{size:"small"})}),a.jsxs("button",{type:"button",className:"h-8 w-14 rounded-control border border-divider-primary bg-white text-center text-caption-2 text-display-on-light-primary hover:bg-background-secondary",onClick:()=>{s.reset(),C.reset()},children:[c,"%"]}),a.jsx("button",{type:"button",className:it,onClick:s.zoomIn,"aria-label":"Zoom in",children:a.jsx(Be,{size:"small"})})]}),a.jsx("div",{className:"h-6 w-px bg-divider-primary"}),a.jsx("button",{type:"button",className:it,onClick:l.rotateCounterClockwise,"aria-label":"Rotate counter-clockwise",children:a.jsx(j1,{direction:"left",size:"small"})})]})]})]})]})};class QA{constructor(t={}){tt(this,"checkboxData");tt(this,"schema");tt(this,"finalGeneration");tt(this,"name","CheckboxModule");this.checkboxData=t.checkboxData||{},this.schema=t.schema,this.finalGeneration=t.finalGeneration||!1}parse(t){return null}postparse(t){return t}render(t,r){return t}postrender(t,r){return!!(r&&r.contentType&&r.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")?(()=>{try{const o=t.map(s=>{const i=typeof s=="string",l=s&&typeof s=="object"&&s.value,u=()=>i&&s,d=()=>!i&&l&&s.value,p=()=>!i&&!l&&String(s);return u()||d()||p()}).join("");return[this.processCheckboxPatterns(o)]}catch{return t}})():t}processCheckboxPatterns(t){try{const r=/<w:bookmarkStart[^>]*w:name="(Check\d+)"[^>]*\/>/gi;r.lastIndex=0;const n=[];let o;for(;(o=r.exec(t))!==null;)n.push(o[1]);return n.length>0?(()=>{const s=()=>(n.forEach(d=>{const g=this.getCheckboxState(d)?"1":"0",x=new RegExp(`(<w:fldChar w:fldCharType="begin">.*?<w:name w:val="${d}".*?<w:default w:val=")([01])(".*?</w:fldChar>)`,"gs");t=t.replace(x,`$1${g}$3`)}),t),i=()=>(r.lastIndex=0,t.replace(r,(d,p)=>{try{return`<w:r><w:t>${`|||${this.getCheckboxState(p)?"☑":"☐"}|||checkbox:${p}|||`}</w:t></w:r><w:bookmarkStart w:name="${p}" w:id="0"/>`}catch{return d}})),l=()=>this.finalGeneration&&s(),u=()=>!this.finalGeneration&&i();return l()||u()})():t}catch{return t}}getCheckboxState(t){const r=!!this.schema,n=()=>!r&&(this.checkboxData[t]||!1),o=()=>r&&(()=>{const c=Object.entries(this.schema.properties||{}).find(([s,i])=>{const u=i.docx_mapping,d=u&&u.type==="checkbox",p=u&&u.type==="radio"&&u.mapping,g=d&&u.name===t,x=d&&u.true_name===t,C=d&&u.false_name===t,m=p&&u.mapping.find(f=>f.name===t);return g||x||C||!!m});return c?(()=>{const[s,i]=c,u=i.docx_mapping,d=u&&u.type==="checkbox"&&u.name===t,p=u&&u.type==="checkbox"&&u.true_name===t,g=u&&u.type==="checkbox"&&u.false_name===t,x=u&&u.type==="radio"&&u.mapping&&u.mapping.find(O=>O.name===t),C=()=>(d||p)&&this.checkboxData[s]===!0,m=()=>g&&this.checkboxData[s]===!1,f=()=>x&&this.checkboxData[s]===x.value;return C()||m()||f()||!1})():this.checkboxData[t]||!1})();return n()||o()||!1}updateCheckboxData(t){this.checkboxData={...this.checkboxData,...t}}}let P1={},la={};const EA=({docxUrl:e,schema:t,onDataChange:r,initialData:n,onSaveRef:o,readonly:c=!1})=>{const[s,i]=w.useState([]),[l,u]=w.useState(!0),[d,p]=w.useState(null),[g,x]=w.useState(0),C=w.useRef(null),m=w.useCallback(k=>{const b=/\{([^}]+)\}/g,K=[];let U;for(;(U=b.exec(k))!==null;)K.push(U[1]);return[...new Set(K)]},[]),f=w.useCallback((k,b)=>{P1={...P1,[k]:b},I(k,b),r==null||r(P1)},[r]),O=w.useCallback((k,b)=>{!Object.entries(t.properties||{}).find(([U,D])=>{var e1;const L=D.docx_mapping,s1=(L==null?void 0:L.type)==="checkbox"&&L.name===k;s1&&f(U,b);const c1=(L==null?void 0:L.type)==="checkbox"&&L.true_name===k,_=(L==null?void 0:L.type)==="checkbox"&&L.false_name===k;c1&&f(U,b),_&&f(U,!b);const J=(L==null?void 0:L.type)==="radio"&&((e1=L.mapping)==null?void 0:e1.find(i1=>i1.name===k));return J&&f(U,J.value),s1||c1||_||!!J})&&f(k,b)},[f,t]),v=w.useCallback((k,b)=>{const K=la[k];return!(b===K||b===""&&K==null||K===""&&b==null)},[]),I=w.useCallback((k,b)=>{const K=!!C.current,U=v(k,b);K&&C.current.querySelectorAll(`[data-field-path="${k}"]`).forEach(r1=>{const L=U?"field-edited":"field-original",s1=U?"field-original":"field-edited";r1.classList.remove(s1),r1.classList.add(L)})},[v]),V=w.useCallback(()=>{!!C.current&&Object.entries(P1).forEach(([b,K])=>{I(b,K)})},[I]),P=w.useCallback(async()=>{r==null||r(P1),x(k=>k+1)},[r]);w.useEffect(()=>{o&&(o.current=P)},[P,o]);const z=w.useCallback(async k=>{try{const K=await(await fetch(e)).arrayBuffer(),U=new O5(K),D={};Object.entries(k).forEach(([_,J])=>{(typeof J=="boolean"||J==="true"||J==="false")&&(D[_]=J===!0||J==="true")});const r1=new y5(U,{paragraphLoop:!0,linebreaks:!0,nullGetter:_=>`||| |||${_.value||"unknown_field"}|||`,modules:[new QA({checkboxData:D,schema:t,finalGeneration:!1})]}),L={},s1="__NEWLINE__";return Object.entries(k).forEach(([_,J])=>{if(J!=null&&J!==""){let e1=J;typeof J=="string"&&(e1=J.replace(/\n/g,s1)),L[_]=`|||${e1}|||${_}|||`}else L[_]=null}),r1.render(L),r1.getZip().generate({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}catch(b){throw console.error("Error processing document:",b),new Error(b instanceof Error?b.message:"Failed to process document")}},[e,t]),H=w.useCallback((k,b,K,U)=>{const D=document.createElement("span");D.className="inline-field-container",D.setAttribute("data-field-path",k);const r1=c,L=b||P1[k]||"",s1=()=>{const d1=K.type==="boolean"?(()=>{const $=document.createElement("span");return $.textContent=L==="true"||P1[k]===!0?"☑":"☐",$.className="inline-checkbox-readonly",$})():(()=>{const $="__NEWLINE__",f1=String(L).replace(new RegExp($,"g"),`
|
|
81
81
|
`),y1=document.createElement("span");return y1.textContent=f1,y1.className="inline-field-readonly",y1.style.whiteSpace="pre-wrap",y1})();return D.appendChild(d1),D},c1=()=>{const Q=document.createElement("input");return Q.type="checkbox",Q.checked=b==="true"||P1[k]===!0,Q.className="inline-checkbox rounded border-gray-300 text-green-600 focus:ring-green-500",Q.setAttribute("data-field-path",k),Q.addEventListener("change",d1=>{f(k,d1.target.checked)}),D.appendChild(Q),D},_=()=>{const Q=document.createElement("select");Q.className="inline-select border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-500",Q.setAttribute("data-field-path",k);const d1=document.createElement("option");return d1.value="",d1.textContent="Select...",Q.appendChild(d1),K.enum.forEach($=>{const f1=document.createElement("option");f1.value=String($),f1.textContent=String($),f1.selected=b===$||P1[k]===$,Q.appendChild(f1)}),Q.addEventListener("change",$=>{f(k,$.target.value)}),D.appendChild(Q),D},J=()=>{const Q=document.createElement("input");return Q.type=K.format==="date"?"date":"datetime-local",Q.value=String(b||P1[k]||""),Q.className="inline-date-input text-sm focus:outline-none",Q.setAttribute("data-field-path",k),Q.style.width="100%",Q.style.maxWidth="200px",Q.placeholder=String(K.description||k),Q.addEventListener("input",d1=>{f(k,d1.target.value)}),D.appendChild(Q),D},e1=()=>{const Q="__NEWLINE__",d1=String(b||P1[k]||"").replace(new RegExp(Q,"g"),`
|
|
82
82
|
`),$=document.createElement("textarea");$.value=d1,$.className="inline-textarea text-sm focus:outline-none resize-none",$.setAttribute("data-field-path",k),$.style.width="100%",$.style.minHeight="17px",$.style.overflow="hidden",$.placeholder=String(K.description||k),$.rows=1;const f1=()=>{$.style.height="auto";const y1=$.value.includes(`
|
|
83
83
|
`)||$.scrollHeight>25;$.style.height=y1?Math.max(17,$.scrollHeight)+"px":"17px"};return $.addEventListener("input",y1=>{f(k,y1.target.value),f1()}),setTimeout(f1,0),D.appendChild($),D},i1=()=>r1&&s1(),v1=()=>!r1&&K.type==="boolean"&&c1(),V1=()=>!r1&&K.enum&&_(),l1=()=>!r1&&(K.format==="date"||K.format==="date-time")&&J();return i1()||v1()||V1()||l1()||e1()},[f,c]),h=w.useCallback((k,b)=>{const K=document.createTreeWalker(k,NodeFilter.SHOW_TEXT,null,!1),U=[];let D;for(;D=K.nextNode();)U.push(D);U.forEach(r1=>{const L=!!r1.textContent,s1=/\|\|\|([^|]*)\|\|\|([^|]+)\|\|\|/g,c1=r1.textContent||"",_=s1.test(c1),J=r1.parentNode;L&&_&&J&&(()=>{let e1=0;const i1=document.createDocumentFragment();r1.textContent.replace(s1,(v1,V1,l1,Q)=>{Q>e1&&i1.appendChild(document.createTextNode(c1.slice(e1,Q)));const y1=l1.startsWith("checkbox:")?(()=>{const u1=l1.replace("checkbox:",""),q1=Object.entries(t.properties||{}).find(([b1,H1])=>{const W1=H1.docx_mapping;return(W1==null?void 0:W1.type)==="checkbox"&&W1.true_name&&W1.false_name&&(W1.true_name===u1||W1.false_name===u1)}),[wt,Qe]=q1||[],Ee=Qe,_e=Ee==null?void 0:Ee.docx_mapping,$e=!!q1,et=(_e==null?void 0:_e.true_name)===u1,Tt=()=>{const b1=document.createElement("span");return b1.textContent=V1,b1.className="inline-checkbox-readonly",b1},Jr=()=>{const b1=document.createElement("span");b1.className="inline-radio-container";const H1=document.createElement("input");H1.type="radio",H1.name=`radio-group-${wt}`,H1.value=et?"true":"false";const Ce=b[wt];return H1.checked=et?Ce===!0||Ce==="true":Ce===!1||Ce==="false",H1.className="text-green-600 focus:ring-green-500 border-gray-300",H1.setAttribute("data-field-path",u1),H1.addEventListener("change",W1=>{W1.target.checked&&O(u1,!0)}),b1.appendChild(H1),b1},Wt=()=>{const b1=document.createElement("input");return b1.type="checkbox",b1.checked=V1==="☑",b1.className="inline-checkbox rounded border-gray-300 text-green-600 focus:ring-green-500",b1.setAttribute("data-field-path",u1),b1.addEventListener("change",H1=>{O(u1,H1.target.checked)}),b1},Rt=()=>c&&Tt(),Qr=()=>!c&&$e&&Jr(),Er=()=>!c&&!$e&&Wt();return Rt()||Qr()||Er()})():(()=>{var q1;const u1=((q1=t.properties)==null?void 0:q1[l1])||{};return H(l1,V1,u1,b)})();return i1.appendChild(y1),e1=Q+v1.length,v1}),e1<c1.length&&i1.appendChild(document.createTextNode(c1.slice(e1))),J.replaceChild(i1,r1)})()})},[t,H,O,c]),S=w.useCallback(async k=>{!!C.current&&await(async()=>{try{const K=await z(k);for(;C.current.firstChild;)C.current.removeChild(C.current.firstChild);await d8.renderAsync(K,C.current,void 0,{className:"docx-preview",inWrapper:!0,hideWrapperOnPrint:!0,ignoreWidth:!1,ignoreHeight:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!0,trimXmlDeclaration:!0,renderHeaders:!1,renderFooters:!1,renderFootnotes:!0,renderEndnotes:!0,ignoreLastRenderedPageBreak:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1}),setTimeout(()=>{!!C.current&&(h(C.current,k),V())},100)}catch(K){console.error("Error updating preview:",K),!!C.current&&(()=>{for(;C.current.firstChild;)C.current.removeChild(C.current.firstChild);const D=document.createElement("div");D.className="p-4 text-red-600",D.textContent=`Error updating preview: ${K instanceof Error?K.message:"Unknown error"}`,C.current.appendChild(D)})()}})()},[z,h,V]),N=w.useCallback(async()=>{try{u(!0);const b=await(await fetch(e)).arrayBuffer(),K=new O5(b),D=new y5(K).getFullText(),r1=m(D);i(r1);const L={};r1.forEach(c1=>{var l1;const _=(l1=t.properties)==null?void 0:l1[c1],J=!!_,e1=()=>J&&_.type==="boolean"&&!1,i1=()=>J&&_.type==="string"&&_.format==="date"&&"",v1=()=>J&&_.type!=="boolean"&&!(_.type==="string"&&_.format==="date")&&"",V1=()=>!J&&"";L[c1]=e1()||i1()||v1()||""});const s1={...L,...n};P1=s1,la={...s1},p(null)}catch(k){p(`Failed to load document: ${k instanceof Error?k.message:"Unknown error"}`)}finally{u(!1)}},[e,t,m,n]);w.useEffect(()=>{N()},[N]),w.useEffect(()=>{!l&&Object.keys(P1).length>0&&!!C.current&&S(P1)},[l,S]),w.useEffect(()=>{g>0&&!!C.current&&S(P1)},[g,S]);const R=()=>a.jsx("div",{className:"flex items-center justify-center p-8",children:a.jsx("div",{className:"text-body",children:"Loading document..."})}),B=()=>a.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:[a.jsx("div",{className:"text-red-800 text-body-em",children:"Error"}),a.jsx("div",{className:"text-red-700 text-body mt-1",children:d})]}),F=l,G=!l&&!!d,t1=()=>F&&a.jsx(R,{}),X=()=>G&&a.jsx(B,{}),Y=()=>!F&&!G&&a.jsxs("div",{children:[a.jsx("style",{children:`
|
package/dist/index.esm.js
CHANGED
|
@@ -9099,7 +9099,7 @@ const Jd = F3, kt = ({
|
|
|
9099
9099
|
disabled: r = !1,
|
|
9100
9100
|
className: n,
|
|
9101
9101
|
...o
|
|
9102
|
-
}) => /* @__PURE__ */ a.
|
|
9102
|
+
}) => /* @__PURE__ */ a.jsxs(
|
|
9103
9103
|
"button",
|
|
9104
9104
|
{
|
|
9105
9105
|
type: "button",
|
|
@@ -9110,21 +9110,33 @@ const Jd = F3, kt = ({
|
|
|
9110
9110
|
c.stopPropagation(), t(!e);
|
|
9111
9111
|
},
|
|
9112
9112
|
className: y(
|
|
9113
|
-
"relative inline-flex h-
|
|
9113
|
+
"relative inline-flex h-6 w-9 shrink-0 items-center",
|
|
9114
9114
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
9115
|
-
e ? "bg-grey-900" : "bg-grey-200",
|
|
9116
9115
|
n
|
|
9117
9116
|
),
|
|
9118
9117
|
...o,
|
|
9119
|
-
children:
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
"
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9118
|
+
children: [
|
|
9119
|
+
/* @__PURE__ */ a.jsx(
|
|
9120
|
+
"span",
|
|
9121
|
+
{
|
|
9122
|
+
"aria-hidden": !0,
|
|
9123
|
+
className: y(
|
|
9124
|
+
"pointer-events-none absolute inset-x-0 top-1/2 h-4 -translate-y-1/2 rounded-full transition-colors",
|
|
9125
|
+
e ? "bg-grey-900" : "bg-grey-400"
|
|
9126
|
+
)
|
|
9127
|
+
}
|
|
9128
|
+
),
|
|
9129
|
+
/* @__PURE__ */ a.jsx(
|
|
9130
|
+
"span",
|
|
9131
|
+
{
|
|
9132
|
+
"aria-hidden": !0,
|
|
9133
|
+
className: y(
|
|
9134
|
+
"relative inline-block size-6 rounded-full border border-solid shadow-raise2 transition-[transform,border-color,background-color]",
|
|
9135
|
+
e ? "translate-x-3 border-grey-900 bg-white" : "translate-x-0 border-grey-400 bg-grey-50"
|
|
9136
|
+
)
|
|
9137
|
+
}
|
|
9138
|
+
)
|
|
9139
|
+
]
|
|
9128
9140
|
}
|
|
9129
9141
|
), L3 = {
|
|
9130
9142
|
blue: "bg-meta-blue text-meta-onBlue",
|
|
@@ -6,6 +6,7 @@ export type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChang
|
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* On/off control — Figma Switch (3068:65681).
|
|
9
|
-
*
|
|
9
|
+
* Track: 36×16 (grey-400 off / grey-900 on). Thumb: 24×24 white (grey-50 off),
|
|
10
|
+
* 1px border matching track, Raise-2 shadow. Off left / on right, edges flush.
|
|
10
11
|
*/
|
|
11
12
|
export declare const Switch: ({ checked, onChange, disabled, className, ...props }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@ export type SwitchProps = Omit<
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* On/off control — Figma Switch (3068:65681).
|
|
15
|
-
*
|
|
15
|
+
* Track: 36×16 (grey-400 off / grey-900 on). Thumb: 24×24 white (grey-50 off),
|
|
16
|
+
* 1px border matching track, Raise-2 shadow. Off left / on right, edges flush.
|
|
16
17
|
*/
|
|
17
18
|
export const Switch = ({
|
|
18
19
|
checked,
|
|
@@ -31,17 +32,26 @@ export const Switch = ({
|
|
|
31
32
|
onChange(!checked);
|
|
32
33
|
}}
|
|
33
34
|
className={cn(
|
|
34
|
-
"relative inline-flex h-
|
|
35
|
+
"relative inline-flex h-6 w-9 shrink-0 items-center",
|
|
35
36
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
36
|
-
checked ? "bg-grey-900" : "bg-grey-200",
|
|
37
37
|
className,
|
|
38
38
|
)}
|
|
39
39
|
{...props}
|
|
40
40
|
>
|
|
41
41
|
<span
|
|
42
|
+
aria-hidden
|
|
42
43
|
className={cn(
|
|
43
|
-
"
|
|
44
|
-
checked ? "
|
|
44
|
+
"pointer-events-none absolute inset-x-0 top-1/2 h-4 -translate-y-1/2 rounded-full transition-colors",
|
|
45
|
+
checked ? "bg-grey-900" : "bg-grey-400",
|
|
46
|
+
)}
|
|
47
|
+
/>
|
|
48
|
+
<span
|
|
49
|
+
aria-hidden
|
|
50
|
+
className={cn(
|
|
51
|
+
"relative inline-block size-6 rounded-full border border-solid shadow-raise2 transition-[transform,border-color,background-color]",
|
|
52
|
+
checked
|
|
53
|
+
? "translate-x-3 border-grey-900 bg-white"
|
|
54
|
+
: "translate-x-0 border-grey-400 bg-grey-50",
|
|
45
55
|
)}
|
|
46
56
|
/>
|
|
47
57
|
</button>
|