dgz-ui-shared
Version:
Custom ui library using React.js, Shadcn/ui, TailwindCSS, Typescript, dgz-ui library
191 lines • 382 kB
JavaScript
"use strict";const b=require("./index-BL59b1Bz-COeLljOH.cjs"),Q=require("react"),Dt=require("./index-ZsCkaYy6-Bjyf2SZs.cjs"),Te=require("./react-select-DVPHHTAP-DKDInFsM.cjs"),Ae=require("./utils-B6fNqzRf-BNysSCt9.cjs"),si=require("./button-CdZDBhmr-3yMPCRDo.cjs"),Pf=require("react-dom"),Rt=require("./index-Cths1nBq-DzDn15YE.cjs"),hn=require("./createLucideIcon-B950nf2d-DrrWmvZU.cjs"),Bf=require("./index-CbK6da4c-QXbo5Vgb.cjs");function dc(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const T=dc(Q),fc=dc(Pf);function bl(n,[e,t]){return Math.min(t,Math.max(e,n))}/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vf=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],pc=hn.k("chevron-down",Vf);var Uf=Object.defineProperty,$f=(n,e,t)=>e in n?Uf(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ee=(n,e,t)=>$f(n,typeof e!="symbol"?e+"":e,t);/**
* @license lucide-react v0.511.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zf=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Hf=hn.k("chevron-up",zf);function ri(n){const e=T.useRef({value:n,previous:n});return T.useMemo(()=>(e.current.value!==n&&(e.current.previous=e.current.value,e.current.value=n),e.current.previous),[n])}var ii="Checkbox",[Kf,Pk]=b.j(ii),[Wf,ja]=Kf(ii);function Gf(n){const{__scopeCheckbox:e,checked:t,children:s,defaultChecked:r,disabled:i,form:o,name:a,onCheckedChange:l,required:c,value:f="on",internal_do_not_use_render:v}=n,[h,d]=b.y({prop:t,defaultProp:r??!1,onChange:l,caller:ii}),[m,g]=T.useState(null),[k,w]=T.useState(null),E=T.useRef(!1),A=m?!!o||!!m.closest("form"):!0,N={checked:h,disabled:i,setChecked:d,control:m,setControl:g,name:a,form:o,value:f,hasConsumerStoppedPropagationRef:E,required:c,defaultChecked:Kt(r)?!1:r,isFormControl:A,bubbleInput:k,setBubbleInput:w};return b.ae.jsx(Wf,{scope:e,...N,children:Zf(v)?v(N):s})}var mc="CheckboxTrigger",gc=T.forwardRef(({__scopeCheckbox:n,onKeyDown:e,onClick:t,...s},r)=>{const{control:i,value:o,disabled:a,checked:l,required:c,setControl:f,setChecked:v,hasConsumerStoppedPropagationRef:h,isFormControl:d,bubbleInput:m}=ja(mc,n),g=b.i(r,f),k=T.useRef(l);return T.useEffect(()=>{const w=i==null?void 0:i.form;if(w){const E=()=>v(k.current);return w.addEventListener("reset",E),()=>w.removeEventListener("reset",E)}},[i,v]),b.ae.jsx(b.h.button,{type:"button",role:"checkbox","aria-checked":Kt(l)?"mixed":l,"aria-required":c,"data-state":kc(l),"data-disabled":a?"":void 0,disabled:a,value:o,...s,ref:g,onKeyDown:b.y$1(e,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:b.y$1(t,w=>{v(E=>Kt(E)?!0:!E),m&&d&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});gc.displayName=mc;var Da=T.forwardRef((n,e)=>{const{__scopeCheckbox:t,name:s,checked:r,defaultChecked:i,required:o,disabled:a,value:l,onCheckedChange:c,form:f,...v}=n;return b.ae.jsx(Gf,{__scopeCheckbox:t,checked:r,defaultChecked:i,disabled:a,required:o,onCheckedChange:c,name:s,form:f,value:l,internal_do_not_use_render:({isFormControl:h})=>b.ae.jsxs(b.ae.Fragment,{children:[b.ae.jsx(gc,{...v,ref:e,__scopeCheckbox:t}),h&&b.ae.jsx(xc,{__scopeCheckbox:t})]})})});Da.displayName=ii;var vc="CheckboxIndicator",yc=T.forwardRef((n,e)=>{const{__scopeCheckbox:t,forceMount:s,...r}=n,i=ja(vc,t);return b.ae.jsx(b.R,{present:s||Kt(i.checked)||i.checked===!0,children:b.ae.jsx(b.h.span,{"data-state":kc(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e,style:{pointerEvents:"none",...n.style}})})});yc.displayName=vc;var bc="CheckboxBubbleInput",xc=T.forwardRef(({__scopeCheckbox:n,...e},t)=>{const{control:s,hasConsumerStoppedPropagationRef:r,checked:i,defaultChecked:o,required:a,disabled:l,name:c,value:f,form:v,bubbleInput:h,setBubbleInput:d}=ja(bc,n),m=b.i(t,d),g=ri(i),k=Dt.In(s);T.useEffect(()=>{const E=h;if(!E)return;const A=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(A,"checked").set,_=!r.current;if(g!==i&&N){const B=new Event("click",{bubbles:_});E.indeterminate=Kt(i),N.call(E,Kt(i)?!1:i),E.dispatchEvent(B)}},[h,g,i,r]);const w=T.useRef(Kt(i)?!1:i);return b.ae.jsx(b.h.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??w.current,required:a,disabled:l,name:c,value:f,form:v,...e,tabIndex:-1,ref:m,style:{...e.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});xc.displayName=bc;function Zf(n){return typeof n=="function"}function Kt(n){return n==="indeterminate"}function kc(n){return Kt(n)?"indeterminate":n?"checked":"unchecked"}const wc=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(Da,{ref:t,className:Ae.mo("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:text-primary size-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",n),...e,children:b.ae.jsx(yc,{className:Ae.mo("flex size-4 items-center justify-center text-current"),children:e.checked==="indeterminate"?b.ae.jsx(Te.C,{className:"text-primary mr-0.5 mb-0.5 size-3.5"}):b.ae.jsx(Te.i,{className:"text-primary mr-0.5 mb-0.5 size-3.5"})})}));wc.displayName=Da.displayName;const oi=si.j("flex h-10 w-full rounded-lg border border-border-alpha-strong px-3 py-2 dark:bg-transparent file:border-0 placeholder:text-secondary placeholder:text-body-sm-regular focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-bg focus-visible:ring-offset-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"focus-visible:ring-item-primary",failure:"focus-visible:ring-item-destructive bg-item-destructive-focus placeholder:text-item-destructive border-item-destructive text-destructive",success:"focus-visible:ring-success bg-success/20 placeholder:text-success/80 border-success text-success"}},defaultVariants:{variant:"default"}}),Ec=T.forwardRef(({className:n,type:e,variant:t,...s},r)=>{const[i,o]=Q.useState(!1),[a,l]=Q.useState(!1);return Q.useEffect(()=>{o(e==="password")},[e]),b.ae.jsxs("div",{className:"relative",children:[b.ae.jsx("input",{type:a?"text":e,className:Ae.mo(oi({variant:t}),n,i&&"pr-10"),ref:r,...s}),i&&b.ae.jsx(si.u,{type:"button",size:"icon",variant:"tertiary",className:"absolute top-1 right-1 size-8 cursor-pointer rounded-md p-2 !ring-0 !ring-offset-0",onClick:()=>{l(!a)},children:a?b.ae.jsx(Te.w,{}):b.ae.jsx(Te.m,{})})]})});Ec.displayName="Input";var Ke=function(){return Ke=Object.assign||function(n){for(var e,t=1,s=arguments.length;t<s;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},Ke.apply(this,arguments)};function Qn(n,e,t){if(t||arguments.length===2)for(var s=0,r=e.length,i;s<r;s++)(i||!(s in e))&&(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return n.concat(i||Array.prototype.slice.call(e))}function Xf(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var Yf=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Jf=Xf(function(n){return Yf.test(n)||n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&n.charCodeAt(2)<91}),Ee="-ms-",js="-moz-",be="-webkit-",_c="comm",ai="rule",Ma="decl",Qf="@import",Sc="@keyframes",ep="@layer",Ac=Math.abs,Fa=String.fromCharCode,Xo=Object.assign;function tp(n,e){return Re(n,0)^45?(((e<<2^Re(n,0))<<2^Re(n,1))<<2^Re(n,2))<<2^Re(n,3):0}function Cc(n){return n.trim()}function Nt(n,e){return(n=e.exec(n))?n[0]:n}function de(n,e,t){return n.replace(e,t)}function Tr(n,e,t){return n.indexOf(e,t)}function Re(n,e){return n.charCodeAt(e)|0}function es(n,e,t){return n.slice(e,t)}function gt(n){return n.length}function Nc(n){return n.length}function Os(n,e){return e.push(n),n}function np(n,e){return n.map(e).join("")}function xl(n,e){return n.filter(function(t){return!Nt(t,e)})}var li=1,ts=1,Oc=0,et=0,Ne=0,ls="";function ui(n,e,t,s,r,i,o,a){return{value:n,root:e,parent:t,type:s,props:r,children:i,line:li,column:ts,length:o,return:"",siblings:a}}function Vt(n,e){return Xo(ui("",null,null,"",null,null,0,n.siblings),n,{length:-n.length},e)}function Bn(n){for(;n.root;)n=Vt(n.root,{children:[n]});Os(n,n.siblings)}function sp(){return Ne}function rp(){return Ne=et>0?Re(ls,--et):0,ts--,Ne===10&&(ts=1,li--),Ne}function ot(){return Ne=et<Oc?Re(ls,et++):0,ts++,Ne===10&&(ts=1,li++),Ne}function pn(){return Re(ls,et)}function Rr(){return et}function ci(n,e){return es(ls,n,e)}function Yo(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ip(n){return li=ts=1,Oc=gt(ls=n),et=0,[]}function op(n){return ls="",n}function wo(n){return Cc(ci(et-1,Jo(n===91?n+2:n===40?n+1:n)))}function ap(n){for(;(Ne=pn())&&Ne<33;)ot();return Yo(n)>2||Yo(Ne)>3?"":" "}function lp(n,e){for(;--e&&ot()&&!(Ne<48||Ne>102||Ne>57&&Ne<65||Ne>70&&Ne<97););return ci(n,Rr()+(e<6&&pn()==32&&ot()==32))}function Jo(n){for(;ot();)switch(Ne){case n:return et;case 34:case 39:n!==34&&n!==39&&Jo(Ne);break;case 40:n===41&&Jo(n);break;case 92:ot();break}return et}function up(n,e){for(;ot()&&n+Ne!==57&&!(n+Ne===84&&pn()===47););return"/*"+ci(e,et-1)+"*"+Fa(n===47?n:ot())}function cp(n){for(;!Yo(pn());)ot();return ci(n,et)}function hp(n){return op(Ir("",null,null,null,[""],n=ip(n),0,[0],n))}function Ir(n,e,t,s,r,i,o,a,l){for(var c=0,f=0,v=o,h=0,d=0,m=0,g=1,k=1,w=1,E=0,A="",N=r,_=i,B=s,H=A;k;)switch(m=E,E=ot()){case 40:if(m!=108&&Re(H,v-1)==58){Tr(H+=de(wo(E),"&","&\f"),"&\f",Ac(c?a[c-1]:0))!=-1&&(w=-1);break}case 34:case 39:case 91:H+=wo(E);break;case 9:case 10:case 13:case 32:H+=ap(m);break;case 92:H+=lp(Rr()-1,7);continue;case 47:switch(pn()){case 42:case 47:Os(dp(up(ot(),Rr()),e,t,l),l);break;default:H+="/"}break;case 123*g:a[c++]=gt(H)*w;case 125*g:case 59:case 0:switch(E){case 0:case 125:k=0;case 59+f:w==-1&&(H=de(H,/\f/g,"")),d>0&>(H)-v&&Os(d>32?wl(H+";",s,t,v-1,l):wl(de(H," ","")+";",s,t,v-2,l),l);break;case 59:H+=";";default:if(Os(B=kl(H,e,t,c,f,r,a,A,N=[],_=[],v,i),i),E===123)if(f===0)Ir(H,e,B,B,N,i,v,a,_);else switch(h===99&&Re(H,3)===110?100:h){case 100:case 108:case 109:case 115:Ir(n,B,B,s&&Os(kl(n,B,B,0,0,r,a,A,r,N=[],v,_),_),r,_,v,a,s?N:_);break;default:Ir(H,B,B,B,[""],_,0,a,_)}}c=f=d=0,g=w=1,A=H="",v=o;break;case 58:v=1+gt(H),d=m;default:if(g<1){if(E==123)--g;else if(E==125&&g++==0&&rp()==125)continue}switch(H+=Fa(E),E*g){case 38:w=f>0?1:(H+="\f",-1);break;case 44:a[c++]=(gt(H)-1)*w,w=1;break;case 64:pn()===45&&(H+=wo(ot())),h=pn(),f=v=gt(A=H+=cp(Rr())),E++;break;case 45:m===45&>(H)==2&&(g=0)}}return i}function kl(n,e,t,s,r,i,o,a,l,c,f,v){for(var h=r-1,d=r===0?i:[""],m=Nc(d),g=0,k=0,w=0;g<s;++g)for(var E=0,A=es(n,h+1,h=Ac(k=o[g])),N=n;E<m;++E)(N=Cc(k>0?d[E]+" "+A:de(A,/&\f/g,d[E])))&&(l[w++]=N);return ui(n,e,t,r===0?ai:a,l,c,f,v)}function dp(n,e,t,s){return ui(n,e,t,_c,Fa(sp()),es(n,2,-2),0,s)}function wl(n,e,t,s,r){return ui(n,e,t,Ma,es(n,0,s),es(n,s+1,-1),s,r)}function Tc(n,e,t){switch(tp(n,e)){case 5103:return be+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return be+n+n;case 4789:return js+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return be+n+js+n+Ee+n+n;case 5936:switch(Re(n,e+11)){case 114:return be+n+Ee+de(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return be+n+Ee+de(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return be+n+Ee+de(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return be+n+Ee+n+n;case 6165:return be+n+Ee+"flex-"+n+n;case 5187:return be+n+de(n,/(\w+).+(:[^]+)/,be+"box-$1$2"+Ee+"flex-$1$2")+n;case 5443:return be+n+Ee+"flex-item-"+de(n,/flex-|-self/g,"")+(Nt(n,/flex-|baseline/)?"":Ee+"grid-row-"+de(n,/flex-|-self/g,""))+n;case 4675:return be+n+Ee+"flex-line-pack"+de(n,/align-content|flex-|-self/g,"")+n;case 5548:return be+n+Ee+de(n,"shrink","negative")+n;case 5292:return be+n+Ee+de(n,"basis","preferred-size")+n;case 6060:return be+"box-"+de(n,"-grow","")+be+n+Ee+de(n,"grow","positive")+n;case 4554:return be+de(n,/([^-])(transform)/g,"$1"+be+"$2")+n;case 6187:return de(de(de(n,/(zoom-|grab)/,be+"$1"),/(image-set)/,be+"$1"),n,"")+n;case 5495:case 3959:return de(n,/(image-set\([^]*)/,be+"$1$`$1");case 4968:return de(de(n,/(.+:)(flex-)?(.*)/,be+"box-pack:$3"+Ee+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+be+n+n;case 4200:if(!Nt(n,/flex-|baseline/))return Ee+"grid-column-align"+es(n,e)+n;break;case 2592:case 3360:return Ee+de(n,"template-","")+n;case 4384:case 3616:return t&&t.some(function(s,r){return e=r,Nt(s.props,/grid-\w+-end/)})?~Tr(n+(t=t[e].value),"span",0)?n:Ee+de(n,"-start","")+n+Ee+"grid-row-span:"+(~Tr(t,"span",0)?Nt(t,/\d+/):+Nt(t,/\d+/)-+Nt(n,/\d+/))+";":Ee+de(n,"-start","")+n;case 4896:case 4128:return t&&t.some(function(s){return Nt(s.props,/grid-\w+-start/)})?n:Ee+de(de(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return de(n,/(.+)-inline(.+)/,be+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(gt(n)-1-e>6)switch(Re(n,e+1)){case 109:if(Re(n,e+4)!==45)break;case 102:return de(n,/(.+:)(.+)-([^]+)/,"$1"+be+"$2-$3$1"+js+(Re(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~Tr(n,"stretch",0)?Tc(de(n,"stretch","fill-available"),e,t)+n:n}break;case 5152:case 5920:return de(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(s,r,i,o,a,l,c){return Ee+r+":"+i+c+(o?Ee+r+"-span:"+(a?l:+l-+i)+c:"")+n});case 4949:if(Re(n,e+6)===121)return de(n,":",":"+be)+n;break;case 6444:switch(Re(n,Re(n,14)===45?18:11)){case 120:return de(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+be+(Re(n,14)===45?"inline-":"")+"box$3$1"+be+"$2$3$1"+Ee+"$2box$3")+n;case 100:return de(n,":",":"+Ee)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return de(n,"scroll-","scroll-snap-")+n}return n}function Wr(n,e){for(var t="",s=0;s<n.length;s++)t+=e(n[s],s,n,e)||"";return t}function fp(n,e,t,s){switch(n.type){case ep:if(n.children.length)break;case Qf:case Ma:return n.return=n.return||n.value;case _c:return"";case Sc:return n.return=n.value+"{"+Wr(n.children,s)+"}";case ai:if(!gt(n.value=n.props.join(",")))return""}return gt(t=Wr(n.children,s))?n.return=n.value+"{"+t+"}":""}function pp(n){var e=Nc(n);return function(t,s,r,i){for(var o="",a=0;a<e;a++)o+=n[a](t,s,r,i)||"";return o}}function mp(n){return function(e){e.root||(e=e.return)&&n(e)}}function gp(n,e,t,s){if(n.length>-1&&!n.return)switch(n.type){case Ma:n.return=Tc(n.value,n.length,t);return;case Sc:return Wr([Vt(n,{value:de(n.value,"@","@"+be)})],s);case ai:if(n.length)return np(t=n.props,function(r){switch(Nt(r,s=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Bn(Vt(n,{props:[de(r,/:(read-\w+)/,":"+js+"$1")]})),Bn(Vt(n,{props:[r]})),Xo(n,{props:xl(t,s)});break;case"::placeholder":Bn(Vt(n,{props:[de(r,/:(plac\w+)/,":"+be+"input-$1")]})),Bn(Vt(n,{props:[de(r,/:(plac\w+)/,":"+js+"$1")]})),Bn(Vt(n,{props:[de(r,/:(plac\w+)/,Ee+"input-$1")]})),Bn(Vt(n,{props:[r]})),Xo(n,{props:xl(t,s)});break}return""})}}var vp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},gn=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Rc="active",Ic="data-styled-version",hi="6.1.19",Pa=`/*!sc*/
`,Gr=typeof window<"u"&&typeof document<"u",yp=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),El=/invalid hook call/i,vr=new Set,bp=function(n,e){if(process.env.NODE_ENV!=="production"){var t=e?' with the id of "'.concat(e,'"'):"",s="The component ".concat(n).concat(t,` has been created dynamically.
`)+`You may see this warning because you've called styled inside another component.
To resolve this only create new StyledComponents outside of any render method and function component.
See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
`,r=console.error;try{var i=!0;console.error=function(o){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];El.test(o)?(i=!1,vr.delete(s)):r.apply(void 0,Qn([o],a,!1))},Q.useRef(),i&&!vr.has(s)&&(console.warn(s),vr.add(s))}catch(o){El.test(o.message)&&vr.delete(s)}finally{console.error=r}}},di=Object.freeze([]),ns=Object.freeze({});function xp(n,e,t){return t===void 0&&(t=ns),n.theme!==t.theme&&n.theme||e||t.theme}var Qo=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),kp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,wp=/(^-|-$)/g;function _l(n){return n.replace(kp,"-").replace(wp,"")}var Ep=/(a)(d)/gi,yr=52,Sl=function(n){return String.fromCharCode(n+(n>25?39:97))};function ea(n){var e,t="";for(e=Math.abs(n);e>yr;e=e/yr|0)t=Sl(e%yr)+t;return(Sl(e%yr)+t).replace(Ep,"$1-$2")}var Eo,Lc=5381,cn=function(n,e){for(var t=e.length;t;)n=33*n^e.charCodeAt(--t);return n},qc=function(n){return cn(Lc,n)};function _p(n){return ea(qc(n)>>>0)}function jc(n){return process.env.NODE_ENV!=="production"&&typeof n=="string"&&n||n.displayName||n.name||"Component"}function _o(n){return typeof n=="string"&&(process.env.NODE_ENV==="production"||n.charAt(0)===n.charAt(0).toLowerCase())}var Dc=typeof Symbol=="function"&&Symbol.for,Mc=Dc?Symbol.for("react.memo"):60115,Sp=Dc?Symbol.for("react.forward_ref"):60112,Ap={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Cp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Fc={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Np=((Eo={})[Sp]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Eo[Mc]=Fc,Eo);function Al(n){return("type"in(e=n)&&e.type.$$typeof)===Mc?Fc:"$$typeof"in n?Np[n.$$typeof]:Ap;var e}var Op=Object.defineProperty,Tp=Object.getOwnPropertyNames,Cl=Object.getOwnPropertySymbols,Rp=Object.getOwnPropertyDescriptor,Ip=Object.getPrototypeOf,Nl=Object.prototype;function Pc(n,e,t){if(typeof e!="string"){if(Nl){var s=Ip(e);s&&s!==Nl&&Pc(n,s,t)}var r=Tp(e);Cl&&(r=r.concat(Cl(e)));for(var i=Al(n),o=Al(e),a=0;a<r.length;++a){var l=r[a];if(!(l in Cp||t&&t[l]||o&&l in o||i&&l in i)){var c=Rp(e,l);try{Op(n,l,c)}catch{}}}}return n}function ss(n){return typeof n=="function"}function Ba(n){return typeof n=="object"&&"styledComponentId"in n}function dn(n,e){return n&&e?"".concat(n," ").concat(e):n||e||""}function Ol(n,e){if(n.length===0)return"";for(var t=n[0],s=1;s<n.length;s++)t+=n[s];return t}function rs(n){return n!==null&&typeof n=="object"&&n.constructor.name===Object.name&&!("props"in n&&n.$$typeof)}function ta(n,e,t){if(t===void 0&&(t=!1),!t&&!rs(n)&&!Array.isArray(n))return e;if(Array.isArray(e))for(var s=0;s<e.length;s++)n[s]=ta(n[s],e[s]);else if(rs(e))for(var s in e)n[s]=ta(n[s],e[s]);return n}function Va(n,e){Object.defineProperty(n,"toString",{value:e})}var Lp=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
- Are you trying to reuse it across renders?
- Are you accidentally calling collectStyles twice?
`,3:`Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
`,4:`The \`StyleSheetManager\` expects a valid target or sheet prop!
- Does this error occur on the client and is your target falsy?
- Does this error occur on the server and is the sheet falsy?
`,5:`The clone method cannot be used on the client!
- Are you running in a client-like environment on the server?
- Are you trying to run SSR on the client?
`,6:`Trying to insert a new style tag, but the given Node is unmounted!
- Are you using a custom target that isn't mounted?
- Does your document not have a valid head element?
- Have you accidentally removed a style tag manually?
`,7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:`ThemeProvider: Please make your "theme" prop an object.
`,9:"Missing document `<head>`\n\n",10:`Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
`,11:`_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
`,12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:`%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
`,14:`ThemeProvider: "theme" prop is required.
`,15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:`Reached the limit of how many styled components may be created at group %s.
You may only create up to 1,073,741,824 components. If you're creating components dynamically,
as for instance in your render method then you may be running into this limitation.
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
Has styled-components' style tag been unmounted or altered by another script?
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function qp(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];for(var t=n[0],s=[],r=1,i=n.length;r<i;r+=1)s.push(n[r]);return s.forEach(function(o){t=t.replace(/%[a-z]/,o)}),t}function us(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(n," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):"")):new Error(qp.apply(void 0,Qn([Lp[n]],e,!1)).trim())}var jp=function(){function n(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return n.prototype.indexOfGroup=function(e){for(var t=0,s=0;s<e;s++)t+=this.groupSizes[s];return t},n.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var s=this.groupSizes,r=s.length,i=r;e>=i;)if((i<<=1)<0)throw us(16,"".concat(e));this.groupSizes=new Uint32Array(i),this.groupSizes.set(s),this.length=i;for(var o=r;o<i;o++)this.groupSizes[o]=0}for(var a=this.indexOfGroup(e+1),l=(o=0,t.length);o<l;o++)this.tag.insertRule(a,t[o])&&(this.groupSizes[e]++,a++)},n.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],s=this.indexOfGroup(e),r=s+t;this.groupSizes[e]=0;for(var i=s;i<r;i++)this.tag.deleteRule(s)}},n.prototype.getGroup=function(e){var t="";if(e>=this.length||this.groupSizes[e]===0)return t;for(var s=this.groupSizes[e],r=this.indexOfGroup(e),i=r+s,o=r;o<i;o++)t+="".concat(this.tag.getRule(o)).concat(Pa);return t},n}(),Dp=1<<30,Lr=new Map,Zr=new Map,qr=1,br=function(n){if(Lr.has(n))return Lr.get(n);for(;Zr.has(qr);)qr++;var e=qr++;if(process.env.NODE_ENV!=="production"&&((0|e)<0||e>Dp))throw us(16,"".concat(e));return Lr.set(n,e),Zr.set(e,n),e},Mp=function(n,e){qr=e+1,Lr.set(n,e),Zr.set(e,n)},Fp="style[".concat(gn,"][").concat(Ic,'="').concat(hi,'"]'),Pp=new RegExp("^".concat(gn,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Bp=function(n,e,t){for(var s,r=t.split(","),i=0,o=r.length;i<o;i++)(s=r[i])&&n.registerName(e,s)},Vp=function(n,e){for(var t,s=((t=e.textContent)!==null&&t!==void 0?t:"").split(Pa),r=[],i=0,o=s.length;i<o;i++){var a=s[i].trim();if(a){var l=a.match(Pp);if(l){var c=0|parseInt(l[1],10),f=l[2];c!==0&&(Mp(f,c),Bp(n,f,l[3]),n.getTag().insertRules(c,r)),r.length=0}else r.push(a)}}},Tl=function(n){for(var e=document.querySelectorAll(Fp),t=0,s=e.length;t<s;t++){var r=e[t];r&&r.getAttribute(gn)!==Rc&&(Vp(n,r),r.parentNode&&r.parentNode.removeChild(r))}};function Up(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Bc=function(n){var e=document.head,t=n||e,s=document.createElement("style"),r=function(a){var l=Array.from(a.querySelectorAll("style[".concat(gn,"]")));return l[l.length-1]}(t),i=r!==void 0?r.nextSibling:null;s.setAttribute(gn,Rc),s.setAttribute(Ic,hi);var o=Up();return o&&s.setAttribute("nonce",o),t.insertBefore(s,i),s},$p=function(){function n(e){this.element=Bc(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var s=document.styleSheets,r=0,i=s.length;r<i;r++){var o=s[r];if(o.ownerNode===t)return o}throw us(17)}(this.element),this.length=0}return n.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}},n.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},n.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},n}(),zp=function(){function n(e){this.element=Bc(e),this.nodes=this.element.childNodes,this.length=0}return n.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var s=document.createTextNode(t);return this.element.insertBefore(s,this.nodes[e]||null),this.length++,!0}return!1},n.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},n.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},n}(),Hp=function(){function n(e){this.rules=[],this.length=0}return n.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},n.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},n.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},n}(),Rl=Gr,Kp={isServer:!Gr,useCSSOMInjection:!yp},Vc=function(){function n(e,t,s){e===void 0&&(e=ns),t===void 0&&(t={});var r=this;this.options=Ke(Ke({},Kp),e),this.gs=t,this.names=new Map(s),this.server=!!e.isServer,!this.server&&Gr&&Rl&&(Rl=!1,Tl(this)),Va(this,function(){return function(i){for(var o=i.getTag(),a=o.length,l="",c=function(v){var h=function(w){return Zr.get(w)}(v);if(h===void 0)return"continue";var d=i.names.get(h),m=o.getGroup(v);if(d===void 0||!d.size||m.length===0)return"continue";var g="".concat(gn,".g").concat(v,'[id="').concat(h,'"]'),k="";d!==void 0&&d.forEach(function(w){w.length>0&&(k+="".concat(w,","))}),l+="".concat(m).concat(g,'{content:"').concat(k,'"}').concat(Pa)},f=0;f<a;f++)c(f);return l}(r)})}return n.registerId=function(e){return br(e)},n.prototype.rehydrate=function(){!this.server&&Gr&&Tl(this)},n.prototype.reconstructWithOptions=function(e,t){return t===void 0&&(t=!0),new n(Ke(Ke({},this.options),e),this.gs,t&&this.names||void 0)},n.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},n.prototype.getTag=function(){return this.tag||(this.tag=(e=function(t){var s=t.useCSSOMInjection,r=t.target;return t.isServer?new Hp(r):s?new $p(r):new zp(r)}(this.options),new jp(e)));var e},n.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},n.prototype.registerName=function(e,t){if(br(e),this.names.has(e))this.names.get(e).add(t);else{var s=new Set;s.add(t),this.names.set(e,s)}},n.prototype.insertRules=function(e,t,s){this.registerName(e,t),this.getTag().insertRules(br(e),s)},n.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},n.prototype.clearRules=function(e){this.getTag().clearGroup(br(e)),this.clearNames(e)},n.prototype.clearTag=function(){this.tag=void 0},n}(),Wp=/&/g,Gp=/^\s*\/\/.*$/gm;function Uc(n,e){return n.map(function(t){return t.type==="rule"&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map(function(s){return"".concat(e," ").concat(s)})),Array.isArray(t.children)&&t.type!=="@keyframes"&&(t.children=Uc(t.children,e)),t})}function Zp(n){var e,t,s,r=ns,i=r.options,o=i===void 0?ns:i,a=r.plugins,l=a===void 0?di:a,c=function(h,d,m){return m.startsWith(t)&&m.endsWith(t)&&m.replaceAll(t,"").length>0?".".concat(e):h},f=l.slice();f.push(function(h){h.type===ai&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(Wp,t).replace(s,c))}),o.prefix&&f.push(gp),f.push(fp);var v=function(h,d,m,g){d===void 0&&(d=""),m===void 0&&(m=""),g===void 0&&(g="&"),e=g,t=d,s=new RegExp("\\".concat(t,"\\b"),"g");var k=h.replace(Gp,""),w=hp(m||d?"".concat(m," ").concat(d," { ").concat(k," }"):k);o.namespace&&(w=Uc(w,o.namespace));var E=[];return Wr(w,pp(f.concat(mp(function(A){return E.push(A)})))),E};return v.hash=l.length?l.reduce(function(h,d){return d.name||us(15),cn(h,d.name)},Lc).toString():"",v}var Xp=new Vc,na=Zp(),$c=Q.createContext({shouldForwardProp:void 0,styleSheet:Xp,stylis:na});$c.Consumer;Q.createContext(void 0);function Il(){return Q.useContext($c)}var Ll=function(){function n(e,t){var s=this;this.inject=function(r,i){i===void 0&&(i=na);var o=s.name+i.hash;r.hasNameForId(s.id,o)||r.insertRules(s.id,o,i(s.rules,o,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Va(this,function(){throw us(12,String(s.name))})}return n.prototype.getName=function(e){return e===void 0&&(e=na),this.name+e.hash},n}(),Yp=function(n){return n>="A"&&n<="Z"};function ql(n){for(var e="",t=0;t<n.length;t++){var s=n[t];if(t===1&&s==="-"&&n[0]==="-")return n;Yp(s)?e+="-"+s.toLowerCase():e+=s}return e.startsWith("ms-")?"-"+e:e}var zc=function(n){return n==null||n===!1||n===""},Hc=function(n){var e,t,s=[];for(var r in n){var i=n[r];n.hasOwnProperty(r)&&!zc(i)&&(Array.isArray(i)&&i.isCss||ss(i)?s.push("".concat(ql(r),":"),i,";"):rs(i)?s.push.apply(s,Qn(Qn(["".concat(r," {")],Hc(i),!1),["}"],!1)):s.push("".concat(ql(r),": ").concat((e=r,(t=i)==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in vp||e.startsWith("--")?String(t).trim():"".concat(t,"px")),";")))}return s};function mn(n,e,t,s){if(zc(n))return[];if(Ba(n))return[".".concat(n.styledComponentId)];if(ss(n)){if(!ss(i=n)||i.prototype&&i.prototype.isReactComponent||!e)return[n];var r=n(e);return process.env.NODE_ENV==="production"||typeof r!="object"||Array.isArray(r)||r instanceof Ll||rs(r)||r===null||console.error("".concat(jc(n)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),mn(r,e,t,s)}var i;return n instanceof Ll?t?(n.inject(t,s),[n.getName(s)]):[n]:rs(n)?Hc(n):Array.isArray(n)?Array.prototype.concat.apply(di,n.map(function(o){return mn(o,e,t,s)})):[n.toString()]}function Jp(n){for(var e=0;e<n.length;e+=1){var t=n[e];if(ss(t)&&!Ba(t))return!1}return!0}var Qp=qc(hi),em=function(){function n(e,t,s){this.rules=e,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(s===void 0||s.isStatic)&&Jp(e),this.componentId=t,this.baseHash=cn(Qp,t),this.baseStyle=s,Vc.registerId(t)}return n.prototype.generateAndInjectStyles=function(e,t,s){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,s):"";if(this.isStatic&&!s.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=dn(r,this.staticRulesId);else{var i=Ol(mn(this.rules,e,t,s)),o=ea(cn(this.baseHash,i)>>>0);if(!t.hasNameForId(this.componentId,o)){var a=s(i,".".concat(o),void 0,this.componentId);t.insertRules(this.componentId,o,a)}r=dn(r,o),this.staticRulesId=o}else{for(var l=cn(this.baseHash,s.hash),c="",f=0;f<this.rules.length;f++){var v=this.rules[f];if(typeof v=="string")c+=v,process.env.NODE_ENV!=="production"&&(l=cn(l,v));else if(v){var h=Ol(mn(v,e,t,s));l=cn(l,h+f),c+=h}}if(c){var d=ea(l>>>0);t.hasNameForId(this.componentId,d)||t.insertRules(this.componentId,d,s(c,".".concat(d),void 0,this.componentId)),r=dn(r,d)}}return r},n}(),Kc=Q.createContext(void 0);Kc.Consumer;var So={},jl=new Set;function tm(n,e,t){var s=Ba(n),r=n,i=!_o(n),o=e.attrs,a=o===void 0?di:o,l=e.componentId,c=l===void 0?function(N,_){var B=typeof N!="string"?"sc":_l(N);So[B]=(So[B]||0)+1;var H="".concat(B,"-").concat(_p(hi+B+So[B]));return _?"".concat(_,"-").concat(H):H}(e.displayName,e.parentComponentId):l,f=e.displayName,v=f===void 0?function(N){return _o(N)?"styled.".concat(N):"Styled(".concat(jc(N),")")}(n):f,h=e.displayName&&e.componentId?"".concat(_l(e.displayName),"-").concat(e.componentId):e.componentId||c,d=s&&r.attrs?r.attrs.concat(a).filter(Boolean):a,m=e.shouldForwardProp;if(s&&r.shouldForwardProp){var g=r.shouldForwardProp;if(e.shouldForwardProp){var k=e.shouldForwardProp;m=function(N,_){return g(N,_)&&k(N,_)}}else m=g}var w=new em(t,h,s?r.componentStyle:void 0);function E(N,_){return function(B,H,ae){var he=B.attrs,me=B.componentStyle,y=B.defaultProps,j=B.foldedComponentIds,S=B.styledComponentId,$=B.target,V=Q.useContext(Kc),O=Il(),M=B.shouldForwardProp||O.shouldForwardProp;process.env.NODE_ENV!=="production"&&Q.useDebugValue(S);var Z=xp(H,V,y)||ns,X=function(z,Y,D){for(var P,W=Ke(Ke({},Y),{className:void 0,theme:D}),U=0;U<z.length;U+=1){var J=ss(P=z[U])?P(W):P;for(var I in J)W[I]=I==="className"?dn(W[I],J[I]):I==="style"?Ke(Ke({},W[I]),J[I]):J[I]}return Y.className&&(W.className=dn(W.className,Y.className)),W}(he,H,Z),C=X.as||$,L={};for(var F in X)X[F]===void 0||F[0]==="$"||F==="as"||F==="theme"&&X.theme===Z||(F==="forwardedAs"?L.as=X.forwardedAs:M&&!M(F,C)||(L[F]=X[F],M||process.env.NODE_ENV!=="development"||Jf(F)||jl.has(F)||!Qo.has(C)||(jl.add(F),console.warn('styled-components: it looks like an unknown prop "'.concat(F,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var G=function(z,Y){var D=Il(),P=z.generateAndInjectStyles(Y,D.styleSheet,D.stylis);return process.env.NODE_ENV!=="production"&&Q.useDebugValue(P),P}(me,X);process.env.NODE_ENV!=="production"&&B.warnTooManyClasses&&B.warnTooManyClasses(G);var K=dn(j,S);return G&&(K+=" "+G),X.className&&(K+=" "+X.className),L[_o(C)&&!Qo.has(C)?"class":"className"]=K,ae&&(L.ref=ae),Q.createElement(C,L)}(A,N,_)}E.displayName=v;var A=Q.forwardRef(E);return A.attrs=d,A.componentStyle=w,A.displayName=v,A.shouldForwardProp=m,A.foldedComponentIds=s?dn(r.foldedComponentIds,r.styledComponentId):"",A.styledComponentId=h,A.target=s?r.target:n,Object.defineProperty(A,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(N){this._foldedDefaultProps=s?function(_){for(var B=[],H=1;H<arguments.length;H++)B[H-1]=arguments[H];for(var ae=0,he=B;ae<he.length;ae++)ta(_,he[ae],!0);return _}({},r.defaultProps,N):N}}),process.env.NODE_ENV!=="production"&&(bp(v,h),A.warnTooManyClasses=function(N,_){var B={},H=!1;return function(ae){if(!H&&(B[ae]=!0,Object.keys(B).length>=200)){var he=_?' with the id of "'.concat(_,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(N).concat(he,`.
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
Example:
const Component = styled.div.attrs(props => ({
style: {
background: props.background,
},
}))\`width: 100%;\`
<Component />`),H=!0,B={}}}}(v,h)),Va(A,function(){return".".concat(A.styledComponentId)}),i&&Pc(A,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),A}function Dl(n,e){for(var t=[n[0]],s=0,r=e.length;s<r;s+=1)t.push(e[s],n[s+1]);return t}var Ml=function(n){return Object.assign(n,{isCss:!0})};function nm(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(ss(n)||rs(n))return Ml(mn(Dl(di,Qn([n],e,!0))));var s=n;return e.length===0&&s.length===1&&typeof s[0]=="string"?mn(s):Ml(mn(Dl(s,e)))}function sa(n,e,t){if(t===void 0&&(t=ns),!e)throw us(1,e);var s=function(r){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return n(e,t,nm.apply(void 0,Qn([r],i,!1)))};return s.attrs=function(r){return sa(n,e,Ke(Ke({},t),{attrs:Array.prototype.concat(t.attrs,r).filter(Boolean)}))},s.withConfig=function(r){return sa(n,e,Ke(Ke({},t),r))},s}var Wc=function(n){return sa(tm,n)},Ua=Wc;Qo.forEach(function(n){Ua[n]=Wc(n)});process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
Perhaps you're looking to import 'styled-components/native'?
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var xr="__sc-".concat(gn,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[xr]||(window[xr]=0),window[xr]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
See https://s-c.sh/2BAXzed for more info.`),window[xr]+=1);const sm=Ua.div`
.filepond {
&--drop-label {
label {
color: ${({$invalid:n})=>n?"var(--color-item-primary-destructive)":"inherit"} !important;
}
}
&--root {
margin-bottom: 0.5rem;
border-radius: 0.75rem;
}
&--panel {
border-radius: 0.8rem;
overflow: hidden;
&-root {
background-color: transparent;
}
}
&--drip {
border: 1px solid
${({$invalid:n})=>n?"var(--color-item-primary-destructive)":"var(--color-border-alpha-strong)"};
background-color: transparent;
opacity: 1;
outline-offset: 2px;
border-radius: 0.75rem;
}
}
&:focus-within {
.filepond {
&--drip {
outline: 2px solid
${({$invalid:n})=>n?"var(--color-item-primary-destructive)":"var(--color-item-primary-primary)"};
}
}
}
`;function Gc({variant:n="default",...e}){return b.ae.jsx(sm,{$invalid:n==="failure",...e})}Gc.displayName="FilepondContainer";var rm="Label",Zc=T.forwardRef((n,e)=>b.ae.jsx(b.h.label,{...n,ref:e,onMouseDown:t=>{var s;t.target.closest("button, input, select, textarea")||((s=n.onMouseDown)==null||s.call(n,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Zc.displayName=rm;var Xc=Zc,im=n=>n.type==="checkbox",Ts=n=>n instanceof Date,$a=n=>n==null;const Yc=n=>typeof n=="object";var vn=n=>!$a(n)&&!Array.isArray(n)&&Yc(n)&&!Ts(n),om=n=>vn(n)&&n.target?im(n.target)?n.target.checked:n.target.value:n,am=n=>n.substring(0,n.search(/\.\d+(\.|$)/))||n,lm=(n,e)=>n.has(am(e)),um=n=>{const e=n.constructor&&n.constructor.prototype;return vn(e)&&e.hasOwnProperty("isPrototypeOf")},cm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Jc(n){let e;const t=Array.isArray(n),s=typeof FileList<"u"?n instanceof FileList:!1;if(n instanceof Date)e=new Date(n);else if(!(cm&&(n instanceof Blob||s))&&(t||vn(n)))if(e=t?[]:Object.create(Object.getPrototypeOf(n)),!t&&!um(n))e=n;else for(const r in n)n.hasOwnProperty(r)&&(e[r]=Jc(n[r]));else return n;return e}var Qc=n=>/^\w*$/.test(n),ra=n=>n===void 0,hm=n=>Array.isArray(n)?n.filter(Boolean):[],eh=n=>hm(n.replace(/["|']|\]/g,"").split(/\.|\[/)),He=(n,e,t)=>{if(!e||!vn(n))return t;const s=(Qc(e)?[e]:eh(e)).reduce((r,i)=>$a(r)?r:r[i],n);return ra(s)||s===n?ra(n[e])?t:n[e]:s},Ao=n=>typeof n=="boolean",Fl=(n,e,t)=>{let s=-1;const r=Qc(e)?[e]:eh(e),i=r.length,o=i-1;for(;++s<i;){const a=r[s];let l=t;if(s!==o){const c=n[a];l=vn(c)||Array.isArray(c)?c:isNaN(+r[s+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;n[a]=l,n=n[a]}};const Pl={BLUR:"blur",CHANGE:"change"},Bl={all:"all"},za=Q.createContext(null);za.displayName="HookFormContext";const fi=()=>Q.useContext(za),dm=n=>{const{children:e,...t}=n;return Q.createElement(za.Provider,{value:t},e)};var fm=(n,e,t,s=!0)=>{const r={defaultValues:e._defaultValues};for(const i in n)Object.defineProperty(r,i,{get:()=>{const o=i;return e._proxyFormState[o]!==Bl.all&&(e._proxyFormState[o]=!s||Bl.all),t&&(t[o]=!0),n[o]}});return r};const th=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function pm(n){const e=fi(),{control:t=e.control,disabled:s,name:r,exact:i}=n||{},[o,a]=Q.useState(t._formState),l=Q.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return th(()=>t._subscribe({name:r,formState:l.current,exact:i,callback:c=>{!s&&a({...t._formState,...c})}}),[r,s,i]),Q.useEffect(()=>{l.current.isValid&&t._setValid(!0)},[t]),Q.useMemo(()=>fm(o,t,l.current,!1),[o,t])}var mm=n=>typeof n=="string",Vl=(n,e,t,s,r)=>mm(n)?He(t,n,r):Array.isArray(n)?n.map(i=>He(t,i)):t,Ul=n=>$a(n)||!Yc(n);function jr(n,e,t=new WeakSet){if(Ul(n)||Ul(e))return Object.is(n,e);if(Ts(n)&&Ts(e))return n.getTime()===e.getTime();const s=Object.keys(n),r=Object.keys(e);if(s.length!==r.length)return!1;if(t.has(n)||t.has(e))return!0;t.add(n),t.add(e);for(const i of s){const o=n[i];if(!r.includes(i))return!1;if(i!=="ref"){const a=e[i];if(Ts(o)&&Ts(a)||vn(o)&&vn(a)||Array.isArray(o)&&Array.isArray(a)?!jr(o,a,t):!Object.is(o,a))return!1}}return!0}function gm(n){const e=fi(),{control:t=e.control,name:s,defaultValue:r,disabled:i,exact:o,compute:a}=n||{},l=Q.useRef(r),c=Q.useRef(a),f=Q.useRef(void 0),v=Q.useRef(t),h=Q.useRef(s);c.current=a;const[d,m]=Q.useState(()=>{const N=t._getWatch(s,l.current);return c.current?c.current(N):N}),g=Q.useCallback(N=>{const _=Vl(s,t._names,N||t._formValues,!1,l.current);return c.current?c.current(_):_},[t._formValues,t._names,s]),k=Q.useCallback(N=>{if(!i){const _=Vl(s,t._names,N||t._formValues,!1,l.current);if(c.current){const B=c.current(_);jr(B,f.current)||(m(B),f.current=B)}else m(_)}},[t._formValues,t._names,i,s]);th(()=>((v.current!==t||!jr(h.current,s))&&(v.current=t,h.current=s,k()),t._subscribe({name:s,formState:{values:!0},exact:o,callback:N=>{k(N.values)}})),[t,o,s,k]),Q.useEffect(()=>t._removeUnmounted());const w=v.current!==t,E=h.current,A=Q.useMemo(()=>{if(i)return null;const N=!w&&!jr(E,s);return w||N?g():null},[i,w,s,E,g]);return A!==null?A:d}function vm(n){const e=fi(),{name:t,disabled:s,control:r=e.control,shouldUnregister:i,defaultValue:o,exact:a=!0}=n,l=lm(r._names.array,t),c=Q.useMemo(()=>He(r._formValues,t,He(r._defaultValues,t,o)),[r,t,o]),f=gm({control:r,name:t,defaultValue:c,exact:a}),v=pm({control:r,name:t,exact:a}),h=Q.useRef(n),d=Q.useRef(void 0),m=Q.useRef(r.register(t,{...n.rules,value:f,...Ao(n.disabled)?{disabled:n.disabled}:{}}));h.current=n;const g=Q.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!He(v.errors,t)},isDirty:{enumerable:!0,get:()=>!!He(v.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!He(v.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!He(v.validatingFields,t)},error:{enumerable:!0,get:()=>He(v.errors,t)}}),[v,t]),k=Q.useCallback(N=>m.current.onChange({target:{value:om(N),name:t},type:Pl.CHANGE}),[t]),w=Q.useCallback(()=>m.current.onBlur({target:{value:He(r._formValues,t),name:t},type:Pl.BLUR}),[t,r._formValues]),E=Q.useCallback(N=>{const _=He(r._fields,t);_&&N&&(_._f.ref={focus:()=>N.focus&&N.focus(),select:()=>N.select&&N.select(),setCustomValidity:B=>N.setCustomValidity(B),reportValidity:()=>N.reportValidity()})},[r._fields,t]),A=Q.useMemo(()=>({name:t,value:f,...Ao(s)||v.disabled?{disabled:v.disabled||s}:{},onChange:k,onBlur:w,ref:E}),[t,s,v.disabled,k,w,E,f]);return Q.useEffect(()=>{const N=r._options.shouldUnregister||i,_=d.current;_&&_!==t&&!l&&r.unregister(_),r.register(t,{...h.current.rules,...Ao(h.current.disabled)?{disabled:h.current.disabled}:{}});const B=(H,ae)=>{const he=He(r._fields,H);he&&he._f&&(he._f.mount=ae)};if(B(t,!0),N){const H=Jc(He(r._options.defaultValues,t,h.current.defaultValue));Fl(r._defaultValues,t,H),ra(He(r._formValues,t))&&Fl(r._formValues,t,H)}return!l&&r.register(t),d.current=t,()=>{(l?N&&!r._state.action:N)?r.unregister(t):B(t,!1)}},[t,r,l,i]),Q.useEffect(()=>{r._setDisabledField({disabled:s,name:t})},[s,t,r]),Q.useMemo(()=>({field:A,formState:v,fieldState:g}),[A,v,g])}const ym=n=>n.render(vm(n)),bm=si.j("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ha=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(Xc,{ref:t,className:Ae.mo(bm(),n),...e}));Ha.displayName=Xc.displayName;const xm=dm,nh=T.createContext({}),km=({...n})=>b.ae.jsx(nh.Provider,{value:{name:n.name},children:b.ae.jsx(ym,{...n})}),Ks=()=>{const n=T.useContext(nh),e=T.useContext(sh),{getFieldState:t,formState:s}=fi(),r=t(n.name,s);if(!n)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:n.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...r}},sh=T.createContext({}),rh=T.forwardRef(({className:n,...e},t)=>{const s=T.useId();return b.ae.jsx(sh.Provider,{value:{id:s},children:b.ae.jsx("div",{ref:t,className:Ae.mo("relative space-y-2",n),...e})})});rh.displayName="FormItem";const ih=T.forwardRef(({className:n,...e},t)=>{const{error:s,formItemId:r}=Ks();return b.ae.jsx(Ha,{ref:t,className:Ae.mo("!text-body-xs-medium",n,s&&"text-destructive"),htmlFor:r,...e})});ih.displayName="FormLabel";const oh=T.forwardRef(({...n},e)=>{const{error:t,formItemId:s,formDescriptionId:r,formMessageId:i}=Ks();return b.ae.jsx(b.h$1,{ref:e,id:s,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...n})});oh.displayName="FormControl";const ah=T.forwardRef(({className:n,...e},t)=>{const{formDescriptionId:s}=Ks();return b.ae.jsx("p",{ref:t,id:s,className:Ae.mo("text-muted-foreground text-sm",n),...e})});ah.displayName="FormDescription";const lh=T.forwardRef(({className:n,children:e,...t},s)=>{const{error:r,formMessageId:i}=Ks(),o=r?String(r==null?void 0:r.message):e;return o?b.ae.jsx("p",{ref:s,id:i,className:Ae.mo("!text-body-xs-medium text-destructive",n),...t,children:o}):null});lh.displayName="FormMessage";var pi="Switch",[wm,Bk]=b.j(pi),[Em,_m]=wm(pi),uh=T.forwardRef((n,e)=>{const{__scopeSwitch:t,name:s,checked:r,defaultChecked:i,required:o,disabled:a,value:l="on",onCheckedChange:c,form:f,...v}=n,[h,d]=T.useState(null),m=b.i(e,A=>d(A)),g=T.useRef(!1),k=h?f||!!h.closest("form"):!0,[w,E]=b.y({prop:r,defaultProp:i??!1,onChange:c,caller:pi});return b.ae.jsxs(Em,{scope:t,checked:w,disabled:a,children:[b.ae.jsx(b.h.button,{type:"button",role:"switch","aria-checked":w,"aria-required":o,"data-state":fh(w),"data-disabled":a?"":void 0,disabled:a,value:l,...v,ref:m,onClick:b.y$1(n.onClick,A=>{E(N=>!N),k&&(g.current=A.isPropagationStopped(),g.current||A.stopPropagation())})}),k&&b.ae.jsx(dh,{control:h,bubbles:!g.current,name:s,value:l,checked:w,required:o,disabled:a,form:f,style:{transform:"translateX(-100%)"}})]})});uh.displayName=pi;var ch="SwitchThumb",hh=T.forwardRef((n,e)=>{const{__scopeSwitch:t,...s}=n,r=_m(ch,t);return b.ae.jsx(b.h.span,{"data-state":fh(r.checked),"data-disabled":r.disabled?"":void 0,...s,ref:e})});hh.displayName=ch;var Sm="SwitchBubbleInput",dh=T.forwardRef(({__scopeSwitch:n,control:e,checked:t,bubbles:s=!0,...r},i)=>{const o=T.useRef(null),a=b.i(o,i),l=ri(t),c=Dt.In(e);return T.useEffect(()=>{const f=o.current;if(!f)return;const v=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(v,"checked").set;if(l!==t&&h){const d=new Event("click",{bubbles:s});h.call(f,t),f.dispatchEvent(d)}},[l,t,s]),b.ae.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:a,style:{...r.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});dh.displayName=Sm;function fh(n){return n?"checked":"unchecked"}var ph=uh,Am=hh;const mh=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(ph,{className:Ae.mo("peer focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-item-primary data-[state=unchecked]:bg-input inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-40",n),...e,ref:t,children:b.ae.jsx(Am,{className:Ae.mo("bg-background pointer-events-none block size-3.5 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}));mh.displayName=ph.displayName;const gh=T.forwardRef(({className:n,variant:e,...t},s)=>b.ae.jsx("textarea",{className:Ae.mo("min-h-20 px-3 py-2",oi({variant:e}),n),ref:s,...t}));gh.displayName="Textarea";var Cm=[" ","Enter","ArrowUp","ArrowDown"],Nm=[" ","Enter"],yn="Select",[mi,gi,Om]=Rt.D(yn),[cs,Vk]=b.j(yn,[Om,Dt.oo]),vi=Dt.oo(),[Tm,Xt]=cs(yn),[Rm,Im]=cs(yn),vh=n=>{const{__scopeSelect:e,children:t,open:s,defaultOpen:r,onOpenChange:i,value:o,defaultValue:a,onValueChange:l,dir:c,name:f,autoComplete:v,disabled:h,required:d,form:m}=n,g=vi(e),[k,w]=T.useState(null),[E,A]=T.useState(null),[N,_]=T.useState(!1),B=Rt.n(c),[H,ae]=b.y({prop:s,defaultProp:r??!1,onChange:i,caller:yn}),[he,me]=b.y({prop:o,defaultProp:a,onChange:l,caller:yn}),y=T.useRef(null),j=k?m||!!k.closest("form"):!0,[S,$]=T.useState(new Set),V=Array.from(S).map(O=>O.props.value).join(";");return b.ae.jsx(Dt.io,{...g,children:b.ae.jsxs(Tm,{required:d,scope:e,trigger:k,onTriggerChange:w,valueNode:E,onValueNodeChange:A,valueNodeHasChildren:N,onValueNodeHasChildrenChange:_,contentId:b.g(),value:he,onValueChange:me,open:H,onOpenChange:ae,dir:B,triggerPointerDownPosRef:y,disabled:h,children:[b.ae.jsx(mi.Provider,{scope:e,children:b.ae.jsx(Rm,{scope:n.__scopeSelect,onNativeOptionAdd:T.useCallback(O=>{$(M=>new Set(M).add(O))},[]),onNativeOptionRemove:T.useCallback(O=>{$(M=>{const Z=new Set(M);return Z.delete(O),Z})},[]),children:t})}),j?b.ae.jsxs(Uh,{"aria-hidden":!0,required:d,tabIndex:-1,name:f,autoComplete:v,value:he,onChange:O=>me(O.target.value),disabled:h,form:m,children:[he===void 0?b.ae.jsx("option",{value:""}):null,Array.from(S)]},V):null]})})};vh.displayName=yn;var yh="SelectTrigger",bh=T.forwardRef((n,e)=>{const{__scopeSelect:t,disabled:s=!1,...r}=n,i=vi(t),o=Xt(yh,t),a=o.disabled||s,l=b.i(e,o.onTriggerChange),c=gi(t),f=T.useRef("touch"),[v,h,d]=zh(g=>{const k=c().filter(A=>!A.disabled),w=k.find(A=>A.value===o.value),E=Hh(k,g,w);E!==void 0&&o.onValueChange(E.value)}),m=g=>{a||(o.onOpenChange(!0),d()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return b.ae.jsx(Dt.ro,{asChild:!0,...i,children:b.ae.jsx(b.h.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":$h(o.value)?"":void 0,...r,ref:l,onClick:b.y$1(r.onClick,g=>{g.currentTarget.focus(),f.current!=="mouse"&&m(g)}),onPointerDown:b.y$1(r.onPointerDown,g=>{f.current=g.pointerType;const k=g.target;k.hasPointerCapture(g.pointerId)&&k.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(m(g),g.preventDefault())}),onKeyDown:b.y$1(r.onKeyDown,g=>{const k=v.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(k&&g.key===" ")&&Cm.includes(g.key)&&(m(),g.preventDefault())})})})});bh.displayName=yh;var xh="SelectValue",kh=T.forwardRef((n,e)=>{const{__scopeSelect:t,className:s,style:r,children:i,placeholder:o="",...a}=n,l=Xt(xh,t),{onValueNodeHasChildrenChange:c}=l,f=i!==void 0,v=b.i(e,l.onValueNodeChange);return b.w$1(()=>{c(f)},[c,f]),b.ae.jsx(b.h.span,{...a,ref:v,style:{pointerEvents:"none"},children:$h(l.value)?b.ae.jsx(b.ae.Fragment,{children:o}):i})});kh.displayName=xh;var Lm="SelectIcon",wh=T.forwardRef((n,e)=>{const{__scopeSelect:t,children:s,...r}=n;return b.ae.jsx(b.h.span,{"aria-hidden":!0,...r,ref:e,children:s||"▼"})});wh.displayName=Lm;var qm="SelectPortal",Eh=n=>b.ae.jsx(hn.Me,{asChild:!0,...n});Eh.displayName=qm;var bn="SelectContent",_h=T.forwardRef((n,e)=>{const t=Xt(bn,n.__scopeSelect),[s,r]=T.useState();if(b.w$1(()=>{r(new DocumentFragment)},[]),!t.open){const i=s;return i?fc.createPortal(b.ae.jsx(Sh,{scope:n.__scopeSelect,children:b.ae.jsx(mi.Slot,{scope:n.__scopeSelect,children:b.ae.jsx("div",{children:n.children})})}),i):null}return b.ae.jsx(Ah,{...n,ref:e})});_h.displayName=bn;var rt=10,[Sh,Yt]=cs(bn),jm="SelectContentImpl",Dm=b.S("SelectContent.RemoveScroll"),Ah=T.forwardRef((n,e)=>{const{__scopeSelect:t,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:v,collisionBoundary:h,collisionPadding:d,sticky:m,hideWhenDetached:g,avoidCollisions:k,...w}=n,E=Xt(bn,t),[A,N]=T.useState(null),[_,B]=T.useState(null),H=b.i(e,D=>N(D)),[ae,he]=T.useState(null),[me,y]=T.useState(null),j=gi(t),[S,$]=T.useState(!1),V=T.useRef(!1);T.useEffect(()=>{if(A)return hn.Rt(A)},[A]),hn.Ct();const O=T.useCallback(D=>{const[P,...W]=j().map(I=>I.ref.current),[U]=W.slice(-1),J=document.activeElement;for(const I of D)if(I===J||(I==null||I.scrollIntoView({block:"nearest"}),I===P&&_&&(_.scrollTop=0),I===U&&_&&(_.scrollTop=_.scrollHeight),I==null||I.focus(),document.activeElement!==J))return},[j,_]),M=T.useCallback(()=>O([ae,A]),[O,ae,A]);T.useEffect(()=>{S&&M()},[S,M]);const{onOpenChange:Z,triggerPointerDownPosRef:X}=E;T.useEffect(()=>{if(A){let D={x:0,y:0};const P=U=>{var J,I;D={x:Math.abs(Math.round(U.pageX)-(((J=X.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(U.pageY)-(((I=X.current)==null?void 0:I.y)??0))}},W=U=>{D.x<=10&&D.y<=10?U.preventDefault():A.contains(U.target)||Z(!1),document.removeEventListener("pointermove",P),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",P),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",W,{capture:!0})}}},[A,Z,X]),T.useEffect(()=>{const D=()=>Z(!1);return window.addEventListener("blur",D),window.addEventListener("resize",D),()=>{window.removeEventListener("blur",D),window.removeEventListener("resize",D)}},[Z]);const[C,L]=zh(D=>{const P=j().filter(J=>!J.disabled),W=P.find(J=>J.ref.current===document.activeElement),U=Hh(P,D,W);U&&setTimeout(()=>U.ref.current.focus())}),F=T.useCallback((D,P,W)=>{const U=!V.current&&!W;(E.value!==void 0&&E.value===P||U)&&(he(D),U&&(V.current=!0))},[E.value]),G=T.useCallback(()=>A==null?void 0:A.focus(),[A]),K=T.useCallback((D,P,W)=>{const U=!V.current&&!W;(E.value!==void 0&&E.value===P||U)&&y(D)},[E.value]),z=s==="popper"?ia:Ch,Y=z===ia?{side:a,sideOffset:l,align:c,alignOffset:f,arrowPadding:v,collisionBoundary:h,collisionPadding:d,sticky:m,hideWhenDetached:g,avoidCollisions:k}:{};return b.ae.jsx(Sh,{scope:t,content:A,viewport:_,onViewportChange:B,itemRefCallback:F,selectedItem:ae,onItemLeave:G,itemTextRefCallback:K,focusSelectedItem:M,selectedItemText:me,position:s,isPositioned:S,searchRef:C,children:b.ae.jsx(hn.dt,{as:Dm,allowPinchZoom:!0,children:b.ae.jsx(hn.Se,{asChild:!0,trapped:E.open,onMountAutoFocus:D=>{D.preventDefault()},onUnmountAutoFocus:b.y$1(r,D=>{var P;(P=E.trigger)==null||P.focus({preventScroll:!0}),D.preventDefault()}),children:b.ae.jsx(b.M,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:D=>D.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:b.ae.jsx(z,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:D=>D.preventDefault(),...w,...Y,onPlaced:()=>$(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:b.y$1(w.onKeyDown,D=>{const P=D.ctrlKey||D.altKey||D.metaKey;if(D.key==="Tab"&&D.preventDefault(),!P&&D.key.length===1&&L(D.key),["ArrowUp","ArrowDown","Home","End"].includes(D.key)){let W=j().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(D.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(D.key)){const U=D.target,J=W.indexOf(U);W=W.slice(J+1)}setTimeout(()=>O(W)),D.preventDefault()}})})})})})})});Ah.displayName=jm;var Mm="SelectItemAlignedPosition",Ch=T.forwardRef((n,e)=>{const{__scopeSelect:t,onPlaced:s,...r}=n,i=Xt(bn,t),o=Yt(bn,t),[a,l]=T.useState(null),[c,f]=T.useState(null),v=b.i(e,H=>f(H)),h=gi(t),d=T.useRef(!1),m=T.useRef(!0),{viewport:g,selectedItem:k,selectedItemText:w,focusSelectedItem:E}=o,A=T.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&g&&k&&w){const H=i.trigger.getBoundingClientRect(),ae=c.getBoundingClientRect(),he=i.valueNode.getBoundingClientRect(),me=w.getBoundingClientRect();if(i.dir!=="rtl"){const U=me.left-ae.left,J=he.left-U,I=H.left-J,ue=H.width+I,xe=Math.max(ue,ae.width),Se=window.innerWidth-rt,wt=bl(J,[rt,Math.max(rt,Se-xe)]);a.style.minWidth=ue+"px",a.style.left=wt+"px"}else{const U=ae.right-me.right,J=window.innerWidth-he.right-U,I=window.innerWidth-H.right-J,ue=H.width+I,xe=Math.max(ue,ae.width),Se=window.innerWidth-rt,wt=bl(J,[rt,Math.max(rt,Se-xe)]);a.style.minWidth=ue+"px",a.style.right=wt+"px"}const y=h(),j=window.innerHeight-rt*2,S=g.scrollHeight,$=window.getComputedStyle(c),V=parseInt($.borderTopWidth,10),O=parseInt($.paddingTop,10),M=parseInt($.borderBottomWidth,10),Z=parseInt($.paddingBottom,10),X=V+O+S+Z+M,C=Math.min(k.offsetHeight*5,X),L=window.getComputedStyle(g),F=parseInt(L.paddingTop,10),G=parseInt(L.paddingBottom,10),K=H.top+H.height/2-rt,z=j-K,Y=k.offsetHeight/2,D=k.offsetTop+Y,P=V+O+D,W=X-P;if(P<=K){const U=y.length>0&&k===y[y.length-1].ref.current;a.style.bottom="0px";const J=c.clientHeight-g.offsetTop-g.offsetHeight,I=Math.max(z,Y+(U?G:0)+J+M),ue=P+I;a.style.height=ue+"px"}else{const U=y.length>0&&k===y[0].ref.current;a.style.top="0px";const J=Math.max(K,V+g.offsetTop+(U?F:0)+Y)+W;a.style.height=J+"px",g.scrollTop=P-K+g.offsetTop}a.style.margin=`${rt}px 0`,a.style.minHeight=C+"px",a.style.maxHeight=j+"px",s==null||s(),requestAnimationFrame(()=>d.current=!0)}},[h,i.trigger,i.valueNode,a,c,g,k,w,i.dir,s]);b.w$1(()=>A(),[A]);const[N,_]=T.useState();b.w$1(()=>{c&&_(window.getComputedStyle(c).zIndex)},[c]);const B=T.useCallback(H=>{H&&m.current===!0&&(A(),E==null||E(),m.current=!1)},[A,E]);return b.ae.jsx(Pm,{scope:t,contentWrapper:a,shouldExpandOnScrollRef:d,onScrollButtonChange:B,children:b.ae.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:b.ae.jsx(b.h.div,{...r,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Ch.displayName=Mm;var Fm="SelectPopperPosition",ia=T.forwardRef((n,e)=>{const{__scopeSelect:t,align:s="start",collisionPadding:r=rt,...i}=n,o=vi(t);return b.ae.jsx(Dt.so,{...o,...i,ref:e,align:s,collisionPadding:r,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ia.displayName=Fm;var[Pm,Ka]=cs(bn,{}),oa="SelectViewport",Nh=T.forwardRef((n,e)=>{const{__scopeSelect:t,nonce:s,...r}=n,i=Yt(oa,t),o=Ka(oa,t),a=b.i(e,i.onViewportChange),l=T.useRef(0);return b.ae.jsxs(b.ae.Fragment,{children:[b.ae.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),b.ae.jsx(mi.Slot,{scope:t,children:b.ae.jsx(b.h.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:b.y$1(r.onScroll,c=>{const f=c.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&v){const d=Math.abs(l.current-f.scrollTop);if(d>0){const m=window.innerHeight-rt*2,g=parseFloat(v.style.minHeight),k=parseFloat(v.style.height),w=Math.max(g,k);if(w<m){const E=w+d,A=Math.min(m,E),N=E-A;v.style.height=A+"px",v.style.bottom==="0px"&&(f.scrollTop=N>0?N:0,v.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});Nh.displayName=oa;var Oh="SelectGroup",[Bm,Vm]=cs(Oh),Th=T.forwardRef((n,e)=>{const{__scopeSelect:t,...s}=n,r=b.g();return b.ae.jsx(Bm,{scope:t,id:r,children:b.ae.jsx(b.h.div,{role:"group","aria-labelledby":r,...s,ref:e})})});Th.displayName=Oh;var Rh="SelectLabel",Ih=T.forwardRef((n,e)=>{const{__scopeSelect:t,...s}=n,r=Vm(Rh,t);return b.ae.jsx(b.h.div,{id:r.id,...s,ref:e})});Ih.displayName=Rh;var Xr="SelectItem",[Um,Lh]=cs(Xr),qh=T.forwardRef((n,e)=>{const{__scopeSelect:t,value:s,disabled:r=!1,textValue:i,...o}=n,a=Xt(Xr,t),l=Yt(Xr,t),c=a.value===s,[f,v]=T.useState(i??""),[h,d]=T.useState(!1),m=b.i(e,E=>{var A;return(A=l.itemRefCallback)==null?void 0:A.call(l,E,s,r)}),g=b.g(),k=T.useRef("touch"),w=()=>{r||(a.onValueChange(s),a.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.ae.jsx(Um,{scope:t,value:s,disabled:r,textId:g,isSelected:c,onItemTextChange:T.useCallback(E=>{v(A=>A||((E==null?void 0:E.textContent)??"").trim())},[]),children:b.ae.jsx(mi.ItemSlot,{scope:t,value:s,disabled:r,textValue:f,children:b.ae.jsx(b.h.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,ref:m,onFocus:b.y$1(o.onFocus,()=>d(!0)),onBlur:b.y$1(o.onBlur,()=>d(!1)),onClick:b.y$1(o.onClick,()=>{k.current!=="mouse"&&w()}),onPointerUp:b.y$1(o.onPointerUp,()=>{k.current==="mouse"&&w()}),onPointerDown:b.y$1(o.onPointerDown,E=>{k.current=E.pointerType}),onPointerMove:b.y$1(o.onPointerMove,E=>{var A;k.current=E.pointerType,r?(A=l.onItemLeave)==null||A.call(l):k.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:b.y$1(o.onPointerLeave,E=>{var A;E.currentTarget===document.activeElement&&((A=l.onItemLeave)==null||A.call(l))}),onKeyDown:b.y$1(o.onKeyDown,E=>{var A;((A=l.searchRef)==null?void 0:A.current)!==""&&E.key===" "||(Nm.includes(E.key)&&w(),E.key===" "&&E.preventDefault())})})})})});qh.displayName=Xr;var Rs="SelectItemText",jh=T.forwardRef((n,e)=>{const{__scopeSelect:t,className:s,style:r,...i}=n,o=Xt(Rs,t),a=Yt(Rs,t),l=Lh(Rs,t),c=Im(Rs,t),[f,v]=T.useState(null),h=b.i(e,w=>v(w),l.onItemTextChange,w=>{var E;return(E=a.itemTextRefCallback)==null?void 0:E.call(a,w,l.value,l.disabled)}),d=f==null?void 0:f.textContent,m=T.useMemo(()=>b.ae.jsx("option",{value:l.value,disabled:l.disabled,children:d},l.value),[l.disabled,l.value,d]),{onNativeOptionAdd:g,onNativeOptionRemove:k}=c;return b.w$1(()=>(g(m),()=>k(m)),[g,k,m]),b.ae.jsxs(b.ae.Fragment,{children:[b.ae.jsx(b.h.span,{id:l.textId,...i,ref:h}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?fc.createPortal(i.children,o.valueNode):null]})});jh.displayName=Rs;var Dh="SelectItemIndicator",Mh=T.forwardRef((n,e)=>{const{__scopeSelect:t,...s}=n;return Lh(Dh,t).isSelected?b.ae.jsx(b.h.span,{"aria-hidden":!0,...s,ref:e}):null});Mh.displayName=Dh;var aa="SelectScrollUpButton",Fh=T.forwardRef((n,e)=>{const t=Yt(aa,n.__scopeSelect),s=Ka(aa,n.__scopeSelect),[r,i]=T.useState(!1),o=b.i(e,s.onScrollButtonChange);return b.w$1(()=>{if(t.viewport&&t.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=t.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),r?b.ae.jsx(Bh,{...n,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Fh.displayName=aa;var la="SelectScrollDownButton",Ph=T.forwardRef((n,e)=>{const t=Yt(la,n.__scopeSelect),s=Ka(la,n.__scopeSelect),[r,i]=T.useState(!1),o=b.i(e,s.onScrollButtonChange);return b.w$1(()=>{if(t.viewport&&t.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<c;i(f)};const l=t.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[t.viewport,t.isPositioned]),r?b.ae.jsx(Bh,{...n,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=t;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Ph.displayName=la;var Bh=T.forwardRef((n,e)=>{const{__scopeSelect:t,onAutoScroll:s,...r}=n,i=Yt("SelectScrollButton",t),o=T.useRef(null),a=gi(t),l=T.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return T.useEffect(()=>()=>l(),[l]),b.w$1(()=>{var c;const f=a().find(v=>v.ref.current===document.activeElement);(c=f==null?void 0:f.ref.current)==null||c.scrollIntoView({block:"nearest"})},[a]),b.ae.jsx(b.h.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:b.y$1(r.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(s,50))}),onPointerMove:b.y$1(r.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),o.current===null&&(o.current=window.setInterval(s,50))}),onPointerLeave:b.y$1(r.onPointerLeave,()=>{l()})})}),$m="SelectSeparator",Vh=T.forwardRef((n,e)=>{const{__scopeSelect:t,...s}=n;return b.ae.jsx(b.h.div,{"aria-hidden":!0,...s,ref:e})});Vh.displayName=$m;var ua="SelectArrow",zm=T.forwardRef((n,e)=>{const{__scopeSelect:t,...s}=n,r=vi(t),i=Xt(ua,t),o=Yt(ua,t);return i.open&&o.position==="popper"?b.ae.jsx(Dt.co,{...r,...s,ref:e}):null});zm.displayName=ua;var Hm="SelectBubbleInput",Uh=T.forwardRef(({__scopeSelect:n,value:e,...t},s)=>{const r=T.useRef(null),i=b.i(s,r),o=ri(e);return T.useEffect(()=>{const a=r.current;if(!a)return;const l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&c){const f=new Event("change",{bubbles:!0});c.call(a,e),a.dispatchEvent(f)}},[o,e]),b.ae.jsx(b.h.select,{...t,style:{...Bf.s,...t.style},ref:i,defaultValue:e})});Uh.displayName=Hm;function $h(n){return n===""||n===void 0}function zh(n){const e=b.n(n),t=T.useRef(""),s=T.useRef(0),r=T.useCallback(o=>{const a=t.current+o;e(a),function l(c){t.current=c,window.clearTimeout(s.current),c!==""&&(s.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=T.useCallback(()=>{t.current="",window.clearTimeout(s.current)},[]);return T.useEffect(()=>()=>window.clearTimeout(s.current),[]),[t,r,i]}function Hh(n,e,t){const s=e.length>1&&Array.from(e).every(a=>a===e[0])?e[0]:e,r=t?n.indexOf(t):-1;let i=Km(n,Math.max(r,0));s.length===1&&(i=i.filter(a=>a!==t));const o=i.find(a=>a.textValue.toLowerCase().startsWith(s.toLowerCase()));return o!==t?o:void 0}function Km(n,e){return n.map((t,s)=>n[(e+s)%n.length])}var Wm=vh,Kh=bh,Gm=kh,Zm=wh,Xm=Eh,Wh=_h,Ym=Nh,Jm=Th,Gh=Ih,Zh=qh,Qm=jh,eg=Mh,Xh=Fh,Yh=Ph,Jh=Vh;function tg(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,Te.ia(n,e)}var $l=Number.isNaN||function(n){return typeof n=="number"&&n!==n};function ng(n,e){return!!(n===e||$l(n)&&$l(e))}function sg(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!ng(n[t],e[t]))return!1;return!0}function Co(n,e){e===void 0&&(e=sg);var t,s=[],r,i=!1;function o(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&t===this&&e(a,s)||(r=n.apply(this,a),i=!0,t=this,s=a),r}return o}var rg=typeof performance=="object"&&typeof performance.now=="function",zl=rg?function(){return performance.now()}:function(){return Date.now()};function Hl(n){cancelAnimationFrame(n.id)}function ig(n,e){var t=zl();function s(){zl()-t>=e?n.call(null):r.id=requestAnimationFrame(s)}var r={id:requestAnimationFrame(s)};return r}var No=-1;function Kl(n){if(n===void 0&&(n=!1),No===-1||n){var e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",document.body.appendChild(e),No=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return No}var Vn=null;function Wl(n){if(n===void 0&&(n=!1),Vn===null||n){var e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";var s=document.createElement("div"),r=s.style;return r.width="100px",r.height="100px",e.appendChild(s),document.body.appendChild(e),e.scrollLeft>0?Vn="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?Vn="negative":Vn="positive-ascending"),document.body.removeChild(e),Vn}return Vn}process.env.NODE_ENV;var og=150,ag=function(n,e){return n},Dr=null,Mr=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Dr=new WeakSet,Mr=new WeakSet);function lg(n){var e,t=n.getItemOffset,s=n.getEstimatedTotalSize,r=n.getItemSize,i=n.getOffsetForIndexAndAlignment,o=n.getStartIndexForOffset,a=n.getStopIndexForStartIndex,l=n.initInstanceProps,c=n.validateProps;return e=function(f){tg(v,f);function v(d){var m;return m=f.call(this,d)||this,m._instanceProps=l(m.props,Te.lv(m)),m._outerRef=void 0,m._resetIsScrollingTimeoutId=null,m.state={instance:Te.lv(m),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof m.props.initialScrollOffset=="number"?m.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},m._callOnItemsRendered=void 0,m._callOnItemsRendered=Co(function(g,k,w,E){return m.props.onItemsRendered({overscanStartIndex:g,overscanStopIndex:k,visibleStartIndex:w,visibleStopIndex:E})}),m._callOnScroll=void 0,m._callOnScroll=Co(function(g,k,w){return m.props.onScroll({scrollDirection:g,scrollOffset:k,scrollUpdateWasRequested:w})}),m._getItemStyle=void 0,m._getItemStyle=function(g){var k=m.props,w=k.direction,E=k.itemSize,A=k.layout,N=m._getItemStyleCache(E,A,w),_;if(N.hasOwnProperty(g))_=N[g];else{var B=t(m.props,g,m._instanceProps),H=r(m.props,g,m._instanceProps),ae=w==="horizontal"||A==="horizontal",he=w==="rtl",me=ae?B:0;N[g]=_={position:"absolute",left:he?void 0:me,right:he?me:void 0,top:ae?0:B,height:ae?"100%":H,width:ae?H:"100%"}}return _},m._getItemStyleCache=void 0,m._getItemStyleCache=Co(function(g,k,w){return{}}),m._onScrollHorizontal=function(g){var k=g.currentTarget,w=k.clientWidth,E=k.scrollLeft,A=k.scrollWidth;m.setState(function(N){if(N.scrollOffset===E)return null;var _=m.props.direction,B=E;if(_==="rtl")switch(Wl()){case"negative":B=-E;break;case"positive-descending":B=A-w-E;break}return B=Math.max(0,Math.min(B,A-w)),{isScrolling:!0,scrollDirection:N.scrollOffset<B?"forward":"backward",scrollOffset:B,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._onScrollVertical=function(g){var k=g.currentTarget,w=k.clientHeight,E=k.scrollHeight,A=k.scrollTop;m.setState(function(N){if(N.scrollOffset===A)return null;var _=Math.max(0,Math.min(A,E-w));return{isScrolling:!0,scrollDirection:N.scrollOffset<_?"forward":"backward",scrollOffset:_,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._outerRefSetter=function(g){var k=m.props.outerRef;m._outerRef=g,typeof k=="function"?k(g):k!=null&&typeof k=="object"&&k.hasOwnProperty("current")&&(k.current=g)},m._resetIsScrollingDebounced=function(){m._resetIsScrollingTimeoutId!==null&&Hl(m._resetIsScrollingTimeoutId),m._resetIsScrollingTimeoutId=ig(m._resetIsScrolling,og)},m._resetIsScrolling=function(){m._resetIsScrollingTimeoutId=null,m.setState({isScrolling:!1},function(){m._getItemStyleCache(-1,null)})},m}v.getDerivedStateFromProps=function(d,m){return ug(d,m),c(d),null};var h=v.prototype;return h.scrollTo=function(d){d=Math.max(0,d),this.setState(function(m){return m.scrollOffset===d?null:{scrollDirection:m.scrollOffset<d?"forward":"backward",scrollOffset:d,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},h.scrollToItem=function(d,m){m===void 0&&(m="auto");var g=this.props,k=g.itemCount,w=g.layout,E=this.state.scrollOffset;d=Math.max(0,Math.min(d,k-1));var A=0;if(this._outerRef){var N=this._outerRef;w==="vertical"?A=N.scrollWidth>N.clientWidth?Kl():0:A=N.scrollHeight>N.clientHeight?Kl():0}this.scrollTo(i(this.props,d,m,E,this._instanceProps,A))},h.componentDidMount=function(){var d=this.props,m=d.direction,g=d.initialScrollOffset,k=d.layout;if(typeof g=="number"&&this._outerRef!=null){var w=this._outerRef;m==="horizontal"||k==="horizontal"?w.scrollLeft=g:w.scrollTop=g}this._callPropsCallbacks()},h.componentDidUpdate=function(){var d=this.props,m=d.direction,g=d.layout,k=this.state,w=k.scrollOffset,E=k.scrollUpdateWasRequested;if(E&&this._outerRef!=null){var A=this._outerRef;if(m==="horizontal"||g==="horizontal")if(m==="rtl")switch(Wl()){case"negative":A.scrollLeft=-w;break;case"positive-ascending":A.scrollLeft=w;break;default:var N=A.clientWidth,_=A.scrollWidth;A.scrollLeft=_-N-w;break}else A.scrollLeft=w;else A.scrollTop=w}this._callPropsCallbacks()},h.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Hl(this._resetIsScrollingTimeoutId)},h.render=function(){var d=this.props,m=d.children,g=d.className,k=d.direction,w=d.height,E=d.innerRef,A=d.innerElementType,N=d.innerTagName,_=d.itemCount,B=d.itemData,H=d.itemKey,ae=H===void 0?ag:H,he=d.layout,me=d.outerElementType,y=d.outerTagName,j=d.style,S=d.useIsScrolling,$=d.width,V=this.state.isScrolling,O=k==="horizontal"||he==="horizontal",M=O?this._onScrollHorizontal:this._onScrollVertical,Z=this._getRangeToRender(),X=Z[0],C=Z[1],L=[];if(_>0)for(var F=X;F<=C;F++)L.push(Q.createElement(m,{data:B,key:ae(F,B),index:F,isScrolling:S?V:void 0,style:this._getItemStyle(F)}));var G=s(this.props,this._instanceProps);return Q.createElement(me||y||"div",{className:g,onScroll:M,ref:this._outerRefSetter,style:Te.k({position:"relative",height:w,width:$,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:k},j)},Q.createElement(A||N||"div",{children:L,ref:E,style:{height:O?"100%":G,pointerEvents:V?"none":void 0,width:O?G:"100%"}}))},h._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var d=this.props.itemCount;if(d>0){var m=this._getRangeToRender(),g=m[0],k=m[1],w=m[2],E=m[3];this._callOnItemsRendered(g,k,w,E)}}if(typeof this.props.onScroll=="function"){var A=this.state,N=A.scrollDirection,_=A.scrollOffset,B=A.scrollUpdateWasRequested;this._callOnScroll(N,_,B)}},h._getRangeToRender=function(){var d=this.props,m=d.itemCount,g=d.overscanCount,k=this.state,w=k.isScrolling,E=k.scrollDirection,A=k.scrollOffset;if(m===0)return[0,0,0,0];var N=o(this.props,A,this._instanceProps),_=a(this.props,N,A,this._instanceProps),B=!w||E==="backward"?Math.max(1,g):1,H=!w||E==="forward"?Math.max(1,g):1;return[Math.max(0,N-B),Math.max(0,Math.min(m-1,_+H)),N,_]},v}(Q.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var ug=function(n,e){var t=n.children,s=n.direction,r=n.height,i=n.layout,o=n.innerTagName,a=n.outerTagName,l=n.width,c=e.instance;if(process.env.NODE_ENV!=="production"){(o!=null||a!=null)&&Mr&&!Mr.has(c)&&(Mr.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||i==="horizontal";switch(s){case"horizontal":case"vertical":Dr&&!Dr.has(c)&&(Dr.add(c),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+s+'" was specified.'))}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+i+'" was specified.'))}if(t==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(t===null?"null":typeof t)+'" was specified.'));if(f&&typeof l!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(l===null?"null":typeof l)+'" was specified.'));if(!f&&typeof r!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}},cg=lg({getItemOffset:function(n,e){var t=n.itemSize;return e*t},getItemSize:function(n,e){var t=n.itemSize;return t},getEstimatedTotalSize:function(n){var e=n.itemCount,t=n.itemSize;return t*e},getOffsetForIndexAndAlignment:function(n,e,t,s,r,i){var o=n.direction,a=n.height,l=n.itemCount,c=n.itemSize,f=n.layout,v=n.width,h=o==="horizontal"||f==="horizontal",d=h?v:a,m=Math.max(0,l*c-d),g=Math.min(m,e*c),k=Math.max(0,e*c-d+c+i);switch(t==="smart"&&(s>=k-d&&s<=g+d?t="auto":t="center"),t){case"start":return g;case"end":return k;case"center":{var w=Math.round(k+(g-k)/2);return w<Math.ceil(d/2)?0:w>m+Math.floor(d/2)?m:w}case"auto":default:return s>=k&&s<=g?s:s<k?k:g}},getStartIndexForOffset:function(n,e){var t=n.itemCount,s=n.itemSize;return Math.max(0,Math.min(t-1,Math.floor(e/s)))},getStopIndexForStartIndex:function(n,e,t){var s=n.direction,r=n.height,i=n.itemCount,o=n.itemSize,a=n.layout,l=n.width,c=s==="horizontal"||a==="horizontal",f=e*o,v=c?l:r,h=Math.ceil((v+t-f)/o);return Math.max(0,Math.min(i-1,e+h-1))},initInstanceProps:function(n){},validateProps:function(n){var e=n.itemSize;if(process.env.NODE_ENV!=="production"&&typeof e!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(e===null?"null":typeof e)+'" was specified.'))}});const hg=Wm,dg=Jm,fg=Gm,Qh=T.forwardRef(({className:n,children:e,variant:t="default",...s},r)=>b.ae.jsxs(Kh,{ref:r,className:Ae.mo("border-border ring-offset-background placeholder:text-muted-foreground focus:ring-offset-none focus:ring-primary flex h-10 w-full items-center justify-between rounded-md border bg-white px-3 py-2 text-sm focus:ring-2 focus:ring-offset-transparent focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-transparent [&>span]:line-clamp-1",t==="failure"&&"focus:ring-destructive hover:bg-destructive/20 bg-destructive/20 border-destructive !text-destructive",n),...s,children:[e,b.ae.jsx(Zm,{asChild:!0,children:b.ae.jsx(pc,{className:"h-4 w-4 opacity-50"})})]}));Qh.displayName=Kh.displayName;const Wa=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(Xh,{ref:t,className:Ae.mo("flex cursor-default items-center justify-center py-1",n),...e,children:b.ae.jsx(Hf,{className:"h-4 w-4"})}));Wa.displayName=Xh.displayName;const Ga=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(Yh,{ref:t,className:Ae.mo("flex cursor-default items-center justify-center py-1",n),...e,children:b.ae.jsx(pc,{className:"h-4 w-4"})}));Ga.displayName=Yh.displayName;const Za=T.forwardRef(({className:n,children:e,position:t="popper",...s},r)=>b.ae.jsx(Xm,{children:b.ae.jsxs(Wh,{ref:r,className:Ae.mo("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",t==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:t,...s,children:[b.ae.jsx(Wa,{}),b.ae.jsx(Ym,{className:Ae.mo("p-1",t==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),b.ae.jsx(Ga,{})]})}));Za.displayName=Wh.displayName;const ed=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(Gh,{ref:t,className:Ae.mo("py-1.5 pr-2 pl-8 text-sm font-semibold",n),...e}));ed.displayName=Gh.displayName;const Xa=T.forwardRef(({className:n,children:e,...t},s)=>b.ae.jsxs(Zh,{ref:s,className:Ae.mo("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n),...t,children:[b.ae.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.ae.jsx(eg,{children:b.ae.jsx(Rt.t,{className:"h-4 w-4"})})}),b.ae.jsx(Qm,{children:e})]}));Xa.displayName=Zh.displayName;const td=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(Jh,{ref:t,className:Ae.mo("bg-muted -mx-1 my-1 h-px",n),...e}));td.displayName=Jh.displayName;const nd=T.forwardRef(({className:n,options:e,position:t="popper",itemHeight:s=35,maxHeight:r=300,...i},o)=>{const a=Q.useRef(null),l=({index:c,style:f})=>{const v=e[c];return b.ae.jsx("div",{style:f,children:b.ae.jsx(Xa,{value:`${v.value}`,children:v.label})})};return b.ae.jsx(Za,{ref:o,...i,children:b.ae.jsx(cg,{ref:a,height:Math.min(r,e.length*s),itemCount:e.length,itemSize:s,width:"100%",children:l})})});nd.displayName="VirtualizedSelectContent";var Ya="Radio",[pg,sd]=b.j(Ya),[mg,gg]=pg(Ya),rd=T.forwardRef((n,e)=>{const{__scopeRadio:t,name:s,checked:r=!1,required:i,disabled:o,value:a="on",onCheck:l,form:c,...f}=n,[v,h]=T.useState(null),d=b.i(e,k=>h(k)),m=T.useRef(!1),g=v?c||!!v.closest("form"):!0;return b.ae.jsxs(mg,{scope:t,checked:r,disabled:o,children:[b.ae.jsx(b.h.button,{type:"button",role:"radio","aria-checked":r,"data-state":ld(r),"data-disabled":o?"":void 0,disabled:o,value:a,...f,ref:d,onClick:b.y$1(n.onClick,k=>{r||l==null||l(),g&&(m.current=k.isPropagationStopped(),m.current||k.stopPropagation())})}),g&&b.ae.jsx(ad,{control:v,bubbles:!m.current,name:s,value:a,checked:r,required:i,disabled:o,form:c,style:{transform:"translateX(-100%)"}})]})});rd.displayName=Ya;var id="RadioIndicator",od=T.forwardRef((n,e)=>{const{__scopeRadio:t,forceMount:s,...r}=n,i=gg(id,t);return b.ae.jsx(b.R,{present:s||i.checked,children:b.ae.jsx(b.h.span,{"data-state":ld(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:e})})});od.displayName=id;var vg="RadioBubbleInput",ad=T.forwardRef(({__scopeRadio:n,control:e,checked:t,bubbles:s=!0,...r},i)=>{const o=T.useRef(null),a=b.i(o,i),l=ri(t),c=Dt.In(e);return T.useEffect(()=>{const f=o.current;if(!f)return;const v=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(v,"checked").set;if(l!==t&&h){const d=new Event("click",{bubbles:s});h.call(f,t),f.dispatchEvent(d)}},[l,t,s]),b.ae.jsx(b.h.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...r,tabIndex:-1,ref:a,style:{...r.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ad.displayName=vg;function ld(n){return n?"checked":"unchecked"}var yg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yi="RadioGroup",[bg,Uk]=b.j(yi,[Rt.be,sd]),ud=Rt.be(),cd=sd(),[xg,kg]=bg(yi),hd=T.forwardRef((n,e)=>{const{__scopeRadioGroup:t,name:s,defaultValue:r,value:i,required:o=!1,disabled:a=!1,orientation:l,dir:c,loop:f=!0,onValueChange:v,...h}=n,d=ud(t),m=Rt.n(c),[g,k]=b.y({prop:i,defaultProp:r??null,onChange:v,caller:yi});return b.ae.jsx(xg,{scope:t,name:s,required:o,disabled:a,value:g,onValueChange:k,children:b.ae.jsx(Rt.Fe,{asChild:!0,...d,orientation:l,dir:m,loop:f,children:b.ae.jsx(b.h.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...h,ref:e})})})});hd.displayName=yi;var dd="RadioGroupItem",fd=T.forwardRef((n,e)=>{const{__scopeRadioGroup:t,disabled:s,...r}=n,i=kg(dd,t),o=i.disabled||s,a=ud(t),l=cd(t),c=T.useRef(null),f=b.i(e,c),v=i.value===r.value,h=T.useRef(!1);return T.useEffect(()=>{const d=g=>{yg.includes(g.key)&&(h.current=!0)},m=()=>h.current=!1;return document.addEventListener("keydown",d),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",d),document.removeEventListener("keyup",m)}},[]),b.ae.jsx(Rt.ge,{asChild:!0,...a,focusable:!o,active:v,children:b.ae.jsx(rd,{disabled:o,required:i.required,checked:v,...l,...r,name:i.name,ref:f,onCheck:()=>i.onValueChange(r.value),onKeyDown:b.y$1(d=>{d.key==="Enter"&&d.preventDefault()}),onFocus:b.y$1(r.onFocus,()=>{var d;h.current&&((d=c.current)==null||d.click())})})})});fd.displayName=dd;var wg="RadioGroupIndicator",pd=T.forwardRef((n,e)=>{const{__scopeRadioGroup:t,...s}=n,r=cd(t);return b.ae.jsx(od,{...r,...s,ref:e})});pd.displayName=wg;var md=hd,gd=fd,Eg=pd;const vd=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(md,{className:Ae.mo("grid gap-2",n),...e,ref:t}));vd.displayName=md.displayName;const yd=T.forwardRef(({className:n,...e},t)=>b.ae.jsx(gd,{ref:t,className:Ae.mo("border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),...e,children:b.ae.jsx(Eg,{className:"flex items-center justify-center",children:b.ae.jsx(Rt.a,{className:"h-2.5 w-2.5 fill-current text-current"})})}));yd.displayName=gd.displayName;var bd=typeof global=="object"&&global&&global.Object===Object&&global,_g=typeof self=="object"&&self&&self.Object===Object&&self,kt=bd||_g||Function("return this")(),Zt=kt.Symbol,xd=Object.prototype,Sg=xd.hasOwnProperty,Ag=xd.toString,Cs=Zt?Zt.toStringTag:void 0;function Cg(n){var e=Sg.call(n,Cs),t=n[Cs];try{n[Cs]=void 0;var s=!0}catch{}var r=Ag.call(n);return s&&(e?n[Cs]=t:delete n[Cs]),r}var Ng=Object.prototype,Og=Ng.toString;function Tg(n){return Og.call(n)}var Rg="[object Null]",Ig="[object Undefined]",Gl=Zt?Zt.toStringTag:void 0;function hs(n){return n==null?n===void 0?Ig:Rg:Gl&&Gl in Object(n)?Cg(n):Tg(n)}function It(n){return n!=null&&typeof n=="object"}var xn=Array.isArray;function Jt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function kd(n){return n}var Lg="[object AsyncFunction]",qg="[object Function]",jg="[object GeneratorFunction]",Dg="[object Proxy]";function Ja(n){if(!Jt(n))return!1;var e=hs(n);return e==qg||e==jg||e==Lg||e==Dg}var Oo=kt["__core-js_shared__"],Zl=function(){var n=/[^.]+$/.exec(Oo&&Oo.keys&&Oo.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Mg(n){return!!Zl&&Zl in n}var Fg=Function.prototype,Pg=Fg.toString;function En(n){if(n!=null){try{return Pg.call(n)}catch{}try{return n+""}catch{}}return""}var Bg=/[\\^$.*+?()[\]{}|]/g,Vg=/^\[object .+?Constructor\]$/,Ug=Function.prototype,$g=Object.prototype,zg=Ug.toString,Hg=$g.hasOwnProperty,Kg=RegExp("^"+zg.call(Hg).replace(Bg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wg(n){if(!Jt(n)||Mg(n))return!1;var e=Ja(n)?Kg:Vg;return e.test(En(n))}function Gg(n,e){return n==null?void 0:n[e]}function _n(n,e){var t=Gg(n,e);return Wg(t)?t:void 0}var ca=_n(kt,"WeakMap"),Xl=Object.create,Zg=function(){function n(){}return function(e){if(!Jt(e))return{};if(Xl)return Xl(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function Xg(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Yg(n,e){var t=-1,s=n.length;for(e||(e=Array(s));++t<s;)e[t]=n[t];return e}var Jg=800,Qg=16,e0=Date.now;function t0(n){var e=0,t=0;return function(){var s=e0(),r=Qg-(s-t);if(t=s,r>0){if(++e>=Jg)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function n0(n){return function(){return n}}var Yr=function(){try{var n=_n(Object,"defineProperty");return n({},"",{}),n}catch{}}(),s0=Yr?function(n,e){return Yr(n,"toString",{configurable:!0,enumerable:!1,value:n0(e),writable:!0})}:kd,r0=t0(s0);function i0(n,e){for(var t=-1,s=n==null?0:n.length;++t<s&&e(n[t],t,n)!==!1;);return n}var o0=9007199254740991,a0=/^(?:0|[1-9]\d*)$/;function wd(n,e){var t=typeof n;return e=e??o0,!!e&&(t=="number"||t!="symbol"&&a0.test(n))&&n>-1&&n%1==0&&n<e}function Qa(n,e,t){e=="__proto__"&&Yr?Yr(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Ws(n,e){return n===e||n!==n&&e!==e}var l0=Object.prototype,u0=l0.hasOwnProperty;function Ed(n,e,t){var s=n[e];(!(u0.call(n,e)&&Ws(s,t))||t===void 0&&!(e in n))&&Qa(n,e,t)}function c0(n,e,t,s){var r=!t;t||(t={});for(var i=-1,o=e.length;++i<o;){var a=e[i],l=void 0;l===void 0&&(l=n[a]),r?Qa(t,a,l):Ed(t,a,l)}return t}var Yl=Math.max;function h0(n,e,t){return e=Yl(e===void 0?n.length-1:e,0),function(){for(var s=arguments,r=-1,i=Yl(s.length-e,0),o=Array(i);++r<i;)o[r]=s[e+r];r=-1;for(var a=Array(e+1);++r<e;)a[r]=s[r];return a[e]=t(o),Xg(n,this,a)}}function d0(n,e){return r0(h0(n,e,kd),n+"")}var f0=9007199254740991;function _d(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=f0}function bi(n){return n!=null&&_d(n.length)&&!Ja(n)}function p0(n,e,t){if(!Jt(t))return!1;var s=typeof e;return(s=="number"?bi(t)&&wd(e,t.length):s=="string"&&e in t)?Ws(t[e],n):!1}function m0(n){return d0(function(e,t){var s=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(r--,i):void 0,o&&p0(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++s<r;){var a=t[s];a&&n(e,a,s,i)}return e})}var g0=Object.prototype;function el(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||g0;return n===t}function v0(n,e){for(var t=-1,s=Array(n);++t<n;)s[t]=e(t);return s}var y0="[object Arguments]";function Jl(n){return It(n)&&hs(n)==y0}var Sd=Object.prototype,b0=Sd.hasOwnProperty,x0=Sd.propertyIsEnumerable,ha=Jl(function(){return arguments}())?Jl:function(n){return It(n)&&b0.call(n,"callee")&&!x0.call(n,"callee")};function k0(){return!1}var Ad=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ql=Ad&&typeof module=="object"&&module&&!module.nodeType&&module,w0=Ql&&Ql.exports===Ad,eu=w0?kt.Buffer:void 0,E0=eu?eu.isBuffer:void 0,Fs=E0||k0,_0="[object Arguments]",S0="[object Array]",A0="[object Boolean]",C0="[object Date]",N0="[object Error]",O0="[object Function]",T0="[object Map]",R0="[object Number]",I0="[object Object]",L0="[object RegExp]",q0="[object Set]",j0="[object String]",D0="[object WeakMap]",M0="[object ArrayBuffer]",F0="[object DataView]",P0="[object Float32Array]",B0="[object Float64Array]",V0="[object Int8Array]",U0="[object Int16Array]",$0="[object Int32Array]",z0="[object Uint8Array]",H0="[object Uint8ClampedArray]",K0="[object Uint16Array]",W0="[object Uint32Array]",_e={};_e[P0]=_e[B0]=_e[V0]=_e[U0]=_e[$0]=_e[z0]=_e[H0]=_e[K0]=_e[W0]=!0;_e[_0]=_e[S0]=_e[M0]=_e[A0]=_e[F0]=_e[C0]=_e[N0]=_e[O0]=_e[T0]=_e[R0]=_e[I0]=_e[L0]=_e[q0]=_e[j0]=_e[D0]=!1;function G0(n){return It(n)&&_d(n.length)&&!!_e[hs(n)]}function tl(n){return function(e){return n(e)}}var Cd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ds=Cd&&typeof module=="object"&&module&&!module.nodeType&&module,Z0=Ds&&Ds.exports===Cd,To=Z0&&bd.process,is=function(){try{var n=Ds&&Ds.require&&Ds.require("util").types;return n||To&&To.binding&&To.binding("util")}catch{}}(),tu=is&&is.isTypedArray,nl=tu?tl(tu):G0,X0=Object.prototype,Y0=X0.hasOwnProperty;function Nd(n,e){var t=xn(n),s=!t&&ha(n),r=!t&&!s&&Fs(n),i=!t&&!s&&!r&&nl(n),o=t||s||r||i,a=o?v0(n.length,String):[],l=a.length;for(var c in n)(e||Y0.call(n,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wd(c,l)))&&a.push(c);return a}function Od(n,e){return function(t){return n(e(t))}}var J0=Od(Object.keys,Object),Q0=Object.prototype,e1=Q0.hasOwnProperty;function t1(n){if(!el(n))return J0(n);var e=[];for(var t in Object(n))e1.call(n,t)&&t!="constructor"&&e.push(t);return e}function n1(n){return bi(n)?Nd(n):t1(n)}function s1(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var r1=Object.prototype,i1=r1.hasOwnProperty;function o1(n){if(!Jt(n))return s1(n);var e=el(n),t=[];for(var s in n)s=="constructor"&&(e||!i1.call(n,s))||t.push(s);return t}function Td(n){return bi(n)?Nd(n,!0):o1(n)}var Ps=_n(Object,"create");function a1(){this.__data__=Ps?Ps(null):{},this.size=0}function l1(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var u1="__lodash_hash_undefined__",c1=Object.prototype,h1=c1.hasOwnProperty;function d1(n){var e=this.__data__;if(Ps){var t=e[n];return t===u1?void 0:t}return h1.call(e,n)?e[n]:void 0}var f1=Object.prototype,p1=f1.hasOwnProperty;function m1(n){var e=this.__data__;return Ps?e[n]!==void 0:p1.call(e,n)}var g1="__lodash_hash_undefined__";function v1(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ps&&e===void 0?g1:e,this}function kn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}kn.prototype.clear=a1;kn.prototype.delete=l1;kn.prototype.get=d1;kn.prototype.has=m1;kn.prototype.set=v1;function y1(){this.__data__=[],this.size=0}function xi(n,e){for(var t=n.length;t--;)if(Ws(n[t][0],e))return t;return-1}var b1=Array.prototype,x1=b1.splice;function k1(n){var e=this.__data__,t=xi(e,n);if(t<0)return!1;var s=e.length-1;return t==s?e.pop():x1.call(e,t,1),--this.size,!0}function w1(n){var e=this.__data__,t=xi(e,n);return t<0?void 0:e[t][1]}function E1(n){return xi(this.__data__,n)>-1}function _1(n,e){var t=this.__data__,s=xi(t,n);return s<0?(++this.size,t.push([n,e])):t[s][1]=e,this}function Mt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Mt.prototype.clear=y1;Mt.prototype.delete=k1;Mt.prototype.get=w1;Mt.prototype.has=E1;Mt.prototype.set=_1;var Bs=_n(kt,"Map");function S1(){this.size=0,this.__data__={hash:new kn,map:new(Bs||Mt),string:new kn}}function A1(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ki(n,e){var t=n.__data__;return A1(e)?t[typeof e=="string"?"string":"hash"]:t.map}function C1(n){var e=ki(this,n).delete(n);return this.size-=e?1:0,e}function N1(n){return ki(this,n).get(n)}function O1(n){return ki(this,n).has(n)}function T1(n,e){var t=ki(this,n),s=t.size;return t.set(n,e),this.size+=t.size==s?0:1,this}function Sn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var s=n[e];this.set(s[0],s[1])}}Sn.prototype.clear=S1;Sn.prototype.delete=C1;Sn.prototype.get=N1;Sn.prototype.has=O1;Sn.prototype.set=T1;function R1(n,e){for(var t=-1,s=e.length,r=n.length;++t<s;)n[r+t]=e[t];return n}var Rd=Od(Object.getPrototypeOf,Object),I1="[object Object]",L1=Function.prototype,q1=Object.prototype,Id=L1.toString,j1=q1.hasOwnProperty,D1=Id.call(Object);function M1(n){if(!It(n)||hs(n)!=I1)return!1;var e=Rd(n);if(e===null)return!0;var t=j1.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Id.call(t)==D1}function F1(){this.__data__=new Mt,this.size=0}function P1(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function B1(n){return this.__data__.get(n)}function V1(n){return this.__data__.has(n)}var U1=200;function $1(n,e){var t=this.__data__;if(t instanceof Mt){var s=t.__data__;if(!Bs||s.length<U1-1)return s.push([n,e]),this.size=++t.size,this;t=this.__data__=new Sn(s)}return t.set(n,e),this.size=t.size,this}function yt(n){var e=this.__data__=new Mt(n);this.size=e.size}yt.prototype.clear=F1;yt.prototype.delete=P1;yt.prototype.get=B1;yt.prototype.has=V1;yt.prototype.set=$1;var Ld=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nu=Ld&&typeof module=="object"&&module&&!module.nodeType&&module,z1=nu&&nu.exports===Ld,su=z1?kt.Buffer:void 0,ru=su?su.allocUnsafe:void 0;function qd(n,e){if(e)return n.slice();var t=n.length,s=ru?ru(t):new n.constructor(t);return n.copy(s),s}function H1(n,e){for(var t=-1,s=n==null?0:n.length,r=0,i=[];++t<s;){var o=n[t];e(o,t,n)&&(i[r++]=o)}return i}function K1(){return[]}var W1=Object.prototype,G1=W1.propertyIsEnumerable,iu=Object.getOwnPropertySymbols,Z1=iu?function(n){return n==null?[]:(n=Object(n),H1(iu(n),function(e){return G1.call(n,e)}))}:K1;function X1(n,e,t){var s=e(n);return xn(n)?s:R1(s,t(n))}function da(n){return X1(n,n1,Z1)}var fa=_n(kt,"DataView"),pa=_n(kt,"Promise"),ma=_n(kt,"Set"),ou="[object Map]",Y1="[object Object]",au="[object Promise]",lu="[object Set]",uu="[object WeakMap]",cu="[object DataView]",J1=En(fa),Q1=En(Bs),ev=En(pa),tv=En(ma),nv=En(ca),it=hs;(fa&&it(new fa(new ArrayBuffer(1)))!=cu||Bs&&it(new Bs)!=ou||pa&&it(pa.resolve())!=au||ma&&it(new ma)!=lu||ca&&it(new ca)!=uu)&&(it=function(n){var e=hs(n),t=e==Y1?n.constructor:void 0,s=t?En(t):"";if(s)switch(s){case J1:return cu;case Q1:return ou;case ev:return au;case tv:return lu;case nv:return uu}return e});var sv=Object.prototype,rv=sv.hasOwnProperty;function iv(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&rv.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Jr=kt.Uint8Array;function sl(n){var e=new n.constructor(n.byteLength);return new Jr(e).set(new Jr(n)),e}function ov(n,e){var t=sl(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var av=/\w*$/;function lv(n){var e=new n.constructor(n.source,av.exec(n));return e.lastIndex=n.lastIndex,e}var hu=Zt?Zt.prototype:void 0,du=hu?hu.valueOf:void 0;function uv(n){return du?Object(du.call(n)):{}}function jd(n,e){var t=e?sl(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var cv="[object Boolean]",hv="[object Date]",dv="[object Map]",fv="[object Number]",pv="[object RegExp]",mv="[object Set]",gv="[object String]",vv="[object Symbol]",yv="[object ArrayBuffer]",bv="[object DataView]",xv="[object Float32Array]",kv="[object Float64Array]",wv="[object Int8Array]",Ev="[object Int16Array]",_v="[object Int32Array]",Sv="[object Uint8Array]",Av="[object Uint8ClampedArray]",Cv="[object Uint16Array]",Nv="[object Uint32Array]";function Ov(n,e,t){var s=n.constructor;switch(e){case yv:return sl(n);case cv:case hv:return new s(+n);case bv:return ov(n);case xv:case kv:case wv:case Ev:case _v:case Sv:case Av:case Cv:case Nv:return jd(n,t);case dv:return new s;case fv:case gv:return new s(n);case pv:return lv(n);case mv:return new s;case vv:return uv(n)}}function Dd(n){return typeof n.constructor=="function"&&!el(n)?Zg(Rd(n)):{}}var Tv="[object Map]";function Rv(n){return It(n)&&it(n)==Tv}var fu=is&&is.isMap,Iv=fu?tl(fu):Rv,Lv="[object Set]";function qv(n){return It(n)&&it(n)==Lv}var pu=is&&is.isSet,jv=pu?tl(pu):qv,Dv=1,Md="[object Arguments]",Mv="[object Array]",Fv="[object Boolean]",Pv="[object Date]",Bv="[object Error]",Fd="[object Function]",Vv="[object GeneratorFunction]",Uv="[object Map]",$v="[object Number]",Pd="[object Object]",zv="[object RegExp]",Hv="[object Set]",Kv="[object String]",Wv="[object Symbol]",Gv="[object WeakMap]",Zv="[object ArrayBuffer]",Xv="[object DataView]",Yv="[object Float32Array]",Jv="[object Float64Array]",Qv="[object Int8Array]",ey="[object Int16Array]",ty="[object Int32Array]",ny="[object Uint8Array]",sy="[object Uint8ClampedArray]",ry="[object Uint16Array]",iy="[object Uint32Array]",we={};we[Md]=we[Mv]=we[Zv]=we[Xv]=we[Fv]=we[Pv]=we[Yv]=we[Jv]=we[Qv]=we[ey]=we[ty]=we[Uv]=we[$v]=we[Pd]=we[zv]=we[Hv]=we[Kv]=we[Wv]=we[ny]=we[sy]=we[ry]=we[iy]=!0;we[Bv]=we[Fd]=we[Gv]=!1;function Fr(n,e,t,s,r,i){var o,a=e&Dv;if(o!==void 0)return o;if(!Jt(n))return n;var l=xn(n);if(l)o=iv(n);else{var c=it(n),f=c==Fd||c==Vv;if(Fs(n))return qd(n,a);if(c==Pd||c==Md||f&&!r)o=f?{}:Dd(n);else{if(!we[c])return r?n:{};o=Ov(n,c,a)}}i||(i=new yt);var v=i.get(n);if(v)return v;i.set(n,o),jv(n)?n.forEach(function(m){o.add(Fr(m,e,t,m,n,i))}):Iv(n)&&n.forEach(function(m,g){o.set(g,Fr(m,e,t,g,n,i))});var h=da,d=l?void 0:h(n);return i0(d||n,function(m,g){d&&(g=m,m=n[g]),Ed(o,g,Fr(m,e,t,g,n,i))}),o}var oy=1,ay=4;function Xn(n){return Fr(n,oy|ay)}var ly="__lodash_hash_undefined__";function uy(n){return this.__data__.set(n,ly),this}function cy(n){return this.__data__.has(n)}function Qr(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Sn;++e<t;)this.add(n[e])}Qr.prototype.add=Qr.prototype.push=uy;Qr.prototype.has=cy;function hy(n,e){for(var t=-1,s=n==null?0:n.length;++t<s;)if(e(n[t],t,n))return!0;return!1}function dy(n,e){return n.has(e)}var fy=1,py=2;function Bd(n,e,t,s,r,i){var o=t&fy,a=n.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=i.get(n),f=i.get(e);if(c&&f)return c==e&&f==n;var v=-1,h=!0,d=t&py?new Qr:void 0;for(i.set(n,e),i.set(e,n);++v<a;){var m=n[v],g=e[v];if(s)var k=o?s(g,m,v,e,n,i):s(m,g,v,n,e,i);if(k!==void 0){if(k)continue;h=!1;break}if(d){if(!hy(e,function(w,E){if(!dy(d,E)&&(m===w||r(m,w,t,s,i)))return d.push(E)})){h=!1;break}}else if(!(m===g||r(m,g,t,s,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function my(n){var e=-1,t=Array(n.size);return n.forEach(function(s,r){t[++e]=[r,s]}),t}function gy(n){var e=-1,t=Array(n.size);return n.forEach(function(s){t[++e]=s}),t}var vy=1,yy=2,by="[object Boolean]",xy="[object Date]",ky="[object Error]",wy="[object Map]",Ey="[object Number]",_y="[object RegExp]",Sy="[object Set]",Ay="[object String]",Cy="[object Symbol]",Ny="[object ArrayBuffer]",Oy="[object DataView]",mu=Zt?Zt.prototype:void 0,Ro=mu?mu.valueOf:void 0;function Ty(n,e,t,s,r,i,o){switch(t){case Oy:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case Ny:return!(n.byteLength!=e.byteLength||!i(new Jr(n),new Jr(e)));case by:case xy:case Ey:return Ws(+n,+e);case ky:return n.name==e.name&&n.message==e.message;case _y:case Ay:return n==e+"";case wy:var a=my;case Sy:var l=s&vy;if(a||(a=gy),n.size!=e.size&&!l)return!1;var c=o.get(n);if(c)return c==e;s|=yy,o.set(n,e);var f=Bd(a(n),a(e),s,r,i,o);return o.delete(n),f;case Cy:if(Ro)return Ro.call(n)==Ro.call(e)}return!1}var Ry=1,Iy=Object.prototype,Ly=Iy.hasOwnProperty;function qy(n,e,t,s,r,i){var o=t&Ry,a=da(n),l=a.length,c=da(e),f=c.length;if(l!=f&&!o)return!1;for(var v=l;v--;){var h=a[v];if(!(o?h in e:Ly.call(e,h)))return!1}var d=i.get(n),m=i.get(e);if(d&&m)return d==e&&m==n;var g=!0;i.set(n,e),i.set(e,n);for(var k=o;++v<l;){h=a[v];var w=n[h],E=e[h];if(s)var A=o?s(E,w,h,e,n,i):s(w,E,h,n,e,i);if(!(A===void 0?w===E||r(w,E,t,s,i):A)){g=!1;break}k||(k=h=="constructor")}if(g&&!k){var N=n.constructor,_=e.constructor;N!=_&&"constructor"in n&&"constructor"in e&&!(typeof N=="function"&&N instanceof N&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return i.delete(n),i.delete(e),g}var jy=1,gu="[object Arguments]",vu="[object Array]",kr="[object Object]",Dy=Object.prototype,yu=Dy.hasOwnProperty;function My(n,e,t,s,r,i){var o=xn(n),a=xn(e),l=o?vu:it(n),c=a?vu:it(e);l=l==gu?kr:l,c=c==gu?kr:c;var f=l==kr,v=c==kr,h=l==c;if(h&&Fs(n)){if(!Fs(e))return!1;o=!0,f=!1}if(h&&!f)return i||(i=new yt),o||nl(n)?Bd(n,e,t,s,r,i):Ty(n,e,l,t,s,r,i);if(!(t&jy)){var d=f&&yu.call(n,"__wrapped__"),m=v&&yu.call(e,"__wrapped__");if(d||m){var g=d?n.value():n,k=m?e.value():e;return i||(i=new yt),r(g,k,t,s,i)}}return h?(i||(i=new yt),qy(n,e,t,s,r,i)):!1}function Vd(n,e,t,s,r){return n===e?!0:n==null||e==null||!It(n)&&!It(e)?n!==n&&e!==e:My(n,e,t,s,Vd,r)}function Fy(n){return function(e,t,s){for(var r=-1,i=Object(e),o=s(e),a=o.length;a--;){var l=o[++r];if(t(i[l],l,i)===!1)break}return e}}var Py=Fy();function ga(n,e,t){(t!==void 0&&!Ws(n[e],t)||t===void 0&&!(e in n))&&Qa(n,e,t)}function By(n){return It(n)&&bi(n)}function va(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Vy(n){return c0(n,Td(n))}function Uy(n,e,t,s,r,i,o){var a=va(n,t),l=va(e,t),c=o.get(l);if(c){ga(n,t,c);return}var f=i?i(a,l,t+"",n,e,o):void 0,v=f===void 0;if(v){var h=xn(l),d=!h&&Fs(l),m=!h&&!d&&nl(l);f=l,h||d||m?xn(a)?f=a:By(a)?f=Yg(a):d?(v=!1,f=qd(l,!0)):m?(v=!1,f=jd(l,!0)):f=[]:M1(l)||ha(l)?(f=a,ha(a)?f=Vy(a):(!Jt(a)||Ja(a))&&(f=Dd(l))):v=!1}v&&(o.set(l,f),r(f,l,s,i,o),o.delete(l)),ga(n,t,f)}function Ud(n,e,t,s,r){n!==e&&Py(e,function(i,o){if(r||(r=new yt),Jt(i))Uy(n,e,o,t,Ud,s,r);else{var a=s?s(va(n,o),i,o+"",n,e,r):void 0;a===void 0&&(a=i),ga(n,o,a)}},Td)}function $t(n,e){return Vd(n,e)}var Wt=m0(function(n,e,t){Ud(n,e,t)}),se=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(se||{});class xt{constructor(e,t,s={}){this.attrName=e,this.keyName=t;const r=se.TYPE&se.ATTRIBUTE;this.scope=s.scope!=null?s.scope&se.LEVEL|r:se.ATTRIBUTE,s.whitelist!=null&&(this.whitelist=s.whitelist)}static keys(e){return Array.from(e.attributes).map(t=>t.name)}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class Yn extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const $d=class ya{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let s=null;try{s=e.parentNode}catch{return null}return this.find(s,t)}return null}create(e,t,s){const r=this.query(t);if(r==null)throw new Yn(`Unable to create ${t} blot`);const i=r,o=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(s),a=new i(e,o,s);return ya.blots.set(a.domNode,a),a}find(e,t=!1){return ya.find(e,t)}query(e,t=se.ANY){let s;return typeof e=="string"?s=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?s=this.types.text:typeof e=="number"?e&se.LEVEL&se.BLOCK?s=this.types.block:e&se.LEVEL&se.INLINE&&(s=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(r=>(s=this.classes[r],!!s)),s=s||this.tags[e.tagName]),s==null?null:"scope"in s&&t&se.LEVEL&s.scope&&t&se.TYPE&s.scope?s:null}register(...e){return e.map(t=>{const s="blotName"in t,r="attrName"in t;if(!s&&!r)throw new Yn("Invalid definition");if(s&&t.blotName==="abstract")throw new Yn("Cannot register abstract class");const i=s?t.blotName:r?t.attrName:void 0;return this.types[i]=t,r?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):s&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(o=>o.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(o=>{(this.tags[o]==null||t.className==null)&&(this.tags[o]=t)}))),t})}};$d.blots=new WeakMap;let os=$d;function bu(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class $y extends xt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){bu(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(bu(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const ut=$y;function Io(n){const e=n.split("-"),t=e.slice(1).map(s=>s[0].toUpperCase()+s.slice(1)).join("");return e[0]+t}class zy extends xt{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[Io(this.keyName)]=t,!0):!1}remove(e){e.style[Io(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Io(this.keyName)];return this.canAdd(e,t)?t:""}}const Qt=zy;class Hy{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=os.find(this.domNode);if(e==null)return;const t=xt.keys(this.domNode),s=ut.keys(this.domNode),r=Qt.keys(this.domNode);t.concat(s).concat(r).forEach(i=>{const o=e.scroll.query(i,se.ATTRIBUTE);o instanceof xt&&(this.attributes[o.attrName]=o)})}copy(e){Object.keys(this.attributes).forEach(t=>{const s=this.attributes[t].value(this.domNode);e.format(t,s)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}}const wi=Hy,zd=class{constructor(n,e){this.scroll=n,this.domNode=e,os.blots.set(e,this),this.prev=null,this.next=null}static create(n){if(this.tagName==null)throw new Yn("Blot definition missing tagName");let e,t;return Array.isArray(this.tagName)?(typeof n=="string"?(t=n.toUpperCase(),parseInt(t,10).toString()===t&&(t=parseInt(t,10))):typeof n=="number"&&(t=n),typeof t=="number"?e=document.createElement(this.tagName[t-1]):t&&this.tagName.indexOf(t)>-1?e=document.createElement(t):e=document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const n=this.domNode.cloneNode(!1);return this.scroll.create(n)}detach(){this.parent!=null&&this.parent.removeChild(this),os.blots.delete(this.domNode)}deleteAt(n,e){this.isolate(n,e).remove()}formatAt(n,e,t,s){const r=this.isolate(n,e);if(this.scroll.query(t,se.BLOT)!=null&&s)r.wrap(t,s);else if(this.scroll.query(t,se.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);r.wrap(i),i.format(t,s)}}insertAt(n,e,t){const s=t==null?this.scroll.create("text",e):this.scroll.create(e,t),r=this.split(n);this.parent.insertBefore(s,r||void 0)}isolate(n,e){const t=this.split(n);if(t==null)throw new Error("Attempt to isolate at end");return t.split(e),t}length(){return 1}offset(n=this.parent){return this.parent==null||this===n?0:this.parent.children.offset(this)+this.parent.offset(n)}optimize(n){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(n,e){const t=typeof n=="string"?this.scroll.create(n,e):n;return this.parent!=null&&(this.parent.insertBefore(t,this.next||void 0),this.remove()),t}split(n,e){return n===0?this:this.next}update(n,e){}wrap(n,e){const t=typeof n=="string"?this.scroll.create(n,e):n;if(this.parent!=null&&this.parent.insertBefore(t,this.next||void 0),typeof t.appendChild!="function")throw new Yn(`Cannot wrap ${n}`);return t.appendChild(this),t}};zd.blotName="abstract";let Hd=zd;const Kd=class extends Hd{static value(n){return!0}index(n,e){return this.domNode===n||this.domNode.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(n,e){let t=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return n>0&&(t+=1),[this.parent.domNode,t]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Kd.scope=se.INLINE_BLOT;let Ky=Kd;const Fe=Ky;class Wy{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let s=t();for(;s&&e>0;)e-=1,s=t();return s}contains(e){const t=this.iterator();let s=t();for(;s;){if(s===e)return!0;s=t()}return!1}indexOf(e){const t=this.iterator();let s=t(),r=0;for(;s;){if(s===e)return r;r+=1,s=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,s=this.head;for(;s!=null;){if(s===e)return t;t+=s.length(),s=s.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const s=this.iterator();let r=s();for(;r;){const i=r.length();if(e<i||t&&e===i&&(r.next==null||r.next.length()!==0))return[r,e];e-=i,r=s()}return[null,0]}forEach(e){const t=this.iterator();let s=t();for(;s;)e(s),s=t()}forEachAt(e,t,s){if(t<=0)return;const[r,i]=this.find(e);let o=e-i;const a=this.iterator(r);let l=a();for(;l&&o<e+t;){const c=l.length();e>o?s(l,e-o,Math.min(t,o+c-e)):s(l,0,Math.min(c,e+t-o)),o+=c,l=a()}}map(e){return this.reduce((t,s)=>(t.push(e(s)),t),[])}reduce(e,t){const s=this.iterator();let r=s();for(;r;)t=e(t,r),r=s();return t}}function xu(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const s=e.create(se.INLINE);return Array.from(n.childNodes).forEach(r=>{s.domNode.appendChild(r)}),n.parentNode&&n.parentNode.replaceChild(s.domNode,n),s.attach(),s}}const Wd=class Ut extends Hd{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Ut.uiClass&&this.uiNode.classList.add(Ut.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Wy,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=xu(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof Yn)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(s,r,i)=>{s.deleteAt(r,i)})}descendant(e,t=0){const[s,r]=this.children.find(t);return e.blotName==null&&e(s)||e.blotName!=null&&s instanceof e?[s,r]:s instanceof Ut?s.descendant(e,r):[null,-1]}descendants(e,t=0,s=Number.MAX_VALUE){let r=[],i=s;return this.children.forEachAt(t,s,(o,a,l)=>{(e.blotName==null&&e(o)||e.blotName!=null&&o instanceof e)&&r.push(o),o instanceof Ut&&(r=r.concat(o.descendants(e,a,i))),i-=l}),r}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(s=>t instanceof s)||(t.statics.scope===se.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof Ut?t.unwrap():t.remove())})}formatAt(e,t,s,r){this.children.forEachAt(e,t,(i,o,a)=>{i.formatAt(o,a,s,r)})}insertAt(e,t,s){const[r,i]=this.children.find(e);if(r)r.insertAt(i,t,s);else{const o=s==null?this.scroll.create("text",t):this.scroll.create(t,s);this.appendChild(o)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let s=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(s=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==s)&&this.domNode.insertBefore(e.domNode,s),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(s=>{e.insertBefore(s,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[s,r]=this.children.find(e,t),i=[[this,e]];return s instanceof Ut?i.concat(s.path(r,t)):(s!=null&&i.push([s,r]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const s=typeof e=="string"?this.scroll.create(e,t):e;return s instanceof Ut&&this.moveChildren(s),super.replaceWith(s)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const s=this.clone();return this.parent&&this.parent.insertBefore(s,this.next||void 0),this.children.forEachAt(e,this.length(),(r,i,o)=>{const a=r.split(i,t);a!=null&&s.appendChild(a)}),s}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const s=[],r=[];e.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(s.push(...i.addedNodes),r.push(...i.removedNodes))}),r.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const o=this.scroll.find(i);o!=null&&(o.domNode.parentNode==null||o.domNode.parentNode===this.domNode)&&o.detach()}),s.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,o)=>i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let o=null;i.nextSibling!=null&&(o=this.scroll.find(i.nextSibling));const a=xu(i,this.scroll);(a.next!==o||a.next==null)&&(a.parent!=null&&a.parent.removeChild(this),this.insertBefore(a,o||void 0))}),this.enforceAllowedChildren()}};Wd.uiClass="";let Gy=Wd;const at=Gy;function Zy(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const Un=class $n extends at{static create(e){return super.create(e)}static formats(e,t){const s=t.query($n.blotName);if(!(s!=null&&e.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new wi(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(s=>{s instanceof $n||(s=s.wrap($n.blotName,!0)),this.attributes.copy(s)}),this.unwrap();else{const s=this.scroll.query(e,se.INLINE);if(s==null)return;s instanceof xt?this.attributes.attribute(s,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,s,r){this.formats()[s]!=null||this.scroll.query(s,se.ATTRIBUTE)?this.isolate(e,t).format(s,r):super.formatAt(e,t,s,r)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const s=this.next;s instanceof $n&&s.prev===this&&Zy(t,s.formats())&&(s.moveChildren(this),s.remove())}replaceWith(e,t){const s=super.replaceWith(e,t);return this.attributes.copy(s),s}update(e,t){super.update(e,t),e.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}wrap(e,t){const s=super.wrap(e,t);return s instanceof $n&&this.attributes.move(s),s}};Un.allowedChildren=[Un,Fe],Un.blotName="inline",Un.scope=se.INLINE_BLOT,Un.tagName="SPAN";let Xy=Un;const rl=Xy,zn=class ba extends at{static create(e){return super.create(e)}static formats(e,t){const s=t.query(ba.blotName);if(!(s!=null&&e.tagName===s.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new wi(this.domNode)}format(e,t){const s=this.scroll.query(e,se.BLOCK);s!=null&&(s instanceof xt?this.attributes.attribute(s,t):e===this.statics.blotName&&!t?this.replaceWith(ba.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,s,r){this.scroll.query(s,se.BLOCK)!=null?this.format(s,r):super.formatAt(e,t,s,r)}insertAt(e,t,s){if(s==null||this.scroll.query(t,se.INLINE)!=null)super.insertAt(e,t,s);else{const r=this.split(e);if(r!=null){const i=this.scroll.create(t,s);r.parent.insertBefore(i,r)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const s=super.replaceWith(e,t);return this.attributes.copy(s),s}update(e,t){super.update(e,t),e.some(s=>s.target===this.domNode&&s.type==="attributes")&&this.attributes.build()}};zn.blotName="block",zn.scope=se.BLOCK_BLOT,zn.tagName="P",zn.allowedChildren=[rl,zn,Fe];let Yy=zn;const Vs=Yy,xa=class extends at{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(n,e){super.deleteAt(n,e),this.enforceAllowedChildren()}formatAt(n,e,t,s){super.formatAt(n,e,t,s),this.enforceAllowedChildren()}insertAt(n,e,t){super.insertAt(n,e,t),this.enforceAllowedChildren()}optimize(n){super.optimize(n),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};xa.blotName="container",xa.scope=se.BLOCK_BLOT;let Jy=xa;const Ei=Jy;class Qy extends Fe{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,s,r){e===0&&t===this.length()?this.format(s,r):super.formatAt(e,t,s,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Ge=Qy,eb={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},tb=100,Hn=class extends at{constructor(n,e){super(null,e),this.registry=n,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,eb),this.attach()}create(n,e){return this.registry.create(this,n,e)}find(n,e=!1){const t=this.registry.find(n,e);return t?t.scroll===this?t:e?this.find(t.scroll.domNode.parentNode,!0):null:null}query(n,e=se.ANY){return this.registry.query(n,e)}register(...n){return this.registry.register(...n)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(n,e){this.update(),n===0&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(n,e)}formatAt(n,e,t,s){this.update(),super.formatAt(n,e,t,s)}insertAt(n,e,t){this.update(),super.insertAt(n,e,t)}optimize(n=[],e={}){super.optimize(e);const t=e.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)n.push(s.pop());const r=(a,l=!0)=>{a==null||a===this||a.domNode.parentNode!=null&&(t.has(a.domNode)||t.set(a.domNode,[]),l&&r(a.parent))},i=a=>{t.has(a.domNode)&&(a instanceof at&&a.children.forEach(i),t.delete(a.domNode),a.optimize(e))};let o=n;for(let a=0;o.length>0;a+=1){if(a>=tb)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(l=>{const c=this.find(l.target,!0);c!=null&&(c.domNode===l.target&&(l.type==="childList"?(r(this.find(l.previousSibling,!1)),Array.from(l.addedNodes).forEach(f=>{const v=this.find(f,!1);r(v,!1),v instanceof at&&v.children.forEach(h=>{r(h,!1)})})):l.type==="attributes"&&r(c.prev)),r(c))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)n.push(s.pop())}}update(n,e={}){n=n||this.observer.takeRecords();const t=new WeakMap;n.map(s=>{const r=this.find(s.target,!0);return r==null?null:t.has(r.domNode)?(t.get(r.domNode).push(s),null):(t.set(r.domNode,[s]),r)}).forEach(s=>{s!=null&&s!==this&&t.has(s.domNode)&&s.update(t.get(s.domNode)||[],e)}),e.mutationsMap=t,t.has(this.domNode)&&super.update(t.get(this.domNode),e),this.optimize(n,e)}};Hn.blotName="scroll",Hn.defaultChild=Vs,Hn.allowedChildren=[Vs,Ei],Hn.scope=se.BLOCK_BLOT,Hn.tagName="DIV";let nb=Hn;const il=nb,ka=class Gd extends Fe{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,s){s==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,s)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Gd&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const s=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(s,this.next||void 0),this.text=this.statics.value(this.domNode),s}update(e,t){e.some(s=>s.type==="characterData"&&s.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};ka.blotName="text",ka.scope=se.INLINE_BLOT;let sb=ka;const ei=sb,rb=Object.freeze(Object.defineProperty({__proto__:null,Attributor:xt,AttributorStore:wi,BlockBlot:Vs,ClassAttributor:ut,ContainerBlot:Ei,EmbedBlot:Ge,InlineBlot:rl,LeafBlot:Fe,ParentBlot:at,Registry:os,Scope:se,ScrollBlot:il,StyleAttributor:Qt,TextBlot:ei},Symbol.toStringTag,{value:"Module"}));var Lo={exports:{}},qo,ku;function ib(){if(ku)return qo;ku=1;var n=-1,e=1,t=0;function s(y,j,S,$,V){if(y===j)return y?[[t,y]]:[];if(S!=null){var O=he(y,j,S);if(O)return O}var M=a(y,j),Z=y.substring(0,M);y=y.substring(M),j=j.substring(M),M=c(y,j);var X=y.substring(y.length-M);y=y.substring(0,y.length-M),j=j.substring(0,j.length-M);var C=r(y,j);return Z&&C.unshift([t,Z]),X&&C.push([t,X]),E(C,V),$&&v(C),C}function r(y,j){var S;if(!y)return[[e,j]];if(!j)return[[n,y]];var $=y.length>j.length?y:j,V=y.length>j.length?j:y,O=$.indexOf(V);if(O!==-1)return S=[[e,$.substring(0,O)],[t,V],[e,$.substring(O+V.length)]],y.length>j.length&&(S[0][0]=S[2][0]=n),S;if(V.length===1)return[[n,y],[e,j]];var M=f(y,j);if(M){var Z=M[0],X=M[1],C=M[2],L=M[3],F=M[4],G=s(Z,C),K=s(X,L);return G.concat([[t,F]],K)}return i(y,j)}function i(y,j){for(var S=y.length,$=j.length,V=Math.ceil((S+$)/2),O=V,M=2*V,Z=new Array(M),X=new Array(M),C=0;C<M;C++)Z[C]=-1,X[C]=-1;Z[O+1]=0,X[O+1]=0;for(var L=S-$,F=L%2!==0,G=0,K=0,z=0,Y=0,D=0;D<V;D++){for(var P=-D+G;P<=D-K;P+=2){var W=O+P,U;P===-D||P!==D&&Z[W-1]<Z[W+1]?U=Z[W+1]:U=Z[W-1]+1;for(var J=U-P;U<S&&J<$&&y.charAt(U)===j.charAt(J);)U++,J++;if(Z[W]=U,U>S)K+=2;else if(J>$)G+=2;else if(F){var I=O+L-P;if(I>=0&&I<M&&X[I]!==-1){var ue=S-X[I];if(U>=ue)return o(y,j,U,J)}}}for(var xe=-D+z;xe<=D-Y;xe+=2){var I=O+xe,ue;xe===-D||xe!==D&&X[I-1]<X[I+1]?ue=X[I+1]:ue=X[I-1]+1;for(var Se=ue-xe;ue<S&&Se<$&&y.charAt(S-ue-1)===j.charAt($-Se-1);)ue++,Se++;if(X[I]=ue,ue>S)Y+=2;else if(Se>$)z+=2;else if(!F){var W=O+L-xe;if(W>=0&&W<M&&Z[W]!==-1){var U=Z[W],J=O+U-W;if(ue=S-ue,U>=ue)return o(y,j,U,J)}}}}return[[n,y],[e,j]]}function o(y,j,S,$){var V=y.substring(0,S),O=j.substring(0,$),M=y.substring(S),Z=j.substring($),X=s(V,O),C=s(M,Z);return X.concat(C)}function a(y,j){if(!y||!j||y.charAt(0)!==j.charAt(0))return 0;for(var S=0,$=Math.min(y.length,j.length),V=$,O=0;S<V;)y.substring(O,V)==j.substring(O,V)?(S=V,O=S):$=V,V=Math.floor(($-S)/2+S);return A(y.charCodeAt(V-1))&&V--,V}function l(y,j){var S=y.length,$=j.length;if(S==0||$==0)return 0;S>$?y=y.substring(S-$):S<$&&(j=j.substring(0,S));var V=Math.min(S,$);if(y==j)return V;for(var O=0,M=1;;){var Z=y.substring(V-M),X=j.indexOf(Z);if(X==-1)return O;M+=X,(X==0||y.substring(V-M)==j.substring(0,M))&&(O=M,M++)}}function c(y,j){if(!y||!j||y.slice(-1)!==j.slice(-1))return 0;for(var S=0,$=Math.min(y.length,j.length),V=$,O=0;S<V;)y.substring(y.length-V,y.length-O)==j.substring(j.length-V,j.length-O)?(S=V,O=S):$=V,V=Math.floor(($-S)/2+S);return N(y.charCodeAt(y.length-V))&&V--,V}function f(y,j){var S=y.length>j.length?y:j,$=y.length>j.length?j:y;if(S.length<4||$.length*2<S.length)return null;function V(K,z,Y){for(var D=K.substring(Y,Y+Math.floor(K.length/4)),P=-1,W="",U,J,I,ue;(P=z.indexOf(D,P+1))!==-1;){var xe=a(K.substring(Y),z.substring(P)),Se=c(K.substring(0,Y),z.substring(0,P));W.length<Se+xe&&(W=z.substring(P-Se,P)+z.substring(P,P+xe),U=K.substring(0,Y-Se),J=K.substring(Y+xe),I=z.substring(0,P-Se),ue=z.substring(P+xe))}return W.length*2>=K.length?[U,J,I,ue,W]:null}var O=V(S,$,Math.ceil(S.length/4)),M=V(S,$,Math.ceil(S.length/2)),Z;if(!O&&!M)return null;M?O?Z=O[4].length>M[4].length?O:M:Z=M:Z=O;var X,C,L,F;y.length>j.length?(X=Z[0],C=Z[1],L=Z[2],F=Z[3]):(L=Z[0],F=Z[1],X=Z[2],C=Z[3]);var G=Z[4];return[X,C,L,F,G]}function v(y){for(var j=!1,S=[],$=0,V=null,O=0,M=0,Z=0,X=0,C=0;O<y.length;)y[O][0]==t?(S[$++]=O,M=X,Z=C,X=0,C=0,V=y[O][1]):(y[O][0]==e?X+=y[O][1].length:C+=y[O][1].length,V&&V.length<=Math.max(M,Z)&&V.length<=Math.max(X,C)&&(y.splice(S[$-1],0,[n,V]),y[S[$-1]+1][0]=e,$--,$--,O=$>0?S[$-1]:-1,M=0,Z=0,X=0,C=0,V=null,j=!0)),O++;for(j&&E(y),w(y),O=1;O<y.length;){if(y[O-1][0]==n&&y[O][0]==e){var L=y[O-1][1],F=y[O][1],G=l(L,F),K=l(F,L);G>=K?(G>=L.length/2||G>=F.length/2)&&(y.splice(O,0,[t,F.substring(0,G)]),y[O-1][1]=L.substring(0,L.length-G),y[O+1][1]=F.substring(G),O++):(K>=L.length/2||K>=F.length/2)&&(y.splice(O,0,[t,L.substring(0,K)]),y[O-1][0]=e,y[O-1][1]=F.substring(0,F.length-K),y[O+1][0]=n,y[O+1][1]=L.substring(K),O++),O++}O++}}var h=/[^a-zA-Z0-9]/,d=/\s/,m=/[\r\n]/,g=/\n\r?\n$/,k=/^\r?\n\r?\n/;function w(y){function j(K,z){if(!K||!z)return 6;var Y=K.charAt(K.length-1),D=z.charAt(0),P=Y.match(h),W=D.match(h),U=P&&Y.match(d),J=W&&D.match(d),I=U&&Y.match(m),ue=J&&D.match(m),xe=I&&K.match(g),Se=ue&&z.match(k);return xe||Se?5:I||ue?4:P&&!U&&J?3:U||J?2:P||W?1:0}for(var S=1;S<y.length-1;){if(y[S-1][0]==t&&y[S+1][0]==t){var $=y[S-1][1],V=y[S][1],O=y[S+1][1],M=c($,V);if(M){var Z=V.substring(V.length-M);$=$.substring(0,$.length-M),V=Z+V.substring(0,V.length-M),O=Z+O}for(var X=$,C=V,L=O,F=j($,V)+j(V,O);V.charAt(0)===O.charAt(0);){$+=V.charAt(0),V=V.substring(1)+O.charAt(0),O=O.substring(1);var G=j($,V)+j(V,O);G>=F&&(F=G,X=$,C=V,L=O)}y[S-1][1]!=X&&(X?y[S-1][1]=X:(y.splice(S-1,1),S--),y[S][1]=C,L?y[S+1][1]=L:(y.splice(S+1,1),S--))}S++}}function E(y,j){y.push([t,""]);for(var S=0,$=0,V=0,O="",M="",Z;S<y.length;){if(S<y.length-1&&!y[S][1]){y.splice(S,1);continue}switch(y[S][0]){case e:V++,M+=y[S][1],S++;break;case n:$++,O+=y[S][1],S++;break;case t:var X=S-V-$-1;if(j){if(X>=0&&B(y[X][1])){var C=y[X][1].slice(-1);if(y[X][1]=y[X][1].slice(0,-1),O=C+O,M=C+M,!y[X][1]){y.splice(X,1),S--;var L=X-1;y[L]&&y[L][0]===e&&(V++,M=y[L][1]+M,L--),y[L]&&y[L][0]===n&&($++,O=y[L][1]+O,L--),X=L}}if(_(y[S][1])){var C=y[S][1].charAt(0);y[S][1]=y[S][1].slice(1),O+=C,M+=C}}if(S<y.length-1&&!y[S][1]){y.splice(S,1);break}if(O.length>0||M.length>0){O.length>0&&M.length>0&&(Z=a(M,O),Z!==0&&(X>=0?y[X][1]+=M.substring(0,Z):(y.splice(0,0,[t,M.substring(0,Z)]),S++),M=M.substring(Z),O=O.substring(Z)),Z=c(M,O),Z!==0&&(y[S][1]=M.substring(M.length-Z)+y[S][1],M=M.substring(0,M.length-Z),O=O.substring(0,O.length-Z)));var F=V+$;O.length===0&&M.length===0?(y.splice(S-F,F),S=S-F):O.length===0?(y.splice(S-F,F,[e,M]),S=S-F+1):M.length===0?(y.splice(S-F,F,[n,O]),S=S-F+1):(y.splice(S-F,F,[n,O],[e,M]),S=S-F+2)}S!==0&&y[S-1][0]===t?(y[S-1][1]+=y[S][1],y.splice(S,1)):S++,V=0,$=0,O="",M="";break}}y[y.length-1][1]===""&&y.pop();var G=!1;for(S=1;S<y.length-1;)y[S-1][0]===t&&y[S+1][0]===t&&(y[S][1].substring(y[S][1].length-y[S-1][1].length)===y[S-1][1]?(y[S][1]=y[S-1][1]+y[S][1].substring(0,y[S][1].length-y[S-1][1].length),y[S+1][1]=y[S-1][1]+y[S+1][1],y.splice(S-1,1),G=!0):y[S][1].substring(0,y[S+1][1].length)==y[S+1][1]&&(y[S-1][1]+=y[S+1][1],y[S][1]=y[S][1].substring(y[S+1][1].length)+y[S+1][1],y.splice(S+1,1),G=!0)),S++;G&&E(y,j)}function A(y){return y>=55296&&y<=56319}function N(y){return y>=56320&&y<=57343}function _(y){return N(y.charCodeAt(0))}function B(y){return A(y.charCodeAt(y.length-1))}function H(y){for(var j=[],S=0;S<y.length;S++)y[S][1].length>0&&j.push(y[S]);return j}function ae(y,j,S,$){return B(y)||_($)?null:H([[t,y],[n,j],[e,S],[t,$]])}function he(y,j,S){var $=typeof S=="number"?{index:S,length:0}:S.oldRange,V=typeof S=="number"?null:S.newRange,O=y.length,M=j.length;if($.length===0&&(V===null||V.length===0)){var Z=$.index,X=y.slice(0,Z),C=y.slice(Z),L=V?V.index:null;e:{var F=Z+M-O;if(L!==null&&L!==F||F<0||F>M)break e;var G=j.slice(0,F),K=j.slice(F);if(K!==C)break e;var z=Math.min(Z,F),Y=X.slice(0,z),D=G.slice(0,z);if(Y!==D)break e;var P=X.slice(z),W=G.slice(z);return ae(Y,P,W,C)}e:{if(L!==null&&L!==Z)break e;var U=Z,G=j.slice(0,U),K=j.slice(U);if(G!==X)break e;var J=Math.min(O-U,M-U),I=C.slice(C.length-J),ue=K.slice(K.length-J);if(I!==ue)break e;var P=C.slice(0,C.length-J),W=K.slice(0,K.length-J);return ae(X,P,W,I)}}if($.length>0&&V&&V.length===0)e:{var Y=y.slice(0,$.index),I=y.slice($.index+$.length),z=Y.length,J=I.length;if(M<z+J)break e;var D=j.slice(0,z),ue=j.slice(M-J);if(Y!==D||I!==ue)break e;var P=y.slice(z,O-J),W=j.slice(z,M-J);return ae(Y,P,W,I)}return null}function me(y,j,S,$){return s(y,j,S,$,!0)}return me.INSERT=e,me.DELETE=n,me.EQUAL=t,qo=me,qo}var Pr={exports:{}};Pr.exports;var wu;function Zd(){return wu||(wu=1,function(n,e){var t=200,s="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",v="[object GeneratorFunction]",h="[object Map]",d="[object Number]",m="[object Object]",g="[object Promise]",k="[object RegExp]",w="[object Set]",E="[object String]",A="[object Symbol]",N="[object WeakMap]",_="[object ArrayBuffer]",B="[object DataView]",H="[object Float32Array]",ae="[object Float64Array]",he="[object Int8Array]",me="[object Int16Array]",y="[object Int32Array]",j="[object Uint8Array]",S="[object Uint8ClampedArray]",$="[object Uint16Array]",V="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,M=/\w*$/,Z=/^\[object .+?Constructor\]$/,X=/^(?:0|[1-9]\d*)$/,C={};C[i]=C[o]=C[_]=C[B]=C[a]=C[l]=C[H]=C[ae]=C[he]=C[me]=C[y]=C[h]=C[d]=C[m]=C[k]=C[w]=C[E]=C[A]=C[j]=C[S]=C[$]=C[V]=!0,C[c]=C[f]=C[N]=!1;var L=typeof Te.ai=="object"&&Te.ai&&Te.ai.Object===Object&&Te.ai,F=typeof self=="object"&&self&&self.Object===Object&&self,G=L||F||Function("return this")(),K=e&&!e.nodeType&&e,z=K&&!0&&n&&!n.nodeType&&n,Y=z&&z.exports===K;function D(u,p){return u.set(p[0],p[1]),u}function P(u,p){return u.add(p),u}function W(u,p){for(var x=-1,R=u?u.length:0;++x<R&&p(u[x],x,u)!==!1;);return u}function U(u,p){for(var x=-1,R=p.length,ce=u.length;++x<R;)u[ce+x]=p[x];return u}function J(u,p,x,R){for(var ce=-1,oe=u?u.length:0;++ce<oe;)x=p(x,u[ce],ce,u);return x}function I(u,p){for(var x=-1,R=Array(u);++x<u;)R[x]=p(x);return R}function ue(u,p){return u==null?void 0:u[p]}function xe(u){var p=!1;if(u!=null&&typeof u.toString!="function")try{p=!!(u+"")}catch{}return p}function Se(u){var p=-1,x=Array(u.size);return u.forEach(function(R,ce){x[++p]=[ce,R]}),x}function wt(u,p){return function(x){return u(p(x))}}function Js(u){var p=-1,x=Array(u.size);return u.forEach(function(R){x[++p]=R}),x}var qi=Array.prototype,ji=Function.prototype,On=Object.prototype,ds=G["__core-js_shared__"],Qs=function(){var u=/[^.]+$/.exec(ds&&ds.keys&&ds.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),er=ji.toString,dt=On.hasOwnProperty,Tn=On.toString,Di=RegExp("^"+er.call(dt).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tn=Y?G.Buffer:void 0,Rn=G.Symbol,fs=G.Uint8Array,Ze=wt(Object.getPrototypeOf,Object),tr=Object.create,nr=On.propertyIsEnumerable,Mi=qi.splice,ps=Object.getOwnPropertySymbols,In=tn?tn.isBuffer:void 0,sr=wt(Object.keys,Object),Ln=nt(G,"DataView"),nn=nt(G,"Map"),tt=nt(G,"Promise"),qn=nt(G,"Set"),ms=nt(G,"WeakMap"),sn=nt(Object,"create"),gs=Ue(Ln),rn=Ue(nn),vs=Ue(tt),ys=Ue(qn),bs=Ue(ms),Pt=Rn?Rn.prototype:void 0,rr=Pt?Pt.valueOf:void 0;function Et(u){var p=-1,x=u?u.length:0;for(this.clear();++p<x;){var R=u[p];this.set(R[0],R[1])}}function Fi(){this.__data__=sn?sn(null):{}}function Pi(u){return this.has(u)&&delete this.__data__[u]}function Bi(u){var p=this.__data__;if(sn){var x=p[u];return x===s?void 0:x}return dt.call(p,u)?p[u]:void 0}function ir(u){var p=this.__data__;return sn?p[u]!==void 0:dt.call(p,u)}function xs(u,p){var x=this.__data__;return x[u]=sn&&p===void 0?s:p,this}Et.prototype.clear=Fi,Et.prototype.delete=Pi,Et.prototype.get=Bi,Et.prototype.has=ir,Et.prototype.set=xs;function Ie(u){var p=-1,x=u?u.length:0;for(this.clear();++p<x;){var R=u[p];this.set(R[0],R[1])}}function Vi(){this.__data__=[]}function Ui(u){var p=this.__data__,x=Dn(p,u);if(x<0)return!1;var R=p.length-1;return x==R?p.pop():Mi.call(p,x,1),!0}function $i(u){var p=this.__data__,x=Dn(p,u);return x<0?void 0:p[x][1]}function zi(u){return Dn(this.__data__,u)>-1}function Hi(u,p){var x=this.__data__,R=Dn(x,u);return R<0?x.push([u,p]):x[R][1]=p,this}Ie.prototype.clear=Vi,Ie.prototype.delete=Ui,Ie.prototype.get=$i,Ie.prototype.has=zi,Ie.prototype.set=Hi;function je(u){var p=-1,x=u?u.length:0;for(this.clear();++p<x;){var R=u[p];this.set(R[0],R[1])}}function Ki(){this.__data__={hash:new Et,map:new(nn||Ie),string:new Et}}function Wi(u){return an(this,u).delete(u)}function Gi(u){return an(this,u).get(u)}function Zi(u){return an(this,u).has(u)}function Xi(u,p){return an(this,u).set(u,p),this}je.prototype.clear=Ki,je.prototype.delete=Wi,je.prototype.get=Gi,je.prototype.has=Zi,je.prototype.set=Xi;function $e(u){this.__data__=new Ie(u)}function Yi(){this.__data__=new Ie}function Ji(u){return this.__data__.delete(u)}function Qi(u){return this.__data__.get(u)}function eo(u){return this.__data__.has(u)}function to(u,p){var x=this.__data__;if(x instanceof Ie){var R=x.__data__;if(!nn||R.length<t-1)return R.push([u,p]),this;x=this.__data__=new je(R)}return x.set(u,p),this}$e.prototype.clear=Yi,$e.prototype.delete=Ji,$e.prototype.get=Qi,$e.prototype.has=eo,$e.prototype.set=to;function jn(u,p){var x=_s(u)||Fn(u)?I(u.length,String):[],R=x.length,ce=!!R;for(var oe in u)dt.call(u,oe)&&!(ce&&(oe=="length"||go(oe,R)))&&x.push(oe);return x}function or(u,p,x){var R=u[p];(!(dt.call(u,p)&&hr(R,x))||x===void 0&&!(p in u))&&(u[p]=x)}function Dn(u,p){for(var x=u.length;x--;)if(hr(u[x][0],p))return x;return-1}function ft(u,p){return u&&Es(p,As(p),u)}function ks(u,p,x,R,ce,oe,ge){var pe;if(R&&(pe=oe?R(u,ce,oe,ge):R(u)),pe!==void 0)return pe;if(!mt(u))return u;var Ce=_s(u);if(Ce){if(pe=po(u),!p)return co(u,pe)}else{var ve=St(u),De=ve==f||ve==v;if(dr(u))return Mn(u,p);if(ve==m||ve==i||De&&!oe){if(xe(u))return oe?u:{};if(pe=pt(De?{}:u),!p)return ho(u,ft(pe,u))}else{if(!C[ve])return oe?u:{};pe=mo(u,ve,ks,p)}}ge||(ge=new $e);var ze=ge.get(u);if(ze)return ze;if(ge.set(u,pe),!Ce)var Oe=x?fo(u):As(u);return W(Oe||u,function(Me,Le){Oe&&(Le=Me,Me=u[Le]),or(pe,Le,ks(Me,p,x,R,Le,u,ge))}),pe}function no(u){return mt(u)?tr(u):{}}function so(u,p,x){var R=p(u);return _s(u)?R:U(R,x(u))}function ro(u){return Tn.call(u)}function io(u){if(!mt(u)||yo(u))return!1;var p=Ss(u)||xe(u)?Di:Z;return p.test(Ue(u))}function oo(u){if(!ur(u))return sr(u);var p=[];for(var x in Object(u))dt.call(u,x)&&x!="constructor"&&p.push(x);return p}function Mn(u,p){if(p)return u.slice();var x=new u.constructor(u.length);return u.copy(x),x}function ws(u){var p=new u.constructor(u.byteLength);return new fs(p).set(new fs(u)),p}function on(u,p){var x=p?ws(u.buffer):u.buffer;return new u.constructor(x,u.byteOffset,u.byteLength)}function ar(u,p,x){var R=p?x(Se(u),!0):Se(u);return J(R,D,new u.constructor)}function lr(u){var p=new u.constructor(u.source,M.exec(u));return p.lastIndex=u.lastIndex,p}function ao(u,p,x){var R=p?x(Js(u),!0):Js(u);return J(R,P,new u.constructor)}function lo(u){return rr?Object(rr.call(u)):{}}function uo(u,p){var x=p?ws(u.buffer):u.buffer;return new u.constructor(x,u.byteOffset,u.length)}function co(u,p){var x=-1,R=u.length;for(p||(p=Array(R));++x<R;)p[x]=u[x];return p}function Es(u,p,x,R){x||(x={});for(var ce=-1,oe=p.length;++ce<oe;){var ge=p[ce],pe=void 0;or(x,ge,pe===void 0?u[ge]:pe)}return x}function ho(u,p){return Es(u,_t(u),p)}function fo(u){return so(u,As,_t)}function an(u,p){var x=u.__data__;return vo(p)?x[typeof p=="string"?"string":"hash"]:x.map}function nt(u,p){var x=ue(u,p);return io(x)?x:void 0}var _t=ps?wt(ps,Object):xo,St=ro;(Ln&&St(new Ln(new ArrayBuffer(1)))!=B||nn&&St(new nn)!=h||tt&&St(tt.resolve())!=g||qn&&St(new qn)!=w||ms&&St(new ms)!=N)&&(St=function(u){var p=Tn.call(u),x=p==m?u.constructor:void 0,R=x?Ue(x):void 0;if(R)switch(R){case gs:return B;case rn:return h;case vs:return g;case ys:return w;case bs:return N}return p});function po(u){var p=u.length,x=u.constructor(p);return p&&typeof u[0]=="string"&&dt.call(u,"index")&&(x.index=u.index,x.input=u.input),x}function pt(u){return typeof u.constructor=="function"&&!ur(u)?no(Ze(u)):{}}function mo(u,p,x,R){var ce=u.constructor;switch(p){case _:return ws(u);case a:case l:return new ce(+u);case B:return on(u,R);case H:case ae:case he:case me:case y:case j:case S:case $:case V:return uo(u,R);case h:return ar(u,R,x);case d:case E:return new ce(u);case k:return lr(u);case w:return ao(u,R,x);case A:return lo(u)}}function go(u,p){return p=p??r,!!p&&(typeof u=="number"||X.test(u))&&u>-1&&u%1==0&&u<p}function vo(u){var p=typeof u;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?u!=="__proto__":u===null}function yo(u){return!!Qs&&Qs in u}function ur(u){var p=u&&u.constructor,x=typeof p=="function"&&p.prototype||On;return u===x}function Ue(u){if(u!=null){try{return er.call(u)}catch{}try{return u+""}catch{}}return""}function cr(u){return ks(u,!0,!0)}function hr(u,p){return u===p||u!==u&&p!==p}function Fn(u){return bo(u)&&dt.call(u,"callee")&&(!nr.call(u,"callee")||Tn.call(u)==i)}var _s=Array.isArray;function Pn(u){return u!=null&&fr(u.length)&&!Ss(u)}function bo(u){return pr(u)&&Pn(u)}var dr=In||ko;function Ss(u){var p=mt(u)?Tn.call(u):"";return p==f||p==v}function fr(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=r}function mt(u){var p=typeof u;return!!u&&(p=="object"||p=="function")}function pr(u){return!!u&&typeof u=="object"}function As(u){return Pn(u)?jn(u):oo(u)}function xo(){return[]}function ko(){return!1}n.exports=cr}(Pr,Pr.exports)),Pr.exports}var Br={exports:{}};Br.exports;var Eu;function Xd(){return Eu||(Eu=1,function(n,e){var t=200,s="__lodash_hash_undefined__",r=1,i=2,o=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",f="[object Boolean]",v="[object Date]",h="[object Error]",d="[object Function]",m="[object GeneratorFunction]",g="[object Map]",k="[object Number]",w="[object Null]",E="[object Object]",A="[object Promise]",N="[object Proxy]",_="[object RegExp]",B="[object Set]",H="[object String]",ae="[object Symbol]",he="[object Undefined]",me="[object WeakMap]",y="[object ArrayBuffer]",j="[object DataView]",S="[object Float32Array]",$="[object Float64Array]",V="[object Int8Array]",O="[object Int16Array]",M="[object Int32Array]",Z="[object Uint8Array]",X="[object Uint8ClampedArray]",C="[object Uint16Array]",L="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,G=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,z={};z[S]=z[$]=z[V]=z[O]=z[M]=z[Z]=z[X]=z[C]=z[L]=!0,z[a]=z[l]=z[y]=z[f]=z[j]=z[v]=z[h]=z[d]=z[g]=z[k]=z[E]=z[_]=z[B]=z[H]=z[me]=!1;var Y=typeof Te.ai=="object"&&Te.ai&&Te.ai.Object===Object&&Te.ai,D=typeof self=="object"&&self&&self.Object===Object&&self,P=Y||D||Function("return this")(),W=e&&!e.nodeType&&e,U=W&&!0&&n&&!n.nodeType&&n,J=U&&U.exports===W,I=J&&Y.process,ue=function(){try{return I&&I.binding&&I.binding("util")}catch{}}(),xe=ue&&ue.isTypedArray;function Se(u,p){for(var x=-1,R=u==null?0:u.length,ce=0,oe=[];++x<R;){var ge=u[x];p(ge,x,u)&&(oe[ce++]=ge)}return oe}function wt(u,p){for(var x=-1,R=p.length,ce=u.length;++x<R;)u[ce+x]=p[x];return u}function Js(u,p){for(var x=-1,R=u==null?0:u.length;++x<R;)if(p(u[x],x,u))return!0;return!1}function qi(u,p){for(var x=-1,R=Array(u);++x<u;)R[x]=p(x);return R}function ji(u){return function(p){return u(p)}}function On(u,p){return u.has(p)}function ds(u,p){return u==null?void 0:u[p]}function Qs(u){var p=-1,x=Array(u.size);return u.forEach(function(R,ce){x[++p]=[ce,R]}),x}function er(u,p){return function(x){return u(p(x))}}function dt(u){var p=-1,x=Array(u.size);return u.forEach(function(R){x[++p]=R}),x}var Tn=Array.prototype,Di=Function.prototype,tn=Object.prototype,Rn=P["__core-js_shared__"],fs=Di.toString,Ze=tn.hasOwnProperty,tr=function(){var u=/[^.]+$/.exec(Rn&&Rn.keys&&Rn.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),nr=tn.toString,Mi=RegExp("^"+fs.call(Ze).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ps=J?P.Buffer:void 0,In=P.Symbol,sr=P.Uint8Array,Ln=tn.propertyIsEnumerable,nn=Tn.splice,tt=In?In.toStringTag:void 0,qn=Object.getOwnPropertySymbols,ms=ps?ps.isBuffer:void 0,sn=er(Object.keys,Object),gs=_t(P,"DataView"),rn=_t(P,"Map"),vs=_t(P,"Promise"),ys=_t(P,"Set"),bs=_t(P,"WeakMap"),Pt=_t(Object,"create"),rr=Ue(gs),Et=Ue(rn),Fi=Ue(vs),Pi=Ue(ys),Bi=Ue(bs),ir=In?In.prototype:void 0,xs=ir?ir.valueOf:void 0;function Ie(u){var p=-1,x=u==null?0:u.length;for(this.clear();++p<x;){var R=u[p];this.set(R[0],R[1])}}function Vi(){this.__data__=Pt?Pt(null):{},this.size=0}function Ui(u){var p=this.has(u)&&delete this.__data__[u];return this.size-=p?1:0,p}function $i(u){var p=this.__data__;if(Pt){var x=p[u];return x===s?void 0:x}return Ze.call(p,u)?p[u]:void 0}function zi(u){var p=this.__data__;return Pt?p[u]!==void 0:Ze.call(p,u)}function Hi(u,p){var x=this.__data__;return this.size+=this.has(u)?0:1,x[u]=Pt&&p===void 0?s:p,this}Ie.prototype.clear=Vi,Ie.prototype.delete=Ui,Ie.prototype.get=$i,Ie.prototype.has=zi,Ie.prototype.set=Hi;function je(u){var p=-1,x=u==null?0:u.length;for(this.clear();++p<x;){var R=u[p];this.set(R[0],R[1])}}function Ki(){this.__data__=[],this.size=0}function Wi(u){var p=this.__data__,x=Mn(p,u);if(x<0)return!1;var R=p.length-1;return x==R?p.pop():nn.call(p,x,1),--this.size,!0}function Gi(u){var p=this.__data__,x=Mn(p,u);return x<0?void 0:p[x][1]}function Zi(u){return Mn(this.__data__,u)>-1}function Xi(u,p){var x=this.__data__,R=Mn(x,u);return R<0?(++this.size,x.push([u,p])):x[R][1]=p,this}je.prototype.clear=Ki,je.prototype.delete=Wi,je.prototype.get=Gi,je.prototype.has=Zi,je.prototype.set=Xi;function $e(u){var p=-1,x=u==null?0:u.length;for(this.clear();++p<x;){var R=u[p];this.set(R[0],R[1])}}function Yi(){this.size=0,this.__data__={hash:new Ie,map:new(rn||je),string:new Ie}}function Ji(u){var p=nt(this,u).delete(u);return this.size-=p?1:0,p}function Qi(u){return nt(this,u).get(u)}function eo(u){return nt(this,u).has(u)}function to(u,p){var x=nt(this,u),R=x.size;return x.set(u,p),this.size+=x.size==R?0:1,this}$e.prototype.clear=Yi,$e.prototype.delete=Ji,$e.prototype.get=Qi,$e.prototype.has=eo,$e.prototype.set=to;function jn(u){var p=-1,x=u==null?0:u.length;for(this.__data__=new $e;++p<x;)this.add(u[p])}function or(u){return this.__data__.set(u,s),this}function Dn(u){return this.__data__.has(u)}jn.prototype.add=jn.prototype.push=or,jn.prototype.has=Dn;function ft(u){var p=this.__data__=new je(u);this.size=p.size}function ks(){this.__data__=new je,this.size=0}function no(u){var p=this.__data__,x=p.delete(u);return this.size=p.size,x}function so(u){return this.__data__.get(u)}function ro(u){return this.__data__.has(u)}function io(u,p){var x=this.__data__;if(x instanceof je){var R=x.__data__;if(!rn||R.length<t-1)return R.push([u,p]),this.size=++x.size,this;x=this.__data__=new $e(R)}return x.set(u,p),this.size=x.size,this}ft.prototype.clear=ks,ft.prototype.delete=no,ft.prototype.get=so,ft.prototype.has=ro,ft.prototype.set=io;function oo(u,p){var x=Fn(u),R=!x&&hr(u),ce=!x&&!R&&Pn(u),oe=!x&&!R&&!ce&&pr(u),ge=x||R||ce||oe,pe=ge?qi(u.length,String):[],Ce=pe.length;for(var ve in u)Ze.call(u,ve)&&!(ge&&(ve=="length"||ce&&(ve=="offset"||ve=="parent")||oe&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||mo(ve,Ce)))&&pe.push(ve);return pe}function Mn(u,p){for(var x=u.length;x--;)if(cr(u[x][0],p))return x;return-1}function ws(u,p,x){var R=p(u);return Fn(u)?R:wt(R,x(u))}function on(u){return u==null?u===void 0?he:w:tt&&tt in Object(u)?St(u):ur(u)}function ar(u){return mt(u)&&on(u)==a}function lr(u,p,x,R,ce){return u===p?!0:u==null||p==null||!mt(u)&&!mt(p)?u!==u&&p!==p:ao(u,p,x,R,lr,ce)}function ao(u,p,x,R,ce,oe){var ge=Fn(u),pe=Fn(p),Ce=ge?l:pt(u),ve=pe?l:pt(p);Ce=Ce==a?E:Ce,ve=ve==a?E:ve;var De=Ce==E,ze=ve==E,Oe=Ce==ve;if(Oe&&Pn(u)){if(!Pn(p))return!1;ge=!0,De=!1}if(Oe&&!De)return oe||(oe=new ft),ge||pr(u)?Es(u,p,x,R,ce,oe):ho(u,p,Ce,x,R,ce,oe);if(!(x&r)){var Me=De&&Ze.call(u,"__wrapped__"),Le=ze&&Ze.call(p,"__wrapped__");if(Me||Le){var Bt=Me?u.value():u,At=Le?p.value():p;return oe||(oe=new ft),ce(Bt,At,x,R,oe)}}return Oe?(oe||(oe=new ft),fo(u,p,x,R,ce,oe)):!1}function lo(u){if(!fr(u)||vo(u))return!1;var p=dr(u)?Mi:G;return p.test(Ue(u))}function uo(u){return mt(u)&&Ss(u.length)&&!!z[on(u)]}function co(u){if(!yo(u))return sn(u);var p=[];for(var x in Object(u))Ze.call(u,x)&&x!="constructor"&&p.push(x);return p}function Es(u,p,x,R,ce,oe){var ge=x&r,pe=u.length,Ce=p.length;if(pe!=Ce&&!(ge&&Ce>pe))return!1;var ve=oe.get(u);if(ve&&oe.get(p))return ve==p;var De=-1,ze=!0,Oe=x&i?new jn:void 0;for(oe.set(u,p),oe.set(p,u);++De<pe;){var Me=u[De],Le=p[De];if(R)var Bt=ge?R(Le,Me,De,p,u,oe):R(Me,Le,De,u,p,oe);if(Bt!==void 0){if(Bt)continue;ze=!1;break}if(Oe){if(!Js(p,function(At,ln){if(!On(Oe,ln)&&(Me===At||ce(Me,At,x,R,oe)))return Oe.push(ln)})){ze=!1;break}}else if(!(Me===Le||ce(Me,Le,x,R,oe))){ze=!1;break}}return oe.delete(u),oe.delete(p),ze}function ho(u,p,x,R,ce,oe,ge){switch(x){case j:if(u.byteLength!=p.byteLength||u.byteOffset!=p.byteOffset)return!1;u=u.buffer,p=p.buffer;case y:return!(u.byteLength!=p.byteLength||!oe(new sr(u),new sr(p)));case f:case v:case k:return cr(+u,+p);case h:return u.name==p.name&&u.message==p.message;case _:case H:return u==p+"";case g:var pe=Qs;case B:var Ce=R&r;if(pe||(pe=dt),u.size!=p.size&&!Ce)return!1;var ve=ge.get(u);if(ve)return ve==p;R|=i,ge.set(u,p);var De=Es(pe(u),pe(p),R,ce,oe,ge);return ge.delete(u),De;case ae:if(xs)return xs.call(u)==xs.call(p)}return!1}function fo(u,p,x,R,ce,oe){var ge=x&r,pe=an(u),Ce=pe.length,ve=an(p),De=ve.length;if(Ce!=De&&!ge)return!1;for(var ze=Ce;ze--;){var Oe=pe[ze];if(!(ge?Oe in p:Ze.call(p,Oe)))return!1}var Me=oe.get(u);if(Me&&oe.get(p))return Me==p;var Le=!0;oe.set(u,p),oe.set(p,u);for(var Bt=ge;++ze<Ce;){Oe=pe[ze];var At=u[Oe],ln=p[Oe];if(R)var yl=ge?R(ln,At,Oe,p,u,oe):R(At,ln,Oe,u,p,oe);if(!(yl===void 0?At===ln||ce(At,ln,x,R,oe):yl)){Le=!1;break}Bt||(Bt=Oe=="constructor")}if(Le&&!Bt){var mr=u.constructor,gr=p.constructor;mr!=gr&&"constructor"in u&&"constructor"in p&&!(typeof mr=="function"&&mr instanceof mr&&typeof gr=="function"&&gr instanceof gr)&&(Le=!1)}return oe.delete(u),oe.delete(p),Le}function an(u){return ws(u,As,po)}function nt(u,p){var x=u.__data__;return go(p)?x[typeof p=="string"?"string":"hash"]:x.map}function _t(u,p){var x=ds(u,p);return lo(x)?x:void 0}function St(u){var p=Ze.call(u,tt),x=u[tt];try{u[tt]=void 0;var R=!0}catch{}var ce=nr.call(u);return R&&(p?u[tt]=x:delete u[tt]),ce}var po=qn?function(u){return u==null?[]:(u=Object(u),Se(qn(u),function(p){return Ln.call(u,p)}))}:xo,pt=on;(gs&&pt(new gs(new ArrayBuffer(1)))!=j||rn&&pt(new rn)!=g||vs&&pt(vs.resolve())!=A||ys&&pt(new ys)!=B||bs&&pt(new bs)!=me)&&(pt=function(u){var p=on(u),x=p==E?u.constructor:void 0,R=x?Ue(x):"";if(R)switch(R){case rr:return j;case Et:return g;case Fi:return A;case Pi:return B;case Bi:return me}return p});function mo(u,p){return p=p??o,!!p&&(typeof u=="number"||K.test(u))&&u>-1&&u%1==0&&u<p}function go(u){var p=typeof u;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?u!=="__proto__":u===null}function vo(u){return!!tr&&tr in u}function yo(u){var p=u&&u.constructor,x=typeof p=="function"&&p.prototype||tn;return u===x}function ur(u){return nr.call(u)}function Ue(u){if(u!=null){try{return fs.call(u)}catch{}try{return u+""}catch{}}return""}function cr(u,p){return u===p||u!==u&&p!==p}var hr=ar(function(){return arguments}())?ar:function(u){return mt(u)&&Ze.call(u,"callee")&&!Ln.call(u,"callee")},Fn=Array.isArray;function _s(u){return u!=null&&Ss(u.length)&&!dr(u)}var Pn=ms||ko;function bo(u,p){return lr(u,p)}function dr(u){if(!fr(u))return!1;var p=on(u);return p==d||p==m||p==c||p==N}function Ss(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=o}function fr(u){var p=typeof u;return u!=null&&(p=="object"||p=="function")}function mt(u){return u!=null&&typeof u=="object"}var pr=xe?ji(xe):uo;function As(u){return _s(u)?oo(u):co(u)}function xo(){return[]}function ko(){return!1}n.exports=bo}(Br,Br.exports)),Br.exports}var wr={},_u;function ob(){if(_u)return wr;_u=1,Object.defineProperty(wr,"__esModule",{value:!0});const n=Zd(),e=Xd();var t;return function(s){function r(l={},c={},f=!1){typeof l!="object"&&(l={}),typeof c!="object"&&(c={});let v=n(c);f||(v=Object.keys(v).reduce((h,d)=>(v[d]!=null&&(h[d]=v[d]),h),{}));for(const h in l)l[h]!==void 0&&c[h]===void 0&&(v[h]=l[h]);return Object.keys(v).length>0?v:void 0}s.compose=r;function i(l={},c={}){typeof l!="object"&&(l={}),typeof c!="object"&&(c={});const f=Object.keys(l).concat(Object.keys(c)).reduce((v,h)=>(e(l[h],c[h])||(v[h]=c[h]===void 0?null:c[h]),v),{});return Object.keys(f).length>0?f:void 0}s.diff=i;function o(l={},c={}){l=l||{};const f=Object.keys(c).reduce((v,h)=>(c[h]!==l[h]&&l[h]!==void 0&&(v[h]=c[h]),v),{});return Object.keys(l).reduce((v,h)=>(l[h]!==c[h]&&c[h]===void 0&&(v[h]=null),v),f)}s.invert=o;function a(l,c,f=!1){if(typeof l!="object")return c;if(typeof c!="object")return;if(!f)return c;const v=Object.keys(c).reduce((h,d)=>(l[d]===void 0&&(h[d]=c[d]),h),{});return Object.keys(v).length>0?v:void 0}s.transform=a}(t||(t={})),wr.default=t,wr}var Er={},Su;function Yd(){if(Su)return Er;Su=1,Object.defineProperty(Er,"__esModule",{value:!0});var n;return function(e){function t(s){return typeof s.delete=="number"?s.delete:typeof s.retain=="number"?s.retain:typeof s.retain=="object"&&s.retain!==null?1:typeof s.insert=="string"?s.insert.length:1}e.length=t}(n||(n={})),Er.default=n,Er}var _r={},Au;function ab(){if(Au)return _r;Au=1,Object.defineProperty(_r,"__esModule",{value:!0});const n=Yd();class e{constructor(s){this.ops=s,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(s){s||(s=1/0);const r=this.ops[this.index];if(r){const i=this.offset,o=n.default.length(r);if(s>=o-i?(s=o-i,this.index+=1,this.offset=0):this.offset+=s,typeof r.delete=="number")return{delete:s};{const a={};return r.attributes&&(a.attributes=r.attributes),typeof r.retain=="number"?a.retain=s:typeof r.retain=="object"&&r.retain!==null?a.retain=r.retain:typeof r.insert=="string"?a.insert=r.insert.substr(i,s):a.insert=r.insert,a}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const s=this.ops[this.index];return s?typeof s.delete=="number"?"delete":typeof s.retain=="number"||typeof s.retain=="object"&&s.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const s=this.offset,r=this.index,i=this.next(),o=this.ops.slice(this.index);return this.offset=s,this.index=r,[i].concat(o)}}else return[]}}return _r.default=e,_r}var Cu;function lb(){return Cu||(Cu=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=ib(),s=Zd(),r=Xd(),i=ob();e.AttributeMap=i.default;const o=Yd();e.Op=o.default;const a=ab();e.OpIterator=a.default;const l="\0",c=(v,h)=>{if(typeof v!="object"||v===null)throw new Error(`cannot retain a ${typeof v}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const d=Object.keys(v)[0];if(!d||d!==Object.keys(h)[0])throw new Error(`embed types not matched: ${d} != ${Object.keys(h)[0]}`);return[d,v[d],h[d]]};class f{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,d){this.handlers[h]=d}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const d=this.handlers[h];if(!d)throw new Error(`no handlers for embed type "${h}"`);return d}insert(h,d){const m={};return typeof h=="string"&&h.length===0?this:(m.insert=h,d!=null&&typeof d=="object"&&Object.keys(d).length>0&&(m.attributes=d),this.push(m))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,d){if(typeof h=="number"&&h<=0)return this;const m={retain:h};return d!=null&&typeof d=="object"&&Object.keys(d).length>0&&(m.attributes=d),this.push(m)}push(h){let d=this.ops.length,m=this.ops[d-1];if(h=s(h),typeof m=="object"){if(typeof h.delete=="number"&&typeof m.delete=="number")return this.ops[d-1]={delete:m.delete+h.delete},this;if(typeof m.delete=="number"&&h.insert!=null&&(d-=1,m=this.ops[d-1],typeof m!="object"))return this.ops.unshift(h),this;if(r(h.attributes,m.attributes)){if(typeof h.insert=="string"&&typeof m.insert=="string")return this.ops[d-1]={insert:m.insert+h.insert},typeof h.attributes=="object"&&(this.ops[d-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof m.retain=="number")return this.ops[d-1]={retain:m.retain+h.retain},typeof h.attributes=="object"&&(this.ops[d-1].attributes=h.attributes),this}}return d===this.ops.length?this.ops.push(h):this.ops.splice(d,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const d=[],m=[];return this.forEach(g=>{(h(g)?d:m).push(g)}),[d,m]}reduce(h,d){return this.ops.reduce(h,d)}changeLength(){return this.reduce((h,d)=>d.insert?h+o.default.length(d):d.delete?h-d.delete:h,0)}length(){return this.reduce((h,d)=>h+o.default.length(d),0)}slice(h=0,d=1/0){const m=[],g=new a.default(this.ops);let k=0;for(;k<d&&g.hasNext();){let w;k<h?w=g.next(h-k):(w=g.next(d-k),m.push(w)),k+=o.default.length(w)}return new f(m)}compose(h){const d=new a.default(this.ops),m=new a.default(h.ops),g=[],k=m.peek();if(k!=null&&typeof k.retain=="number"&&k.attributes==null){let E=k.retain;for(;d.peekType()==="insert"&&d.peekLength()<=E;)E-=d.peekLength(),g.push(d.next());k.retain-E>0&&m.next(k.retain-E)}const w=new f(g);for(;d.hasNext()||m.hasNext();)if(m.peekType()==="insert")w.push(m.next());else if(d.peekType()==="delete")w.push(d.next());else{const E=Math.min(d.peekLength(),m.peekLength()),A=d.next(E),N=m.next(E);if(N.retain){const _={};if(typeof A.retain=="number")_.retain=typeof N.retain=="number"?E:N.retain;else if(typeof N.retain=="number")A.retain==null?_.insert=A.insert:_.retain=A.retain;else{const H=A.retain==null?"insert":"retain",[ae,he,me]=c(A[H],N.retain),y=f.getHandler(ae);_[H]={[ae]:y.compose(he,me,H==="retain")}}const B=i.default.compose(A.attributes,N.attributes,typeof A.retain=="number");if(B&&(_.attributes=B),w.push(_),!m.hasNext()&&r(w.ops[w.ops.length-1],_)){const H=new f(d.rest());return w.concat(H).chop()}}else typeof N.delete=="number"&&(typeof A.retain=="number"||typeof A.retain=="object"&&A.retain!==null)&&w.push(N)}return w.chop()}concat(h){const d=new f(this.ops.slice());return h.ops.length>0&&(d.push(h.ops[0]),d.ops=d.ops.concat(h.ops.slice(1))),d}diff(h,d){if(this.ops===h.ops)return new f;const m=[this,h].map(A=>A.map(N=>{if(N.insert!=null)return typeof N.insert=="string"?N.insert:l;const _=A===h?"on":"with";throw new Error("diff() called "+_+" non-document")}).join("")),g=new f,k=t(m[0],m[1],d,!0),w=new a.default(this.ops),E=new a.default(h.ops);return k.forEach(A=>{let N=A[1].length;for(;N>0;){let _=0;switch(A[0]){case t.INSERT:_=Math.min(E.peekLength(),N),g.push(E.next(_));break;case t.DELETE:_=Math.min(N,w.peekLength()),w.next(_),g.delete(_);break;case t.EQUAL:_=Math.min(w.peekLength(),E.peekLength(),N);const B=w.next(_),H=E.next(_);r(B.insert,H.insert)?g.retain(_,i.default.diff(B.attributes,H.attributes)):g.push(H).delete(_);break}N-=_}}),g.chop()}eachLine(h,d=`
`){const m=new a.default(this.ops);let g=new f,k=0;for(;m.hasNext();){if(m.peekType()!=="insert")return;const w=m.peek(),E=o.default.length(w)-m.peekLength(),A=typeof w.insert=="string"?w.insert.indexOf(d,E)-E:-1;if(A<0)g.push(m.next());else if(A>0)g.push(m.next(A));else{if(h(g,m.next(1).attributes||{},k)===!1)return;k+=1,g=new f}}g.length()>0&&h(g,{},k)}invert(h){const d=new f;return this.reduce((m,g)=>{if(g.insert)d.delete(o.default.length(g));else{if(typeof g.retain=="number"&&g.attributes==null)return d.retain(g.retain),m+g.retain;if(g.delete||typeof g.retain=="number"){const k=g.delete||g.retain;return h.slice(m,m+k).forEach(w=>{g.delete?d.push(w):g.retain&&g.attributes&&d.retain(o.default.length(w),i.default.invert(g.attributes,w.attributes))}),m+k}else if(typeof g.retain=="object"&&g.retain!==null){const k=h.slice(m,m+1),w=new a.default(k.ops).next(),[E,A,N]=c(g.retain,w.insert),_=f.getHandler(E);return d.retain({[E]:_.invert(A,N)},i.default.invert(g.attributes,w.attributes)),m+1}}return m},0),d.chop()}transform(h,d=!1){if(d=!!d,typeof h=="number")return this.transformPosition(h,d);const m=h,g=new a.default(this.ops),k=new a.default(m.ops),w=new f;for(;g.hasNext()||k.hasNext();)if(g.peekType()==="insert"&&(d||k.peekType()!=="insert"))w.retain(o.default.length(g.next()));else if(k.peekType()==="insert")w.push(k.next());else{const E=Math.min(g.peekLength(),k.peekLength()),A=g.next(E),N=k.next(E);if(A.delete)continue;if(N.delete)w.push(N);else{const _=A.retain,B=N.retain;let H=typeof B=="object"&&B!==null?B:E;if(typeof _=="object"&&_!==null&&typeof B=="object"&&B!==null){const ae=Object.keys(_)[0];if(ae===Object.keys(B)[0]){const he=f.getHandler(ae);he&&(H={[ae]:he.transform(_[ae],B[ae],d)})}}w.retain(H,i.default.transform(A.attributes,N.attributes,d))}}return w.chop()}transformPosition(h,d=!1){d=!!d;const m=new a.default(this.ops);let g=0;for(;m.hasNext()&&g<=h;){const k=m.peekLength(),w=m.peekType();if(m.next(),w==="delete"){h-=Math.min(k,h-g);continue}else w==="insert"&&(g<h||!d)&&(h+=k);g+=k}return h}}f.Op=o.default,f.OpIterator=a.default,f.AttributeMap=i.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(Lo,Lo.exports)),Lo.exports}var Je=lb();const ne=Te.Jm(Je);class ct extends Ge{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}ct.blotName="break";ct.tagName="BR";let lt=class extends ei{};const ub={"&":"&","<":"<",">":">",'"':""","'":"'"};function _i(n){return n.replace(/[&<>"']/g,e=>ub[e])}const Vr=class Kn extends rl{static compare(e,t){const s=Kn.order.indexOf(e),r=Kn.order.indexOf(t);return s>=0||r>=0?s-r:e===t?0:e<t?-1:1}formatAt(e,t,s,r){if(Kn.compare(this.statics.blotName,s)<0&&this.scroll.query(s,se.BLOT)){const i=this.isolate(e,t);r&&i.wrap(s,r)}else super.formatAt(e,t,s,r)}optimize(e){if(super.optimize(e),this.parent instanceof Kn&&Kn.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};ee(Vr,"allowedChildren",[Vr,ct,Ge,lt]),ee(Vr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let en=Vr;const Nu=1;class qe extends Vs{constructor(){super(...arguments),ee(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Jd(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,s,r){t<=0||(this.scroll.query(s,se.BLOCK)?e+t===this.length()&&this.format(s,r):super.formatAt(e,Math.min(t,this.length()-e-1),s,r),this.cache={})}insertAt(e,t,s){if(s!=null){super.insertAt(e,t,s),this.cache={};return}if(t.length===0)return;const r=t.split(`
`),i=r.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let o=this;r.reduce((a,l)=>(o=o.split(a,!0),o.insertAt(0,l),l.length),e+i.length)}insertBefore(e,t){const{head:s}=this.children;super.insertBefore(e,t),s instanceof ct&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Nu),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Nu)){const r=this.clone();return e===0?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}const s=super.split(e,t);return this.cache={},s}}qe.blotName="block";qe.tagName="P";qe.defaultChild=ct;qe.allowedChildren=[ct,en,Ge,lt];class Qe extends Ge{attach(){super.attach(),this.attributes=new wi(this.domNode)}delta(){return new ne().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const s=this.scroll.query(e,se.BLOCK_ATTRIBUTE);s!=null&&this.attributes.attribute(s,t)}formatAt(e,t,s,r){this.format(s,r)}insertAt(e,t,s){if(s!=null){super.insertAt(e,t,s);return}const r=t.split(`
`),i=r.pop(),o=r.map(l=>{const c=this.scroll.create(qe.blotName);return c.insertAt(0,l),c}),a=this.split(e);o.forEach(l=>{this.parent.insertBefore(l,a)}),i&&this.parent.insertBefore(this.scroll.create("text",i),a)}}Qe.scope=se.BLOCK_BLOT;function Jd(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(Fe).reduce((t,s)=>s.length()===0?t:t.insert(s.value(),Xe(s,{},e)),new ne).insert(`
`,Xe(n))}function Xe(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:Xe(n.parent,e,t)}const Is=class un extends Ge{static value(){}constructor(e,t,s){super(e,t),this.selection=s,this.textNode=document.createTextNode(un.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let s=this,r=0;for(;s!=null&&s.statics.scope!==se.BLOCK_BLOT;)r+=s.offset(s.parent),s=s.parent;s!=null&&(this.savedLength=un.CONTENTS.length,s.optimize(),s.formatAt(r,un.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof lt?this.prev:null,s=t?t.length():0,r=this.next instanceof lt?this.next:null,i=r?r.text:"",{textNode:o}=this,a=o.data.split(un.CONTENTS).join("");o.data=un.CONTENTS;let l;if(t)l=t,(a||r)&&(t.insertAt(t.length(),a+i),r&&r.remove());else if(r)l=r,r.insertAt(0,a);else{const c=document.createTextNode(a);l=this.scroll.create(c),this.parent.insertBefore(l,this)}if(this.remove(),e){const c=(h,d)=>t&&h===t.domNode?d:h===o?s+d-1:r&&h===r.domNode?s+a.length+d:null,f=c(e.start.node,e.start.offset),v=c(e.end.node,e.end.offset);if(f!==null&&v!==null)return{startNode:l.domNode,startOffset:f,endNode:l.domNode,endOffset:v}}return null}update(e,t){if(e.some(s=>s.type==="characterData"&&s.target===this.textNode)){const s=this.restore();s&&(t.range=s)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=un.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}};ee(Is,"blotName","cursor"),ee(Is,"className","ql-cursor"),ee(Is,"tagName","span"),ee(Is,"CONTENTS","\uFEFF");let Si=Is;var Ou={exports:{}},Tu;function cb(){return Tu||(Tu=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(t=!1));function r(l,c,f){this.fn=l,this.context=c,this.once=f||!1}function i(l,c,f,v,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var d=new r(f,v||l,h),m=t?t+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],d]:l._events[m].push(d):(l._events[m]=d,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new s:delete l._events[c]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,f;if(this._eventsCount===0)return l;for(f in c=this._events)e.call(c,f)&&l.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=t?t+l:l,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var v=0,h=f.length,d=new Array(h);v<h;v++)d[v]=f[v].fn;return d},a.prototype.listenerCount=function(l){var c=t?t+l:l,f=this._events[c];return f?f.fn?1:f.length:0},a.prototype.emit=function(l,c,f,v,h,d){var m=t?t+l:l;if(!this._events[m])return!1;var g=this._events[m],k=arguments.length,w,E;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),k){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,f),!0;case 4:return g.fn.call(g.context,c,f,v),!0;case 5:return g.fn.call(g.context,c,f,v,h),!0;case 6:return g.fn.call(g.context,c,f,v,h,d),!0}for(E=1,w=new Array(k-1);E<k;E++)w[E-1]=arguments[E];g.fn.apply(g.context,w)}else{var A=g.length,N;for(E=0;E<A;E++)switch(g[E].once&&this.removeListener(l,g[E].fn,void 0,!0),k){case 1:g[E].fn.call(g[E].context);break;case 2:g[E].fn.call(g[E].context,c);break;case 3:g[E].fn.call(g[E].context,c,f);break;case 4:g[E].fn.call(g[E].context,c,f,v);break;default:if(!w)for(N=1,w=new Array(k-1);N<k;N++)w[N-1]=arguments[N];g[E].fn.apply(g[E].context,w)}}return!0},a.prototype.on=function(l,c,f){return i(this,l,c,f,!1)},a.prototype.once=function(l,c,f){return i(this,l,c,f,!0)},a.prototype.removeListener=function(l,c,f,v){var h=t?t+l:l;if(!this._events[h])return this;if(!c)return o(this,h),this;var d=this._events[h];if(d.fn)d.fn===c&&(!v||d.once)&&(!f||d.context===f)&&o(this,h);else{for(var m=0,g=[],k=d.length;m<k;m++)(d[m].fn!==c||v&&!d[m].once||f&&d[m].context!==f)&&g.push(d[m]);g.length?this._events[h]=g.length===1?g[0]:g:o(this,h)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=t?t+l:l,this._events[c]&&o(this,c)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a}(Ou)),Ou.exports}var hb=cb();const db=Te.Jm(hb),wa=new WeakMap,Ea=["error","warn","log","info"];let _a="warn";function Qd(n){if(_a&&Ea.indexOf(n)<=Ea.indexOf(_a)){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];console[n](...t)}}function Ft(n){return Ea.reduce((e,t)=>(e[t]=Qd.bind(console,t,n),e),{})}Ft.level=n=>{_a=n};Qd.level=Ft.level;const jo=Ft("quill:events"),fb=["selectionchange","mousedown","mouseup","click"];fb.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];Array.from(document.querySelectorAll(".ql-container")).forEach(r=>{const i=wa.get(r);i&&i.emitter&&i.emitter.handleDOM(...t)})})});class te extends db{constructor(){super(),this.domListeners={},this.on("error",jo.error)}emit(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return jo.log.call(jo,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];(this.domListeners[e.type]||[]).forEach(i=>{let{node:o,handler:a}=i;(e.target===o||o.contains(e.target))&&a(e,...s)})}listenDOM(e,t,s){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:s})}}ee(te,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),ee(te,"sources",{API:"api",SILENT:"silent",USER:"user"});const Do=Ft("quill:selection");class wn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class pb{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new wn(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,te.sources.USER),1)}),this.emitter.on(te.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const s=this.getNativeRange();s!=null&&s.start.node!==this.cursor.textNode&&this.emitter.once(te.events.SCROLL_UPDATE,(r,i)=>{try{this.root.contains(s.start.node)&&this.root.contains(s.end.node)&&this.setNativeRange(s.start.node,s.start.offset,s.end.node,s.end.offset);const o=i.some(a=>a.type==="characterData"||a.type==="childList"||a.type==="attributes"&&a.target===this.root);this.update(o?te.sources.SILENT:r)}catch{}})}),this.emitter.on(te.events.SCROLL_OPTIMIZE,(s,r)=>{if(r.range){const{startNode:i,startOffset:o,endNode:a,endOffset:l}=r.range;this.setNativeRange(i,o,a,l),this.update(te.sources.SILENT)}}),this.update(te.sources.SILENT)}handleComposition(){this.emitter.on(te.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(te.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(te.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const s=this.getNativeRange();if(!(s==null||!s.native.collapsed||this.scroll.query(e,se.BLOCK))){if(s.start.node!==this.cursor.textNode){const r=this.scroll.find(s.start.node,!1);if(r==null)return;if(r instanceof Fe){const i=r.split(s.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,s.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const s=this.scroll.length();e=Math.min(e,s-1),t=Math.min(e+t,s-1)-e;let r,[i,o]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&o===i.length()){const[f]=this.scroll.leaf(e+1);if(f){const[v]=this.scroll.line(e),[h]=this.scroll.line(e+1);v===h&&(i=f,o=0)}}[r,o]=i.position(o,!0);const a=document.createRange();if(t>0)return a.setStart(r,o),[i,o]=this.scroll.leaf(e+t),i==null?null:([r,o]=i.position(o,!0),a.setEnd(r,o),a.getBoundingClientRect());let l="left",c;if(r instanceof Text){if(!r.data.length)return null;o<r.data.length?(a.setStart(r,o),a.setEnd(r,o+1)):(a.setStart(r,o-1),a.setEnd(r,o),l="right"),c=a.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;c=i.domNode.getBoundingClientRect(),o>0&&(l="right")}return{bottom:c.top+c.height,height:c.height,left:c[l],right:c[l],top:c.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const s=this.normalizeNative(t);return Do.info("getNativeRange",s),s}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Mo(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const s=t.map(o=>{const[a,l]=o,c=this.scroll.find(a,!0),f=c.offset(this.scroll);return l===0?f:c instanceof Fe?f+c.index(a,l):f+c.length()}),r=Math.min(Math.max(...s),this.scroll.length()-1),i=Math.min(r,...s);return new wn(i,r-i)}normalizeNative(e){if(!Mo(this.root,e.startContainer)||!e.collapsed&&!Mo(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(s=>{let{node:r,offset:i}=s;for(;!(r instanceof Text)&&r.childNodes.length>0;)if(r.childNodes.length>i)r=r.childNodes[i],i=0;else if(r.childNodes.length===i)r=r.lastChild,r instanceof Text?i=r.data.length:r.childNodes.length>0?i=r.childNodes.length:i=r.childNodes.length+1;else break;s.node=r,s.offset=i}),t}rangeToNative(e){const t=this.scroll.length(),s=(r,i)=>{r=Math.min(t-1,r);const[o,a]=this.scroll.leaf(r);return o?o.position(a,i):[null,-1]};return[...s(e.index,!1),...s(e.index+e.length,!0)]}setNativeRange(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Do.info("setNativeRange",e,t,s,r),e!=null&&(this.root.parentNode==null||e.parentNode==null||s.parentNode==null))return;const o=document.getSelection();if(o!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:a}=this.getNativeRange()||{};if(a==null||i||e!==a.startContainer||t!==a.startOffset||s!==a.endContainer||r!==a.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),s instanceof Element&&s.tagName==="BR"&&(r=Array.from(s.parentNode.childNodes).indexOf(s),s=s.parentNode);const l=document.createRange();l.setStart(e,t),l.setEnd(s,r),o.removeAllRanges(),o.addRange(l)}}else o.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te.sources.API;if(typeof t=="string"&&(s=t,t=!1),Do.info("setRange",e),e!=null){const r=this.rangeToNative(e);this.setNativeRange(...r,t)}else this.setNativeRange(null);this.update(s)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:te.sources.USER;const t=this.lastRange,[s,r]=this.getRange();if(this.lastRange=s,this.lastNative=r,this.lastRange!=null&&(this.savedRange=this.lastRange),!$t(t,this.lastRange)){if(!this.composing&&r!=null&&r.native.collapsed&&r.start.node!==this.cursor.textNode){const o=this.cursor.restore();o&&this.setNativeRange(o.startNode,o.startOffset,o.endNode,o.endOffset)}const i=[te.events.SELECTION_CHANGE,Xn(this.lastRange),Xn(t),e];this.emitter.emit(te.events.EDITOR_CHANGE,...i),e!==te.sources.SILENT&&this.emitter.emit(...i)}}}function Mo(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const mb=/^[ -~]*$/;class gb{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const s=Ru(e),r=new ne;return yb(s.ops.slice()).reduce((i,o)=>{const a=Je.Op.length(o);let l=o.attributes||{},c=!1,f=!1;if(o.insert!=null){if(r.retain(a),typeof o.insert=="string"){const d=o.insert;f=!d.endsWith(`
`)&&(t<=i||!!this.scroll.descendant(Qe,i)[0]),this.scroll.insertAt(i,d);const[m,g]=this.scroll.line(i);let k=Wt({},Xe(m));if(m instanceof qe){const[w]=m.descendant(Fe,g);w&&(k=Wt(k,Xe(w)))}l=Je.AttributeMap.diff(k,l)||{}}else if(typeof o.insert=="object"){const d=Object.keys(o.insert)[0];if(d==null)return i;const m=this.scroll.query(d,se.INLINE)!=null;if(m)(t<=i||this.scroll.descendant(Qe,i)[0])&&(f=!0);else if(i>0){const[g,k]=this.scroll.descendant(Fe,i-1);g instanceof lt?g.value()[k]!==`
`&&(c=!0):g instanceof Ge&&g.statics.scope===se.INLINE_BLOT&&(c=!0)}if(this.scroll.insertAt(i,d,o.insert[d]),m){const[g]=this.scroll.descendant(Fe,i);if(g){const k=Wt({},Xe(g));l=Je.AttributeMap.diff(k,l)||{}}}}t+=a}else if(r.push(o),o.retain!==null&&typeof o.retain=="object"){const d=Object.keys(o.retain)[0];if(d==null)return i;this.scroll.updateEmbedAt(i,d,o.retain[d])}Object.keys(l).forEach(d=>{this.scroll.formatAt(i,a,d,l[d])});const v=c?1:0,h=f?1:0;return t+=v+h,r.retain(v),r.delete(h),i+a+v+h},0),r.reduce((i,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(i,o.delete),i):i+Je.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(s)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new ne().retain(e).delete(t))}formatLine(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(s).forEach(i=>{this.scroll.lines(e,Math.max(t,1)).forEach(o=>{o.format(i,s[i])})}),this.scroll.optimize();const r=new ne().retain(e).retain(t,Xn(s));return this.update(r)}formatText(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(s).forEach(i=>{this.scroll.formatAt(e,t,i,s[i])});const r=new ne().retain(e).retain(t,Xn(s));return this.update(r)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new ne)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=[],r=[];t===0?this.scroll.path(e).forEach(a=>{const[l]=a;l instanceof qe?s.push(l):l instanceof Fe&&r.push(l)}):(s=this.scroll.lines(e,t),r=this.scroll.descendants(Fe,e,t));const[i,o]=[s,r].map(a=>{const l=a.shift();if(l==null)return{};let c=Xe(l);for(;Object.keys(c).length>0;){const f=a.shift();if(f==null)return c;c=vb(Xe(f),c)}return c});return{...i,...o}}getHTML(e,t){const[s,r]=this.scroll.line(e);if(s){const i=s.length();return s.length()>=r+t&&!(r===0&&t===i)?Us(s,r,t,!0):Us(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(s=>typeof s.insert=="string").map(s=>s.insert).join("")}insertContents(e,t){const s=Ru(t),r=new ne().retain(e).concat(s);return this.scroll.insertContents(e,s),this.update(r)}insertEmbed(e,t,s){return this.scroll.insertAt(e,t,s),this.update(new ne().retain(e).insert({[t]:s}))}insertText(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
`).replace(/\r/g,`
`),this.scroll.insertAt(e,t),Object.keys(s).forEach(r=>{this.scroll.formatAt(e,t.length,r,s[r])}),this.update(new ne().retain(e).insert(t,Xn(s)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==qe.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof ct}removeFormat(e,t){const s=this.getText(e,t),[r,i]=this.scroll.line(e+t);let o=0,a=new ne;r!=null&&(o=r.length()-i,a=r.delta().slice(i,i+o-1).insert(`
`));const l=this.getContents(e,t+o).diff(new ne().insert(s).concat(a)),c=new ne().retain(e).concat(l);return this.applyDelta(c)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const r=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(mb)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),o=Xe(i),a=i.offset(this.scroll),l=t[0].oldValue.replace(Si.CONTENTS,""),c=new ne().insert(l),f=new ne().insert(i.value()),v=s&&{oldRange:Iu(s.oldRange,-a),newRange:Iu(s.newRange,-a)};e=new ne().retain(a).concat(c.diff(f,v)).reduce((h,d)=>d.insert?h.insert(d.insert,o):h.push(d),new ne),this.delta=r.compose(e)}else this.delta=this.getDelta(),(!e||!$t(r.compose(e),this.delta))&&(e=r.diff(this.delta,s));return e}}function Wn(n,e,t){if(n.length===0){const[d]=Fo(t.pop());return e<=0?`</li></${d}>`:`</li></${d}>${Wn([],e-1,t)}`}const[{child:s,offset:r,length:i,indent:o,type:a},...l]=n,[c,f]=Fo(a);if(o>e)return t.push(a),o===e+1?`<${c}><li${f}>${Us(s,r,i)}${Wn(l,o,t)}`:`<${c}><li>${Wn(n,e+1,t)}`;const v=t[t.length-1];if(o===e&&a===v)return`</li><li${f}>${Us(s,r,i)}${Wn(l,o,t)}`;const[h]=Fo(t.pop());return`</li></${h}>${Wn(n,e-1,t)}`}function Us(n,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof lt)return _i(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof at){if(n.statics.blotName==="list-container"){const c=[];return n.children.forEachAt(e,t,(f,v,h)=>{const d="formats"in f&&typeof f.formats=="function"?f.formats():{};c.push({child:f,offset:v,length:h,indent:d.indent||0,type:d.list})}),Wn(c,-1,[])}const r=[];if(n.children.forEachAt(e,t,(c,f,v)=>{r.push(Us(c,f,v))}),s||n.statics.blotName==="list")return r.join("");const{outerHTML:i,innerHTML:o}=n.domNode,[a,l]=i.split(`>${o}<`);return a==="<table"?`<table style="border: 1px solid #000;">${r.join("")}<${l}`:`${a}>${r.join("")}<${l}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function vb(n,e){return Object.keys(e).reduce((t,s)=>{if(n[s]==null)return t;const r=e[s];return r===n[s]?t[s]=r:Array.isArray(r)?r.indexOf(n[s])<0?t[s]=r.concat([n[s]]):t[s]=r:t[s]=[r,n[s]],t},{})}function Fo(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Ru(n){return n.reduce((e,t)=>{if(typeof t.insert=="string"){const s=t.insert.replace(/\r\n/g,`
`).replace(/\r/g,`
`);return e.insert(s,t.attributes)}return e.push(t)},new ne)}function Iu(n,e){let{index:t,length:s}=n;return new wn(t+e,s)}function yb(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
`).forEach((s,r)=>{r&&e.push({insert:`
`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class ht{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}ee(ht,"DEFAULTS",{});const Sr="\uFEFF";class ol extends Ge{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(s=>{this.contentNode.appendChild(s)}),this.leftGuard=document.createTextNode(Sr),this.rightGuard=document.createTextNode(Sr),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,s;const r=e.data.split(Sr).join("");if(e===this.leftGuard)if(this.prev instanceof lt){const i=this.prev.length();this.prev.insertAt(i,r),t={startNode:this.prev.domNode,startOffset:i+r.length}}else s=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(s),this),t={startNode:s,startOffset:r.length};else e===this.rightGuard&&(this.next instanceof lt?(this.next.insertAt(0,r),t={startNode:this.next.domNode,startOffset:r.length}):(s=document.createTextNode(r),this.parent.insertBefore(this.scroll.create(s),this.next),t={startNode:s,startOffset:r.length}));return e.data=Sr,t}update(e,t){e.forEach(s=>{if(s.type==="characterData"&&(s.target===this.leftGuard||s.target===this.rightGuard)){const r=this.restore(s.target);r&&(t.range=r)}})}}class bb{constructor(e,t){ee(this,"isComposing",!1),this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof ol)&&(this.emitter.emit(te.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(te.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(te.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(te.events.COMPOSITION_END,e),this.isComposing=!1}}const Ur=class{constructor(e,t){ee(this,"modules",{}),this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}};ee(Ur,"DEFAULTS",{modules:{}}),ee(Ur,"themes",{default:Ur});let Ai=Ur;const xb=n=>n.parentElement||n.getRootNode().host||null,kb=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,s="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*s,left:e.left}},Ar=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},Lu=(n,e,t,s,r,i)=>n<t&&e>s?0:n<t?-(t-n+r):e>s?e-n>s-t?n+r-t:e-s+i:0,wb=(n,e)=>{var t,s,r;const i=n.ownerDocument;let o=e,a=n;for(;a;){const l=a===i.body,c=l?{top:0,right:((t=window.visualViewport)==null?void 0:t.width)??i.documentElement.clientWidth,bottom:((s=window.visualViewport)==null?void 0:s.height)??i.documentElement.clientHeight,left:0}:kb(a),f=getComputedStyle(a),v=Lu(o.left,o.right,c.left,c.right,Ar(f.scrollPaddingLeft),Ar(f.scrollPaddingRight)),h=Lu(o.top,o.bottom,c.top,c.bottom,Ar(f.scrollPaddingTop),Ar(f.scrollPaddingBottom));if(v||h)if(l)(r=i.defaultView)==null||r.scrollBy(v,h);else{const{scrollLeft:d,scrollTop:m}=a;h&&(a.scrollTop+=h),v&&(a.scrollLeft+=v);const g=a.scrollLeft-d,k=a.scrollTop-m;o={left:o.left-g,top:o.top-k,right:o.right-g,bottom:o.bottom-k}}a=l||f.position==="fixed"?null:xb(a)}},Eb=100,_b=["block","break","cursor","inline","scroll","text"],Sb=(n,e,t)=>{const s=new os;return _b.forEach(r=>{const i=e.query(r);i&&s.register(i)}),n.forEach(r=>{let i=e.query(r);i||t.error(`Cannot register "${r}" specified in "formats" config. Are you sure it was registered?`);let o=0;for(;i;)if(s.register(i),i="blotName"in i?i.requiredContainer??null:null,o+=1,o>Eb){t.error(`Cycle detected in registering blot requiredContainer: "${r}"`);break}}),s},Jn=Ft("quill"),$r=new os;at.uiClass="ql-ui";const Gn=class Ls{static debug(e){e===!0&&(e="log"),Ft.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return wa.get(e)||$r.find(e,t)}static import(e){return this.imports[e]==null&&Jn.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),s="attrName"in e?e.attrName:e.blotName;typeof s=="string"?this.register(`formats/${s}`,e,t):Object.keys(e).forEach(r=>{this.register(r,e[r],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],s=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!s&&Jn.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&$r.register(t),typeof t.register=="function"&&t.register($r)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Ab(e,t),this.container=this.options.container,this.container==null){Jn.error("Invalid Quill container",e);return}this.options.debug&&Ls.debug(this.options.debug);const s=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",wa.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new te;const r=il.blotName,i=this.options.registry.query(r);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${r}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new gb(this.scroll),this.selection=new pb(this.scroll,this.emitter),this.composition=new bb(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(te.events.EDITOR_CHANGE,o=>{o===te.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(te.events.SCROLL_UPDATE,(o,a)=>{const l=this.selection.lastRange,[c]=this.selection.getRange(),f=l&&c?{oldRange:l,newRange:c}:void 0;st.call(this,()=>this.editor.update(null,a,f),o)}),this.emitter.on(te.events.SCROLL_EMBED_UPDATE,(o,a)=>{const l=this.selection.lastRange,[c]=this.selection.getRange(),f=l&&c?{oldRange:l,newRange:c}:void 0;st.call(this,()=>{const v=new ne().retain(o.offset(this)).retain({[o.statics.blotName]:a});return this.editor.update(v,[],f)},Ls.sources.USER)}),s){const o=this.clipboard.convert({html:`${s}<p><br></p>`,text:`
`});this.setContents(o)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const s=e;e=document.createElement("div"),e.classList.add(s)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,s){return[e,t,,s]=Ct(e,t,s),st.call(this,()=>this.editor.deleteText(e,t),s,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:te.sources.API;return st.call(this,()=>{const r=this.getSelection(!0);let i=new ne;if(r==null)return i;if(this.scroll.query(e,se.BLOCK))i=this.editor.formatLine(r.index,r.length,{[e]:t});else{if(r.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(r.index,r.length,{[e]:t})}return this.setSelection(r,te.sources.SILENT),i},s)}formatLine(e,t,s,r,i){let o;return[e,t,o,i]=Ct(e,t,s,r,i),st.call(this,()=>this.editor.formatLine(e,t,o),i,e,0)}formatText(e,t,s,r,i){let o;return[e,t,o,i]=Ct(e,t,s,r,i),st.call(this,()=>this.editor.formatText(e,t,o),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=null;if(typeof e=="number"?s=this.selection.getBounds(e,t):s=this.selection.getBounds(e.index,e.length),!s)return null;const r=this.container.getBoundingClientRect();return{bottom:s.bottom-r.top,height:s.height,left:s.left-r.left,right:s.right-r.left,top:s.top-r.top,width:s.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=Ct(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return arguments.length>0&&arguments[0]!==void 0&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Ct(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Ct(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,s){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ls.sources.API;return st.call(this,()=>this.editor.insertEmbed(e,t,s),r,e)}insertText(e,t,s,r,i){let o;return[e,,o,i]=Ct(e,0,s,r,i),st.call(this,()=>this.editor.insertText(e,t,o),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,s){return[e,t,,s]=Ct(e,t,s),st.call(this,()=>this.editor.removeFormat(e,t),s,e)}scrollRectIntoView(e){wb(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.sources.API;return st.call(this,()=>{e=new ne(e);const s=this.getLength(),r=this.editor.deleteText(0,s),i=this.editor.insertContents(0,e),o=this.editor.deleteText(this.getLength()-1,1);return r.compose(i).compose(o)},t)}setSelection(e,t,s){e==null?this.selection.setRange(null,t||Ls.sources.API):([e,t,,s]=Ct(e,t,s),this.selection.setRange(new wn(Math.max(0,e),t),s),s!==te.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.sources.API;const s=new ne().insert(e);return this.setContents(s,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:te.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.sources.API;return st.call(this,()=>(e=new ne(e),this.editor.applyDelta(e)),t,!0)}};ee(Gn,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:$r,theme:"default"}),ee(Gn,"events",te.events),ee(Gn,"sources",te.sources),ee(Gn,"version","2.0.3"),ee(Gn,"imports",{delta:ne,parchment:rb,"core/module":ht,"core/theme":Ai});let q=Gn;function qu(n){return typeof n=="string"?document.querySelector(n):n}function Po(n){return Object.entries(n??{}).reduce((e,t)=>{let[s,r]=t;return{...e,[s]:r===!0?{}:r}},{})}function ju(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function Ab(n,e){const t=qu(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===q.DEFAULTS.theme?Ai:q.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:r,...i}=q.DEFAULTS,{modules:o,...a}=s.DEFAULTS;let l=Po(e.modules);l!=null&&l.toolbar&&l.toolbar.constructor!==Object&&(l={...l,toolbar:{container:l.toolbar}});const c=Wt({},Po(r),Po(o),l),f={...i,...ju(a),...ju(e)};let v=e.registry;return v?e.formats&&Jn.warn('Ignoring "formats" option because "registry" is specified'):v=e.formats?Sb(e.formats,f.registry,Jn):f.registry,{...f,registry:v,container:t,theme:s,modules:Object.entries(c).reduce((h,d)=>{let[m,g]=d;if(!g)return h;const k=q.import(`modules/${m}`);return k==null?(Jn.error(`Cannot load ${m} module. Are you sure you registered it?`),h):{...h,[m]:Wt({},k.DEFAULTS||{},g)}},{}),bounds:qu(f.bounds)}}function st(n,e,t,s){if(!this.isEnabled()&&e===te.sources.USER&&!this.allowReadOnlyEdits)return new ne;let r=t==null?null:this.getSelection();const i=this.editor.delta,o=n();if(r!=null&&(t===!0&&(t=r.index),s==null?r=Du(r,o,e):s!==0&&(r=Du(r,t,s,e)),this.setSelection(r,te.sources.SILENT)),o.length()>0){const a=[te.events.TEXT_CHANGE,o,i,e];this.emitter.emit(te.events.EDITOR_CHANGE,...a),e!==te.sources.SILENT&&this.emitter.emit(...a)}return o}function Ct(n,e,t,s,r){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(r=s,s=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(r=s,s=t,t=e,e=0),typeof t=="object"?(i=t,r=s):typeof t=="string"&&(s!=null?i[t]=s:r=t),r=r||te.sources.API,[n,e,i,r]}function Du(n,e,t,s){const r=typeof t=="number"?t:0;if(n==null)return null;let i,o;return e&&typeof e.transformPosition=="function"?[i,o]=[n.index,n.index+n.length].map(a=>e.transformPosition(a,s!==te.sources.USER)):[i,o]=[n.index,n.index+n.length].map(a=>a<e||a===e&&s===te.sources.USER?a:r>=0?a+r:Math.max(e,a+r)),new wn(i,o-i)}class An extends Ei{}function Mu(n){return n instanceof qe||n instanceof Qe}function Fu(n){return typeof n.updateContent=="function"}class Zn extends il{constructor(e,t,s){let{emitter:r}=s;super(e,t),this.emitter=r,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",i=>this.handleDragStart(i))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(te.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(te.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(te.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[s,r]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&s!==i&&r>0){if(s instanceof Qe||i instanceof Qe){this.optimize();return}const o=i.children.head instanceof ct?null:i.children.head;s.moveChildren(i,o),s.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,s,r){super.formatAt(e,t,s,r),this.optimize()}insertAt(e,t,s){if(e>=this.length())if(s==null||this.scroll.query(t,se.BLOCK)==null){const r=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(r),s==null&&t.endsWith(`
`)?r.insertAt(0,t.slice(0,-1),s):r.insertAt(0,t,s)}else{const r=this.scroll.create(t,s);this.appendChild(r)}else super.insertAt(e,t,s);this.optimize()}insertBefore(e,t){if(e.statics.scope===se.INLINE_BLOT){const s=this.scroll.create(this.statics.defaultChild.blotName);s.appendChild(e),super.insertBefore(s,t)}else super.insertBefore(e,t)}insertContents(e,t){const s=this.deltaToRenderBlocks(t.concat(new ne().insert(`
`))),r=s.pop();if(r==null)return;this.batchStart();const i=s.shift();if(i){const l=i.type==="block"&&(i.delta.length()===0||!this.descendant(Qe,e)[0]&&e<this.length()),c=i.type==="block"?i.delta:new ne().insert({[i.key]:i.value});Bo(this,e,c);const f=i.type==="block"?1:0,v=e+c.length()+f;l&&this.insertAt(v-1,`
`);const h=Xe(this.line(e)[0]),d=Je.AttributeMap.diff(h,i.attributes)||{};Object.keys(d).forEach(m=>{this.formatAt(v-1,1,m,d[m])}),e=v}let[o,a]=this.children.find(e);if(s.length&&(o&&(o=o.split(a),a=0),s.forEach(l=>{if(l.type==="block"){const c=this.createBlock(l.attributes,o||void 0);Bo(c,0,l.delta)}else{const c=this.create(l.key,l.value);this.insertBefore(c,o||void 0),Object.keys(l.attributes).forEach(f=>{c.format(f,l.attributes[f])})}})),r.type==="block"&&r.delta.length()){const l=o?o.offset(o.scroll)+a:this.length();Bo(this,l,r.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[s,r]=t;return s instanceof Fe?[s,r]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Mu,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const s=(r,i,o)=>{let a=[],l=o;return r.children.forEachAt(i,o,(c,f,v)=>{Mu(c)?a.push(c):c instanceof Ei&&(a=a.concat(s(c,f,l))),l-=v}),a};return s(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(te.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=te.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(s=>{let{target:r}=s;const i=this.find(r,!0);return i&&!Fu(i)}),e.length>0&&this.emitter.emit(te.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(te.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,s){const[r]=this.descendant(i=>i instanceof Qe,e);r&&r.statics.blotName===t&&Fu(r)&&r.updateContent(s)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let s=new ne;return e.forEach(r=>{const i=r==null?void 0:r.insert;if(i)if(typeof i=="string"){const o=i.split(`
`);o.slice(0,-1).forEach(l=>{s.insert(l,r.attributes),t.push({type:"block",delta:s,attributes:r.attributes??{}}),s=new ne});const a=o[o.length-1];a&&s.insert(a,r.attributes)}else{const o=Object.keys(i)[0];if(!o)return;this.query(o,se.INLINE)?s.push(r):(s.length()&&t.push({type:"block",delta:s,attributes:{}}),s=new ne,t.push({type:"blockEmbed",key:o,value:i[o],attributes:r.attributes??{}}))}}),s.length()&&t.push({type:"block",delta:s,attributes:{}}),t}createBlock(e,t){let s;const r={};Object.entries(e).forEach(a=>{let[l,c]=a;this.query(l,se.BLOCK&se.BLOT)!=null?s=l:r[l]=c});const i=this.create(s||this.statics.defaultChild.blotName,s?e[s]:void 0);this.insertBefore(i,t||void 0);const o=i.length();return Object.entries(r).forEach(a=>{let[l,c]=a;i.formatAt(0,o,l,c)}),i}}ee(Zn,"blotName","scroll"),ee(Zn,"className","ql-editor"),ee(Zn,"tagName","DIV"),ee(Zn,"defaultChild",qe),ee(Zn,"allowedChildren",[qe,Qe,An]);function Bo(n,e,t){t.reduce((s,r)=>{const i=Je.Op.length(r);let o=r.attributes||{};if(r.insert!=null){if(typeof r.insert=="string"){const a=r.insert;n.insertAt(s,a);const[l]=n.descendant(Fe,s),c=Xe(l);o=Je.AttributeMap.diff(c,o)||{}}else if(typeof r.insert=="object"){const a=Object.keys(r.insert)[0];if(a==null)return s;if(n.insertAt(s,a,r.insert[a]),n.scroll.query(a,se.INLINE)!=null){const[l]=n.descendant(Fe,s),c=Xe(l);o=Je.AttributeMap.diff(c,o)||{}}}}return Object.keys(o).forEach(a=>{n.formatAt(s,i,a,o[a])}),s+i},e)}const al={scope:se.BLOCK,whitelist:["right","center","justify"]},Cb=new xt("align","align",al),ef=new ut("align","ql-align",al),tf=new Qt("align","text-align",al);class nf extends Qt{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):t}}const Nb=new ut("color","ql-color",{scope:se.INLINE}),ll=new nf("color","color",{scope:se.INLINE}),Ob=new ut("background","ql-bg",{scope:se.INLINE}),ul=new nf("background","background-color",{scope:se.INLINE});class Cn extends An{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(s=>s.length()<=1?"":s.domNode.innerText).join(`
`).slice(e,e+t)}html(e,t){return`<pre>
${_i(this.code(e,t))}
</pre>`}}class Pe extends qe{static register(){q.register(Cn)}}ee(Pe,"TAB"," ");class cl extends en{}cl.blotName="code";cl.tagName="CODE";Pe.blotName="code-block";Pe.className="ql-code-block";Pe.tagName="DIV";Cn.blotName="code-block-container";Cn.className="ql-code-block-container";Cn.tagName="DIV";Cn.allowedChildren=[Pe];Pe.allowedChildren=[lt,ct,Si];Pe.requiredContainer=Cn;const hl={scope:se.BLOCK,whitelist:["rtl"]},sf=new xt("direction","dir",hl),rf=new ut("direction","ql-direction",hl),of=new Qt("direction","direction",hl),af={scope:se.INLINE,whitelist:["serif","monospace"]},lf=new ut("font","ql-font",af);class Tb extends Qt{value(e){return super.value(e).replace(/["']/g,"")}}const uf=new Tb("font","font-family",af),cf=new ut("size","ql-size",{scope:se.INLINE,whitelist:["small","large","huge"]}),hf=new Qt("size","font-size",{scope:se.INLINE,whitelist:["10px","18px","32px"]}),Rb=Ft("quill:keyboard"),Ib=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Ci extends ht{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(s=>!!t[s]!==e[s]&&t[s]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(s=>{this.options.bindings[s]&&this.addBinding(this.options.bindings[s])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=qb(e);if(r==null){Rb.warn("Attempted to add invalid keyboard binding",r);return}typeof t=="function"&&(t={handler:t}),typeof s=="function"&&(s={handler:s}),(Array.isArray(r.key)?r.key:[r.key]).forEach(i=>{const o={...r,key:i,...t,...s};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const t=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(m=>Ci.match(e,m));if(t.length===0)return;const s=q.find(e.target,!0);if(s&&s.scroll!==this.quill.scroll)return;const r=this.quill.getSelection();if(r==null||!this.quill.hasFocus())return;const[i,o]=this.quill.getLine(r.index),[a,l]=this.quill.getLeaf(r.index),[c,f]=r.length===0?[a,l]:this.quill.getLeaf(r.index+r.length),v=a instanceof ei?a.value().slice(0,l):"",h=c instanceof ei?c.value().slice(f):"",d={collapsed:r.length===0,empty:r.length===0&&i.length()<=1,format:this.quill.getFormat(r),line:i,offset:o,prefix:v,suffix:h,event:e};t.some(m=>{if(m.collapsed!=null&&m.collapsed!==d.collapsed||m.empty!=null&&m.empty!==d.empty||m.offset!=null&&m.offset!==d.offset)return!1;if(Array.isArray(m.format)){if(m.format.every(g=>d.format[g]==null))return!1}else if(typeof m.format=="object"&&!Object.keys(m.format).every(g=>m.format[g]===!0?d.format[g]!=null:m.format[g]===!1?d.format[g]==null:$t(m.format[g],d.format[g])))return!1;return m.prefix!=null&&!m.prefix.test(d.prefix)||m.suffix!=null&&!m.suffix.test(d.suffix)?!1:m.handler.call(this,r,d,m)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const s=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let r={};const[i]=this.quill.getLine(e.index);let o=new ne().retain(e.index-s).delete(s);if(t.offset===0){const[a]=this.quill.getLine(e.index-1);if(a&&!(a.statics.blotName==="block"&&a.length()<=1)){const l=i.formats(),c=this.quill.getFormat(e.index-1,1);if(r=Je.AttributeMap.diff(l,c)||{},Object.keys(r).length>0){const f=new ne().retain(e.index+i.length()-2).retain(1,r);o=o.compose(f)}}}this.quill.updateContents(o,q.sources.USER),this.quill.focus()}handleDelete(e,t){const s=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-s)return;let r={};const[i]=this.quill.getLine(e.index);let o=new ne().retain(e.index).delete(s);if(t.offset>=i.length()-1){const[a]=this.quill.getLine(e.index+1);if(a){const l=i.formats(),c=this.quill.getFormat(e.index,1);r=Je.AttributeMap.diff(l,c)||{},Object.keys(r).length>0&&(o=o.retain(a.length()-1).retain(1,r))}}this.quill.updateContents(o,q.sources.USER),this.quill.focus()}handleDeleteRange(e){dl({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const s=Object.keys(t.format).reduce((i,o)=>(this.quill.scroll.query(o,se.BLOCK)&&!Array.isArray(t.format[o])&&(i[o]=t.format[o]),i),{}),r=new ne().retain(e.index).delete(e.length).insert(`
`,s);this.quill.updateContents(r,q.sources.USER),this.quill.setSelection(e.index+1,q.sources.SILENT),this.quill.focus()}}const Lb={bindings:{bold:Vo("bold"),italic:Vo("italic"),underline:Vo("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",q.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",q.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",q.sources.USER):e.format.list!=null&&this.quill.format("list",!1,q.sources.USER)}},"indent code-block":Pu(!0),"outdent code-block":Pu(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,q.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new ne().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(t,q.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,q.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,q.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,q.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),s={...e.formats(),list:"checked"},r=new ne().retain(n.index).insert(`
`,s).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(r,q.sources.USER),this.quill.setSelection(n.index+1,q.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,s]=this.quill.getLine(n.index),r=new ne().retain(n.index).insert(`
`,e.format).retain(t.length()-s-1).retain(1,{header:null});this.quill.updateContents(r,q.sources.USER),this.quill.setSelection(n.index+1,q.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,s,r,i]=e.getTable(n),o=jb(t,s,r,i);if(o==null)return;let a=t.offset();if(o<0){const l=new ne().retain(a).insert(`
`);this.quill.updateContents(l,q.sources.USER),this.quill.setSelection(n.index+1,n.length,q.sources.SILENT)}else if(o>0){a+=t.length();const l=new ne().retain(a).insert(`
`);this.quill.updateContents(l,q.sources.USER),this.quill.setSelection(a,q.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:s}=e,r=s.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(r-1,q.sources.USER):this.quill.setSelection(r+s.length(),q.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[s,r]=this.quill.getLine(n.index);if(r>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(n.index," ",q.sources.USER),this.quill.history.cutoff();const o=new ne().retain(n.index-r).delete(t+1).retain(s.length()-2-r).retain(1,{list:i});return this.quill.updateContents(o,q.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,q.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let s=2,r=e;for(;r!=null&&r.length()<=1&&r.formats()["code-block"];)if(r=r.prev,s-=1,s<=0){const i=new ne().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,q.sources.USER),this.quill.setSelection(n.index-1,q.sources.SILENT),!1}return!0}},"embed left":Cr("ArrowLeft",!1),"embed left shift":Cr("ArrowLeft",!0),"embed right":Cr("ArrowRight",!1),"embed right shift":Cr("ArrowRight",!0),"table down":Bu(!1),"table up":Bu(!0)}};Ci.DEFAULTS=Lb;function Pu(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:s}=t;const r=this.quill.scroll.query("code-block"),{TAB:i}=r;if(e.length===0&&!s.shiftKey){this.quill.insertText(e.index,i,q.sources.USER),this.quill.setSelection(e.index+i.length,q.sources.SILENT);return}const o=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:a,length:l}=e;o.forEach((c,f)=>{n?(c.insertAt(0,i),f===0?a+=i.length:l+=i.length):c.domNode.textContent.startsWith(i)&&(c.deleteAt(0,i.length),f===0?a-=i.length:l-=i.length)}),this.quill.update(q.sources.USER),this.quill.setSelection(a,l,q.sources.SILENT)}}}function Cr(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(t){let{index:s}=t;n==="ArrowRight"&&(s+=t.length+1);const[r]=this.quill.getLeaf(s);return r instanceof Ge?(n==="ArrowLeft"?e?this.quill.setSelection(t.index-1,t.length+1,q.sources.USER):this.quill.setSelection(t.index-1,q.sources.USER):e?this.quill.setSelection(t.index,t.length+1,q.sources.USER):this.quill.setSelection(t.index+t.length+1,q.sources.USER),!1):!0}}}function Vo(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],q.sources.USER)}}}function Bu(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const s=n?"prev":"next",r=t.line,i=r.parent[s];if(i!=null){if(i.statics.blotName==="table-row"){let o=i.children.head,a=r;for(;a.prev!=null;)a=a.prev,o=o.next;const l=o.offset(this.quill.scroll)+Math.min(t.offset,o.length()-1);this.quill.setSelection(l,0,q.sources.USER)}}else{const o=r.table()[s];o!=null&&(n?this.quill.setSelection(o.offset(this.quill.scroll)+o.length()-1,0,q.sources.USER):this.quill.setSelection(o.offset(this.quill.scroll),0,q.sources.USER))}return!1}}}function qb(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=Xn(n);else return null;return n.shortKey&&(n[Ib]=n.shortKey,delete n.shortKey),n}function dl(n){let{quill:e,range:t}=n;const s=e.getLines(t);let r={};if(s.length>1){const i=s[0].formats(),o=s[s.length-1].formats();r=Je.AttributeMap.diff(o,i)||{}}e.deleteText(t,q.sources.USER),Object.keys(r).length>0&&e.formatLine(t.index,1,r,q.sources.USER),e.setSelection(t.index,q.sources.SILENT)}function jb(n,e,t,s){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?s===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Db=/font-weight:\s*normal/,Mb=["P","OL","UL"],Vu=n=>n&&Mb.includes(n.tagName),Fb=n=>{Array.from(n.querySelectorAll("br")).filter(e=>Vu(e.previousElementSibling)&&Vu(e.nextElementSibling)).forEach(e=>{var t;(t=e.parentNode)==null||t.removeChild(e)})},Pb=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var t;return(t=e.getAttribute("style"))==null?void 0:t.match(Db)}).forEach(e=>{var t;const s=n.createDocumentFragment();s.append(...e.childNodes),(t=e.parentNode)==null||t.replaceChild(s,e)})};function Bb(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Pb(n),Fb(n))}const Vb=/\bmso-list:[^;]*ignore/i,Ub=/\bmso-list:[^;]*\bl(\d+)/i,$b=/\bmso-list:[^;]*\blevel(\d+)/i,zb=(n,e)=>{const t=n.getAttribute("style"),s=t==null?void 0:t.match(Ub);if(!s)return null;const r=Number(s[1]),i=t==null?void 0:t.match($b),o=i?Number(i[1]):1,a=new RegExp(`@list l${r}:level${o}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=e.match(a),c=l&&l[1]==="bullet"?"bullet":"ordered";return{id:r,indent:o,type:c,element:n}},Hb=n=>{var e,t;const s=Array.from(n.querySelectorAll("[style*=mso-list]")),r=[],i=[];s.forEach(l=>{(l.getAttribute("style")||"").match(Vb)?r.push(l):i.push(l)}),r.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)});const o=n.documentElement.innerHTML,a=i.map(l=>zb(l,o)).filter(l=>l);for(;a.length;){const l=[];let c=a.shift();for(;c;)l.push(c),c=a.length&&((e=a[0])==null?void 0:e.element)===c.element.nextElementSibling&&a[0].id===c.id?a.shift():null;const f=document.createElement("ul");l.forEach(d=>{const m=document.createElement("li");m.setAttribute("data-list",d.type),d.indent>1&&m.setAttribute("class",`ql-indent-${d.indent-1}`),m.innerHTML=d.element.innerHTML,f.appendChild(m)});const v=(t=l[0])==null?void 0:t.element,{parentNode:h}=v??{};v&&(h==null||h.replaceChild(f,v)),l.slice(1).forEach(d=>{let{element:m}=d;h==null||h.removeChild(m)})}};function Kb(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Hb(n)}const Wb=[Kb,Bb],Gb=n=>{n.documentElement&&Wb.forEach(e=>{e(n)})},Zb=Ft("quill:clipboard"),Xb=[[Node.TEXT_NODE,lx],[Node.TEXT_NODE,$u],["br",tx],[Node.ELEMENT_NODE,$u],[Node.ELEMENT_NODE,ex],[Node.ELEMENT_NODE,Qb],[Node.ELEMENT_NODE,ox],["li",rx],["ol, ul",ix],["pre",nx],["tr",ax],["b",Uo("bold")],["i",Uo("italic")],["strike",Uo("strike")],["style",sx]],Yb=[Cb,sf].reduce((n,e)=>(n[e.keyName]=e,n),{}),Uu=[tf,ul,ll,of,uf,hf].reduce((n,e)=>(n[e.keyName]=e,n),{});class df extends ht{constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",s=>this.onCaptureCopy(s,!1)),this.quill.root.addEventListener("cut",s=>this.onCaptureCopy(s,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],Xb.concat(this.options.matchers??[]).forEach(s=>{let[r,i]=s;this.addMatcher(r,i)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:s}=e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r[Pe.blotName])return new ne().insert(s||"",{[Pe.blotName]:r[Pe.blotName]});if(!t)return new ne().insert(s||"",r);const i=this.convertHTML(t);return Gs(i,`
`)&&(i.ops[i.ops.length-1].attributes==null||r.table)?i.compose(new ne().retain(i.length()-1).delete(1)):i}normalizeHTML(e){Gb(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const s=t.body,r=new WeakMap,[i,o]=this.prepareMatching(s,r);return fl(this.quill.scroll,s,i,o,r)}dangerouslyPasteHTML(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:q.sources.API;if(typeof e=="string"){const r=this.convert({html:e,text:""});this.quill.setContents(r,t),this.quill.setSelection(0,q.sources.SILENT)}else{const r=this.convert({html:t,text:""});this.quill.updateContents(new ne().retain(e).concat(r),s),this.quill.setSelection(e+r.length(),q.sources.SILENT)}}onCaptureCopy(e){var t,s;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[i]=this.quill.selection.getRange();if(i==null)return;const{html:o,text:a}=this.onCopy(i,r);(t=e.clipboardData)==null||t.setData("text/plain",a),(s=e.clipboardData)==null||s.setData("text/html",o),r&&dl({range:i,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
`)}onCapturePaste(e){var t,s,r,i,o;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const a=this.quill.getSelection(!0);if(a==null)return;const l=(t=e.clipboardData)==null?void 0:t.getData("text/html");let c=(s=e.clipboardData)==null?void 0:s.getData("text/plain");if(!l&&!c){const v=(r=e.clipboardData)==null?void 0:r.getData("text/uri-list");v&&(c=this.normalizeURIList(v))}const f=Array.from(((i=e.clipboardData)==null?void 0:i.files)||[]);if(!l&&f.length>0){this.quill.uploader.upload(a,f);return}if(l&&f.length>0){const v=new DOMParser().parseFromString(l,"text/html");if(v.body.childElementCount===1&&((o=v.body.firstElementChild)==null?void 0:o.tagName)==="IMG"){this.quill.uploader.upload(a,f);return}}this.onPaste(a,{html:l,text:c})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:s,html:r}=t;const i=this.quill.getFormat(e.index),o=this.convert({text:s,html:r},i);Zb.log("onPaste",o,{text:s,html:r});const a=new ne().retain(e.index).delete(e.length).concat(o);this.quill.updateContents(a,q.sources.USER),this.quill.setSelection(a.length()-e.length,q.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const s=[],r=[];return this.matchers.forEach(i=>{const[o,a]=i;switch(o){case Node.TEXT_NODE:r.push(a);break;case Node.ELEMENT_NODE:s.push(a);break;default:Array.from(e.querySelectorAll(o)).forEach(l=>{if(t.has(l)){const c=t.get(l);c==null||c.push(a)}else t.set(l,[a])});break}}),[s,r]}}ee(df,"DEFAULTS",{matchers:[]});function Nn(n,e,t,s){return s.query(e)?n.reduce((r,i)=>{if(!i.insert)return r;if(i.attributes&&i.attributes[e])return r.push(i);const o=t?{[e]:t}:{};return r.insert(i.insert,{...o,...i.attributes})},new ne):n}function Gs(n,e){let t="";for(let s=n.ops.length-1;s>=0&&t.length<e.length;--s){const r=n.ops[s];if(typeof r.insert!="string")break;t=r.insert+t}return t.slice(-1*e.length)===e}function zt(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof Ge?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function Jb(n,e){return n.previousElementSibling&&n.nextElementSibling&&!zt(n.previousElementSibling,e)&&!zt(n.nextElementSibling,e)}const Nr=new WeakMap;function ff(n){return n==null?!1:(Nr.has(n)||(n.tagName==="PRE"?Nr.set(n,!0):Nr.set(n,ff(n.parentNode))),Nr.get(n))}function fl(n,e,t,s,r){return e.nodeType===e.TEXT_NODE?s.reduce((i,o)=>o(e,i,n),new ne):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((i,o)=>{let a=fl(n,o,t,s,r);return o.nodeType===e.ELEMENT_NODE&&(a=t.reduce((l,c)=>c(o,l,n),a),a=(r.get(o)||[]).reduce((l,c)=>c(o,l,n),a)),i.concat(a)},new ne):new ne}function Uo(n){return(e,t,s)=>Nn(t,n,!0,s)}function Qb(n,e,t){const s=xt.keys(n),r=ut.keys(n),i=Qt.keys(n),o={};return s.concat(r).concat(i).forEach(a=>{let l=t.query(a,se.ATTRIBUTE);l!=null&&(o[l.attrName]=l.value(n),o[l.attrName])||(l=Yb[a],l!=null&&(l.attrName===a||l.keyName===a)&&(o[l.attrName]=l.value(n)||void 0),l=Uu[a],l!=null&&(l.attrName===a||l.keyName===a)&&(l=Uu[a],o[l.attrName]=l.value(n)||void 0))}),Object.entries(o).reduce((a,l)=>{let[c,f]=l;return Nn(a,c,f,t)},e)}function ex(n,e,t){const s=t.query(n);if(s==null)return e;if(s.prototype instanceof Ge){const r={},i=s.value(n);if(i!=null)return r[s.blotName]=i,new ne().insert(r,s.formats(n,t))}else if(s.prototype instanceof Vs&&!Gs(e,`
`)&&e.insert(`
`),"blotName"in s&&"formats"in s&&typeof s.formats=="function")return Nn(e,s.blotName,s.formats(n,t),t);return e}function tx(n,e){return Gs(e,`
`)||e.insert(`
`),e}function nx(n,e,t){const s=t.query("code-block"),r=s&&"formats"in s&&typeof s.formats=="function"?s.formats(n,t):!0;return Nn(e,"code-block",r,t)}function sx(){return new ne}function rx(n,e,t){const s=t.query(n);if(s==null||s.blotName!=="list"||!Gs(e,`
`))return e;let r=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(r+=1),i=i.parentNode;return r<=0?e:e.reduce((o,a)=>a.insert?a.attributes&&typeof a.attributes.indent=="number"?o.push(a):o.insert(a.insert,{indent:r,...a.attributes||{}}):o,new ne)}function ix(n,e,t){const s=n;let r=s.tagName==="OL"?"ordered":"bullet";const i=s.getAttribute("data-checked");return i&&(r=i==="true"?"checked":"unchecked"),Nn(e,"list",r,t)}function $u(n,e,t){if(!Gs(e,`
`)){if(zt(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`
`);if(e.length()>0&&n.nextSibling){let s=n.nextSibling;for(;s!=null;){if(zt(s,t))return e.insert(`
`);const r=t.query(s);if(r&&r.prototype instanceof Qe)return e.insert(`
`);s=s.firstChild}}}return e}function ox(n,e,t){var s;const r={},i=n.style||{};return i.fontStyle==="italic"&&(r.italic=!0),i.textDecoration==="underline"&&(r.underline=!0),i.textDecoration==="line-through"&&(r.strike=!0),((s=i.fontWeight)!=null&&s.startsWith("bold")||parseInt(i.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((o,a)=>{let[l,c]=a;return Nn(o,l,c,t)},e),parseFloat(i.textIndent||0)>0?new ne().insert(" ").concat(e):e}function ax(n,e,t){var s,r;const i=((s=n.parentElement)==null?void 0:s.tagName)==="TABLE"?n.parentElement:(r=n.parentElement)==null?void 0:r.parentElement;if(i!=null){const o=Array.from(i.querySelectorAll("tr")).indexOf(n)+1;return Nn(e,"table",o,t)}return e}function lx(n,e,t){var s;let r=n.data;if(((s=n.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(r.trim());if(!ff(n)){if(r.trim().length===0&&r.includes(`
`)&&!Jb(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&zt(n.parentElement,t)||n.previousSibling instanceof Element&&zt(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&zt(n.parentElement,t)||n.nextSibling instanceof Element&&zt(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class pf extends ht{constructor(e,t){super(e,t),ee(this,"lastRecorded",0),ee(this,"ignoreChange",!1),ee(this,"stack",{undo:[],redo:[]}),ee(this,"currentRange",null),this.quill.on(q.events.EDITOR_CHANGE,(s,r,i,o)=>{s===q.events.SELECTION_CHANGE?r&&o!==q.sources.SILENT&&(this.currentRange=r):s===q.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===q.sources.USER?this.record(r,i):this.transform(r)),this.currentRange=Sa(this.currentRange,r))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;const s=this.stack[e].pop();if(!s)return;const r=this.quill.getContents(),i=s.delta.invert(r);this.stack[t].push({delta:i,range:Sa(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,q.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let s=e.invert(t),r=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),r=o.range)}else this.lastRecorded=i;s.length()!==0&&(this.stack.undo.push({delta:s,range:r}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){zu(this.stack.undo,e),zu(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,q.sources.USER);else{const t=cx(this.quill.scroll,e.delta);this.quill.setSelection(t,q.sources.USER)}}}ee(pf,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function zu(n,e){let t=e;for(let s=n.length-1;s>=0;s-=1){const r=n[s];n[s]={delta:t.transform(r.delta,!0),range:r.range&&Sa(r.range,t)},t=r.delta.transform(t),n[s].delta.length()===0&&n.splice(s,1)}}function ux(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
`):t.attributes!=null?Object.keys(t.attributes).some(s=>n.query(s,se.BLOCK)!=null):!1}function cx(n,e){const t=e.reduce((r,i)=>r+(i.delete||0),0);let s=e.length()-t;return ux(n,e)&&(s-=1),s}function Sa(n,e){if(!n)return n;const t=e.transformPosition(n.index),s=e.transformPosition(n.index+n.length);return{index:t,length:s-t}}class mf extends ht{constructor(e,t){super(e,t),e.root.addEventListener("drop",s=>{var r;s.preventDefault();let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(s.clientX,s.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(s.clientX,s.clientY);i=document.createRange(),i.setStart(a.offsetNode,a.offset),i.setEnd(a.offsetNode,a.offset)}const o=i&&e.selection.normalizeNative(i);if(o){const a=e.selection.normalizedToRange(o);(r=s.dataTransfer)!=null&&r.files&&this.upload(a,s.dataTransfer.files)}})}upload(e,t){const s=[];Array.from(t).forEach(r=>{var i;r&&(i=this.options.mimetypes)!=null&&i.includes(r.type)&&s.push(r)}),s.length>0&&this.options.handler.call(this,e,s)}}mf.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(s=>new Promise(r=>{const i=new FileReader;i.onload=()=>{r(i.result)},i.readAsDataURL(s)}));Promise.all(t).then(s=>{const r=s.reduce((i,o)=>i.insert({image:o}),new ne().retain(n.index).delete(n.length));this.quill.updateContents(r,te.sources.USER),this.quill.setSelection(n.index+s.length,te.sources.SILENT)})}};const hx=["insertText","insertReplacementText"];class dx extends ht{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",s=>{this.handleBeforeInput(s)}),/Android/i.test(navigator.userAgent)||e.on(q.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){dl({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const s=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new ne().retain(e.index).insert(t,s),q.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,q.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!hx.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const s=fx(e);if(s==null)return;const r=this.quill.selection.normalizeNative(t),i=r?this.quill.selection.normalizedToRange(r):null;i&&this.replaceText(i,s)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function fx(n){var e;return typeof n.data=="string"?n.data:(e=n.dataTransfer)!=null&&e.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const px=/Mac/i.test(navigator.platform),mx=100,gx=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||px&&n.key==="a"&&n.ctrlKey===!0);class vx extends ht{constructor(e,t){super(e,t),ee(this,"isListening",!1),ee(this,"selectionChangeDeadline",0),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:s,event:r}=t;if(!(s instanceof at)||!s.uiNode)return!0;const i=getComputedStyle(s.domNode).direction==="rtl";return i&&r.key!=="ArrowRight"||!i&&r.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(r.shiftKey?1:0),q.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&gx(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+mx,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const s=this.quill.scroll.find(t.startContainer);if(!(s instanceof at)||!s.uiNode)return;const r=document.createRange();r.setStartAfter(s.uiNode),r.setEndAfter(s.uiNode),e.removeAllRanges(),e.addRange(r)}}q.register({"blots/block":qe,"blots/block/embed":Qe,"blots/break":ct,"blots/container":An,"blots/cursor":Si,"blots/embed":ol,"blots/inline":en,"blots/scroll":Zn,"blots/text":lt,"modules/clipboard":df,"modules/history":pf,"modules/keyboard":Ci,"modules/uploader":mf,"modules/input":dx,"modules/uiNode":vx});class yx extends ut{add(e,t){let s=0;if(t==="+1"||t==="-1"){const r=this.value(e)||0;s=t==="+1"?r+1:r-1}else typeof t=="number"&&(s=t);return s===0?(this.remove(e),!0):super.add(e,s.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const bx=new yx("indent","ql-indent",{scope:se.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Aa extends qe{}ee(Aa,"blotName","blockquote"),ee(Aa,"tagName","blockquote");class Ca extends qe{static formats(e){return this.tagName.indexOf(e.tagName)+1}}ee(Ca,"blotName","header"),ee(Ca,"tagName",["H1","H2","H3","H4","H5","H6"]);class Zs extends An{}Zs.blotName="list-container";Zs.tagName="OL";class Xs extends qe{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){q.register(Zs)}constructor(e,t){super(e,t);const s=t.ownerDocument.createElement("span"),r=i=>{if(!e.isEnabled())return;const o=this.statics.formats(t,e);o==="checked"?(this.format("list","unchecked"),i.preventDefault()):o==="unchecked"&&(this.format("list","checked"),i.preventDefault())};s.addEventListener("mousedown",r),s.addEventListener("touchstart",r),this.attachUI(s)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Xs.blotName="list";Xs.tagName="LI";Zs.allowedChildren=[Xs];Xs.requiredContainer=Zs;class $s extends en{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}ee($s,"blotName","bold"),ee($s,"tagName",["STRONG","B"]);class Na extends $s{}ee(Na,"blotName","italic"),ee(Na,"tagName",["EM","I"]);class Ht extends en{static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return gf(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}ee(Ht,"blotName","link"),ee(Ht,"tagName","A"),ee(Ht,"SANITIZED_URL","about:blank"),ee(Ht,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function gf(n,e){const t=document.createElement("a");t.href=n;const s=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(s)>-1}class Oa extends en{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}ee(Oa,"blotName","script"),ee(Oa,"tagName",["SUB","SUP"]);class Ta extends $s{}ee(Ta,"blotName","strike"),ee(Ta,"tagName",["S","STRIKE"]);class Ra extends en{}ee(Ra,"blotName","underline"),ee(Ra,"tagName","U");class zr extends ol{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}ee(zr,"blotName","formula"),ee(zr,"className","ql-formula"),ee(zr,"tagName","SPAN");const Hu=["alt","height","width"];class Ia extends Ge{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Hu.reduce((t,s)=>(e.hasAttribute(s)&&(t[s]=e.getAttribute(s)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return gf(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Hu.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}ee(Ia,"blotName","image"),ee(Ia,"tagName","IMG");const Ku=["height","width"];class Hr extends Qe{static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Ku.reduce((t,s)=>(e.hasAttribute(s)&&(t[s]=e.getAttribute(s)),t),{})}static sanitize(e){return Ht.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Ku.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}ee(Hr,"blotName","video"),ee(Hr,"className","ql-video"),ee(Hr,"tagName","IFRAME");const qs=new ut("code-token","hljs",{scope:se.INLINE});class Lt extends en{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(Pe.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,s){super(e,t,s),qs.add(this.domNode,s)}format(e,t){e!==Lt.blotName?super.format(e,t):t?qs.add(this.domNode,t):(qs.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),qs.value(this.domNode)||this.unwrap()}}Lt.blotName="code-token";Lt.className="ql-token";class Ye extends Pe{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Lt.blotName,!1),super.replaceWith(e,t)}}class Ms extends Cn{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Ye.blotName&&(this.forceNext=!0,this.children.forEach(s=>{s.format(e,t)}))}formatAt(e,t,s,r){s===Ye.blotName&&(this.forceNext=!0),super.formatAt(e,t,s,r)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(i=>i!==this.uiNode).map(i=>i.textContent).join(`
`)}
`,r=Ye.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const i=this.children.reduce((a,l)=>a.concat(Jd(l,!1)),new ne),o=e(s,r);i.diff(o).reduce((a,l)=>{let{retain:c,attributes:f}=l;return c?(f&&Object.keys(f).forEach(v=>{[Ye.blotName,Lt.blotName].includes(v)&&this.formatAt(a,c,v,f[v])}),a+c):a},0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[s]=this.children.find(e);return`<pre data-language="${s?Ye.formats(s.domNode):"plain"}">
${_i(this.code(e,t))}
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=Ye.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Ms.allowedChildren=[Ye];Ye.requiredContainer=Ms;Ye.allowedChildren=[Lt,Si,lt,ct];const xx=(n,e,t)=>{if(typeof n.versionString=="string"){const s=n.versionString.split(".")[0];if(parseInt(s,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class vf extends ht{static register(){q.register(Lt,!0),q.register(Ye,!0),q.register(Ms,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((s,r)=>{let{key:i}=r;return s[i]=!0,s},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(q.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Ms))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(s=>{let{key:r,label:i}=s;const o=t.ownerDocument.createElement("option");o.textContent=i,o.setAttribute("value",r),t.appendChild(o)}),t.addEventListener("change",()=>{e.format(Ye.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=Ye.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(q.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(q.sources.USER);const s=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Ms):[e]).forEach(r=>{r.highlight(this.highlightBlot,t)}),this.quill.update(q.sources.SILENT),s!=null&&this.quill.setSelection(s,q.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return _i(e).split(`
`).reduce((r,i,o)=>(o!==0&&r.insert(`
`,{[Pe.blotName]:t}),r.insert(i)),new ne);const s=this.quill.root.ownerDocument.createElement("div");return s.classList.add(Pe.className),s.innerHTML=xx(this.options.hljs,t,e),fl(this.quill.scroll,s,[(r,i)=>{const o=qs.value(r);return o?i.compose(new ne().retain(i.length(),{[Lt.blotName]:o})):i}],[(r,i)=>r.data.split(`
`).reduce((o,a,l)=>(l!==0&&o.insert(`
`,{[Pe.blotName]:t}),o.insert(a)),i)],new WeakMap)}}vf.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const La=class yf extends qe{static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",pl()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===yf.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};ee(La,"blotName","table"),ee(La,"tagName","TD");let Ot=La;class qt extends An{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),s=this.next.children.head.formats(),r=this.next.children.tail.formats();return e.table===t.table&&e.table===s.table&&e.table===r.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const s=t.formats(),r=t.next.formats();if(s.table!==r.table){const i=this.splitAfter(t);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}ee(qt,"blotName","table-row"),ee(qt,"tagName","TR");class bt extends An{}ee(bt,"blotName","table-body"),ee(bt,"tagName","TBODY");class as extends An{balanceCells(){const e=this.descendants(qt),t=e.reduce((s,r)=>Math.max(r.children.length,s),0);e.forEach(s=>{new Array(t-s.children.length).fill(0).forEach(()=>{let r;s.children.head!=null&&(r=Ot.formats(s.children.head.domNode));const i=this.scroll.create(Ot.blotName,r);s.appendChild(i),i.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(bt);t==null||t.children.head==null||t.children.forEach(s=>{const r=s.children.at(e);r!=null&&r.remove()})}insertColumn(e){const[t]=this.descendant(bt);t==null||t.children.head==null||t.children.forEach(s=>{const r=s.children.at(e),i=Ot.formats(s.children.head.domNode),o=this.scroll.create(Ot.blotName,i);s.insertBefore(o,r)})}insertRow(e){const[t]=this.descendant(bt);if(t==null||t.children.head==null)return;const s=pl(),r=this.scroll.create(qt.blotName);t.children.head.children.forEach(()=>{const o=this.scroll.create(Ot.blotName,s);r.appendChild(o)});const i=t.children.at(e);t.insertBefore(r,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}ee(as,"blotName","table-container"),ee(as,"tagName","TABLE");as.allowedChildren=[bt];bt.requiredContainer=as;bt.allowedChildren=[qt];qt.requiredContainer=bt;qt.allowedChildren=[Ot];Ot.requiredContainer=qt;function pl(){return`row-${Math.random().toString(36).slice(2,6)}`}class kx extends ht{static register(){q.register(Ot),q.register(qt),q.register(bt),q.register(as)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(as).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(q.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(q.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(q.sources.USER),this.quill.setSelection(t,q.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,s]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==Ot.blotName)return[null,null,null,-1];const r=t.parent;return[r.parent.parent,r,t,s]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[s,r,i]=this.getTable(t);if(i==null)return;const o=i.cellOffset();s.insertColumn(o+e),this.quill.update(q.sources.USER);let a=r.rowOffset();e===0&&(a+=1),this.quill.setSelection(t.index+a,t.length,q.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[s,r,i]=this.getTable(t);if(i==null)return;const o=r.rowOffset();s.insertRow(o+e),this.quill.update(q.sources.USER),e>0?this.quill.setSelection(t,q.sources.SILENT):this.quill.setSelection(t.index+r.children.length,t.length,q.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const s=this.quill.getSelection();if(s==null)return;const r=new Array(e).fill(0).reduce(i=>{const o=new Array(t).fill(`
`).join("");return i.insert(o,{table:pl()})},new ne().retain(s.index));this.quill.updateContents(r,q.sources.USER),this.quill.setSelection(s.index,q.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(q.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(q.events.TEXT_CHANGE,(s,r,i)=>{i===q.sources.USER&&this.balanceTables()}),!0):!1)})}}const Wu=Ft("quill:toolbar");class ml extends ht{constructor(e,t){var s,r;if(super(e,t),Array.isArray(this.options.container)){const i=document.createElement("div");i.setAttribute("role","toolbar"),wx(i,this.options.container),(r=(s=e.container)==null?void 0:s.parentNode)==null||r.insertBefore(i,e.container),this.container=i}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Wu.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(i=>{var o;const a=(o=this.options.handlers)==null?void 0:o[i];a&&this.addHandler(i,a)}),Array.from(this.container.querySelectorAll("button, select")).forEach(i=>{this.attach(i)}),this.quill.on(q.events.EDITOR_CHANGE,()=>{const[i]=this.quill.selection.getRange();this.update(i)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(r=>r.indexOf("ql-")===0);if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Wu.warn("ignoring attaching to nonexistent format",t,e);return}const s=e.tagName==="SELECT"?"change":"click";e.addEventListener(s,r=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const a=e.options[e.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),r.preventDefault();this.quill.focus();const[o]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof Ge){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents(new ne().retain(o.index).delete(o.length).insert({[t]:i}),q.sources.USER)}else this.quill.format(t,i,q.sources.USER);this.update(o)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(s=>{const[r,i]=s;if(i.tagName==="SELECT"){let o=null;if(e==null)o=null;else if(t[r]==null)o=i.querySelector("option[selected]");else if(!Array.isArray(t[r])){let a=t[r];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),o=i.querySelector(`option[value="${a}"]`)}o==null?(i.value="",i.selectedIndex=-1):o.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const o=t[r],a=o===i.getAttribute("value")||o!=null&&o.toString()===i.getAttribute("value")||o==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const o=t[r]!=null;i.classList.toggle("ql-active",o),i.setAttribute("aria-pressed",o.toString())}})}}ml.DEFAULTS={};function Gu(n,e,t){const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add(`ql-${e}`),s.setAttribute("aria-pressed","false"),t!=null?(s.value=t,s.setAttribute("aria-label",`${e}: ${t}`)):s.setAttribute("aria-label",e),n.appendChild(s)}function wx(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const s=document.createElement("span");s.classList.add("ql-formats"),t.forEach(r=>{if(typeof r=="string")Gu(s,r);else{const i=Object.keys(r)[0],o=r[i];Array.isArray(o)?Ex(s,i,o):Gu(s,i,o)}}),n.appendChild(s)})}function Ex(n,e,t){const s=document.createElement("select");s.classList.add(`ql-${e}`),t.forEach(r=>{const i=document.createElement("option");r!==!1?i.setAttribute("value",String(r)):i.setAttribute("selected","selected"),s.appendChild(i)}),n.appendChild(s)}ml.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(t=>{this.quill.scroll.query(t,se.INLINE)!=null&&this.quill.format(t,!1,q.sources.USER)})}else this.quill.removeFormat(n.index,n.length,q.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",q.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,q.sources.USER),this.quill.format("direction",n,q.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),s=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let r=n==="+1"?1:-1;t.direction==="rtl"&&(r*=-1),this.quill.format("indent",s+r,q.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,q.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,q.sources.USER):this.quill.format("list","unchecked",q.sources.USER):this.quill.format("list",n,q.sources.USER)}}};const _x='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Sx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Ax='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Cx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Nx='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Ox='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Tx='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Rx='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Zu='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Ix='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',Lx='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',qx='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',jx='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',Dx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',Mx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Fx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Px='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',Bx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',Vx='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',Ux='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',$x='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',zx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',Hx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',Kx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',Wx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',Gx='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',Zx='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',Xx='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',Yx='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',Jx='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',Qx='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',ek='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',tk='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',zs={align:{"":_x,center:Sx,right:Ax,justify:Cx},background:Nx,blockquote:Ox,bold:Tx,clean:Rx,code:Zu,"code-block":Zu,color:Ix,direction:{"":Lx,rtl:qx},formula:jx,header:{1:Dx,2:Mx,3:Fx,4:Px,5:Bx,6:Vx},italic:Ux,image:$x,indent:{"+1":zx,"-1":Hx},link:Kx,list:{bullet:Wx,check:Gx,ordered:Zx},script:{sub:Xx,super:Yx},strike:Jx,table:Qx,underline:ek,video:tk},nk='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let Xu=0;function Yu(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Ni{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Yu(this.label,"aria-expanded"),Yu(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const s=e.getAttribute("value");return s&&t.setAttribute("data-value",s),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",r=>{switch(r.key){case"Enter":this.selectItem(t,!0),r.preventDefault();break;case"Escape":this.escape(),r.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=nk,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Xu}`,Xu+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const s=this.buildItem(t);e.appendChild(s),t.selected===!0&&this.selectItem(s)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const s=this.container.querySelector(".ql-selected");e!==s&&(s!=null&&s.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const s=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(s)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class bf extends Ni{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(s=>{s.classList.add("ql-primary")})}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const s=this.label.querySelector(".ql-color-label"),r=e&&e.getAttribute("data-value")||"";s&&(s.tagName==="line"?s.style.stroke=r:s.style.fill=r)}}class xf extends Ni{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(s=>{s.innerHTML=t[s.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const s=e||this.defaultItem;if(s!=null){if(this.label.innerHTML===s.innerHTML)return;this.label.innerHTML=s.innerHTML}}}const sk=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class kf{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,sk(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,s=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${s}px`,this.root.classList.remove("ql-flip");const r=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let o=0;if(i.right>r.right&&(o=r.right-i.right,this.root.style.left=`${t+o}px`),i.left<r.left&&(o=r.left-i.left,this.root.style.left=`${t+o}px`),i.bottom>r.bottom){const a=i.bottom-i.top,l=e.bottom-e.top+a;this.root.style.top=`${s-l}px`,this.root.classList.add("ql-flip")}return o}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const rk=[!1,"center","right","justify"],ik=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],ok=[!1,"serif","monospace"],ak=["1","2","3",!1],lk=["small",!1,"large","huge"];class Ys extends Ai{constructor(e,t){super(e,t);const s=r=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",s);return}this.tooltip!=null&&!this.tooltip.root.contains(r.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(r.target)||i.close()})};e.emitter.listenDOM("click",document.body,s)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(s=>{(s.getAttribute("class")||"").split(/\s+/).forEach(r=>{if(r.startsWith("ql-")&&(r=r.slice(3),t[r]!=null))if(r==="direction")s.innerHTML=t[r][""]+t[r].rtl;else if(typeof t[r]=="string")s.innerHTML=t[r];else{const i=s.value||"";i!=null&&t[r][i]&&(s.innerHTML=t[r][i])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(r=>{if(r.classList.contains("ql-align")&&(r.querySelector("option")==null&&Ns(r,rk),typeof t.align=="object"))return new xf(r,t.align);if(r.classList.contains("ql-background")||r.classList.contains("ql-color")){const i=r.classList.contains("ql-background")?"background":"color";return r.querySelector("option")==null&&Ns(r,ik,i==="background"?"#ffffff":"#000000"),new bf(r,t[i])}return r.querySelector("option")==null&&(r.classList.contains("ql-font")?Ns(r,ok):r.classList.contains("ql-header")?Ns(r,ak):r.classList.contains("ql-size")&&Ns(r,lk)),new Ni(r)});const s=()=>{this.pickers.forEach(r=>{r.update()})};this.quill.on(te.events.EDITOR_CHANGE,s)}}Ys.DEFAULTS=Wt({},Ai.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""}),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class wf extends kf{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const s=this.quill.getBounds(this.quill.selection.savedRange);s!=null&&this.position(s),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,te.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,te.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=uk(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const s=t.index+t.length;this.quill.insertEmbed(s,this.root.getAttribute("data-mode"),e,te.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(s+1," ",te.sources.USER),this.quill.setSelection(s+2,te.sources.USER)}break}}this.textbox.value="",this.hide()}}function uk(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Ns(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(s=>{const r=document.createElement("option");s===t?r.setAttribute("selected","selected"):r.setAttribute("value",String(s)),n.appendChild(r)})}const ck=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Ef extends wf{constructor(e,t){super(e,t),this.quill.on(te.events.EDITOR_CHANGE,(s,r,i,o)=>{if(s===te.events.SELECTION_CHANGE)if(r!=null&&r.length>0&&o===te.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(r.index,r.length);if(a.length===1){const l=this.quill.getBounds(r);l!=null&&this.position(l)}else{const l=a[a.length-1],c=this.quill.getIndex(l),f=Math.min(l.length()-1,r.index+r.length-c),v=this.quill.getBounds(new wn(c,f));v!=null&&this.position(v)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(te.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}},1)})}cancel(){this.show()}position(e){const t=super.position(e),s=this.root.querySelector(".ql-tooltip-arrow");return s.style.marginLeft="",t!==0&&(s.style.marginLeft=`${-1*t-s.offsetWidth/2}px`),t}}ee(Ef,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class _f extends Ys{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=ck),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Ef(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),zs),this.buildPickers(e.container.querySelectorAll("select"),zs))}}_f.DEFAULTS=Wt({},Ys.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,q.sources.USER)}}}}});const hk=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Sf extends wf{constructor(){super(...arguments),ee(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",e=>{if(this.linkRange!=null){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,te.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(te.events.SELECTION_CHANGE,(e,t,s)=>{if(e!=null){if(e.length===0&&s===te.sources.USER){const[r,i]=this.quill.scroll.descendant(Ht,e.index);if(r!=null){this.linkRange=new wn(e.index-i,r.length());const o=Ht.formats(r.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const a=this.quill.getBounds(this.linkRange);a!=null&&this.position(a);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}ee(Sf,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class Af extends Ys{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=hk),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),zs),this.buildPickers(e.container.querySelectorAll("select"),zs),this.tooltip=new Sf(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,s)=>{e.handlers.link.call(e,!s.format.link)}))}}Af.DEFAULTS=Wt({},Ys.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:s}=this.quill.theme;s.edit("link",t)}else this.quill.format("link",!1,q.sources.USER)}}}}});q.register({"attributors/attribute/direction":sf,"attributors/class/align":ef,"attributors/class/background":Ob,"attributors/class/color":Nb,"attributors/class/direction":rf,"attributors/class/font":lf,"attributors/class/size":cf,"attributors/style/align":tf,"attributors/style/background":ul,"attributors/style/color":ll,"attributors/style/direction":of,"attributors/style/font":uf,"attributors/style/size":hf},!0);q.register({"formats/align":ef,"formats/direction":rf,"formats/indent":bx,"formats/background":ul,"formats/color":ll,"formats/font":lf,"formats/size":cf,"formats/blockquote":Aa,"formats/code-block":Pe,"formats/header":Ca,"formats/list":Xs,"formats/bold":$s,"formats/code":cl,"formats/italic":Na,"formats/link":Ht,"formats/script":Oa,"formats/strike":Ta,"formats/underline":Ra,"formats/formula":zr,"formats/image":Ia,"formats/video":Hr,"modules/syntax":vf,"modules/table":kx,"modules/toolbar":ml,"themes/bubble":_f,"themes/snow":Af,"ui/icons":zs,"ui/picker":Ni,"ui/icon-picker":xf,"ui/color-picker":bf,"ui/tooltip":kf},!0);class Oi extends Q.Component{constructor(e){super(e),this.editingAreaRef=Q.createRef(),this.containerRef=Q.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],this.state={generation:0},this.selection=null,this.onEditorChange=(s,r,i,o)=>{var a,l;s==="text-change"?(a=this.onEditorChangeText)==null||a.call(this,this.editor.root.innerHTML,r,o,this.unprivilegedEditor):s==="selection-change"&&((l=this.onEditorChangeSelection)==null||l.call(this,r,o,this.unprivilegedEditor))};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(Q.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(Q.Children.count(e.children)){const t=Q.Children.only(e.children);if((t==null?void 0:t.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&e.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(e,t){if(this.validateProps(e),!this.editor||this.state.generation!==t.generation)return!0;if("value"in e){const s=this.getEditorContents(),r=e.value??"";this.isEqualValue(r,s)||this.setEditorContents(this.editor,r)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(s=>!$t(e[s],this.props[s]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!$t(e[t],this.props[t]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(e,t){if(this.editor&&this.shouldComponentRegenerate(e)){const s=this.editor.getContents(),r=this.editor.getSelection();this.regenerationSnapshot={delta:s,selection:r},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){const{delta:s,selection:r}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const i=this.editor;i.setContents(s),Ju(()=>this.setEditorSelection(i,r))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){var e,t;if(!this.editor)return;this.unhookEditor(this.editor);const s=(e=this.props.modules)==null?void 0:e.toolbar;if(!(typeof s=="object"&&s&&"container"in s&&typeof s.container=="string"||typeof s=="string")){const r=(t=this.containerRef.current)==null?void 0:t.querySelector(".ql-toolbar");r&&r.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(e,t){const s=new q(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(s,t.tabIndex),this.hookEditor(s),s}hookEditor(e){this.unprivilegedEditor=this.makeUnprivilegedEditor(e),e.on("editor-change",this.onEditorChange)}unhookEditor(e){e.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(e){return e&&e.ops}isEqualValue(e,t){return this.isDelta(e)&&this.isDelta(t)?$t(e.ops,t.ops):$t(e,t)}setEditorContents(e,t){this.value=t;const s=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),Ju(()=>this.setEditorSelection(e,s))}setEditorSelection(e,t){if(this.selection=t,t){const s=e.getLength();t.index=Math.max(0,Math.min(t.index,s-1)),t.length=Math.max(0,Math.min(t.length,s-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){var s;(s=e==null?void 0:e.scroll)!=null&&s.domNode&&(e.scroll.domNode.tabIndex=t)}setEditorReadOnly(e,t){t?e.disable():e.enable()}makeUnprivilegedEditor(e){const t=e;return{getHTML:()=>t.root.innerHTML,getSemanticHTML:t.getSemanticHTML.bind(t),getLength:t.getLength.bind(t),getText:t.getText.bind(t),getContents:t.getContents.bind(t),getSelection:t.getSelection.bind(t),getBounds:t.getBounds.bind(t)}}getEditingArea(){const e=this.editingAreaRef.current;if(!e)throw new Error("Cannot find element for editing area");if(e.nodeType===3)throw new Error("Editing area cannot be a text node");return e}renderEditingArea(){const{children:e,preserveWhitespace:t}=this.props,{generation:s}=this.state,r={key:s,ref:this.editingAreaRef};return Q.Children.count(e)?Q.cloneElement(Q.Children.only(e),r):t?Q.createElement("pre",{...r}):Q.createElement("div",{...r})}render(){return Q.createElement("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,key:this.state.generation,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())}onEditorChangeText(e,t,s,r){var i,o;if(!this.editor)return;const a=this.isDelta(this.value)?r.getContents():r.getHTML();a!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=a,(o=(i=this.props).onChange)==null||o.call(i,e,t,s,r))}onEditorChangeSelection(e,t,s){var r,i,o,a,l,c;if(!this.editor)return;const f=this.getEditorSelection(),v=!f&&e,h=f&&!e;$t(e,f)||(this.selection=e,(i=(r=this.props).onChangeSelection)==null||i.call(r,e,t,s),v?(a=(o=this.props).onFocus)==null||a.call(o,e,t,s):h&&((c=(l=this.props).onBlur)==null||c.call(l,f,t,s)))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}Oi.displayName="React Quill";Oi.Quill=q;Oi.defaultProps={theme:"snow",modules:{},readOnly:!1};function Ju(n){Promise.resolve().then(n)}const dk=si.j("w-full rounded-lg border border-border-alpha-strong dark:bg-transparent file:border-0 placeholder:text-secondary placeholder:text-body-sm-regular focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-bg focus-within:ring-offset-2 focus-within:ring-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"focus-within:ring-item-primary",failure:"focus-within:ring-item-destructive bg-item-destructive-focus placeholder:text-item-destructive border-item-destructive text-destructive",success:"focus-within:ring-success bg-success/20 placeholder:text-success/80 border-success text-success"}},defaultVariants:{variant:"default"}}),fk=Ua.div`
.quill {
.ql {
&-toolbar {
border: none;
}
&-editor,
&-container {
min-height: 120px;
border: none;
}
}
`;function Cf({containerProps:n,className:e,variant:t,...s}){return b.ae.jsx(fk,{...n,className:Ae.mo(dk({variant:t}),"block h-auto p-0",e),children:b.ae.jsx(Oi,{theme:"snow",...s})})}Cf.displayName="HtmlEditor";function Gt(n){return typeof n=="string"||n instanceof String}function Qu(n){var e;return typeof n=="object"&&n!=null&&(n==null||(e=n.constructor)==null?void 0:e.name)==="Object"}function Nf(n,e){return Array.isArray(e)?Nf(n,(t,s)=>e.includes(s)):Object.entries(n).reduce((t,s)=>{let[r,i]=s;return e(i,r)&&(t[r]=i),t},{})}const ie={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function pk(n){switch(n){case ie.LEFT:return ie.FORCE_LEFT;case ie.RIGHT:return ie.FORCE_RIGHT;default:return n}}function $o(n){return n.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function ti(n,e){if(e===n)return!0;const t=Array.isArray(e),s=Array.isArray(n);let r;if(t&&s){if(e.length!=n.length)return!1;for(r=0;r<e.length;r++)if(!ti(e[r],n[r]))return!1;return!0}if(t!=s)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){const i=e instanceof Date,o=n instanceof Date;if(i&&o)return e.getTime()==n.getTime();if(i!=o)return!1;const a=e instanceof RegExp,l=n instanceof RegExp;if(a&&l)return e.toString()==n.toString();if(a!=l)return!1;const c=Object.keys(e);for(r=0;r<c.length;r++)if(!Object.prototype.hasOwnProperty.call(n,c[r]))return!1;for(r=0;r<c.length;r++)if(!ti(n[c[r]],e[c[r]]))return!1;return!0}else if(e&&n&&typeof e=="function"&&typeof n=="function")return e.toString()===n.toString();return!1}class mk{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?ie.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?ie.RIGHT:ie.LEFT}}function le(n,e){return new le.InputMask(n,e)}function Of(n){if(n==null)throw new Error("mask property should be defined");return n instanceof RegExp?le.MaskedRegExp:Gt(n)?le.MaskedPattern:n===Date?le.MaskedDate:n===Number?le.MaskedNumber:Array.isArray(n)||n===Array?le.MaskedDynamic:le.Masked&&n.prototype instanceof le.Masked?n:le.Masked&&n instanceof le.Masked?n.constructor:n instanceof Function?le.MaskedFunction:(console.warn("Mask not found for mask",n),le.Masked)}function Hs(n){if(!n)throw new Error("Options in not defined");if(le.Masked){if(n.prototype instanceof le.Masked)return{mask:n};const{mask:e=void 0,...t}=n instanceof le.Masked?{mask:n}:Qu(n)&&n.mask instanceof le.Masked?n:{};if(e){const s=e.mask;return{...Nf(e,(r,i)=>!i.startsWith("_")),mask:e.constructor,_mask:s,...t}}}return Qu(n)?{...n}:{mask:n}}function jt(n){if(le.Masked&&n instanceof le.Masked)return n;const e=Hs(n),t=Of(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}le.createMask=jt;class gl{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}le.MaskElement=gl;const ec=90,gk=89;class Ti extends gl{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return(e=(t=(s=this.input).getRootNode)==null?void 0:t.call(s))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===ec&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===gk&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===ec&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}le.HTMLMaskElement=Ti;class vk extends Ti{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}le.HTMLMaskElement=Ti;class Tf extends Ti{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,r=t&&t.focusOffset;return r==null||s==null||s<r?s:r}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,r=t&&t.focusOffset;return r==null||s==null||s>r?s:r}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);const r=this.rootElement,i=r.getSelection&&r.getSelection();i&&(i.removeAllRanges(),i.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}le.HTMLContenteditableMaskElement=Tf;class Ri{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Ri.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Ri.MAX_LENGTH=100;class yk{constructor(e,t){this.el=e instanceof gl?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Tf(e):new vk(e),this.masked=jt(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Ri,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof le.Masked)&&this.masked.constructor===Of(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof le.Masked?e:jt({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const s=this._listeners[e];s&&s.forEach(r=>r(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,s=this.masked.value,r=this.masked.rawInputValue,i=this.displayValue,o=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==r;this._unmaskedValue=t,this._value=s,this._rawInputValue=r,this.el.value!==i&&(this.el.value=i),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...s}=e,r=!this.maskEquals(t),i=this.masked.optionsIsChanged(s);r&&(this.mask=t),i&&this.masked.updateOptions(s),(r||i)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,ie.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new mk({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,r=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=s===this.masked.rawInputValue?t.removeDirection:ie.NONE;let o=this.masked.nearestInputPos(t.startChangePos+r,i);i!==ie.NONE&&(o=this.masked.nearestInputPos(o,ie.NONE)),this.updateControl(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}le.InputMask=yk;class fe{static normalize(e){return Array.isArray(e)?e:[e,new fe]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}le.ChangeDetails=fe;class vt{constructor(e,t,s){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class Be{constructor(e){this._value="",this._update({...Be.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new vt(this.extractInput(e,t),e)}appendTail(e){return Gt(e)&&(e=new vt(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new fe({inserted:e,rawInserted:e})):new fe}_appendChar(e,t,s){t===void 0&&(t={});const r=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=r;let a=this.pad(t);const l=this._appendCharRaw(e,t);a=a.aggregate(l),l.rawInserted||a.equals(i)?i=a:this.state=o}if(i.inserted){let o,a=this.doValidate(t)!==!1;if(a&&s!=null){const l=this.state;if(this.overwrite===!0){o=s.state;for(let f=0;f<i.rawInserted.length;++f)s.unshift(this.displayValue.length-i.tailShift)}let c=this.appendTail(s);if(a=c.rawInserted.length===s.toString().length,!(a&&c.inserted)&&this.overwrite==="shift"){this.state=l,o=s.state;for(let f=0;f<i.rawInserted.length;++f)s.shift();c=this.appendTail(s),a=c.rawInserted.length===s.toString().length}a&&c.inserted&&(this.state=l)}a||(i=new fe,this.state=r,s&&o&&(s.state=o))}return i}_appendPlaceholder(){return new fe}_appendEager(){return new fe}append(e,t,s){if(!Gt(e))throw new Error("value should be string");const r=Gt(s)?new vt(String(s)):s;t!=null&&t.tail&&(t._beforeTailState=this.state);let i;[e,i]=this.doPrepare(e,t);for(let o=0;o<e.length;++o){const a=this._appendChar(e[o],t,r);if(!a.rawInserted&&!this.doSkipInvalid(e[o],t,r))break;i.aggregate(a)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&i.aggregate(this._appendEager()),r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new fe}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,s=this.value,r=e();return this.rawInputValue=t,this.value&&this.value!==s&&s.indexOf(this.value)===0&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,r}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),fe.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),fe.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,r,i){s===void 0&&(s=""),r===void 0&&(r=ie.NONE),i===void 0&&(i={input:!0});const o=e+t,a=this.extractTail(o),l=this.eager===!0||this.eager==="remove";let c;l&&(r=pk(r),c=this.extractInput(0,o,{raw:!0}));let f=e;const v=new fe;if(r!==ie.NONE&&(f=this.nearestInputPos(e,t>1&&e!==0&&!l?ie.NONE:r),v.tailShift=f-e),v.aggregate(this.remove(f)),l&&r!==ie.NONE&&c===this.rawInputValue)if(r===ie.FORCE_LEFT){let h;for(;c===this.rawInputValue&&(h=this.displayValue.length);)v.aggregate(new fe({tailShift:-1})).aggregate(this.remove(h-1))}else r===ie.FORCE_RIGHT&&a.unshift();return v.aggregate(this.append(s,i,a))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!ti(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||Be.EMPTY_VALUES.includes(e)&&Be.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new fe}}Be.DEFAULTS={skipInvalid:!0};Be.EMPTY_VALUES=[void 0,null,""];le.Masked=Be;class fn{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Gt(e)?new vt(String(e)):e;const t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof vt)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof fn){if(e.stop==null){let r;for(;e.chunks.length&&e.chunks[0].stop==null;)r=e.chunks.shift(),r.from+=e.from,this.extend(r)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof le.MaskedPattern))return new vt(this.toString()).appendTo(e);const t=new fe;for(let s=0;s<this.chunks.length;++s){const r=this.chunks[s],i=e._mapPosToBlock(e.displayValue.length),o=r.stop;let a;if(o!=null&&(!i||i.index<=o)&&((r instanceof fn||e._stops.indexOf(o)>=0)&&t.aggregate(e._appendPlaceholder(o)),a=r instanceof fn&&e._blocks[o]),a){const l=a.appendTail(r);t.aggregate(l);const c=r.toString().slice(l.rawInserted.length);c&&t.aggregate(e.append(c,{tail:!0}))}else t.aggregate(e.append(r.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(r=>{const i="chunks"in r?new fn:new vt;return i.state=r,i})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let s=0;for(;s<this.chunks.length;){const r=this.chunks[s],i=r.unshift(t);if(r.toString()){if(!i)break;++s}else this.chunks.splice(s,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class bk{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:r}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ie.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ie.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ie.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,ie.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,ie.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,ie.NONE),!0})}}class Rf{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new fe}nearestInputPos(e,t){t===void 0&&(t=ie.NONE);const s=0,r=this._value.length;switch(t){case ie.LEFT:case ie.FORCE_LEFT:return s;case ie.NONE:case ie.RIGHT:case ie.FORCE_RIGHT:default:return r}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new fe;const s=this.eager===!0||this.eager==="append",r=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,i=new fe({inserted:this.char,rawInserted:r?this.char:""});return this._value=this.char,this._isRawInput=r&&(t.raw||t.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new fe;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new vt("")}appendTail(e){return Gt(e)&&(e=new vt(String(e))),e.appendTo(this)}append(e,t,s){const r=this._appendChar(e[0],t);return s!=null&&(r.tailShift+=this.appendTail(s).tailShift),r}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class ni{constructor(e){const{parent:t,isOptional:s,placeholderChar:r,displayChar:i,lazy:o,eager:a,...l}=e;this.masked=jt(l),Object.assign(this,{parent:t,isOptional:s,placeholderChar:r,displayChar:i,lazy:o,eager:a})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new fe}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new fe;const s=this.masked.state;let r=this.masked._appendChar(e,this.currentMaskFlags(t));return r.inserted&&this.doValidate(t)===!1&&(r=new fe,this.masked.state=s),!r.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(r.inserted=this.placeholderChar),r.skip=!r.inserted&&!this.isOptional,this.isFilled=!!r.inserted,r}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new fe:(this.isFilled=!0,new fe({inserted:this.placeholderChar}))}_appendEager(){return new fe}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){t===void 0&&(t=ie.NONE);const s=0,r=this.value.length,i=Math.min(Math.max(e,s),r);switch(t){case ie.LEFT:case ie.FORCE_LEFT:return this.isComplete?i:s;case ie.RIGHT:case ie.FORCE_RIGHT:return this.isComplete?i:r;case ie.NONE:default:return i}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||(e==null?void 0:e._beforeTailState)}}pad(e){return new fe}}ni.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class xk extends Be{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=s=>s.search(t)>=0),super._update(e)}}le.MaskedRegExp=xk;class Ve extends Be{constructor(e){super({...Ve.DEFAULTS,...e,definitions:Object.assign({},ni.DEFAULT_DEFINITIONS,e==null?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let s=!1,r=!1;for(let i=0;i<t.length;++i){if(this.blocks){const c=t.slice(i),f=Object.keys(this.blocks).filter(h=>c.indexOf(h)===0);f.sort((h,d)=>d.length-h.length);const v=f[0];if(v){const{expose:h,repeat:d,...m}=Hs(this.blocks[v]),g={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...m,repeat:d,parent:this},k=d!=null?new le.RepeatBlock(g):jt(g);k&&(this._blocks.push(k),h&&(this.exposeBlock=k),this._maskedBlocks[v]||(this._maskedBlocks[v]=[]),this._maskedBlocks[v].push(this._blocks.length-1)),i+=v.length-1;continue}}let o=t[i],a=o in e;if(o===Ve.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){s=!s;continue}if(o==="["||o==="]"){r=!r;continue}if(o===Ve.ESCAPE_CHAR){if(++i,o=t[i],!o)break;a=!1}const l=a?new ni({isOptional:r,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...Hs(e[o]),parent:this}):new Rf({char:o,eager:this.eager,isUnmasking:s});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:t,...s}=e;this._blocks.forEach((r,i)=>r.state=t[i]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new fe;let s=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(s==null)return t;this._blocks[s].isFilled&&++s;for(let r=s;r<this._blocks.length;++r){const i=this._blocks[r]._appendEager();if(!i.inserted)break;t.aggregate(i)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._mapPosToBlock(this.displayValue.length),r=new fe;if(!s)return r;for(let o=s.index,a;a=this._blocks[o];++o){var i;const l=a._appendChar(e,{...t,_beforeTailState:(i=t._beforeTailState)==null||(i=i._blocks)==null?void 0:i[o]});if(r.aggregate(l),l.consumed)break}return r}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=new fn;return e===t||this._forEachBlocksInRange(e,t,(r,i,o,a)=>{const l=r.extractTail(o,a);l.stop=this._findStopBefore(i),l.from=this._blockStartPos(i),l instanceof fn&&(l.blockIndex=i),s.extend(l)}),s}extractInput(e,t,s){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),s===void 0&&(s={}),e===t)return"";let r="";return this._forEachBlocksInRange(e,t,(i,o,a,l)=>{r+=i.extractInput(a,l,s)}),r}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){const r=this._stops[s];if(r<=e)t=r;else break}return t}_appendPlaceholder(e){const t=new fe;if(this.lazy&&e==null)return t;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;const r=s.index,i=e??this._blocks.length;return this._blocks.slice(r,i).forEach(o=>{if(!o.lazy||e!=null){var a;t.aggregate(o._appendPlaceholder((a=o._blocks)==null?void 0:a.length))}}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){const r=this._blocks[s],i=t.length;if(t+=r.displayValue,e<=t.length)return{index:s,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,s)=>t+=s.displayValue.length,0)}_forEachBlocksInRange(e,t,s){t===void 0&&(t=this.displayValue.length);const r=this._mapPosToBlock(e);if(r){const i=this._mapPosToBlock(t),o=i&&r.index===i.index,a=r.offset,l=i&&o?i.offset:this._blocks[r.index].displayValue.length;if(s(this._blocks[r.index],r.index,a,l),i&&!o){for(let c=r.index+1;c<i.index;++c)s(this._blocks[c],c,0,this._blocks[c].displayValue.length);s(this._blocks[i.index],i.index,0,i.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(r,i,o,a)=>{s.aggregate(r.remove(o,a))}),s}nearestInputPos(e,t){if(t===void 0&&(t=ie.NONE),!this._blocks.length)return 0;const s=new bk(this,e);if(t===ie.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===ie.LEFT||t===ie.FORCE_LEFT){if(t===ie.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===ie.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:t===ie.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return t===ie.RIGHT||t===ie.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:t===ie.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(e,ie.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(r,i,o,a)=>{s+=r.totalInputPositions(o,a)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(s=>this._blocks[s]):[]}pad(e){const t=new fe;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}Ve.DEFAULTS={...Be.DEFAULTS,lazy:!0,placeholderChar:"_"};Ve.STOP_CHAR="`";Ve.ESCAPE_CHAR="\\";Ve.InputDefinition=ni;Ve.FixedDefinition=Rf;le.MaskedPattern=Ve;class Kr extends Ve{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:s=this.from||0,maxLength:r=this.maxLength||0,autofix:i=this.autofix,...o}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,r),this.autofix=i;const a=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let c=0;for(;c<l.length&&l[c]===a[c];)++c;o.mask=l.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",s="";const[,r,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(r.length)+i,s="9".repeat(r.length)+i),t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[t,s]}doPrepareChar(e,t){t===void 0&&(t={});let s;return[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const s=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),[i,o]=this.boundaries(this.value+e);return Number(o)<this.from?super._appendCharRaw(s[this.value.length],t):Number(i)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(r[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;const[s,r]=this.boundaries(t);return this.from<=Number(r)&&Number(s)<=this.to&&super.doValidate(e)}pad(e){const t=new fe;if(this.value.length===this.maxLength)return t;const s=this.value,r=this.maxLength-this.value.length;if(r){this.reset();for(let i=0;i<r;++i)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(i=>this._appendCharRaw(i))}return t}}le.MaskedRange=Kr;const kk="d{.}`m{.}`Y";class Tt extends Ve{static extractPatternOptions(e){const{mask:t,pattern:s,...r}=e;return{...r,mask:Gt(t)?t:s}}constructor(e){super(Tt.extractPatternOptions({...Tt.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:s,blocks:r,...i}={...Tt.DEFAULTS,...e},o=Object.assign({},Tt.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,r),super._update({...i,mask:Gt(t)?t:s,blocks:o})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(Tt.extractPatternOptions(e))}}Tt.GET_DEFAULT_BLOCKS=()=>({d:{mask:Kr,from:1,to:31,maxLength:2},m:{mask:Kr,from:1,to:12,maxLength:2},Y:{mask:Kr,from:1900,to:9999}});Tt.DEFAULTS={...Ve.DEFAULTS,mask:Date,pattern:kk,format:(n,e)=>{if(!n)return"";const t=String(n.getDate()).padStart(2,"0"),s=String(n.getMonth()+1).padStart(2,"0"),r=n.getFullYear();return[t,s,r].join(".")},parse:(n,e)=>{const[t,s,r]=n.split(".").map(Number);return new Date(r,s-1,t)}};le.MaskedDate=Tt;class Ii extends Be{constructor(e){super({...Ii.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(t=>{const{expose:s,...r}=Hs(t),i=jt({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return s&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){e===void 0&&(e=""),t===void 0&&(t={}),s===void 0&&(s="");const r=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,i=this.rawInputValue,o=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:i,a=i.slice(o.length),l=this.currentMask,c=new fe,f=l==null?void 0:l.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),c.tailShift=this.currentMask.value.length-r.length),a&&(c.tailShift+=this.currentMask.append(a,{raw:!0,tail:!0}).tailShift)):f&&(this.currentMask.state=f)),c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new fe;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((s=e._beforeTailState)==null?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return t===void 0&&(t={}),s===void 0&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[s,r]=super.doPrepare(e,t);if(this.currentMask){let i;[s,i]=super.doPrepare(s,this.currentMaskFlags(t)),r=r.aggregate(i)}return[s,r]}doPrepareChar(e,t){t===void 0&&(t={});let[s,r]=super.doPrepareChar(e,t);if(this.currentMask){let i;[s,i]=super.doPrepareChar(s,this.currentMaskFlags(t)),r=r.aggregate(i)}return[s,r]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,t){const s=new fe;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:s,currentMask:r,...i}=e;t&&this.compiledMasks.forEach((o,a)=>o.state=t[a]),s!=null&&(this.currentMask=s,this.currentMask.state=r),super.state=i}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;const{mask:r,...i}=e[s];return ti(t,i)&&t.maskEquals(r)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}Ii.DEFAULTS={...Be.DEFAULTS,dispatch:(n,e,t,s)=>{if(!e.compiledMasks.length)return;const r=e.rawInputValue,i=e.compiledMasks.map((o,a)=>{const l=e.currentMask===o,c=l?o.displayValue.length:o.nearestInputPos(o.displayValue.length,ie.FORCE_LEFT);return o.rawInputValue!==r?(o.reset(),o.append(r,{raw:!0})):l||o.remove(c),o.append(n,e.currentMaskFlags(t)),o.appendTail(s),{index:a,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(c,o.nearestInputPos(o.displayValue.length,ie.FORCE_LEFT)))}});return i.sort((o,a)=>a.weight-o.weight||a.totalInputPositions-o.totalInputPositions),e.compiledMasks[i[0].index]}};le.MaskedDynamic=Ii;class Li extends Ve{constructor(e){super({...Li.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...s}=e;if(t){const r=t.map(a=>a.length),i=Math.min(...r),o=Math.max(...r)-i;s.mask="*".repeat(i),o&&(s.mask+="["+"*".repeat(o)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){t===void 0&&(t={});const s=Math.min(this.nearestInputPos(0,ie.FORCE_RIGHT),this.value.length),r=this.enum.filter(i=>this.matchValue(i,this.unmaskedValue+e,s));if(r.length){r.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,a)=>{const l=r[0][a];a>=this.value.length||l===o.value||(o.reset(),o._appendChar(l,t))});const i=super._appendCharRaw(r[0][this.value.length],t);return r.length===1&&r[0].slice(this.unmaskedValue.length).split("").forEach(o=>i.aggregate(super._appendCharRaw(o))),i}return new fe({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new vt("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new fe;const s=Math.min(super.nearestInputPos(0,ie.FORCE_RIGHT),this.value.length);let r;for(r=e;r>=0&&!(this.enum.filter(o=>this.matchValue(o,this.value.slice(s,r),s)).length>1);--r);const i=super.remove(r,t);return i.tailShift+=r-e,i}get isComplete(){return this.enum.indexOf(this.value)>=0}}Li.DEFAULTS={...Ve.DEFAULTS,matchValue:(n,e,t)=>n.indexOf(e,t)===t};le.MaskedEnum=Li;class wk extends Be{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}le.MaskedFunction=wk;var If;class We extends Be{constructor(e){super({...We.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",s=(this.scale?"("+$o(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map($o).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp($o(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});const[s,r]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(r.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&r.aggregate(this._appendChar("-")),[s,r]}_separatorsCount(e,t){t===void 0&&(t=!1);let s=0;for(let r=0;r<e;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){t===void 0&&(t={});const s=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const o=this.number;let a=!isNaN(o),l=!1;if(a){let h;this.min!=null&&this.min<0&&this.number<this.min&&(h=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(h=this.max),h!=null&&(this.autofix?(this._value=this.format(h,this).replace(We.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!t.tail)):a=!1),a&&(a=!!this._value.match(this._numberRegExp))}let c;a?c=new fe({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,c=new fe),this._value=this._insertThousandsSeparators(this._value);const f=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,v=this._separatorsCountFromSlice(f);return c.tailShift+=(v-r)*this.thousandsSeparator.length,c}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return-1}_adjustRangeWithSeparators(e,t){const s=this._findSeparatorAround(e);s>=0&&(e=s);const r=this._findSeparatorAround(t);return r>=0&&(t=r+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const s=this.value.slice(0,e),r=this.value.slice(t),i=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+r));const o=this._separatorsCountFromSlice(s);return new fe({tailShift:(o-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case ie.NONE:case ie.LEFT:case ie.FORCE_LEFT:{const s=this._findSeparatorAround(e-1);if(s>=0){const r=s+this.thousandsSeparator.length;if(e<r||this.value.length<=r||t===ie.FORCE_LEFT)return s}break}case ie.RIGHT:case ie.FORCE_RIGHT:{const s=this._findSeparatorAround(e);if(s>=0)return s+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(s,r,i,o)=>r+o),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){t===void 0&&(t={});const r=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===We.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,We.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(We.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||We.EMPTY_VALUES.includes(e)&&We.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}If=We;We.UNMASKED_RADIX=".";We.EMPTY_VALUES=[...Be.EMPTY_VALUES,0];We.DEFAULTS={...Be.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[If.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:n=>n.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};le.MaskedNumber=We;const qa={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Lf(n,e,t){e===void 0&&(e=qa.MASKED),t===void 0&&(t=qa.MASKED);const s=jt(n);return r=>s.runIsolated(i=>(i[e]=r,i[t]))}function Ek(n,e,t,s){return Lf(e,t,s)(n)}le.PIPE_TYPE=qa;le.createPipe=Lf;le.pipe=Ek;class _k extends Ve{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,r;const{repeat:i,...o}=Hs(e);this._blockOpts=Object.assign({},this._blockOpts,o);const a=jt(this._blockOpts);this.repeat=(t=(s=i??a.repeat)!=null?s:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((r=this._blocks)==null?void 0:r.length)||0,this.repeatFrom)),blocks:{m:a},eager:a.eager,overwrite:a.overwrite,skipInvalid:a.skipInvalid,lazy:a.lazy,placeholderChar:a.placeholderChar,displayChar:a.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(jt(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const s=new fe;for(let l=(r=(i=this._mapPosToBlock(this.displayValue.length))==null?void 0:i.index)!=null?r:Math.max(this._blocks.length-1,0),c,f;c=(o=this._blocks[l])!=null?o:f=!f&&this._allocateBlock(l);++l){var r,i,o,a;const v=c._appendChar(e,{...t,_beforeTailState:(a=t._beforeTailState)==null||(a=a._blocks)==null?void 0:a[l]});if(v.skip&&f){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(v),v.consumed)break}return s}_trimEmptyTail(e,t){var s,r;e===void 0&&(e=0);const i=Math.max(((s=this._mapPosToBlock(e))==null?void 0:s.index)||0,this.repeatFrom,0);let o;t!=null&&(o=(r=this._mapPosToBlock(t))==null?void 0:r.index),o==null&&(o=this._blocks.length-1);let a=0;for(let l=o;i<=l&&!this._blocks[l].unmaskedValue;--l,++a);a&&(this._blocks.splice(o-a+1,a),this.mask=this.mask.slice(a))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}le.RepeatBlock=_k;try{globalThis.IMask=le}catch{}var Or={exports:{}},zo={exports:{}},ye={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var tc;function Sk(){if(tc)return ye;tc=1;var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,r=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,o=n?Symbol.for("react.provider"):60109,a=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,v=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,d=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,k=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,E=n?Symbol.for("react.scope"):60119;function A(_){if(typeof _=="object"&&_!==null){var B=_.$$typeof;switch(B){case e:switch(_=_.type,_){case l:case c:case s:case i:case r:case v:return _;default:switch(_=_&&_.$$typeof,_){case a:case f:case m:case d:case o:return _;default:return B}}case t:return B}}}function N(_){return A(_)===c}return ye.AsyncMode=l,ye.ConcurrentMode=c,ye.ContextConsumer=a,ye.ContextProvider=o,ye.Element=e,ye.ForwardRef=f,ye.Fragment=s,ye.Lazy=m,ye.Memo=d,ye.Portal=t,ye.Profiler=i,ye.StrictMode=r,ye.Suspense=v,ye.isAsyncMode=function(_){return N(_)||A(_)===l},ye.isConcurrentMode=N,ye.isContextConsumer=function(_){return A(_)===a},ye.isContextProvider=function(_){return A(_)===o},ye.isElement=function(_){return typeof _=="object"&&_!==null&&_.$$typeof===e},ye.isForwardRef=function(_){return A(_)===f},ye.isFragment=function(_){return A(_)===s},ye.isLazy=function(_){return A(_)===m},ye.isMemo=function(_){return A(_)===d},ye.isPortal=function(_){return A(_)===t},ye.isProfiler=function(_){return A(_)===i},ye.isStrictMode=function(_){return A(_)===r},ye.isSuspense=function(_){return A(_)===v},ye.isValidElementType=function(_){return typeof _=="string"||typeof _=="function"||_===s||_===c||_===i||_===r||_===v||_===h||typeof _=="object"&&_!==null&&(_.$$typeof===m||_.$$typeof===d||_.$$typeof===o||_.$$typeof===a||_.$$typeof===f||_.$$typeof===k||_.$$typeof===w||_.$$typeof===E||_.$$typeof===g)},ye.typeOf=A,ye}var ke={};/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var nc;function Ak(){return nc||(nc=1,process.env.NODE_ENV!=="production"&&function(){var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,r=n?Symbol.for("react.strict_mode"):60108,i=n?Symbol.for("react.profiler"):60114,o=n?Symbol.for("react.provider"):60109,a=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,v=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,d=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,k=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,E=n?Symbol.for("react.scope"):60119;function A(I){return typeof I=="string"||typeof I=="function"||I===s||I===c||I===i||I===r||I===v||I===h||typeof I=="object"&&I!==null&&(I.$$typeof===m||I.$$typeof===d||I.$$typeof===o||I.$$typeof===a||I.$$typeof===f||I.$$typeof===k||I.$$typeof===w||I.$$typeof===E||I.$$typeof===g)}function N(I){if(typeof I=="object"&&I!==null){var ue=I.$$typeof;switch(ue){case e:var xe=I.type;switch(xe){case l:case c:case s:case i:case r:case v:return xe;default:var Se=xe&&xe.$$typeof;switch(Se){case a:case f:case m:case d:case o:return Se;default:return ue}}case t:return ue}}}var _=l,B=c,H=a,ae=o,he=e,me=f,y=s,j=m,S=d,$=t,V=i,O=r,M=v,Z=!1;function X(I){return Z||(Z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),C(I)||N(I)===l}function C(I){return N(I)===c}function L(I){return N(I)===a}function F(I){return N(I)===o}function G(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function K(I){return N(I)===f}function z(I){return N(I)===s}function Y(I){return N(I)===m}function D(I){return N(I)===d}function P(I){return N(I)===t}function W(I){return N(I)===i}function U(I){return N(I)===r}function J(I){return N(I)===v}ke.AsyncMode=_,ke.ConcurrentMode=B,ke.ContextConsumer=H,ke.ContextProvider=ae,ke.Element=he,ke.ForwardRef=me,ke.Fragment=y,ke.Lazy=j,ke.Memo=S,ke.Portal=$,ke.Profiler=V,ke.StrictMode=O,ke.Suspense=M,ke.isAsyncMode=X,ke.isConcurrentMode=C,ke.isContextConsumer=L,ke.isContextProvider=F,ke.isElement=G,ke.isForwardRef=K,ke.isFragment=z,ke.isLazy=Y,ke.isMemo=D,ke.isPortal=P,ke.isProfiler=W,ke.isStrictMode=U,ke.isSuspense=J,ke.isValidElementType=A,ke.typeOf=N}()),ke}var sc;function qf(){return sc||(sc=1,process.env.NODE_ENV==="production"?zo.exports=Sk():zo.exports=Ak()),zo.exports}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var Ho,rc;function Ck(){if(rc)return Ho;rc=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function s(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function r(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(f){return o[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Ho=r()?Object.assign:function(i,o){for(var a,l=s(i),c,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var v in a)e.call(a,v)&&(l[v]=a[v]);if(n){c=n(a);for(var h=0;h<c.length;h++)t.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Ho}var Ko,ic;function vl(){if(ic)return Ko;ic=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ko=n,Ko}var oc,ac;function jf(){return ac||(ac=1,oc=Function.call.bind(Object.prototype.hasOwnProperty)),oc}var Wo,lc;function Nk(){if(lc)return Wo;lc=1;var n=function(){};if(process.env.NODE_ENV!=="production"){var e=vl(),t={},s=jf();n=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function r(i,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var f in i)if(s(i,f)){var v;try{if(typeof i[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}v=i[f](o,f,l,a,null,e)}catch(m){v=m}if(v&&!(v instanceof Error)&&n((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof v+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),v instanceof Error&&!(v.message in t)){t[v.message]=!0;var d=c?c():"";n("Failed "+a+" type: "+v.message+(d??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},Wo=r,Wo}var Go,uc;function Ok(){if(uc)return Go;uc=1;var n=qf(),e=Ck(),t=vl(),s=jf(),r=Nk(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return Go=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function v(C){var L=C&&(c&&C[c]||C[f]);if(typeof L=="function")return L}var h="<<anonymous>>",d={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:E(),arrayOf:A,element:N(),elementType:_(),instanceOf:B,node:me(),objectOf:ae,oneOf:H,oneOfType:he,shape:j,exact:S};function m(C,L){return C===L?C!==0||1/C===1/L:C!==C&&L!==L}function g(C,L){this.message=C,this.data=L&&typeof L=="object"?L:{},this.stack=""}g.prototype=Error.prototype;function k(C){if(process.env.NODE_ENV!=="production")var L={},F=0;function G(z,Y,D,P,W,U,J){if(P=P||h,U=U||D,J!==t){if(l){var I=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ue=P+":"+D;!L[ue]&&F<3&&(i("You are manually calling a React.PropTypes validation function for the `"+U+"` prop on `"+P+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),L[ue]=!0,F++)}}return Y[D]==null?z?Y[D]===null?new g("The "+W+" `"+U+"` is marked as required "+("in `"+P+"`, but its value is `null`.")):new g("The "+W+" `"+U+"` is marked as required in "+("`"+P+"`, but its value is `undefined`.")):null:C(Y,D,P,W,U)}var K=G.bind(null,!1);return K.isRequired=G.bind(null,!0),K}function w(C){function L(F,G,K,z,Y,D){var P=F[G],W=O(P);if(W!==C){var U=M(P);return new g("Invalid "+z+" `"+Y+"` of type "+("`"+U+"` supplied to `"+K+"`, expected ")+("`"+C+"`."),{expectedType:C})}return null}return k(L)}function E(){return k(o)}function A(C){function L(F,G,K,z,Y){if(typeof C!="function")return new g("Property `"+Y+"` of component `"+K+"` has invalid PropType notation inside arrayOf.");var D=F[G];if(!Array.isArray(D)){var P=O(D);return new g("Invalid "+z+" `"+Y+"` of type "+("`"+P+"` supplied to `"+K+"`, expected an array."))}for(var W=0;W<D.length;W++){var U=C(D,W,K,z,Y+"["+W+"]",t);if(U instanceof Error)return U}return null}return k(L)}function N(){function C(L,F,G,K,z){var Y=L[F];if(!a(Y)){var D=O(Y);return new g("Invalid "+K+" `"+z+"` of type "+("`"+D+"` supplied to `"+G+"`, expected a single ReactElement."))}return null}return k(C)}function _(){function C(L,F,G,K,z){var Y=L[F];if(!n.isValidElementType(Y)){var D=O(Y);return new g("Invalid "+K+" `"+z+"` of type "+("`"+D+"` supplied to `"+G+"`, expected a single ReactElement type."))}return null}return k(C)}function B(C){function L(F,G,K,z,Y){if(!(F[G]instanceof C)){var D=C.name||h,P=X(F[G]);return new g("Invalid "+z+" `"+Y+"` of type "+("`"+P+"` supplied to `"+K+"`, expected ")+("instance of `"+D+"`."))}return null}return k(L)}function H(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function L(F,G,K,z,Y){for(var D=F[G],P=0;P<C.length;P++)if(m(D,C[P]))return null;var W=JSON.stringify(C,function(U,J){var I=M(J);return I==="symbol"?String(J):J});return new g("Invalid "+z+" `"+Y+"` of value `"+String(D)+"` "+("supplied to `"+K+"`, expected one of "+W+"."))}return k(L)}function ae(C){function L(F,G,K,z,Y){if(typeof C!="function")return new g("Property `"+Y+"` of component `"+K+"` has invalid PropType notation inside objectOf.");var D=F[G],P=O(D);if(P!=="object")return new g("Invalid "+z+" `"+Y+"` of type "+("`"+P+"` supplied to `"+K+"`, expected an object."));for(var W in D)if(s(D,W)){var U=C(D,W,K,z,Y+"."+W,t);if(U instanceof Error)return U}return null}return k(L)}function he(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var L=0;L<C.length;L++){var F=C[L];if(typeof F!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Z(F)+" at index "+L+"."),o}function G(K,z,Y,D,P){for(var W=[],U=0;U<C.length;U++){var J=C[U],I=J(K,z,Y,D,P,t);if(I==null)return null;I.data&&s(I.data,"expectedType")&&W.push(I.data.expectedType)}var ue=W.length>0?", expected one of type ["+W.join(", ")+"]":"";return new g("Invalid "+D+" `"+P+"` supplied to "+("`"+Y+"`"+ue+"."))}return k(G)}function me(){function C(L,F,G,K,z){return $(L[F])?null:new g("Invalid "+K+" `"+z+"` supplied to "+("`"+G+"`, expected a ReactNode."))}return k(C)}function y(C,L,F,G,K){return new g((C||"React class")+": "+L+" type `"+F+"."+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+K+"`.")}function j(C){function L(F,G,K,z,Y){var D=F[G],P=O(D);if(P!=="object")return new g("Invalid "+z+" `"+Y+"` of type `"+P+"` "+("supplied to `"+K+"`, expected `object`."));for(var W in C){var U=C[W];if(typeof U!="function")return y(K,z,Y,W,M(U));var J=U(D,W,K,z,Y+"."+W,t);if(J)return J}return null}return k(L)}function S(C){function L(F,G,K,z,Y){var D=F[G],P=O(D);if(P!=="object")return new g("Invalid "+z+" `"+Y+"` of type `"+P+"` "+("supplied to `"+K+"`, expected `object`."));var W=e({},F[G],C);for(var U in W){var J=C[U];if(s(C,U)&&typeof J!="function")return y(K,z,Y,U,M(J));if(!J)return new g("Invalid "+z+" `"+Y+"` key `"+U+"` supplied to `"+K+"`.\nBad object: "+JSON.stringify(F[G],null," ")+`
Valid keys: `+JSON.stringify(Object.keys(C),null," "));var I=J(D,U,K,z,Y+"."+U,t);if(I)return I}return null}return k(L)}function $(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every($);if(C===null||a(C))return!0;var L=v(C);if(L){var F=L.call(C),G;if(L!==C.entries){for(;!(G=F.next()).done;)if(!$(G.value))return!1}else for(;!(G=F.next()).done;){var K=G.value;if(K&&!$(K[1]))return!1}}else return!1;return!0;default:return!1}}function V(C,L){return C==="symbol"?!0:L?L["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&L instanceof Symbol:!1}function O(C){var L=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":V(L,C)?"symbol":L}function M(C){if(typeof C>"u"||C===null)return""+C;var L=O(C);if(L==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return L}function Z(C){var L=M(C);switch(L){case"array":case"object":return"an "+L;case"boolean":case"date":case"regexp":return"a "+L;default:return L}}function X(C){return!C.constructor||!C.constructor.name?h:C.constructor.name}return d.checkPropTypes=r,d.resetWarningCache=r.resetWarningCache,d.PropTypes=d,d},Go}var Zo,cc;function Tk(){if(cc)return Zo;cc=1;var n=vl();function e(){}function t(){}return t.resetWarningCache=e,Zo=function(){function s(o,a,l,c,f,v){if(v!==n){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}s.isRequired=s;function r(){return s}var i={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:r,element:s,elementType:s,instanceOf:r,node:s,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:t,resetWarningCache:e};return i.PropTypes=i,i},Zo}var hc;function Rk(){if(hc)return Or.exports;if(hc=1,process.env.NODE_ENV!=="production"){var n=qf(),e=!0;Or.exports=Ok()(n.isElement,e)}else Or.exports=Tk()();return Or.exports}var Ik=Rk();const re=Te.Jm(Ik),Df={mask:re.oneOfType([re.array,re.func,re.string,re.instanceOf(RegExp),re.oneOf([Date,Number,le.Masked]),re.instanceOf(le.Masked)]),value:re.any,unmask:re.oneOfType([re.bool,re.oneOf(["typed"])]),prepare:re.func,prepareChar:re.func,validate:re.func,commit:re.func,overwrite:re.oneOfType([re.bool,re.oneOf(["shift"])]),eager:re.oneOfType([re.bool,re.oneOf(["append","remove"])]),skipInvalid:re.bool,onAccept:re.func,onComplete:re.func,placeholderChar:re.string,displayChar:re.string,lazy:re.bool,definitions:re.object,blocks:re.object,enum:re.arrayOf(re.string),maxLength:re.number,from:re.number,to:re.number,pattern:re.string,format:re.func,parse:re.func,autofix:re.oneOfType([re.bool,re.oneOf(["pad"])]),radix:re.string,thousandsSeparator:re.string,mapToRadix:re.arrayOf(re.string),scale:re.number,normalizeZeros:re.bool,padFractionalZeros:re.bool,min:re.oneOfType([re.number,re.instanceOf(Date)]),max:re.oneOfType([re.number,re.instanceOf(Date)]),dispatch:re.func,inputRef:re.oneOfType([re.func,re.shape({current:re.object})])},Mf=Object.keys(Df).filter(n=>n!=="value"),Lk=["value","unmask","onAccept","onComplete","inputRef"],qk=Mf.filter(n=>Lk.indexOf(n)<0);function jk(n){var e;const t=(e=class extends Q.Component{constructor(r){super(r),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){const r=this.props,i=this._extractMaskOptionsFromProps(r);if(i.mask)this.maskRef?(this.maskRef.updateOptions(i),"value"in r&&r.value!==void 0&&(this.maskValue=r.value)):this.initMask(i);else if(this.destroyMask(),"value"in r&&r.value!==void 0){var o;(o=this.element)!=null&&o.isContentEditable&&this.element.tagName!=="INPUT"&&this.element.tagName!=="TEXTAREA"?this.element.textContent=r.value:this.element.value=r.value}}componentWillUnmount(){this.destroyMask()}_inputRef(r){this.element=r,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=r:this.props.inputRef(r))}initMask(r){r===void 0&&(r=this._extractMaskOptionsFromProps(this.props)),this.maskRef=le(this.element,r).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&this.props.value!==void 0&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(r){const{...i}=r;return Object.keys(i).filter(o=>qk.indexOf(o)<0).forEach(o=>{delete i[o]}),i}_extractNonMaskProps(r){const{...i}=r;return Mf.forEach(o=>{o!=="maxLength"&&delete i[o]}),"defaultValue"in i||(i.defaultValue=r.mask?"":i.value),delete i.value,i}get maskValue(){return this.maskRef?this.props.unmask==="typed"?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(r){this.maskRef&&(r=r==null&&this.props.unmask!=="typed"?"":r,this.props.unmask==="typed"?this.maskRef.typedValue=r:this.props.unmask?this.maskRef.unmaskedValue=r:this.maskRef.value=r)}_onAccept(r){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,r)}_onComplete(r){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,r)}render(){return Q.createElement(n,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}},e.displayName=void 0,e.propTypes=void 0,e),s=n.displayName||n.name||"Component";return t.displayName="IMask("+s+")",t.propTypes=Df,Q.forwardRef((r,i)=>Q.createElement(t,{...r,ref:i}))}const Dk=jk(n=>{let{inputRef:e,...t}=n;return Q.createElement("input",{...t,ref:e})}),Mk=(n,e)=>Q.createElement(Dk,{...n,ref:e}),Fk=Q.forwardRef(Mk),Ff=Q.forwardRef(({className:n,type:e,variant:t,...s},r)=>b.ae.jsx(Fk,{className:Ae.mo(oi({variant:t}),n),ref:r,...s}));Ff.displayName="MaskInput";exports.$a=oi;exports.$m=td;exports.Gg=oh;exports.Gw=Cf;exports.Gx=xm;exports.Hg=ih;exports.Jh=Za;exports.Kg=ah;exports.Kx=km;exports.Qh=Ga;exports.Qx=fg;exports.Um=nd;exports.Vm=ed;exports.Wg=lh;exports.Xh=Wa;exports.Xx=dg;exports.Zx=hg;exports.e0=vd;exports.ed=Xa;exports.em=mh;exports.jm=Qh;exports.kg=Gc;exports.oh=Ha;exports.t0=yd;exports.tm=gh;exports.vi=Ks;exports.vp=wc;exports.yp=Ec;exports.yx=Ff;exports.zg=rh;