goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
4 lines • 2.61 MB
JavaScript
'use client';
(function(ze,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],I):(ze=typeof globalThis<"u"?globalThis:ze||self,I(ze.GoobsFrontend={},ze.React,ze.ReactJSXRuntime,ze.ReactDOM))})(this,function(ze,I,s,il){Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"});var mx=Object.create,zg=Object.defineProperty,_x=Object.getOwnPropertyDescriptor,vx=Object.getOwnPropertyNames,bx=Object.getPrototypeOf,Sx=Object.prototype.hasOwnProperty,sa=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(a){throw r=[a],a}},K=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Gg=(e,t)=>{let r={};for(var a in e)zg(r,a,{get:e[a],enumerable:!0});return t||zg(r,Symbol.toStringTag,{value:"Module"}),r},Ex=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var n=vx(t),i=0,o=n.length,l;i<o;i++)l=n[i],!Sx.call(e,l)&&l!==r&&zg(e,l,{get:(c=>t[c]).bind(null,l),enumerable:!(a=_x(t,l))||a.enumerable});return e},$o=(e,t,r)=>(r=e!=null?mx(bx(e)):{},Ex(t||!e||!e.__esModule?zg(r,"default",{value:e,enumerable:!0}):r,e));I=$o(I,1),il=$o(il,1);var Cx="_button_s5151_11",wx="_selected_s5151_78",Tx="_iconAbove_s5151_95",Nx="_iconWrapper_s5151_106",Rx="_buttonGroup_s5151_227",cu={button:Cx,selected:wx,iconAbove:Tx,iconWrapper:Nx,buttonGroup:Rx};function Na(e){if(!(typeof window>"u"))try{window.__diag?.push?.(e)}catch{}}var i1=({value:e,exclusive:t,onChange:r,children:a,styles:n})=>{const i=n?.theme||"sacred",o=I.default.Children.map(a,l=>{if(I.default.isValidElement(l)){const c=(l.props.value||"")===e;return I.default.cloneElement(l,{...l.props,styles:{...l.props.styles,...n,theme:i},onClick:d=>{t&&r(d,l.props.value||""),l.props.onClick&&l.props.onClick(d)},selected:c})}return l});return(0,s.jsx)("div",{className:cu.buttonGroup,"data-theme":i,children:o})};function Ix(e){return e?e==="destructive"?{backgroundColor:"rgba(220, 53, 69, 0.15)",borderColor:"rgba(220, 53, 69, 0.5)",color:"#FF6B6B",hoverBackgroundColor:"rgba(220, 53, 69, 0.25)"}:e==="secondary"?{backgroundColor:"rgba(255, 255, 255, 0.05)",borderColor:"rgba(255, 255, 255, 0.2)",color:"rgba(255, 255, 255, 0.85)",hoverBackgroundColor:"rgba(255, 255, 255, 0.1)"}:{backgroundColor:"rgba(255, 215, 0, 0.15)",borderColor:"rgba(255, 215, 0, 0.5)",color:"#FFD700",hoverBackgroundColor:"rgba(255, 215, 0, 0.25)"}:{}}var zr=(0,I.forwardRef)(({text:e,icon:t,styles:r,onClick:a,selected:n,action:i,subject:o,variant:l,...c},d)=>{const A=(0,I.useMemo)(()=>{const{sacredtheme:R,...T}=c;return T},[c]);r=l?{...Ix(l),...r}:r;const g=r?.disabled||A.disabled,p=r?.iconLocation||"left",u=r?.theme||"sacred",v=(0,I.useCallback)(R=>{g||(Na({type:"action.invoke",action:i??"click",...o!==void 0&&{subject:o}}),a&&a(R))},[g,a,i,o]),_=r?.outline===!0?"1px solid currentcolor":r?.outline===!1?"none":r?.outline||void 0,f={};r?.width&&(f.width=r.width),r?.minWidth&&(f.minWidth=r.minWidth),r?.maxWidth&&(f.maxWidth=r.maxWidth),r?.height&&(f.height=r.height),r?.minHeight&&(f.minHeight=r.minHeight),r?.padding&&(f.padding=r.padding),r?.margin&&(f.margin=r.margin),r?.marginTop&&(f.marginTop=r.marginTop),r?.marginBottom&&(f.marginBottom=r.marginBottom),r?.marginLeft&&(f.marginLeft=r.marginLeft),r?.marginRight&&(f.marginRight=r.marginRight),r?.fontSize&&(f.fontSize=r.fontSize),r?.fontWeight&&(f.fontWeight=r.fontWeight),r?.fontFamily&&(f.fontFamily=r.fontFamily),r?.letterSpacing&&(f.letterSpacing=r.letterSpacing),r?.textTransform&&(f.textTransform=r.textTransform),r?.whiteSpace&&(f.whiteSpace=r.whiteSpace),r?.color&&(f.color=r.color),r?.backgroundColor&&(f.backgroundColor=r.backgroundColor),r?.background&&(f.background=r.background),r?.border&&(f.border=r.border),r?.borderWidth&&(f.borderWidth=r.borderWidth),r?.borderColor&&(f.borderColor=r.borderColor),r?.borderRadius&&(f.borderRadius=r.borderRadius),r?.borderRightWidth&&(f.borderRightWidth=r.borderRightWidth),r?.borderRightStyle&&(f.borderRightStyle=r.borderRightStyle),r?.borderRightColor&&(f.borderRightColor=r.borderRightColor),r?.boxShadow&&(f.boxShadow=r.boxShadow),r?.textShadow&&(f.textShadow=r.textShadow),_&&(f.outline=_),r?.hoverBackgroundColor&&(f["--btn-hover-bg"]=r.hoverBackgroundColor),r?.hoverBorderColor&&(f["--btn-hover-border"]=r.hoverBorderColor),r?.hoverBoxShadow&&(f["--btn-hover-shadow"]=r.hoverBoxShadow),r?.hoverTransform&&(f["--btn-hover-transform"]=r.hoverTransform),r?.flex&&(f.flex=r.flex),r?.opacity!==void 0&&(f.opacity=r.opacity),r?.cursor&&(f.cursor=r.cursor),r?.display&&(f.display=r.display),r?.position&&(f.position=r.position),r?.textAlign&&(f.textAlign=r.textAlign),r?.verticalAlign&&(f.verticalAlign=r.verticalAlign),r?.alignSelf&&(f.alignSelf=r.alignSelf),r?.alignItems&&(f.alignItems=r.alignItems),r?.justifyContent&&(f.justifyContent=r.justifyContent),r?.flexDirection&&(f.flexDirection=r.flexDirection),r?.flexShrink!==void 0&&(f.flexShrink=r.flexShrink),r?.flexGrow!==void 0&&(f.flexGrow=r.flexGrow),r?.flexBasis!==void 0&&(f.flexBasis=r.flexBasis),r?.flexWrap&&(f.flexWrap=r.flexWrap),r?.gap!==void 0&&(f.gap=r.gap),r?.rowGap!==void 0&&(f.rowGap=r.rowGap),r?.columnGap!==void 0&&(f.columnGap=r.columnGap),r?.transition&&(f.transition=r.transition),r?.transform&&(f.transform=r.transform),r?.zIndex!==void 0&&(f.zIndex=r.zIndex),r?.top!==void 0&&(f.top=r.top),r?.right!==void 0&&(f.right=r.right),r?.bottom!==void 0&&(f.bottom=r.bottom),r?.left!==void 0&&(f.left=r.left),r?.overflow&&(f.overflow=r.overflow),r?.overflowX&&(f.overflowX=r.overflowX),r?.overflowY&&(f.overflowY=r.overflowY),r?.textOverflow&&(f.textOverflow=r.textOverflow),r?.lineHeight!==void 0&&(f.lineHeight=r.lineHeight),r?.borderStyle&&(f.borderStyle=r.borderStyle),r?.borderTop&&(f.borderTop=r.borderTop),r?.borderBottom&&(f.borderBottom=r.borderBottom),r?.borderLeft&&(f.borderLeft=r.borderLeft),r?.borderRight&&(f.borderRight=r.borderRight),r?.pointerEvents&&(f.pointerEvents=r.pointerEvents),r?.userSelect&&(f.userSelect=r.userSelect),r?.visibility&&(f.visibility=r.visibility),r?.textDecoration&&(f.textDecoration=r.textDecoration),r?.textIndent!==void 0&&(f.textIndent=r.textIndent),r?.wordBreak&&(f.wordBreak=r.wordBreak),r?.wordSpacing!==void 0&&(f.wordSpacing=r.wordSpacing),r?.fontStyle&&(f.fontStyle=r.fontStyle);const h=[cu.button];p==="above"&&h.push(cu.iconAbove),n&&h.push(cu.selected);const E=(0,I.useMemo)(()=>t?(0,s.jsx)("span",{className:cu.iconWrapper,children:t}):null,[t]);return(0,s.jsxs)("button",{ref:d,className:h.join(" "),"data-component":"Button","data-theme":u,"data-action":i,"data-subject":o,"data-variant":l,style:f,disabled:g,onClick:v,...A,children:[p==="above"&&E,p==="left"&&E,e&&(0,s.jsx)("span",{children:e}),p==="right"&&E]})});zr.displayName="Button";var xx="_spinner_r9khf_8",Ox="_saveButtonSpin_r9khf_1",Bx={spinner:xx,saveButtonSpin:Ox},yx=()=>(0,s.jsx)("span",{className:Bx.spinner,"aria-hidden":"true","data-save-spinner":"true"}),o1=({valid:e,pending:t,onSave:r,label:a="Save",pendingLabel:n="Saving…",subject:i,styles:o,...l})=>{const c=!e||t,d={...o,disabled:c};return(0,s.jsx)(zr,{action:"save",variant:"primary",text:t?n:a,...t&&{icon:(0,s.jsx)(yx,{})},disabled:c,onClick:r,styles:d,"data-save-button":"true",...t&&{"data-save-pending":"true"},...i!==void 0&&{subject:i},...l})};o1.displayName="SaveButton";var Vg=(0,I.forwardRef)(({size:e="medium",color:t="default",children:r,styles:a,...n},i)=>{const o={xsmall:{width:"20px",height:"20px",padding:"2px"},small:{width:"32px",height:"32px",padding:"4px"},medium:{width:"40px",height:"40px",padding:"8px"},large:{width:"48px",height:"48px",padding:"12px"}},l=a?.theme==="dark",c=a?.theme==="sacred"?{primary:{backgroundColor:"transparent",color:"#FFD700"},secondary:{backgroundColor:"transparent",color:"#FFD700"},success:{backgroundColor:"transparent",color:"#10B981"},error:{backgroundColor:"transparent",color:"#EF4444"},info:{backgroundColor:"transparent",color:"#3B82F6"},warning:{backgroundColor:"transparent",color:"#F59E0B"},default:{backgroundColor:"transparent",color:"#FFD700"}}:{primary:{backgroundColor:"#1976d2",color:"white"},secondary:{backgroundColor:"#9c27b0",color:"white"},success:{backgroundColor:"#2e7d32",color:"white"},error:{backgroundColor:"#d32f2f",color:"white"},info:{backgroundColor:"#0288d1",color:"white"},warning:{backgroundColor:"#ed6c02",color:"white"},default:{backgroundColor:"transparent",color:l?"var(--goobs-dark-text)":"inherit"}},d=t==="default"&&a?.theme!=="sacred",A=l?"var(--goobs-dark-border)":"rgba(0, 0, 0, 0.12)";return(0,s.jsx)(zr,{ref:i,icon:r,styles:{...o[e],...c[t],borderRadius:"50%",border:d?`1px solid ${A}`:"none",display:"flex",alignItems:"center",justifyContent:"center",minWidth:"auto",...a,...a?.theme==="sacred"&&{outline:!1,border:"none",borderWidth:"0",borderStyle:"none",borderColor:"transparent",boxShadow:"none",backgroundColor:"transparent",hoverBackgroundColor:"rgba(255, 215, 0, 0.1)"}},...n,"data-component":"IconButton"})});Vg.displayName="IconButton";var Lx="_root_1vij0_42",Dx="_outlined_1vij0_96",Mx="_cinzelH1_1vij0_141",kx="_cinzelH2_1vij0_144",Fx="_cinzelH3_1vij0_147",Px="_cinzelH4_1vij0_150",Ux="_cinzelH5_1vij0_153",Hx="_cinzelH6_1vij0_156",Qx="_cinzelBase_1vij0_159",zx="_merriHelper_1vij0_164",Gx="_h1_1vij0_169",Vx="_h2_1vij0_172",qx="_h3_1vij0_175",Yx="_h4_1vij0_178",Kx="_h5_1vij0_181",Wx="_h6_1vij0_14",$x="_body2_1vij0_189",sn={root:Lx,outlined:Dx,cinzelH1:Mx,cinzelH2:kx,cinzelH3:Fx,cinzelH4:Px,cinzelH5:Ux,cinzelH6:Hx,cinzelBase:Qx,merriHelper:zx,h1:Gx,h2:Vx,h3:qx,h4:Yx,h5:Kx,h6:Wx,body2:$x};function jx(e){const t=e.toLowerCase();return t.includes("cinzel")?t.includes("h1")?{className:sn.cinzelH1??"",fontWeight:700,fontFamily:'"Cinzel", serif'}:t.includes("h2")?{className:sn.cinzelH2??"",fontWeight:700,fontFamily:'"Cinzel", serif'}:t.includes("h3")?{className:sn.cinzelH3??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h4")?{className:sn.cinzelH4??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h5")?{className:sn.cinzelH5??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h6")?{className:sn.cinzelH6??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:{className:sn.cinzelBase??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("merri")?t.includes("helper")||t.includes("footer")?{className:sn.merriHelper??"",fontWeight:400,fontFamily:'"Merriweather", serif',merriColorNonSacred:"rgba(255, 255, 255, 0.6)",merriColorSacred:"rgba(255, 215, 0, 0.7)"}:t.includes("h1")?{className:sn.h1??"",fontWeight:700,fontFamily:'"Merriweather", serif'}:t.includes("h2")?{className:sn.h2??"",fontWeight:700,fontFamily:'"Merriweather", serif'}:t.includes("h3")?{className:sn.h3??"",fontWeight:700,fontFamily:'"Merriweather", serif'}:t.includes("h4")?{className:sn.h4??"",fontWeight:700,fontFamily:'"Merriweather", serif'}:t.includes("h5")?{className:sn.h5??"",fontWeight:700,fontFamily:'"Merriweather", serif'}:t.includes("h6")?{className:sn.h6??"",fontWeight:700,fontFamily:'"Merriweather", serif'}:{className:"",fontWeight:400,fontFamily:'"Merriweather", serif'}:t.includes("h1")?{className:sn.h1??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h2")?{className:sn.h2??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h3")?{className:sn.h3??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h4")?{className:sn.h4??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h5")?{className:sn.h5??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("h6")?{className:sn.h6??"",fontWeight:600,fontFamily:'"Cinzel", serif'}:t.includes("body2")||t.includes("small")?{className:sn.body2??"",fontWeight:400}:{className:"",fontWeight:400}}var ja=({text:e,children:t,variant:r="body1",color:a,fontSize:n,fontFamily:i,fontWeight:o,textAlign:l="left",marginBottom:c,marginTop:d,width:A,outline:g,gutterBottom:p,styles:u})=>{const v=u?.theme==="sacred",_=u?.variant||r,f=u?.fontSize||n,h=u?.fontFamily||i||'"Crimson Text", serif',E=u?.fontWeight||o,R=u?.textAlign||l,T=u?.marginBottom||c||"0",x=u?.marginTop||d||"0",B=u?.marginLeft||"0",O=u?.marginRight||"0",U=u?.margin,k=u?.padding,D=u?.gutterBottom??p??!1,L=u?.outline??g,H=L===!0,z=typeof L=="string"?L:void 0,q=String(_).toLowerCase().includes("h"),Z=jx(String(_)),ee=v?Z.merriColorSacred:Z.merriColorNonSacred,j=u?.color||a,ae=ee??j,X=Z.fontFamily||(q?'"Cinzel", serif':h),ce=E||Z.fontWeight,J={},M=($,ne)=>{ne!==void 0&&ne!==""&&(J[$]=ne)};M("--typography-color",ae),M("--typography-font-family",X),M("--typography-font-weight",ce),M("--typography-font-size",f),M("--typography-text-align",R),M("--typography-line-height",u?.lineHeight),M("--typography-letter-spacing",u?.letterSpacing),M("--typography-text-shadow",u?.textShadow),M("--typography-font-style",u?.fontStyle),M("--typography-text-transform",u?.textTransform),M("--typography-white-space",u?.whiteSpace),M("--typography-opacity",u?.opacity),M("--typography-max-width",u?.maxWidth),M("--typography-min-width",u?.minWidth),M("--typography-background-color",u?.backgroundColor),M("--typography-border-left",u?.borderLeft),M("--typography-flex",u?.flex),M("--typography-align-self",u?.alignSelf),M("--typography-width",u?.width||A),M("--typography-outline",z),M("--typography-border-radius",u?.borderRadius),M("--typography-overflow",u?.overflow),M("--typography-text-overflow",u?.textOverflow),U?J.margin=U:(J.marginTop=x,J.marginBottom=D?"0.35em":T,J.marginLeft=B,J.marginRight=O),k?J.padding=k:(u?.paddingLeft!==void 0&&(J.paddingLeft=u.paddingLeft),u?.paddingRight!==void 0&&(J.paddingRight=u.paddingRight),u?.paddingTop!==void 0&&(J.paddingTop=u.paddingTop),u?.paddingBottom!==void 0&&(J.paddingBottom=u.paddingBottom));const Q=[sn.root,Z.className,H?sn.outlined:""].filter(Boolean).join(" "),Y=e||t;return(0,s.jsx)("span",{className:Q,"data-component":"Typography","data-theme":u?.theme,style:J,children:Y})},Xx="_wrapper_yy6cr_23",Zx="_svg_yy6cr_37",V={wrapper:Xx,svg:Zx},s1=({styles:e,style:t={},...r})=>{const a=e?.theme||"light",n={...e?.padding&&{padding:e.padding},...e?.margin&&{margin:e.margin}},i={...e?.color&&{color:e.color},...e?.backgroundColor&&{backgroundColor:e.backgroundColor},...e?.borderRadius&&{borderRadius:e.borderRadius},...e?.filter&&{filter:e.filter},...e?.transform&&{transform:e.transform},...e?.boxShadow&&{boxShadow:e.boxShadow},...e?.size&&{width:e.size,height:e.size},...t};return(0,s.jsx)("div",{className:V.wrapper,"data-theme":a,"data-disabled":e?.disabled?"true":void 0,style:n,children:(0,s.jsxs)("svg",{className:V.svg,xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24",fill:"currentColor",style:i,...r,children:[(0,s.jsx)("path",{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"})]})})},Yf=I.default.createContext(null);function du(){const e=I.default.useContext(Yf);if(!e)throw new Error("useFormContext must be used inside <Form>. Wrap the consuming component in <Form>...</Form>.");return e}function Dl(){return I.default.useContext(Yf)}function qr({name:e,value:t,onChange:r,onBlur:a,adapter:n}){const i=Dl(),o=!!(i&&e&&t===void 0),l=(0,I.useCallback)(A=>{!i||!e||(i.engine.setValue(e,n?n.payloadToStore(A):A),r?.(A))},[i,e,n,r]),c=(0,I.useCallback)(()=>{!i||!e||(i.engine.setTouched(e,!0),a?.())},[i,e,a]);if(!o||!i||!e)return{value:t,onChange:r,onBlur:a};const d=i.engine.getValue(e);return{value:n?n.valueFromStore(d):d,onChange:l,onBlur:c}}var Jx="_root_11tsf_21",eO="_mainContent_11tsf_219",tO="_inputsRow_11tsf_227",rO="_inputGroup_11tsf_233",aO="_input_11tsf_227",nO="_statusIndicator_11tsf_278",iO="_buttonContainer_11tsf_293",oO="_successContainer_11tsf_305",sO="_successMessage_11tsf_330",lO="_bottomGlyphContainer_11tsf_350",cO="_bottomGlyph_11tsf_350",yo={root:Jx,mainContent:eO,inputsRow:tO,inputGroup:rO,input:aO,statusIndicator:nO,buttonContainer:iO,successContainer:oO,successMessage:sO,bottomGlyphContainer:lO,bottomGlyph:cO,"cci-sacred-pulse":"_cci-sacred-pulse_11tsf_1"},dO=()=>null,AO=()=>(0,s.jsx)("div",{className:yo.bottomGlyphContainer,children:Array.from({length:3}).map((e,t)=>(0,s.jsx)("span",{className:yo.bottomGlyph,children:"."},t))}),Kf=({codeLength:e=6,isValid:t,onChange:r,value:a,name:n,dataFieldName:i,"aria-label":o,"aria-required":l,"aria-invalid":c,codeSent:d=!1,onVerify:A,onSendResend:g,onDisableVerification:p,verifyButtonProps:u={},sendResendButtonProps:v={},disableVerificationButtonProps:_={},showActionButtons:f=!1,showSendResendButton:h=!0,successMessage:E="Verification Successful",showSuccessState:R=!1,styles:T})=>{const x=Dl(),{value:B,onChange:O,onBlur:U}=qr({name:n,value:a,onChange:r}),k=O!==void 0&&B!==void 0,D=B??"",[L,H]=(0,I.useState)(D),z=(0,I.useRef)(Array.from({length:e},()=>null)),q=(0,I.useRef)(!1),Z=k||r!==void 0,ee=Z?D:L,j=T?.theme??"light",ae=j==="sacred",X=T?.disabled,ce={...T?.width!==void 0&&{width:T.width},...T?.maxWidth!==void 0&&{maxWidth:T.maxWidth},...T?.minWidth!==void 0&&{minWidth:T.minWidth},...T?.height!==void 0&&{height:T.height},...T?.maxHeight!==void 0&&{maxHeight:T.maxHeight},...T?.minHeight!==void 0&&{minHeight:T.minHeight},...T?.margin!==void 0&&{margin:T.margin},...T?.marginTop!==void 0&&{marginTop:T.marginTop},...T?.marginBottom!==void 0&&{marginBottom:T.marginBottom},...T?.marginLeft!==void 0&&{marginLeft:T.marginLeft},...T?.marginRight!==void 0&&{marginRight:T.marginRight},...T?.padding!==void 0&&{padding:T.padding},...T?.backgroundColor!==void 0&&{background:T.backgroundColor},...T?.backgroundImage!==void 0&&{backgroundImage:T.backgroundImage},...T?.borderColor!==void 0&&{borderColor:T.borderColor},...T?.borderWidth!==void 0&&{borderWidth:T.borderWidth},...T?.borderRadius!==void 0&&{borderRadius:T.borderRadius},...T?.boxShadow!==void 0&&{boxShadow:T.boxShadow},...T?.gap!==void 0&&{"--cci-gap":T.gap},...T?.inputGap!==void 0&&{"--cci-input-gap":T.inputGap}};(0,I.useEffect)(()=>{if(!q.current){const Ee=setTimeout(()=>{z.current[0]&&!z.current[0].value&&(z.current[0].focus(),q.current=!0)},100);return()=>clearTimeout(Ee)}},[]);const J=(0,I.useCallback)(Ee=>{if(k){O?.(Ee);return}Z||H(Ee),r?.(Ee)},[k,O,Z,r]),M=(0,I.useCallback)((Ee,Re)=>{const Me=Ee.target.value;if(!/^\d*$/.test(Me))return;const Fe=ee.padEnd(e,"").split("");Me.length>1?Me.split("").forEach((Ye,We)=>{Re+We<e&&(Fe[Re+We]=Ye)}):Fe[Re]=Me.charAt(Me.length-1);const ie=Fe.join("").trimEnd();J(ie),Me&&Re<e-1&&z.current[Re+1]?.focus()},[ee,e,J]),Q=(0,I.useCallback)((Ee,Re)=>{const Me=()=>{if(Re>0){Ee.preventDefault(),z.current[Re-1]?.focus();const ie=ee.split("");ie[Re-1]="";const Ye=ie.join("").trimEnd();J(Ye)}},Fe=()=>{const ie=ee.split("");ie[Re]="";const Ye=ie.join("").trimEnd();J(Ye)};switch(Ee.key){case"Backspace":Ee.currentTarget.value===""?Me():Fe();break;case"Delete":Fe();break;case"ArrowLeft":Re>0&&(Ee.preventDefault(),z.current[Re-1]?.focus());break;case"ArrowRight":Re<e-1&&(Ee.preventDefault(),z.current[Re+1]?.focus());break;case"Enter":Re===e-1&&ee.length>=e&&A&&(Ee.preventDefault(),A());break;default:if(/^\d$/.test(Ee.key)){Ee.preventDefault();const ie=ee.padEnd(e,"").split("");ie[Re]=Ee.key;const Ye=ie.join("").trimEnd();J(Ye),Re<e-1&&z.current[Re+1]?.focus()}}},[ee,e,J,A]),Y=(0,I.useCallback)((Ee,Re)=>{Ee.preventDefault();const Me=(Ee.clipboardData.getData("text")||"").replace(/\D/g,"").slice(0,e-Re);if(Me){const Fe=ee.padEnd(e,"").split("");for(let We=0;We<Me.length;We++)Re+We<e&&(Fe[Re+We]=Me.charAt(We));const ie=Fe.join("").trimEnd();J(ie);const Ye=Math.min(Re+Me.length,e-1);z.current[Ye||0]?.focus()}},[ee,e,J]),$=ee.padEnd(e,"").split(""),ne=ee.length>=e,ue=i??n,pe=ee.length>0,he=x&&n?x.engine.getError(n):void 0,we={"data-component":"ConfirmationCodeInput",...ue&&{"data-field-name":ue},"data-filled":pe?"true":void 0,...he&&{"data-error":"true"}};return R?(0,s.jsxs)("div",{className:yo.successContainer,"data-theme":j,...we,children:[(0,s.jsx)(s1,{style:{fontSize:"var(--cci-success-icon-size)",color:"var(--cci-success-icon-color)",filter:"var(--cci-success-icon-filter)"}}),(0,s.jsx)("h3",{className:yo.successMessage,children:E}),(0,s.jsx)("div",{className:yo.buttonContainer,children:(0,s.jsx)(zr,{text:"Disable Verification",styles:{theme:T?.theme||"light",width:"100%",height:"40px"},..._,onClick:()=>{p()}})})]}):(0,s.jsxs)("div",{className:yo.root,"data-theme":j,...X&&{"data-disabled":"true"},...we,style:ce,role:"group","aria-label":o||"Confirmation Code",children:[ae&&(0,s.jsx)(dO,{}),(0,s.jsxs)("div",{className:yo.mainContent,children:[(0,s.jsxs)("div",{className:yo.inputsRow,children:[(0,s.jsx)("div",{className:yo.inputGroup,children:Array.from({length:e}).map((Ee,Re)=>(0,s.jsx)("input",{ref:Me=>{z.current[Re]=Me},type:"text",inputMode:"numeric",pattern:"[0-9]*",maxLength:1,value:$[Re]||"",onChange:Me=>M(Me,Re),onKeyDown:Me=>Q(Me,Re),onPaste:Me=>Y(Me,Re),onBlur:()=>U?.(),"aria-label":`${o||"Confirmation Code"} digit ${Re+1}`,"aria-required":l,"aria-invalid":c,disabled:X,className:yo.input},Re))}),(0,s.jsx)("div",{className:yo.statusIndicator,"data-valid":t?"true":"false",role:"status","aria-label":t?"Code is valid":"Code is invalid"})]}),f&&(0,s.jsxs)("div",{className:yo.buttonContainer,children:[h&&(0,s.jsx)(zr,{text:d?"Resend Code":"Send Code",styles:{theme:T?.theme||"light",width:"180px",height:"44px"},...v,onClick:()=>g&&void g()}),(0,s.jsx)(zr,{text:"Verify",styles:{theme:T?.theme||"light",width:"180px",height:"44px"},...u,onClick:()=>A&&void A(),disabled:!ne})]})]}),ae&&(0,s.jsx)(AO,{})]})},uO="_formControl_1878j_4",gO="_formLabel_1878j_129",pO="_optionLabel_1878j_151",hO="_input_1878j_167",fO="_radioSpan_1878j_174",mO="_radioOuter_1878j_186",_O="_radioInner_1878j_52",vO="_text_1878j_265",Ml={formControl:uO,formLabel:gO,optionLabel:pO,input:hO,radioSpan:fO,radioOuter:mO,radioInner:_O,text:vO},bO=e=>{if(!e)return{};const t={};return e.labelColor&&(t["--rg-label-color-override"]=e.labelColor),e.labelFontSize&&(t["--rg-label-font-size-override"]=e.labelFontSize),e.labelFontWeight!==void 0&&(t["--rg-label-font-weight-override"]=String(e.labelFontWeight)),e.labelFontFamily&&(t["--rg-label-font-family-override"]=e.labelFontFamily),e.marginBottom&&(t["--rg-label-margin-bottom"]=e.marginBottom),e.padding&&(t["--rg-option-padding-override"]=e.padding),e.radioSize&&(t["--rg-radio-size-override"]=e.radioSize),e.radioOuterBorderWidth&&(t["--rg-radio-border-width-override"]=e.radioOuterBorderWidth),e.radioOuterBorderColor&&(t["--rg-radio-border-color-override"]=e.radioOuterBorderColor),e.radioHoverBorderColor&&(t["--rg-radio-hover-border-color-override"]=e.radioHoverBorderColor),e.radioHoverBackgroundColor&&(t["--rg-radio-hover-bg-override"]=e.radioHoverBackgroundColor),e.radioInnerColor&&(t["--rg-radio-inner-color-override"]=e.radioInnerColor),e.textColor&&(t["--rg-text-color-override"]=e.textColor),e.textFontSize&&(t["--rg-text-font-size-override"]=e.textFontSize),e.textFontFamily&&(t["--rg-text-font-family-override"]=e.textFontFamily),e.textHoverColor&&(t["--rg-text-hover-color-override"]=e.textHoverColor),e.transitionDuration&&(t["--rg-transition"]=`all ${e.transitionDuration} ${e.transitionEasing||"cubic-bezier(0.4, 0, 0.2, 1)"}`),t},l1=({label:e,options:t,value:r,defaultValue:a,name:n,labelText:i,dataFieldName:o,onChange:l,styles:c})=>{const[d,A]=(0,I.useState)(a),{value:g,onChange:p}=qr({name:n,value:r}),u=r??(g!==void 0?g:d),v=c?.theme||"light",_=bO(c),f=h=>{A(h.target.value),p?.(h.target.value),l&&l(h)};return(0,s.jsxs)("div",{className:Ml.formControl,"data-component":"RadioGroup","data-field-name":o??n,"data-filled":u!==void 0&&u!=="","data-inner-dot":c?.radioInnerColor?"true":void 0,"data-theme":v,style:_,children:[(0,s.jsx)("label",{id:`${n}-label`,className:Ml.formLabel,children:i||e}),(0,s.jsx)("div",{role:"radiogroup","aria-labelledby":`${n}-label`,children:t.map((h,E)=>{const R=u===h.label;return(0,s.jsxs)("label",{className:Ml.optionLabel,children:[(0,s.jsx)("input",{type:"radio",name:n,value:h.label,checked:R,className:Ml.input,onChange:f}),(0,s.jsxs)("span",{className:Ml.radioSpan,children:[(0,s.jsx)("span",{className:Ml.radioOuter}),(0,s.jsx)("span",{className:Ml.radioInner})]}),(0,s.jsx)("span",{className:Ml.text,"data-has-color":h.color?"true":void 0,style:h.color?{"--rg-option-color":h.color}:void 0,children:h.label})]},E)})})]})},SO="_backdrop_hazww_30",EO="_dialog_hazww_58",CO="_content_hazww_15",Wf={backdrop:SO,dialog:EO,content:CO},wO=()=>{const[e,t]=(0,I.useState)("desktop");return(0,I.useEffect)(()=>{const r=()=>{window.innerWidth<640?t("mobile"):window.innerWidth<1024?t("tablet"):t("desktop")};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e},c1=({open:e,onClose:t,children:r,styles:a,customDialogStyles:n,dataDialogPaper:i,dataDialog:o,dataSubject:l,ariaLabelledBy:c,ariaDescribedBy:d,ariaLabel:A})=>{const g=(0,I.useRef)(null),p=(0,I.useRef)(null),u=wO(),v=a?.theme==="sacred"?"sacred":"light",_=(0,I.useRef)(t);(0,I.useEffect)(()=>{_.current=t},[t]),(0,I.useEffect)(()=>{if(!e)return;const O=document.activeElement,U=g.current,k=()=>U?Array.from(U.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(H=>H.offsetParent!==null):[],D=k()[0];D?D.focus():U?.focus();const L=H=>{if(H.key==="Escape"){_.current();return}if(H.key!=="Tab")return;const z=k();if(z.length===0){H.preventDefault(),U?.focus();return}const q=z[0],Z=z[z.length-1];if(!q||!Z)return;const ee=document.activeElement;H.shiftKey&&ee===q?(H.preventDefault(),Z.focus()):!H.shiftKey&&ee===Z&&(H.preventDefault(),q.focus())};return document.addEventListener("keydown",L),()=>{document.removeEventListener("keydown",L),O?.focus?.()}},[e]);const f=(0,I.useRef)(!1);if((0,I.useEffect)(()=>{const O=o||l||"dialog";e&&!f.current?(f.current=!0,Na({type:"dialog.opened",id:O})):!e&&f.current&&(f.current=!1,Na({type:"dialog.closed",id:O,action:"dismiss"}))},[e,o,l]),(0,I.useEffect)(()=>{if(!e){document.body.style.overflow="";return}document.body.style.overflow="hidden";const O=D=>{const L=p.current??g.current?.querySelector("div");if(L&&L.scrollHeight>L.clientHeight){const H=L.scrollTop<L.scrollHeight-L.clientHeight,z=L.scrollTop>0;(D.deltaY>0&&H||D.deltaY<0&&z)&&(L.scrollTop+=D.deltaY,D.preventDefault())}},U=g.current?.parentElement,k=g.current;return U&&U.addEventListener("wheel",O,{passive:!1}),k&&k.addEventListener("wheel",O,{passive:!1}),()=>{document.body.style.overflow="",U&&U.removeEventListener("wheel",O),k&&k.removeEventListener("wheel",O)}},[e]),!e)return null;const h=()=>u==="mobile"?"95vw":u==="tablet"?"80vw":a?.maxWidth||"600px",E=()=>u==="mobile"?"90vh":a?.maxHeight||"80vh",R=a?.border?a.border:a?.borderColor?`2px solid ${a.borderColor}`:void 0,T={"--dialog-align":a?.topOffset?"flex-start":"center","--dialog-pad-top":a?.topOffset||"16px",...a?.backdropBackgroundColor&&{"--dialog-backdrop-bg":a.backdropBackgroundColor},...a?.backdropFilter&&{"--dialog-backdrop-filter":a.backdropFilter}},x={"--dialog-max-width":a?.fullWidth?"100%":h(),"--dialog-width":a?.fullWidth?"100%":a?.width||"100%","--dialog-max-height":E(),"--dialog-height":a?.height||"auto",...a?.minHeight&&{"--dialog-min-height":a.minHeight},...a?.backgroundColor&&{"--dialog-bg":a.backgroundColor},...R&&{"--dialog-border":R},...a?.borderRadius&&{"--dialog-radius":a.borderRadius},...a?.boxShadow&&{"--dialog-shadow":a.boxShadow},...n},B=a?.padding?{"--dialog-content-padding":a.padding}:void 0;return(0,s.jsx)("div",{className:Wf.backdrop,"data-theme":v,style:T,onClick:t,"data-dialog-backdrop":"true",children:(0,s.jsx)("div",{ref:g,className:Wf.dialog,"data-component":"Dialog","data-state":"open","data-theme":v,style:x,onClick:O=>O.stopPropagation(),role:"dialog","aria-modal":"true",tabIndex:-1,"aria-labelledby":c,"aria-describedby":d,"aria-label":c?void 0:A,"data-dialog-paper":i?"true":void 0,"data-dialog":o,"data-subject":l,children:(0,s.jsx)("div",{ref:p,className:Wf.content,"data-theme":v,...B&&{style:B},children:r})})})},TO=K(((e,t)=>{function r(_e){return _e instanceof Map?_e.clear=_e.delete=_e.set=function(){throw new Error("map is read-only")}:_e instanceof Set&&(_e.add=_e.clear=_e.delete=function(){throw new Error("set is read-only")}),Object.freeze(_e),Object.getOwnPropertyNames(_e).forEach(nt=>{const ct=_e[nt],Et=typeof ct;(Et==="object"||Et==="function")&&!Object.isFrozen(ct)&&r(ct)}),_e}var a=class{constructor(_e){_e.data===void 0&&(_e.data={}),this.data=_e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function n(_e){return _e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(_e,...nt){const ct=Object.create(null);for(const Et in _e)ct[Et]=_e[Et];return nt.forEach(function(Et){for(const Rr in Et)ct[Rr]=Et[Rr]}),ct}var o="</span>",l=_e=>!!_e.scope,c=(_e,{prefix:nt})=>{if(_e.startsWith("language:"))return _e.replace("language:","language-");if(_e.includes(".")){const ct=_e.split(".");return[`${nt}${ct.shift()}`,...ct.map((Et,Rr)=>`${Et}${"_".repeat(Rr+1)}`)].join(" ")}return`${nt}${_e}`},d=class{constructor(_e,nt){this.buffer="",this.classPrefix=nt.classPrefix,_e.walk(this)}addText(_e){this.buffer+=n(_e)}openNode(_e){if(!l(_e))return;const nt=c(_e.scope,{prefix:this.classPrefix});this.span(nt)}closeNode(_e){l(_e)&&(this.buffer+=o)}value(){return this.buffer}span(_e){this.buffer+=`<span class="${_e}">`}},A=(_e={})=>{const nt={children:[]};return Object.assign(nt,_e),nt},g=class ux{constructor(){this.rootNode=A(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(nt){this.top.children.push(nt)}openNode(nt){const ct=A({scope:nt});this.add(ct),this.stack.push(ct)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(nt){return this.constructor._walk(nt,this.rootNode)}static _walk(nt,ct){return typeof ct=="string"?nt.addText(ct):ct.children&&(nt.openNode(ct),ct.children.forEach(Et=>this._walk(nt,Et)),nt.closeNode(ct)),nt}static _collapse(nt){typeof nt!="string"&&nt.children&&(nt.children.every(ct=>typeof ct=="string")?nt.children=[nt.children.join("")]:nt.children.forEach(ct=>{ux._collapse(ct)}))}},p=class extends g{constructor(_e){super(),this.options=_e}addText(_e){_e!==""&&this.add(_e)}startScope(_e){this.openNode(_e)}endScope(){this.closeNode()}__addSublanguage(_e,nt){const ct=_e.root;nt&&(ct.scope=`language:${nt}`),this.add(ct)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function u(_e){return _e?typeof _e=="string"?_e:_e.source:null}function v(_e){return h("(?=",_e,")")}function _(_e){return h("(?:",_e,")*")}function f(_e){return h("(?:",_e,")?")}function h(..._e){return _e.map(nt=>u(nt)).join("")}function E(_e){const nt=_e[_e.length-1];return typeof nt=="object"&&nt.constructor===Object?(_e.splice(_e.length-1,1),nt):{}}function R(..._e){return"("+(E(_e).capture?"":"?:")+_e.map(nt=>u(nt)).join("|")+")"}function T(_e){return new RegExp(_e.toString()+"|").exec("").length-1}function x(_e,nt){const ct=_e&&_e.exec(nt);return ct&&ct.index===0}var B=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function O(_e,{joinWith:nt}){let ct=0;return _e.map(Et=>{ct+=1;const Rr=ct;let vr=u(Et),Dt="";for(;vr.length>0;){const Rt=B.exec(vr);if(!Rt){Dt+=vr;break}Dt+=vr.substring(0,Rt.index),vr=vr.substring(Rt.index+Rt[0].length),Rt[0][0]==="\\"&&Rt[1]?Dt+="\\"+String(Number(Rt[1])+Rr):(Dt+=Rt[0],Rt[0]==="("&&ct++)}return Dt}).map(Et=>`(${Et})`).join(nt)}var U=/\b\B/,k="[a-zA-Z]\\w*",D="[a-zA-Z_]\\w*",L="\\b\\d+(\\.\\d+)?",H="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",z="\\b(0b[01]+)",q="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Z=(_e={})=>{const nt=/^#![ ]*\//;return _e.binary&&(_e.begin=h(nt,/.*\b/,_e.binary,/\b.*/)),i({scope:"meta",begin:nt,end:/$/,relevance:0,"on:begin":(ct,Et)=>{ct.index!==0&&Et.ignoreMatch()}},_e)},ee={begin:"\\\\[\\s\\S]",relevance:0},j={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ee]},ae={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ee]},X={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ce=function(_e,nt,ct={}){const Et=i({scope:"comment",begin:_e,end:nt,contains:[]},ct);Et.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Rr=R("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Et.contains.push({begin:h(/[ ]+/,"(",Rr,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Et},J=ce("//","$"),M=ce("/\\*","\\*/"),Q=ce("#","$"),Y={scope:"number",begin:L,relevance:0},$={scope:"number",begin:H,relevance:0},ne={scope:"number",begin:z,relevance:0},ue={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ee,{begin:/\[/,end:/\]/,relevance:0,contains:[ee]}]},pe={scope:"title",begin:k,relevance:0},he={scope:"title",begin:D,relevance:0},we={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},Ee=function(_e){return Object.assign(_e,{"on:begin":(nt,ct)=>{ct.data._beginMatch=nt[1]},"on:end":(nt,ct)=>{ct.data._beginMatch!==nt[1]&&ct.ignoreMatch()}})},Re=Object.freeze({__proto__:null,APOS_STRING_MODE:j,BACKSLASH_ESCAPE:ee,BINARY_NUMBER_MODE:ne,BINARY_NUMBER_RE:z,COMMENT:ce,C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:J,C_NUMBER_MODE:$,C_NUMBER_RE:H,END_SAME_AS_BEGIN:Ee,HASH_COMMENT_MODE:Q,IDENT_RE:k,MATCH_NOTHING_RE:U,METHOD_GUARD:we,NUMBER_MODE:Y,NUMBER_RE:L,PHRASAL_WORDS_MODE:X,QUOTE_STRING_MODE:ae,REGEXP_MODE:ue,RE_STARTERS_RE:q,SHEBANG:Z,TITLE_MODE:pe,UNDERSCORE_IDENT_RE:D,UNDERSCORE_TITLE_MODE:he});function Me(_e,nt){_e.input[_e.index-1]==="."&&nt.ignoreMatch()}function Fe(_e,nt){_e.className!==void 0&&(_e.scope=_e.className,delete _e.className)}function ie(_e,nt){nt&&_e.beginKeywords&&(_e.begin="\\b("+_e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",_e.__beforeBegin=Me,_e.keywords=_e.keywords||_e.beginKeywords,delete _e.beginKeywords,_e.relevance===void 0&&(_e.relevance=0))}function Ye(_e,nt){Array.isArray(_e.illegal)&&(_e.illegal=R(..._e.illegal))}function We(_e,nt){if(_e.match){if(_e.begin||_e.end)throw new Error("begin & end are not supported with match");_e.begin=_e.match,delete _e.match}}function dt(_e,nt){_e.relevance===void 0&&(_e.relevance=1)}var Ie=(_e,nt)=>{if(!_e.beforeMatch)return;if(_e.starts)throw new Error("beforeMatch cannot be used with starts");const ct=Object.assign({},_e);Object.keys(_e).forEach(Et=>{delete _e[Et]}),_e.keywords=ct.keywords,_e.begin=h(ct.beforeMatch,v(ct.begin)),_e.starts={relevance:0,contains:[Object.assign(ct,{endsParent:!0})]},_e.relevance=0,delete ct.beforeMatch},Xe=["of","and","for","in","not","or","if","then","parent","list","value"],Ke="keyword";function gt(_e,nt,ct=Ke){const Et=Object.create(null);return typeof _e=="string"?Rr(ct,_e.split(" ")):Array.isArray(_e)?Rr(ct,_e):Object.keys(_e).forEach(function(vr){Object.assign(Et,gt(_e[vr],nt,vr))}),Et;function Rr(vr,Dt){nt&&(Dt=Dt.map(Rt=>Rt.toLowerCase())),Dt.forEach(function(Rt){const Bt=Rt.split("|");Et[Bt[0]]=[vr,it(Bt[0],Bt[1])]})}}function it(_e,nt){return nt?Number(nt):Qe(_e)?0:1}function Qe(_e){return Xe.includes(_e.toLowerCase())}var je={},Le=_e=>{console.error(_e)},Ce=(_e,...nt)=>{console.log(`WARN: ${_e}`,...nt)},Oe=(_e,nt)=>{je[`${_e}/${nt}`]||(console.log(`Deprecated as of ${_e}. ${nt}`),je[`${_e}/${nt}`]=!0)},Pe=new Error;function pt(_e,nt,{key:ct}){let Et=0;const Rr=_e[ct],vr={},Dt={};for(let Rt=1;Rt<=nt.length;Rt++)Dt[Rt+Et]=Rr[Rt],vr[Rt+Et]=!0,Et+=T(nt[Rt-1]);_e[ct]=Dt,_e[ct]._emit=vr,_e[ct]._multi=!0}function $e(_e){if(Array.isArray(_e.begin)){if(_e.skip||_e.excludeBegin||_e.returnBegin)throw Le("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Pe;if(typeof _e.beginScope!="object"||_e.beginScope===null)throw Le("beginScope must be object"),Pe;pt(_e,_e.begin,{key:"beginScope"}),_e.begin=O(_e.begin,{joinWith:""})}}function At(_e){if(Array.isArray(_e.end)){if(_e.skip||_e.excludeEnd||_e.returnEnd)throw Le("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Pe;if(typeof _e.endScope!="object"||_e.endScope===null)throw Le("endScope must be object"),Pe;pt(_e,_e.end,{key:"endScope"}),_e.end=O(_e.end,{joinWith:""})}}function xt(_e){_e.scope&&typeof _e.scope=="object"&&_e.scope!==null&&(_e.beginScope=_e.scope,delete _e.scope)}function St(_e){xt(_e),typeof _e.beginScope=="string"&&(_e.beginScope={_wrap:_e.beginScope}),typeof _e.endScope=="string"&&(_e.endScope={_wrap:_e.endScope}),$e(_e),At(_e)}function Ot(_e){function nt(Dt,Rt){return new RegExp(u(Dt),"m"+(_e.case_insensitive?"i":"")+(_e.unicodeRegex?"u":"")+(Rt?"g":""))}class ct{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Rt,Bt){Bt.position=this.position++,this.matchIndexes[this.matchAt]=Bt,this.regexes.push([Bt,Rt]),this.matchAt+=T(Rt)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Rt=this.regexes.map(Bt=>Bt[1]);this.matcherRe=nt(O(Rt,{joinWith:"|"}),!0),this.lastIndex=0}exec(Rt){this.matcherRe.lastIndex=this.lastIndex;const Bt=this.matcherRe.exec(Rt);if(!Bt)return null;const gr=Bt.findIndex((dn,An)=>An>0&&dn!==void 0),br=this.matchIndexes[gr];return Bt.splice(0,gr),Object.assign(Bt,br)}}class Et{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Rt){if(this.multiRegexes[Rt])return this.multiRegexes[Rt];const Bt=new ct;return this.rules.slice(Rt).forEach(([gr,br])=>Bt.addRule(gr,br)),Bt.compile(),this.multiRegexes[Rt]=Bt,Bt}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Rt,Bt){this.rules.push([Rt,Bt]),Bt.type==="begin"&&this.count++}exec(Rt){const Bt=this.getMatcher(this.regexIndex);Bt.lastIndex=this.lastIndex;let gr=Bt.exec(Rt);if(this.resumingScanAtSamePosition()&&!(gr&&gr.index===this.lastIndex)){const br=this.getMatcher(0);br.lastIndex=this.lastIndex+1,gr=br.exec(Rt)}return gr&&(this.regexIndex+=gr.position+1,this.regexIndex===this.count&&this.considerAll()),gr}}function Rr(Dt){const Rt=new Et;return Dt.contains.forEach(Bt=>Rt.addRule(Bt.begin,{rule:Bt,type:"begin"})),Dt.terminatorEnd&&Rt.addRule(Dt.terminatorEnd,{type:"end"}),Dt.illegal&&Rt.addRule(Dt.illegal,{type:"illegal"}),Rt}function vr(Dt,Rt){const Bt=Dt;if(Dt.isCompiled)return Bt;[Fe,We,St,Ie].forEach(br=>br(Dt,Rt)),_e.compilerExtensions.forEach(br=>br(Dt,Rt)),Dt.__beforeBegin=null,[ie,Ye,dt].forEach(br=>br(Dt,Rt)),Dt.isCompiled=!0;let gr=null;return typeof Dt.keywords=="object"&&Dt.keywords.$pattern&&(Dt.keywords=Object.assign({},Dt.keywords),gr=Dt.keywords.$pattern,delete Dt.keywords.$pattern),gr=gr||/\w+/,Dt.keywords&&(Dt.keywords=gt(Dt.keywords,_e.case_insensitive)),Bt.keywordPatternRe=nt(gr,!0),Rt&&(Dt.begin||(Dt.begin=/\B|\b/),Bt.beginRe=nt(Bt.begin),!Dt.end&&!Dt.endsWithParent&&(Dt.end=/\B|\b/),Dt.end&&(Bt.endRe=nt(Bt.end)),Bt.terminatorEnd=u(Bt.end)||"",Dt.endsWithParent&&Rt.terminatorEnd&&(Bt.terminatorEnd+=(Dt.end?"|":"")+Rt.terminatorEnd)),Dt.illegal&&(Bt.illegalRe=nt(Dt.illegal)),Dt.contains||(Dt.contains=[]),Dt.contains=[].concat(...Dt.contains.map(function(br){return Lt(br==="self"?Dt:br)})),Dt.contains.forEach(function(br){vr(br,Bt)}),Dt.starts&&vr(Dt.starts,Rt),Bt.matcher=Rr(Bt),Bt}if(_e.compilerExtensions||(_e.compilerExtensions=[]),_e.contains&&_e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return _e.classNameAliases=i(_e.classNameAliases||{}),vr(_e)}function wr(_e){return _e?_e.endsWithParent||wr(_e.starts):!1}function Lt(_e){return _e.variants&&!_e.cachedVariants&&(_e.cachedVariants=_e.variants.map(function(nt){return i(_e,{variants:null},nt)})),_e.cachedVariants?_e.cachedVariants:wr(_e)?i(_e,{starts:_e.starts?i(_e.starts):null}):Object.isFrozen(_e)?i(_e):_e}var mt="11.11.1",ot=class extends Error{constructor(_e,nt){super(_e),this.name="HTMLInjectionError",this.html=nt}},tr=n,ur=i,zt=Symbol("nomatch"),Ft=7,_r=function(_e){const nt=Object.create(null),ct=Object.create(null),Et=[];let Rr=!0;const vr="Could not find the language '{}', did you forget to load/include a language module?",Dt={disableAutodetect:!0,name:"Plain text",contains:[]};let Rt={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function Bt(bt){return Rt.noHighlightRe.test(bt)}function gr(bt){let jt=bt.className+" ";jt+=bt.parentNode?bt.parentNode.className:"";const pr=Rt.languageDetectRe.exec(jt);if(pr){const Tr=Ze(pr[1]);return Tr||(Ce(vr.replace("{}",pr[1])),Ce("Falling back to no-highlight mode for this block.",bt)),Tr?pr[1]:"no-highlight"}return jt.split(/\s+/).find(Tr=>Bt(Tr)||Ze(Tr))}function br(bt,jt,pr){let Tr="",Yr="";typeof jt=="object"?(Tr=bt,pr=jt.ignoreIllegals,Yr=jt.language):(Oe("10.7.0","highlight(lang, code, ...args) has been deprecated."),Oe("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),Yr=bt,Tr=jt),pr===void 0&&(pr=!0);const aa={code:Tr,language:Yr};ir("before:highlight",aa);const Kr=aa.result?aa.result:dn(aa.language,aa.code,pr);return Kr.code=aa.code,ir("after:highlight",Kr),Kr}function dn(bt,jt,pr,Tr){const Yr=Object.create(null);function aa(Mt,Kt){return Mt.keywords[Kt]}function Kr(){if(!cr.keywords){ya.addText(Hr);return}let Mt=0;cr.keywordPatternRe.lastIndex=0;let Kt=cr.keywordPatternRe.exec(Hr),wt="";for(;Kt;){wt+=Hr.substring(Mt,Kt.index);const Gr=Ba.case_insensitive?Kt[0].toLowerCase():Kt[0],fa=aa(cr,Gr);if(fa){const[li,Vi]=fa;if(ya.addText(wt),wt="",Yr[Gr]=(Yr[Gr]||0)+1,Yr[Gr]<=Ft&&(To+=Vi),li.startsWith("_"))wt+=Kt[0];else{const Qs=Ba.classNameAliases[li]||li;Ri(Kt[0],Qs)}}else wt+=Kt[0];Mt=cr.keywordPatternRe.lastIndex,Kt=cr.keywordPatternRe.exec(Hr)}wt+=Hr.substring(Mt),ya.addText(wt)}function ii(){if(Hr==="")return;let Mt=null;if(typeof cr.subLanguage=="string"){if(!nt[cr.subLanguage]){ya.addText(Hr);return}Mt=dn(cr.subLanguage,Hr,!0,so[cr.subLanguage]),so[cr.subLanguage]=Mt._top}else Mt=Ca(Hr,cr.subLanguage.length?cr.subLanguage:null);cr.relevance>0&&(To+=Mt.relevance),ya.__addSublanguage(Mt._emitter,Mt.language)}function da(){cr.subLanguage!=null?ii():Kr(),Hr=""}function Ri(Mt,Kt){Mt!==""&&(ya.startScope(Kt),ya.addText(Mt),ya.endScope())}function Qi(Mt,Kt){let wt=1;const Gr=Kt.length-1;for(;wt<=Gr;){if(!Mt._emit[wt]){wt++;continue}const fa=Ba.classNameAliases[Mt[wt]]||Mt[wt],li=Kt[wt];fa?Ri(li,fa):(Hr=li,Kr(),Hr=""),wt++}}function un(Mt,Kt){return Mt.scope&&typeof Mt.scope=="string"&&ya.openNode(Ba.classNameAliases[Mt.scope]||Mt.scope),Mt.beginScope&&(Mt.beginScope._wrap?(Ri(Hr,Ba.classNameAliases[Mt.beginScope._wrap]||Mt.beginScope._wrap),Hr=""):Mt.beginScope._multi&&(Qi(Mt.beginScope,Kt),Hr="")),cr=Object.create(Mt,{parent:{value:cr}}),cr}function oi(Mt,Kt,wt){let Gr=x(Mt.endRe,wt);if(Gr){if(Mt["on:end"]){const fa=new a(Mt);Mt["on:end"](Kt,fa),fa.isMatchIgnored&&(Gr=!1)}if(Gr){for(;Mt.endsParent&&Mt.parent;)Mt=Mt.parent;return Mt}}if(Mt.endsWithParent)return oi(Mt.parent,Kt,wt)}function zi(Mt){return cr.matcher.regexIndex===0?(Hr+=Mt[0],1):(Ii=!0,0)}function fr(Mt){const Kt=Mt[0],wt=Mt.rule,Gr=new a(wt),fa=[wt.__beforeBegin,wt["on:begin"]];for(const li of fa)if(li&&(li(Mt,Gr),Gr.isMatchIgnored))return zi(Kt);return wt.skip?Hr+=Kt:(wt.excludeBegin&&(Hr+=Kt),da(),!wt.returnBegin&&!wt.excludeBegin&&(Hr=Kt)),un(wt,Mt),wt.returnBegin?0:Kt.length}function Po(Mt){const Kt=Mt[0],wt=jt.substring(Mt.index),Gr=oi(cr,Mt,wt);if(!Gr)return zt;const fa=cr;cr.endScope&&cr.endScope._wrap?(da(),Ri(Kt,cr.endScope._wrap)):cr.endScope&&cr.endScope._multi?(da(),Qi(cr.endScope,Mt)):fa.skip?Hr+=Kt:(fa.returnEnd||fa.excludeEnd||(Hr+=Kt),da(),fa.excludeEnd&&(Hr=Kt));do cr.scope&&ya.closeNode(),!cr.skip&&!cr.subLanguage&&(To+=cr.relevance),cr=cr.parent;while(cr!==Gr.parent);return Gr.starts&&un(Gr.starts,Mt),fa.returnEnd?0:Kt.length}function Cn(){const Mt=[];for(let Kt=cr;Kt!==Ba;Kt=Kt.parent)Kt.scope&&Mt.unshift(Kt.scope);Mt.forEach(Kt=>ya.openNode(Kt))}let wo={};function gs(Mt,Kt){const wt=Kt&&Kt[0];if(Hr+=Mt,wt==null)return da(),0;if(wo.type==="begin"&&Kt.type==="end"&&wo.index===Kt.index&&wt===""){if(Hr+=jt.slice(Kt.index,Kt.index+1),!Rr){const Gr=new Error(`0 width match regex (${bt})`);throw Gr.languageName=bt,Gr.badRule=wo.rule,Gr}return 1}if(wo=Kt,Kt.type==="begin")return fr(Kt);if(Kt.type==="illegal"&&!pr){const Gr=new Error('Illegal lexeme "'+wt+'" for mode "'+(cr.scope||"<unnamed>")+'"');throw Gr.mode=cr,Gr}else if(Kt.type==="end"){const Gr=Po(Kt);if(Gr!==zt)return Gr}if(Kt.type==="illegal"&&wt==="")return Hr+=`
`,1;if(si>1e5&&si>Kt.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Hr+=wt,wt.length}const Ba=Ze(bt);if(!Ba)throw Le(vr.replace("{}",bt)),new Error('Unknown language: "'+bt+'"');const Gi=Ot(Ba);let wn="",cr=Tr||Gi;const so={},ya=new Rt.__emitter(Rt);Cn();let Hr="",To=0,Tn=0,si=0,Ii=!1;try{if(Ba.__emitTokens)Ba.__emitTokens(jt,ya);else{for(cr.matcher.considerAll();;){si++,Ii?Ii=!1:cr.matcher.considerAll(),cr.matcher.lastIndex=Tn;const Mt=cr.matcher.exec(jt);if(!Mt)break;const Kt=gs(jt.substring(Tn,Mt.index),Mt);Tn=Mt.index+Kt}gs(jt.substring(Tn))}return ya.finalize(),wn=ya.toHTML(),{language:bt,value:wn,relevance:To,illegal:!1,_emitter:ya,_top:cr}}catch(Mt){if(Mt.message&&Mt.message.includes("Illegal"))return{language:bt,value:tr(jt),illegal:!0,relevance:0,_illegalBy:{message:Mt.message,index:Tn,context:jt.slice(Tn-100,Tn+100),mode:Mt.mode,resultSoFar:wn},_emitter:ya};if(Rr)return{language:bt,value:tr(jt),illegal:!1,relevance:0,errorRaised:Mt,_emitter:ya,_top:cr};throw Mt}}function An(bt){const jt={value:tr(bt),illegal:!1,relevance:0,_top:Dt,_emitter:new Rt.__emitter(Rt)};return jt._emitter.addText(bt),jt}function Ca(bt,jt){jt=jt||Rt.languages||Object.keys(nt);const pr=An(bt),Tr=jt.filter(Ze).filter(It).map(ii=>dn(ii,bt,!1));Tr.unshift(pr);const[Yr,aa]=Tr.sort((ii,da)=>{if(ii.relevance!==da.relevance)return da.relevance-ii.relevance;if(ii.language&&da.language){if(Ze(ii.language).supersetOf===da.language)return 1;if(Ze(da.language).supersetOf===ii.language)return-1}return 0}),Kr=Yr;return Kr.secondBest=aa,Kr}function Pr(bt,jt,pr){const Tr=jt&&ct[jt]||pr;bt.classList.add("hljs"),bt.classList.add(`language-${Tr}`)}function ra(bt){let jt=null;const pr=gr(bt);if(Bt(pr))return;if(ir("before:highlightElement",{el:bt,language:pr}),bt.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",bt);return}if(bt.children.length>0&&(Rt.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(bt)),Rt.throwUnescapedHTML))throw new ot("One of your code blocks includes unescaped HTML.",bt.innerHTML);jt=bt;const Tr=jt.textContent,Yr=pr?br(Tr,{language:pr,ignoreIllegals:!0}):Ca(Tr);bt.innerHTML=Yr.value,bt.dataset.highlighted="yes",Pr(bt,pr,Yr.language),bt.result={language:Yr.language,re:Yr.relevance,relevance:Yr.relevance},Yr.secondBest&&(bt.secondBest={language:Yr.secondBest.language,relevance:Yr.secondBest.relevance}),ir("after:highlightElement",{el:bt,result:Yr,text:Tr})}function qa(bt){Rt=ur(Rt,bt)}const Ja=()=>{Ut(),Oe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function jn(){Ut(),Oe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Pa=!1;function Ut(){function bt(){Ut()}if(document.readyState==="loading"){Pa||window.addEventListener("DOMContentLoaded",bt,!1),Pa=!0;return}document.querySelectorAll(Rt.cssSelector).forEach(ra)}function Ne(bt,jt){let pr=null;try{pr=jt(_e)}catch(Tr){if(Le("Language definition for '{}' could not be registered.".replace("{}",bt)),Rr)Le(Tr);else throw Tr;pr=Dt}pr.name||(pr.name=bt),nt[bt]=pr,pr.rawDefinition=jt.bind(null,_e),pr.aliases&&Nt(pr.aliases,{languageName:bt})}function _t(bt){delete nt[bt];for(const jt of Object.keys(ct))ct[jt]===bt&&delete ct[jt]}function Pt(){return Object.keys(nt)}function Ze(bt){return bt=(bt||"").toLowerCase(),nt[bt]||nt[ct[bt]]}function Nt(bt,{languageName:jt}){typeof bt=="string"&&(bt=[bt]),bt.forEach(pr=>{ct[pr.toLowerCase()]=jt})}function It(bt){const jt=Ze(bt);return jt&&!jt.disableAutodetect}function sr(bt){bt["before:highlightBlock"]&&!bt["before:highlightElement"]&&(bt["before:highlightElement"]=jt=>{bt["before:highlightBlock"](Object.assign({block:jt.el},jt))}),bt["after:highlightBlock"]&&!bt["after:highlightElement"]&&(bt["after:highlightElement"]=jt=>{bt["after:highlightBlock"](Object.assign({block:jt.el},jt))})}function Wt(bt){sr(bt),Et.push(bt)}function Ur(bt){const jt=Et.indexOf(bt);jt!==-1&&Et.splice(jt,1)}function ir(bt,jt){const pr=bt;Et.forEach(function(Tr){Tr[pr]&&Tr[pr](jt)})}function Vn(bt){return Oe("10.7.0","highlightBlock will be removed entirely in v12.0"),Oe("10.7.0","Please use highlightElement now."),ra(bt)}Object.assign(_e,{highlight:br,highlightAuto:Ca,highlightAll:Ut,highlightElement:ra,highlightBlock:Vn,configure:qa,initHighlighting:Ja,initHighlightingOnLoad:jn,registerLanguage:Ne,unregisterLanguage:_t,listLanguages:Pt,getLanguage:Ze,registerAliases:Nt,autoDetection:It,inherit:ur,addPlugin:Wt,removePlugin:Ur}),_e.debugMode=function(){Rr=!1},_e.safeMode=function(){Rr=!0},_e.versionString=mt,_e.regex={concat:h,lookahead:v,either:R,optional:f,anyNumberOfTi