pesona-ui 0.1.39 → 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),nr=require("react-dom");var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Cr={exports:{}},In={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react"),$t=require("react-dom");var vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ri(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Cr={exports:{}},qn={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ji;function uc(){if(Ji)return In;Ji=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var l in s)l!=="key"&&(i[l]=s[l])}else i=s;return s=i.ref,{$$typeof:n,type:r,key:a,ref:s!==void 0?s:null,props:i}}return In.Fragment=e,In.jsx=t,In.jsxs=t,In}var qn={};/**
9
+ */var Qi;function uc(){if(Qi)return qn;Qi=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var l in s)l!=="key"&&(i[l]=s[l])}else i=s;return s=i.ref,{$$typeof:n,type:r,key:a,ref:s!==void 0?s:null,props:i}}return qn.Fragment=e,qn.jsx=t,qn.jsxs=t,qn}var Mn={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,58 +14,58 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Qi;function hc(){return Qi||(Qi=1,process.env.NODE_ENV!=="production"&&function(){function n(C){if(C==null)return null;if(typeof C=="function")return C.$$typeof===ee?null:C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case y:return"Fragment";case T:return"Profiler";case N:return"StrictMode";case v:return"Suspense";case S:return"SuspenseList";case z:return"Activity"}if(typeof C=="object")switch(typeof C.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),C.$$typeof){case E:return"Portal";case k:return(C.displayName||"Context")+".Provider";case A:return(C._context.displayName||"Context")+".Consumer";case D:var $=C.render;return C=C.displayName,C||(C=$.displayName||$.name||"",C=C!==""?"ForwardRef("+C+")":"ForwardRef"),C;case j:return $=C.displayName||null,$!==null?$:n(C.type)||"Memo";case B:$=C._payload,C=C._init;try{return n(C($))}catch{}}return null}function e(C){return""+C}function t(C){try{e(C);var $=!1}catch{$=!0}if($){$=console;var F=$.error,Z=typeof Symbol=="function"&&Symbol.toStringTag&&C[Symbol.toStringTag]||C.constructor.name||"Object";return F.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Z),e(C)}}function r(C){if(C===y)return"<>";if(typeof C=="object"&&C!==null&&C.$$typeof===B)return"<...>";try{var $=n(C);return $?"<"+$+">":"<...>"}catch{return"<...>"}}function s(){var C=b.A;return C===null?null:C.getOwner()}function i(){return Error("react-stack-top-frame")}function a(C){if(q.call(C,"key")){var $=Object.getOwnPropertyDescriptor(C,"key").get;if($&&$.isReactWarning)return!1}return C.key!==void 0}function l(C,$){function F(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",$))}F.isReactWarning=!0,Object.defineProperty(C,"key",{get:F,configurable:!0})}function c(){var C=n(this.type);return I[C]||(I[C]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),C=this.props.ref,C!==void 0?C:null}function u(C,$,F,Z,J,H,le,ue){return F=H.ref,C={$$typeof:m,type:C,key:$,props:H,_owner:J},(F!==void 0?F:null)!==null?Object.defineProperty(C,"ref",{enumerable:!1,get:c}):Object.defineProperty(C,"ref",{enumerable:!1,value:null}),C._store={},Object.defineProperty(C._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(C,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(C,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty(C,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(C.props),Object.freeze(C)),C}function p(C,$,F,Z,J,H,le,ue){var Y=$.children;if(Y!==void 0)if(Z)if(w(Y)){for(Z=0;Z<Y.length;Z++)g(Y[Z]);Object.freeze&&Object.freeze(Y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(Y);if(q.call($,"key")){Y=n(C);var ne=Object.keys($).filter(function(ie){return ie!=="key"});Z=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",K[Y+Z]||(ne=0<ne.length?"{"+ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ea;function hc(){return ea||(ea=1,process.env.NODE_ENV!=="production"&&function(){function n(C){if(C==null)return null;if(typeof C=="function")return C.$$typeof===ee?null:C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case x:return"Fragment";case T:return"Profiler";case w:return"StrictMode";case v:return"Suspense";case S:return"SuspenseList";case z:return"Activity"}if(typeof C=="object")switch(typeof C.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),C.$$typeof){case y:return"Portal";case O:return(C.displayName||"Context")+".Provider";case A:return(C._context.displayName||"Context")+".Consumer";case D:var $=C.render;return C=C.displayName,C||(C=$.displayName||$.name||"",C=C!==""?"ForwardRef("+C+")":"ForwardRef"),C;case j:return $=C.displayName||null,$!==null?$:n(C.type)||"Memo";case B:$=C._payload,C=C._init;try{return n(C($))}catch{}}return null}function e(C){return""+C}function t(C){try{e(C);var $=!1}catch{$=!0}if($){$=console;var F=$.error,Z=typeof Symbol=="function"&&Symbol.toStringTag&&C[Symbol.toStringTag]||C.constructor.name||"Object";return F.call($,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Z),e(C)}}function r(C){if(C===x)return"<>";if(typeof C=="object"&&C!==null&&C.$$typeof===B)return"<...>";try{var $=n(C);return $?"<"+$+">":"<...>"}catch{return"<...>"}}function s(){var C=b.A;return C===null?null:C.getOwner()}function i(){return Error("react-stack-top-frame")}function a(C){if(q.call(C,"key")){var $=Object.getOwnPropertyDescriptor(C,"key").get;if($&&$.isReactWarning)return!1}return C.key!==void 0}function l(C,$){function F(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",$))}F.isReactWarning=!0,Object.defineProperty(C,"key",{get:F,configurable:!0})}function c(){var C=n(this.type);return I[C]||(I[C]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),C=this.props.ref,C!==void 0?C:null}function u(C,$,F,Z,J,H,le,ue){return F=H.ref,C={$$typeof:m,type:C,key:$,props:H,_owner:J},(F!==void 0?F:null)!==null?Object.defineProperty(C,"ref",{enumerable:!1,get:c}):Object.defineProperty(C,"ref",{enumerable:!1,value:null}),C._store={},Object.defineProperty(C._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(C,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(C,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty(C,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.freeze&&(Object.freeze(C.props),Object.freeze(C)),C}function f(C,$,F,Z,J,H,le,ue){var Y=$.children;if(Y!==void 0)if(Z)if(N(Y)){for(Z=0;Z<Y.length;Z++)g(Y[Z]);Object.freeze&&Object.freeze(Y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(Y);if(q.call($,"key")){Y=n(C);var ne=Object.keys($).filter(function(ie){return ie!=="key"});Z=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",K[Y+Z]||(ne=0<ne.length?"{"+ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,Z,Y,ne,Y),K[Y+Z]=!0)}if(Y=null,F!==void 0&&(t(F),Y=""+F),a($)&&(t($.key),Y=""+$.key),"key"in $){F={};for(var re in $)re!=="key"&&(F[re]=$[re])}else F=$;return Y&&l(F,typeof C=="function"?C.displayName||C.name||"Unknown":C),u(C,Y,H,J,s(),F,le,ue)}function g(C){typeof C=="object"&&C!==null&&C.$$typeof===m&&C._store&&(C._store.validated=1)}var h=_,m=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),k=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),ee=Symbol.for("react.client.reference"),b=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,w=Array.isArray,R=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(C){return C()}};var M,I={},P=h.react_stack_bottom_frame.bind(h,i)(),U=R(r(i)),K={};qn.Fragment=y,qn.jsx=function(C,$,F,Z,J){var H=1e4>b.recentlyCreatedOwnerStacks++;return p(C,$,F,!1,Z,J,H?Error("react-stack-top-frame"):P,H?R(r(C)):U)},qn.jsxs=function(C,$,F,Z,J){var H=1e4>b.recentlyCreatedOwnerStacks++;return p(C,$,F,!0,Z,J,H?Error("react-stack-top-frame"):P,H?R(r(C)):U)}}()),qn}var ea;function dc(){return ea||(ea=1,process.env.NODE_ENV==="production"?Cr.exports=uc():Cr.exports=hc()),Cr.exports}var d=dc();const Pe=({type:n="button",className:e,children:t,...r})=>d.jsx("button",{type:n==="submit"?"submit":"button",className:e,...r,children:t}),fc=({children:n,className:e})=>d.jsx("div",{className:`card-header ${e}`,children:n}),pc=({children:n,className:e="",...t})=>d.jsx("div",{className:`card-body ${e}`,...t,children:n}),gc=({children:n,className:e=""})=>d.jsx("div",{className:`card-footer ${e}`,children:n}),mc=({children:n,className:e="",...t})=>d.jsx("div",{className:`card ${e}`,...t,children:n}),bc=()=>d.jsx("div",{className:"spinner",children:d.jsx("svg",{className:"spinner-icon",width:"30px",height:"30px",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("circle",{className:"path",fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})}),wt=(n,e)=>{_.useEffect(()=>{if(!Array.isArray(n)||n.length===0)return;const t=r=>{n.every(i=>i.current&&!i.current.contains(r.target))&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[n,e])},vc=({children:n,items:e,position:t="bottom-left",className:r=""})=>{const[s,i]=_.useState(!1),[a,l]=_.useState({top:0,left:0}),c=_.useRef(null),u=_.useRef(null);wt([c,u],()=>{i(!1)}),_.useEffect(()=>{if(s&&c.current&&u.current){const g=()=>{if(!c.current||!u.current)return;const m=c.current.getBoundingClientRect(),E=u.current.getBoundingClientRect();let y=0,N=0;switch(t){case"bottom-left":y=m.bottom+4,N=m.left;break;case"bottom-right":y=m.bottom+4,N=m.right-E.width;break;case"top-left":y=m.top-E.height-4,N=m.left;break;case"top-right":y=m.top-E.height-4,N=m.right-E.width;break}l({top:Math.round(y),left:Math.round(N)})};g();const h=()=>{g()};return window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}}},[s,t]);const p=()=>{switch(t){case"bottom-right":return"dropdown-menu-end";case"top-left":return"dropup";case"top-right":return"dropup dropdown-menu-end";default:return""}};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dropdown",ref:c,onClick:()=>i(!s),children:n}),s&&nr.createPortal(d.jsx("ul",{ref:u,style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`},className:`dropdown-menu ${p()} show ${r}`,children:e.map((g,h)=>g.divider?d.jsx("li",{children:d.jsx("hr",{className:"dropdown-divider"})},h):d.jsx("li",{children:d.jsxs("a",{className:`dropdown-item ${g.className||""}`,href:"#",onClick:m=>{m.preventDefault(),g.onClick(),i(!1)},children:[g.icon&&d.jsx("span",{className:"me-2",children:g.icon}),g.label]})},h))}),document.body)]})},yc=({children:n,className:e="",position:t="bottom-left"})=>{const[r,s]=_.useState(!1),i=_.useRef(null),a=_.useRef(null),l=_.useRef(`dropdown-${Math.random().toString(36).substr(2,9)}`),c=()=>{s(!r)};return wt([i,a],()=>{s(!1)}),d.jsx("div",{className:`dropdown ${e}`,ref:i,id:l.current,children:_.Children.map(n,u=>_.isValidElement(u)?_.cloneElement(u,{toggleDropdown:c,isOpen:r,position:t,contentRef:a,dropdownId:l.current}):u)})},xc=({children:n,className:e="",toggleDropdown:t,dropdownId:r})=>d.jsx("div",{className:`dropdown-toggle ${e}`,onClick:t,"data-dropdown-id":r,children:n}),Ec=({children:n,className:e="",isOpen:t=!1,position:r="bottom-left",contentRef:s,dropdownId:i})=>{const[a,l]=_.useState({top:0,left:0});return _.useEffect(()=>{if(t&&s?.current){const c=()=>{const p=document.querySelector(`[data-dropdown-id="${i}"]`);if(!p||!s?.current)return;const g=p.getBoundingClientRect(),h=s.current.getBoundingClientRect();let m=0,E=0;switch(r){case"bottom-left":m=g.bottom+4,E=g.left;break;case"bottom-right":m=g.bottom+4,E=g.right-h.width;break;case"top-left":m=g.top-h.height-4,E=g.left;break;case"top-right":m=g.top-h.height-4,E=g.right-h.width;break}l({top:Math.round(m),left:Math.round(E)})};c();const u=()=>{c()};return window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}}},[t,r,s,i]),t?nr.createPortal(d.jsx("div",{ref:s,style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`},className:`dropdown-content ${r} ${e}`,children:n}),document.body):null},Nc=({className:n,children:e,style:t})=>d.jsx("span",{className:n,style:t,children:e}),wc=({children:n,className:e="",...t})=>d.jsx("div",{className:`box ${e}`,...t,children:n}),ui=({children:n})=>d.jsx(d.Fragment,{children:n}),Oo=({children:n})=>d.jsx(d.Fragment,{children:n}),Tc=({className:n="",navClassName:e="",contentClassName:t="",children:r,activeTab:s,handleActiveTab:i,customHeader:a})=>{const{tabs:l,groups:c,tabIdMap:u}=_.useMemo(()=>{const h=[],m=[],E=new Map;return _.Children.forEach(r,y=>{if(_.isValidElement(y)){if(y.type===Oo){const N=[],T=y.props;_.Children.forEach(T.children,A=>{if(_.isValidElement(A)&&A.type===ui){const k=A.props.id||`tab-${h.length}`;h.push({title:A.props.title,icon:A.props.icon,children:A.props.children,id:k});const D=h.length-1;E.set(k,D),N.push(D)}}),m.push({title:T.title,tabIndices:N})}else if(y.type===ui){const N=y.props,T=N.id||`tab-${h.length}`;h.push({title:N.title,icon:N.icon,children:N.children,id:T});const A=h.length-1;E.set(T,A)}}}),{tabs:h,groups:m,tabIdMap:E}},[r]),p=_.useMemo(()=>typeof s=="number"?s:u.get(s)??0,[s,u]);_.useEffect(()=>{l.length>0&&(p<0||p>=l.length)&&i(0)},[l.length,p,i]);const g=(h,m)=>{const E=m===p,y=()=>i(h.id);return d.jsxs("div",{className:`tab-item ${E?"active":""}`,onClick:y,role:"button",tabIndex:0,onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),y())},children:[h.icon&&d.jsx("span",{className:"tab-icon",children:h.icon}),d.jsx("span",{className:"tab-title",children:h.title})]},`tab-nav-${m}`)};return d.jsxs("div",{className:`card tabs ${n}`,children:[d.jsxs("div",{className:`card-header ${e}`,children:[a,d.jsx("div",{className:"nav-tabs",role:"tablist",children:c.length>0?c.map(h=>d.jsxs(_.Fragment,{children:[d.jsx("legend",{className:"tab-item-legend",children:h.title}),h.tabIndices.map(m=>g(l[m],m))]},`group-${h.title}`)):l.map((h,m)=>g(h,m))})]}),d.jsx("div",{className:`card-body ${t}`,children:d.jsx("div",{className:"tab-content",children:d.jsx("div",{className:"tab-panel",children:l[p]?d.jsx("div",{children:l[p].children},`tab-content-${p}`):d.jsx("div",{children:"No content available"})})})})]})};var Ro={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ta=_.createContext&&_.createContext(Ro),Ac=["attr","size","title"];function Sc(n,e){if(n==null)return{};var t=Cc(n,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Cc(n,e){if(n==null)return{};var t={};for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){if(e.indexOf(r)>=0)continue;t[r]=n[r]}return t}function Ur(){return Ur=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ur.apply(this,arguments)}function na(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Hr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?na(Object(t),!0).forEach(function(r){_c(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):na(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _c(n,e,t){return e=Oc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oc(n){var e=Rc(n,"string");return typeof e=="symbol"?e:e+""}function Rc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Lo(n){return n&&n.map((e,t)=>_.createElement(e.tag,Hr({key:t},e.attr),Lo(e.child)))}function Oe(n){return e=>_.createElement(Lc,Ur({attr:Hr({},n.attr)},e),Lo(n.child))}function Lc(n){var e=t=>{var{attr:r,size:s,title:i}=n,a=Sc(n,Ac),l=s||t.size||"1em",c;return t.className&&(c=t.className),n.className&&(c=(c?c+" ":"")+n.className),_.createElement("svg",Ur({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,a,{className:c,style:Hr(Hr({color:n.color||t.color},t.style),n.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&_.createElement("title",null,i),n.children)};return ta!==void 0?_.createElement(ta.Consumer,null,t=>e(t)):e(Ro)}function kc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 19 5 12 12 5"},child:[]}]})(n)}function hi(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(n)}function Kn(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(n)}function jc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 18 9 12 15 6"},child:[]}]})(n)}function Ic(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(n)}function qc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},child:[]}]})(n)}function Mc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},child:[]}]})(n)}function Dc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"19 20 9 12 19 4 19 20"},child:[]},{tag:"line",attr:{x1:"5",y1:"19",x2:"5",y2:"5"},child:[]}]})(n)}function Pc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"5 4 15 12 5 20 5 4"},child:[]},{tag:"line",attr:{x1:"19",y1:"5",x2:"19",y2:"19"},child:[]}]})(n)}function $c(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]}]})(n)}function ko(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(n)}var Mn={},nn={},_r={},jt={},It={},Vs={},ra;function jo(){return ra||(ra=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Doctype=n.CDATA=n.Tag=n.Style=n.Script=n.Comment=n.Directive=n.Text=n.Root=n.isTag=n.ElementType=void 0;var e;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(e=n.ElementType||(n.ElementType={}));function t(r){return r.type===e.Tag||r.type===e.Script||r.type===e.Style}n.isTag=t,n.Root=e.Root,n.Text=e.Text,n.Directive=e.Directive,n.Comment=e.Comment,n.Script=e.Script,n.Style=e.Style,n.Tag=e.Tag,n.CDATA=e.CDATA,n.Doctype=e.Doctype}(Vs)),Vs}var te={},sa;function ia(){if(sa)return te;sa=1;var n=te&&te.__extends||function(){var v=function(S,j){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,z){B.__proto__=z}||function(B,z){for(var ee in z)Object.prototype.hasOwnProperty.call(z,ee)&&(B[ee]=z[ee])},v(S,j)};return function(S,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");v(S,j);function B(){this.constructor=S}S.prototype=j===null?Object.create(j):(B.prototype=j.prototype,new B)}}(),e=te&&te.__assign||function(){return e=Object.assign||function(v){for(var S,j=1,B=arguments.length;j<B;j++){S=arguments[j];for(var z in S)Object.prototype.hasOwnProperty.call(S,z)&&(v[z]=S[z])}return v},e.apply(this,arguments)};Object.defineProperty(te,"__esModule",{value:!0}),te.cloneNode=te.hasChildren=te.isDocument=te.isDirective=te.isComment=te.isText=te.isCDATA=te.isTag=te.Element=te.Document=te.CDATA=te.NodeWithChildren=te.ProcessingInstruction=te.Comment=te.Text=te.DataNode=te.Node=void 0;var t=jo(),r=function(){function v(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(v.prototype,"parentNode",{get:function(){return this.parent},set:function(S){this.parent=S},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"previousSibling",{get:function(){return this.prev},set:function(S){this.prev=S},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"nextSibling",{get:function(){return this.next},set:function(S){this.next=S},enumerable:!1,configurable:!0}),v.prototype.cloneNode=function(S){return S===void 0&&(S=!1),k(this,S)},v}();te.Node=r;var s=function(v){n(S,v);function S(j){var B=v.call(this)||this;return B.data=j,B}return Object.defineProperty(S.prototype,"nodeValue",{get:function(){return this.data},set:function(j){this.data=j},enumerable:!1,configurable:!0}),S}(r);te.DataNode=s;var i=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.Text,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),S}(s);te.Text=i;var a=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.Comment,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),S}(s);te.Comment=a;var l=function(v){n(S,v);function S(j,B){var z=v.call(this,B)||this;return z.name=j,z.type=t.ElementType.Directive,z}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),S}(s);te.ProcessingInstruction=l;var c=function(v){n(S,v);function S(j){var B=v.call(this)||this;return B.children=j,B}return Object.defineProperty(S.prototype,"firstChild",{get:function(){var j;return(j=this.children[0])!==null&&j!==void 0?j:null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"childNodes",{get:function(){return this.children},set:function(j){this.children=j},enumerable:!1,configurable:!0}),S}(r);te.NodeWithChildren=c;var u=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.CDATA,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),S}(c);te.CDATA=u;var p=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.Root,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),S}(c);te.Document=p;var g=function(v){n(S,v);function S(j,B,z,ee){z===void 0&&(z=[]),ee===void 0&&(ee=j==="script"?t.ElementType.Script:j==="style"?t.ElementType.Style:t.ElementType.Tag);var b=v.call(this,z)||this;return b.name=j,b.attribs=B,b.type=ee,b}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"tagName",{get:function(){return this.name},set:function(j){this.name=j},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"attributes",{get:function(){var j=this;return Object.keys(this.attribs).map(function(B){var z,ee;return{name:B,value:j.attribs[B],namespace:(z=j["x-attribsNamespace"])===null||z===void 0?void 0:z[B],prefix:(ee=j["x-attribsPrefix"])===null||ee===void 0?void 0:ee[B]}})},enumerable:!1,configurable:!0}),S}(c);te.Element=g;function h(v){return(0,t.isTag)(v)}te.isTag=h;function m(v){return v.type===t.ElementType.CDATA}te.isCDATA=m;function E(v){return v.type===t.ElementType.Text}te.isText=E;function y(v){return v.type===t.ElementType.Comment}te.isComment=y;function N(v){return v.type===t.ElementType.Directive}te.isDirective=N;function T(v){return v.type===t.ElementType.Root}te.isDocument=T;function A(v){return Object.prototype.hasOwnProperty.call(v,"children")}te.hasChildren=A;function k(v,S){S===void 0&&(S=!1);var j;if(E(v))j=new i(v.data);else if(y(v))j=new a(v.data);else if(h(v)){var B=S?D(v.children):[],z=new g(v.name,e({},v.attribs),B);B.forEach(function(w){return w.parent=z}),v.namespace!=null&&(z.namespace=v.namespace),v["x-attribsNamespace"]&&(z["x-attribsNamespace"]=e({},v["x-attribsNamespace"])),v["x-attribsPrefix"]&&(z["x-attribsPrefix"]=e({},v["x-attribsPrefix"])),j=z}else if(m(v)){var B=S?D(v.children):[],ee=new u(B);B.forEach(function(R){return R.parent=ee}),j=ee}else if(T(v)){var B=S?D(v.children):[],b=new p(B);B.forEach(function(R){return R.parent=b}),v["x-mode"]&&(b["x-mode"]=v["x-mode"]),j=b}else if(N(v)){var q=new l(v.name,v.data);v["x-name"]!=null&&(q["x-name"]=v["x-name"],q["x-publicId"]=v["x-publicId"],q["x-systemId"]=v["x-systemId"]),j=q}else throw new Error("Not implemented yet: ".concat(v.type));return j.startIndex=v.startIndex,j.endIndex=v.endIndex,v.sourceCodeLocation!=null&&(j.sourceCodeLocation=v.sourceCodeLocation),j}te.cloneNode=k;function D(v){for(var S=v.map(function(B){return k(B,!0)}),j=1;j<S.length;j++)S[j].prev=S[j-1],S[j-1].next=S[j];return S}return te}var aa;function Io(){return aa||(aa=1,function(n){var e=It&&It.__createBinding||(Object.create?function(l,c,u,p){p===void 0&&(p=u);var g=Object.getOwnPropertyDescriptor(c,u);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,p,g)}:function(l,c,u,p){p===void 0&&(p=u),l[p]=c[u]}),t=It&&It.__exportStar||function(l,c){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&e(c,l,u)};Object.defineProperty(n,"__esModule",{value:!0}),n.DomHandler=void 0;var r=jo(),s=ia();t(ia(),n);var i={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},a=function(){function l(c,u,p){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof u=="function"&&(p=u,u=i),typeof c=="object"&&(u=c,c=void 0),this.callback=c??null,this.options=u??i,this.elementCB=p??null}return l.prototype.onparserinit=function(c){this.parser=c},l.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},l.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},l.prototype.onerror=function(c){this.handleCallback(c)},l.prototype.onclosetag=function(){this.lastNode=null;var c=this.tagStack.pop();this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(c)},l.prototype.onopentag=function(c,u){var p=this.options.xmlMode?r.ElementType.Tag:void 0,g=new s.Element(c,u,void 0,p);this.addNode(g),this.tagStack.push(g)},l.prototype.ontext=function(c){var u=this.lastNode;if(u&&u.type===r.ElementType.Text)u.data+=c,this.options.withEndIndices&&(u.endIndex=this.parser.endIndex);else{var p=new s.Text(c);this.addNode(p),this.lastNode=p}},l.prototype.oncomment=function(c){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=c;return}var u=new s.Comment(c);this.addNode(u),this.lastNode=u},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var c=new s.Text(""),u=new s.CDATA([c]);this.addNode(u),c.parent=u,this.lastNode=c},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(c,u){var p=new s.ProcessingInstruction(c,u);this.addNode(p)},l.prototype.handleCallback=function(c){if(typeof this.callback=="function")this.callback(c,this.dom);else if(c)throw c},l.prototype.addNode=function(c){var u=this.tagStack[this.tagStack.length-1],p=u.children[u.children.length-1];this.options.withStartIndices&&(c.startIndex=this.parser.startIndex),this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),u.children.push(c),p&&(c.prev=p,p.next=c),c.parent=u,this.lastNode=null},l}();n.DomHandler=a,n.default=a}(It)),It}var Ws={},oa;function Bc(){return oa||(oa=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CARRIAGE_RETURN_PLACEHOLDER_REGEX=n.CARRIAGE_RETURN_PLACEHOLDER=n.CARRIAGE_RETURN_REGEX=n.CARRIAGE_RETURN=n.CASE_SENSITIVE_TAG_NAMES_MAP=n.CASE_SENSITIVE_TAG_NAMES=void 0,n.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],n.CASE_SENSITIVE_TAG_NAMES_MAP=n.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),n.CARRIAGE_RETURN="\r",n.CARRIAGE_RETURN_REGEX=new RegExp(n.CARRIAGE_RETURN,"g"),n.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__"),n.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(n.CARRIAGE_RETURN_PLACEHOLDER,"g")}(Ws)),Ws}var la;function qo(){if(la)return jt;la=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.formatAttributes=r,jt.escapeSpecialCharacters=i,jt.revertEscapedCharacters=a,jt.formatDOM=l;var n=Io(),e=Bc();function t(c){return e.CASE_SENSITIVE_TAG_NAMES_MAP[c]}function r(c){for(var u={},p=0,g=c.length;p<g;p++){var h=c[p];u[h.name]=h.value}return u}function s(c){c=c.toLowerCase();var u=t(c);return u||c}function i(c){return c.replace(e.CARRIAGE_RETURN_REGEX,e.CARRIAGE_RETURN_PLACEHOLDER)}function a(c){return c.replace(e.CARRIAGE_RETURN_PLACEHOLDER_REGEX,e.CARRIAGE_RETURN)}function l(c,u,p){u===void 0&&(u=null);for(var g=[],h,m=0,E=c.length;m<E;m++){var y=c[m];switch(y.nodeType){case 1:{var N=s(y.nodeName);h=new n.Element(N,r(y.attributes)),h.children=l(N==="template"?y.content.childNodes:y.childNodes,h);break}case 3:h=new n.Text(a(y.nodeValue));break;case 8:h=new n.Comment(y.nodeValue);break;default:continue}var T=g[m-1]||null;T&&(T.next=h),h.parent=u,h.prev=T,h.next=null,g.push(h)}return p&&(h=new n.ProcessingInstruction(p.substring(0,p.indexOf(" ")).toLowerCase(),p),h.next=g[0]||null,h.parent=u,g.unshift(h),g[1]&&(g[1].prev=g[0])),g}return jt}var ca;function Fc(){if(ca)return _r;ca=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.default=y;var n=qo(),e="html",t="head",r="body",s=/<([a-zA-Z]+[0-9]?)/,i=/<head[^]*>/i,a=/<body[^]*>/i,l=function(N,T){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(N,T){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u=typeof window=="object"&&window.DOMParser;if(typeof u=="function"){var p=new u,g="text/html";c=function(N,T){return T&&(N="<".concat(T,">").concat(N,"</").concat(T,">")),p.parseFromString(N,g)},l=c}if(typeof document=="object"&&document.implementation){var h=document.implementation.createHTMLDocument();l=function(N,T){if(T){var A=h.documentElement.querySelector(T);return A&&(A.innerHTML=N),h}return h.documentElement.innerHTML=N,h}}var m=typeof document=="object"&&document.createElement("template"),E;m&&m.content&&(E=function(N){return m.innerHTML=N,m.content.childNodes});function y(N){var T,A;N=(0,n.escapeSpecialCharacters)(N);var k=N.match(s),D=k&&k[1]?k[1].toLowerCase():"";switch(D){case e:{var v=c(N);if(!i.test(N)){var S=v.querySelector(t);(T=S?.parentNode)===null||T===void 0||T.removeChild(S)}if(!a.test(N)){var S=v.querySelector(r);(A=S?.parentNode)===null||A===void 0||A.removeChild(S)}return v.querySelectorAll(e)}case t:case r:{var j=l(N).querySelectorAll(D);return a.test(N)&&i.test(N)?j[0].parentNode.childNodes:j}default:{if(E)return E(N);var S=l(N,r).querySelector(r);return S.childNodes}}}return _r}var ua;function Uc(){if(ua)return nn;ua=1;var n=nn&&nn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(nn,"__esModule",{value:!0}),nn.default=s;var e=n(Fc()),t=qo(),r=/<(![a-zA-Z\s]+)>/;function s(i){if(typeof i!="string")throw new TypeError("First argument must be a string");if(!i)return[];var a=i.match(r),l=a?a[1]:void 0;return(0,t.formatDOM)((0,e.default)(i),null,l)}return nn}var Or={},Ie={},Dn={},ha;function Hc(){if(ha)return Dn;ha=1;var n=0;Dn.SAME=n;var e=1;return Dn.CAMELCASE=e,Dn.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},Dn}var da;function zc(){if(da)return Ie;da=1;const n=0,e=1,t=2,r=3,s=4,i=5,a=6;function l(v){return u.hasOwnProperty(v)?u[v]:null}function c(v,S,j,B,z,ee,b){this.acceptsBooleans=S===t||S===r||S===s,this.attributeName=B,this.attributeNamespace=z,this.mustUseProperty=j,this.propertyName=v,this.type=S,this.sanitizeURL=ee,this.removeEmptyString=b}const u={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(v=>{u[v]=new c(v,n,!1,v,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([v,S])=>{u[v]=new c(v,e,!1,S,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(v=>{u[v]=new c(v,t,!1,v.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(v=>{u[v]=new c(v,t,!1,v,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(v=>{u[v]=new c(v,r,!1,v.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(v=>{u[v]=new c(v,r,!0,v,null,!1,!1)}),["capture","download"].forEach(v=>{u[v]=new c(v,s,!1,v,null,!1,!1)}),["cols","rows","size","span"].forEach(v=>{u[v]=new c(v,a,!1,v,null,!1,!1)}),["rowSpan","start"].forEach(v=>{u[v]=new c(v,i,!1,v.toLowerCase(),null,!1,!1)});const g=/[\-\:]([a-z])/g,h=v=>v[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(v=>{const S=v.replace(g,h);u[S]=new c(S,e,!1,v,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(v=>{const S=v.replace(g,h);u[S]=new c(S,e,!1,v,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(v=>{const S=v.replace(g,h);u[S]=new c(S,e,!1,v,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(v=>{u[v]=new c(v,e,!1,v.toLowerCase(),null,!1,!1)});const m="xlinkHref";u[m]=new c("xlinkHref",e,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(v=>{u[v]=new c(v,e,!1,v.toLowerCase(),null,!0,!0)});const{CAMELCASE:E,SAME:y,possibleStandardNames:N}=Hc(),A=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",k=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+A+"]*$")),D=Object.keys(N).reduce((v,S)=>{const j=N[S];return j===y?v[S]=S:j===E?v[S.toLowerCase()]=S:v[S]=j,v},{});return Ie.BOOLEAN=r,Ie.BOOLEANISH_STRING=t,Ie.NUMERIC=i,Ie.OVERLOADED_BOOLEAN=s,Ie.POSITIVE_NUMERIC=a,Ie.RESERVED=n,Ie.STRING=e,Ie.getPropertyInfo=l,Ie.isCustomAttribute=k,Ie.possibleStandardNames=D,Ie}var Pn={},rn={},Ks,fa;function Gc(){if(fa)return Ks;fa=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
23
- `,u="/",p="*",g="",h="comment",m="declaration";Ks=function(y,N){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];N=N||{};var T=1,A=1;function k(w){var R=w.match(e);R&&(T+=R.length);var M=w.lastIndexOf(c);A=~M?w.length-M:A+w.length}function D(){var w={line:T,column:A};return function(R){return R.position=new v(w),B(),R}}function v(w){this.start=w,this.end={line:T,column:A},this.source=N.source}v.prototype.content=y;function S(w){var R=new Error(N.source+":"+T+":"+A+": "+w);if(R.reason=w,R.filename=N.source,R.line=T,R.column=A,R.source=y,!N.silent)throw R}function j(w){var R=w.exec(y);if(R){var M=R[0];return k(M),y=y.slice(M.length),R}}function B(){j(t)}function z(w){var R;for(w=w||[];R=ee();)R!==!1&&w.push(R);return w}function ee(){var w=D();if(!(u!=y.charAt(0)||p!=y.charAt(1))){for(var R=2;g!=y.charAt(R)&&(p!=y.charAt(R)||u!=y.charAt(R+1));)++R;if(R+=2,g===y.charAt(R-1))return S("End of comment missing");var M=y.slice(2,R-2);return A+=2,k(M),y=y.slice(R),A+=2,w({type:h,comment:M})}}function b(){var w=D(),R=j(r);if(R){if(ee(),!j(s))return S("property missing ':'");var M=j(i),I=w({type:m,property:E(R[0].replace(n,g)),value:M?E(M[0].replace(n,g)):g});return j(a),I}}function q(){var w=[];z(w);for(var R;R=b();)R!==!1&&(w.push(R),z(w));return w}return B(),q()};function E(y){return y?y.replace(l,g):g}return Ks}var pa;function Vc(){if(pa)return rn;pa=1;var n=rn&&rn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rn,"__esModule",{value:!0}),rn.default=t;var e=n(Gc());function t(r,s){var i=null;if(!r||typeof r!="string")return i;var a=(0,e.default)(r),l=typeof s=="function";return a.forEach(function(c){if(c.type==="declaration"){var u=c.property,p=c.value;l?s(u,p,c):p&&(i=i||{},i[u]=p)}}),i}return rn}var $n={},ga;function Wc(){if(ga)return $n;ga=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||n.test(u)},a=function(u,p){return p.toUpperCase()},l=function(u,p){return"".concat(p,"-")},c=function(u,p){return p===void 0&&(p={}),i(u)?u:(u=u.toLowerCase(),p.reactCompat?u=u.replace(s,l):u=u.replace(r,l),u.replace(e,a))};return $n.camelCase=c,$n}var Bn,ma;function Kc(){if(ma)return Bn;ma=1;var n=Bn&&Bn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=n(Vc()),t=Wc();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(a[(0,t.camelCase)(l,i)]=c)}),a}return r.default=r,Bn=r,Bn}var ba;function Mo(){return ba||(ba=1,function(n){var e=Pn&&Pn.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(n,"__esModule",{value:!0}),n.returnFirstArg=n.canTextBeChildOfNode=n.ELEMENTS_WITH_NO_TEXT_CHILDREN=n.PRESERVE_CUSTOM_ATTRIBUTES=void 0,n.isCustomComponent=i,n.setStyleProp=l;var t=_,r=e(Kc()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function i(p,g){return p.includes("-")?!s.has(p):!!(g&&typeof g.is=="string")}var a={reactCompat:!0};function l(p,g){if(typeof p=="string"){if(!p.trim()){g.style={};return}try{g.style=(0,r.default)(p,a)}catch{g.style={}}}}n.PRESERVE_CUSTOM_ATTRIBUTES=Number(t.version.split(".")[0])>=16,n.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var c=function(p){return!n.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(p.name)};n.canTextBeChildOfNode=c;var u=function(p){return p};n.returnFirstArg=u}(Pn)),Pn}var va;function Do(){if(va)return Or;va=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.default=i;var n=zc(),e=Mo(),t=["checked","value"],r=["input","select","textarea"],s={reset:!0,submit:!0};function i(l,c){l===void 0&&(l={});var u={},p=!!(l.type&&s[l.type]);for(var g in l){var h=l[g];if((0,n.isCustomAttribute)(g)){u[g]=h;continue}var m=g.toLowerCase(),E=a(m);if(E){var y=(0,n.getPropertyInfo)(E);switch(t.includes(E)&&r.includes(c)&&!p&&(E=a("default"+m)),u[E]=h,y&&y.type){case n.BOOLEAN:u[E]=!0;break;case n.OVERLOADED_BOOLEAN:h===""&&(u[E]=!0);break}continue}e.PRESERVE_CUSTOM_ATTRIBUTES&&(u[g]=h)}return(0,e.setStyleProp)(l.style,u),u}function a(l){return n.possibleStandardNames[l]}return Or}var sn={},ya;function Yc(){if(ya)return sn;ya=1;var n=sn&&sn.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(sn,"__esModule",{value:!0}),sn.default=i;var e=_,t=n(Do()),r=Mo(),s={cloneElement:e.cloneElement,createElement:e.createElement,isValidElement:e.isValidElement};function i(l,c){c===void 0&&(c={});for(var u=[],p=typeof c.replace=="function",g=c.transform||r.returnFirstArg,h=c.library||s,m=h.cloneElement,E=h.createElement,y=h.isValidElement,N=l.length,T=0;T<N;T++){var A=l[T];if(p){var k=c.replace(A,T);if(y(k)){N>1&&(k=m(k,{key:k.key||T})),u.push(g(k,A,T));continue}}if(A.type==="text"){var D=!A.data.trim().length;if(D&&A.parent&&!(0,r.canTextBeChildOfNode)(A.parent)||c.trim&&D)continue;u.push(g(A.data,A,T));continue}var v=A,S={};a(v)?((0,r.setStyleProp)(v.attribs.style,v.attribs),S=v.attribs):v.attribs&&(S=(0,t.default)(v.attribs,v.name));var j=void 0;switch(A.type){case"script":case"style":A.children[0]&&(S.dangerouslySetInnerHTML={__html:A.children[0].data});break;case"tag":A.name==="textarea"&&A.children[0]?S.defaultValue=A.children[0].data:A.children&&A.children.length&&(j=i(A.children,c));break;default:continue}N>1&&(S.key=T),u.push(g(E(A.name,S,j),A,T))}return u.length===1?u[0]:u}function a(l){return r.PRESERVE_CUSTOM_ATTRIBUTES&&l.type==="tag"&&(0,r.isCustomComponent)(l.name,l.attribs)}return sn}var xa;function Xc(){return xa||(xa=1,function(n){var e=Mn&&Mn.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(n,"__esModule",{value:!0}),n.htmlToDOM=n.domToReact=n.attributesToProps=n.Text=n.ProcessingInstruction=n.Element=n.Comment=void 0,n.default=l;var t=e(Uc());n.htmlToDOM=t.default;var r=e(Do());n.attributesToProps=r.default;var s=e(Yc());n.domToReact=s.default;var i=Io();Object.defineProperty(n,"Comment",{enumerable:!0,get:function(){return i.Comment}}),Object.defineProperty(n,"Element",{enumerable:!0,get:function(){return i.Element}}),Object.defineProperty(n,"ProcessingInstruction",{enumerable:!0,get:function(){return i.ProcessingInstruction}}),Object.defineProperty(n,"Text",{enumerable:!0,get:function(){return i.Text}});var a={lowerCaseAttributeNames:!1};function l(c,u){if(typeof c!="string")throw new TypeError("First argument must be a string");return c?(0,s.default)((0,t.default)(c,u?.htmlparser2||a),u):[]}}(Mn)),Mn}var Zc=Xc();const Ea=Oi(Zc),Jc=Ea.default||Ea,Qc=({type:n,text:e})=>{const[t,r]=_.useState(!0),s=_.useRef(null),i=_.useRef(null),a=()=>{i.current&&(i.current.style.transition="opacity 0.4s",i.current.style.opacity="0"),s.current=window.setTimeout(()=>{r(!t)},500)};return _.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),t?d.jsxs("div",{ref:i,className:`alert ${n}`,role:"alert",children:[d.jsx("p",{children:Jc(e)}),d.jsx("button",{className:"close",type:"button","data-toggle":"close",onClick:a,children:d.jsx(ko,{})})]}):null},Po=({children:n,className:e="",...t})=>d.jsx("div",{className:`modal-header ${e}`,...t,children:n}),$o=({children:n,className:e="",...t})=>d.jsx("div",{className:`modal-body ${e}`,...t,children:n}),Bo=({children:n,className:e="",...t})=>d.jsx("div",{className:`modal-footer ${e}`,...t,children:n}),Fo=({children:n,className:e="",...t})=>(_.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]),nr.createPortal(d.jsx("div",{className:"modal",...t,children:d.jsx("div",{className:`modal-dialog ${e}`,children:n})}),document.body)),eu=({labelIcon:n,label:e="Confirmation",message:t,onCancel:r,onConfirm:s})=>d.jsxs(Fo,{className:"modal-sm",children:[d.jsxs(Po,{className:"bg-danger",children:[d.jsxs("div",{className:"modal-header-title",children:[n||d.jsx(hi,{className:"icon"}),d.jsx("span",{children:e})]}),d.jsx("div",{className:"tools",children:d.jsx(ko,{className:"icon",onClick:r})})]}),d.jsx($o,{children:d.jsx("p",{children:t})}),d.jsxs(Bo,{className:"justify-content-space-between",children:[d.jsxs(Pe,{type:"button",className:"btn btn-default",onClick:r,children:[d.jsx(kc,{})," Batalkan"]}),d.jsxs(Pe,{type:"button",className:"btn btn-primary",onClick:s,children:[d.jsx(hi,{})," Konfirmasi"]})]})]}),tu=({className:n="",type:e,title:t,text:r})=>d.jsxs("div",{className:`callout ${e} ${n}`,children:[t&&d.jsx("h5",{children:t}),typeof r=="string"?d.jsx("p",{children:r}):r]}),nu=({children:n,text:e,position:t="top",className:r="",offset:s=5})=>{const[i,a]=_.useState(!1),[l,c]=_.useState({top:0,left:0}),u=_.useRef(null),p=_.useRef(null);return _.useEffect(()=>{if(i&&u.current&&p.current){const g=u.current.getBoundingClientRect(),h=p.current.getBoundingClientRect(),{scrollX:m,scrollY:E}=window;let y=0,N=0;switch(t){case"top":y=g.top-h.height-s,N=g.left+(g.width-h.width)/2;break;case"bottom":y=g.bottom+s,N=g.left+(g.width-h.width)/2;break;case"left":y=g.top+(g.height-h.height)/2,N=g.left-h.width-s;break;case"right":y=g.top+(g.height-h.height)/2,N=g.right+s;break}c({top:Math.round(y+E),left:Math.round(N+m)})}},[i,t,s]),d.jsxs("div",{ref:u,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[n,i&&nr.createPortal(d.jsx("div",{ref:p,style:{position:"absolute",top:`${l.top}px`,left:`${l.left}px`},className:`tooltip ${t} ${r}`,children:e}),document.body)]})},ru=({className:n,children:e,text:t,title:r,dismissible:s=!0})=>{const[i,a]=_.useState(!1),[l,c]=_.useState({top:0,left:0}),u=_.useRef(null),p=_.useRef(null);wt([u,p],()=>{s&&a(!1)}),_.useEffect(()=>{if(i&&u.current&&p.current){const h=u.current.getBoundingClientRect(),m=p.current.getBoundingClientRect(),{scrollX:E,scrollY:y}=window;let N=0,T=0;n.includes("top")?(N=h.top-m.height-10,T=h.left+(h.width-m.width)/2):n.includes("bottom")?(N=h.bottom+10,T=h.left+(h.width-m.width)/2):n.includes("left")?(N=h.top+(h.height-m.height)/2,T=h.left-m.width-10):n.includes("right")&&(N=h.top+(h.height-m.height)/2,T=h.right+10),c({top:Math.round(N+y),left:Math.round(T+E)})}},[i,n]);function g(){a(!i)}return d.jsxs("div",{ref:u,onClick:g,children:[e,i&&nr.createPortal(d.jsxs("div",{ref:p,className:`popover ${n}`,role:"tooltip",style:{position:"absolute",top:`${l.top}px`,left:`${l.left}px`},children:[d.jsx("div",{className:"arrow"}),r&&d.jsx("h3",{className:"popover-title",children:r}),d.jsx("div",{className:"popover-content",children:t})]}),document.body)]})},su=({defaultIndex:n=null,alwaysOpen:e=!1,flush:t=!1,children:r})=>{const[s,i]=_.useState(n!==null?[n]:[]),a=l=>{i(e?c=>c.includes(l)?c.filter(u=>u!==l):[...c,l]:c=>c.includes(l)?[]:[l])};return d.jsx("div",{className:`accordion ${t?"accordion-flush":""}`,children:_.Children.map(r,(l,c)=>_.cloneElement(l,{isOpen:s.includes(c),onClick:()=>a(c)}))})},iu=({title:n,titleIcon:e,children:t,isOpen:r=!1,onClick:s})=>{const i=_.useRef(null),[a,l]=_.useState(0);_.useEffect(()=>{i.current&&l(i.current.scrollHeight)},[t]);const c=_.Children.toArray(t).find(p=>p.type===Uo),u=_.Children.toArray(t).find(p=>p.type===Ho);return d.jsxs("div",{className:"accordion-item",children:[d.jsxs("div",{className:"accordion-header",role:"button",tabIndex:0,onClick:s,onKeyDown:s,children:[d.jsxs("div",{className:"accordion-title",children:[e,d.jsx("span",{children:n})]}),d.jsx(Kn,{className:`accordion-icon ${r?"active":""}`})]}),d.jsxs("div",{ref:i,className:`accordion-collapse ${r?"show":""}`,style:{maxHeight:r?`${a}px`:"0px"},children:[c,u]})]})},Uo=({className:n="",children:e})=>d.jsx("div",{className:`accordion-body ${n}`,children:e}),Ho=({className:n="",children:e})=>d.jsx("div",{className:`accordion-footer ${n}`,children:e}),au=({size:n=40,className:e="",color:t})=>d.jsx("span",{className:`circular-progress ${e} ${t?`brand-${t}`:""}`,style:{width:`${n}px`,height:`${n}px`}}),ou=({showLabel:n=!1,progress:e=0,className:t="",color:r})=>{const s=t.includes("indeterminate");return d.jsxs("div",{className:`linear-progress ${t}`,children:[d.jsx("div",{className:`progress-bar ${r?`brand-${r}`:""}`,children:d.jsx("span",{className:"progress",style:{width:`${e}%`}})}),n&&!s&&d.jsxs("span",{className:"progress-label",children:[e,"%"]})]})},lu=({progress:n=0,size:e=40,className:t="",color:r,strokeWidth:s=4})=>{const[i,a]=_.useState(0);return _.useEffect(()=>{if(i<n){const l=setTimeout(()=>{a(i+1)},10);return()=>clearTimeout(l)}},[i,n]),d.jsxs("div",{className:`circular-progress-with-label ${t}`,children:[d.jsx("span",{className:`progress ${r?`brand-${r}`:""}`,style:{width:`${e}px`,height:`${e}px`,borderWidth:`${s}px`,background:r?`radial-gradient(closest-side, var(--secondary-bg) 79%, transparent 80% 100%), conic-gradient(var(--brand-${r}) ${i}%, var(--primary-bg) 0)`:`radial-gradient(closest-side, var(--secondary-bg) 79%, transparent 80% 100%), conic-gradient(#888 ${i}%, var(--primary-bg) 0)`}}),d.jsxs("span",{className:"progress-label",children:[i,"%"]})]})},ye=[];for(let n=0;n<256;++n)ye.push((n+256).toString(16).slice(1));function cu(n,e=0){return(ye[n[e+0]]+ye[n[e+1]]+ye[n[e+2]]+ye[n[e+3]]+"-"+ye[n[e+4]]+ye[n[e+5]]+"-"+ye[n[e+6]]+ye[n[e+7]]+"-"+ye[n[e+8]]+ye[n[e+9]]+"-"+ye[n[e+10]]+ye[n[e+11]]+ye[n[e+12]]+ye[n[e+13]]+ye[n[e+14]]+ye[n[e+15]]).toLowerCase()}let Ys;const uu=new Uint8Array(16);function hu(){if(!Ys){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ys=crypto.getRandomValues.bind(crypto)}return Ys(uu)}const du=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Na={randomUUID:du};function zo(n,e,t){if(Na.randomUUID&&!n)return Na.randomUUID();n=n||{};const r=n.random??n.rng?.()??hu();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,cu(r)}const Ri=_.forwardRef(({name:n,label:e,message:t,error:r,checked:s=!1,onChange:i,...a},l)=>{const c=zo(),u=p=>{i(p)};return d.jsxs(d.Fragment,{children:[d.jsxs("label",{className:"custom-checkbox",htmlFor:c,children:[d.jsx("input",{type:"checkbox",id:c,name:n,ref:l,role:"checkbox",checked:s,onChange:u,...a}),d.jsx("span",{className:"checkmark"}),e&&d.jsx("span",{className:a.required?"required":"",children:e})]}),r?d.jsx("small",{className:"form-message text-danger",children:r}):t&&d.jsx("small",{className:"form-message",children:t})]})});Ri.displayName="Checkbox";const fu=({children:n})=>d.jsx("div",{className:"form",children:n}),pu=({className:n="",children:e})=>d.jsx("div",{className:`form-group ${n}`,children:e}),gu=({className:n="",children:e})=>d.jsx("div",{className:`form-checkbox ${n}`,children:e}),mu=({className:n="",children:e})=>d.jsx("div",{className:`form-radio ${n}`,children:e});function bu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM9 14H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm-8 4H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2z"},child:[]}]})(n)}function vu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]},{tag:"path",attr:{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},child:[]}]})(n)}function yu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"},child:[]}]})(n)}function xu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(n)}const Li=(n,e)=>{_.useEffect(()=>{if(n&&e.current){const t=e.current.getBoundingClientRect(),r=window.innerHeight;t.bottom>r?e.current.classList.add("position-top"):e.current.classList.remove("position-top");const s=e.current.querySelector(".option.selected");s&&s.scrollIntoView({block:"nearest"})}},[n,e])},Qe=_.forwardRef((n,e)=>{const{className:t="",id:r,name:s,label:i,message:a,selectLabel:l="Select an option",size:c="md",floatingLabel:u=!1,error:p,options:g,value:h="",onChange:m,onBlur:E,required:y,disabled:N}=n,T=r||s,[A,k]=_.useState(!1),D=_.useRef(null),v=_.useRef(null),S=_.useRef(null),j=g.find(z=>z.value===h)?.label??l;_.useImperativeHandle(e,()=>S.current),_.useEffect(()=>k(!1),[]),wt([D],()=>{k(!1),S.current?.blur()}),Li(A,v);const B=z=>{const ee=g.find(w=>w.value===z);if(!ee)return;const b=ee.value;if(m?.({target:{name:s,value:b,type:"select-one"},currentTarget:{name:s,value:b}}),S.current){S.current.value=String(b);const w=new CustomEvent("change",{bubbles:!0,detail:{originalValue:b}});S.current.dispatchEvent(w)}k(!1)};return d.jsxs(d.Fragment,{children:[!u&&i&&d.jsxs("label",{htmlFor:T,children:[i," ",y&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsxs("select",{ref:S,name:s,value:h!=null&&!Number.isNaN(h)?h:"",onChange:m,onBlur:E,required:y,disabled:N,style:{position:"absolute",left:"-9999px"},tabIndex:-1,children:[d.jsx("option",{value:"",children:"Select an option"}),g.map(z=>d.jsx("option",{value:String(z.value),children:z.label},z.value))]}),d.jsxs("div",{className:`dropdown-select-container ${t} ${c}`,ref:D,children:[d.jsxs("div",{className:`dropdown-header ${A?"open":""} ${N?"disabled":""}`,onClick:()=>!N&&k(!A),"aria-haspopup":"listbox","aria-expanded":A,children:[d.jsx("span",{className:"label",children:j}),d.jsx(Kn,{className:"arrow"})]}),A&&d.jsx("div",{className:"dropdown-options scrollbar",ref:v,role:"listbox",children:g.map(z=>d.jsx("div",{className:`option ${z.value===h?"selected":""}`,onClick:()=>B(z.value),role:"option","aria-selected":z.value===h,children:z.label},z.value))})]}),u&&i&&d.jsxs("label",{htmlFor:T,children:[i," ",y&&d.jsx("span",{className:"text-danger",children:"*"})]}),p?d.jsx("small",{className:"form-message text-danger",children:p}):a&&d.jsx("small",{className:"form-message",children:a})]})});Qe.displayName="Select";const Go=n=>{const[e,t]=_.useState(!1);return _.useEffect(()=>{const r=()=>{if(!n.current)return;const{top:i,height:a}=n.current.getBoundingClientRect(),l=window.innerHeight;t(i+a>l)};r();const s=()=>{r()};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[n]),e},Vo=n=>{const e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`},Eu=n=>n.toLocaleDateString("id-ID",{timeZone:"Asia/Jakarta",year:"numeric",month:"long",day:"numeric"}),Yn=(n,e)=>Array.from({length:n},(t,r)=>e(r)),Rr=(n,e)=>{const t=new Date(e,n,1).getDay(),r=new Date(e,n+1,0).getDate(),s=Yn(t,()=>({value:"",label:""})),i=Yn(r,a=>({value:(a+1).toString(),label:(a+1).toString()}));return[...s,...i]},Nu=(n,e)=>{const t=new Date(e,n+1,0).getDate();return Yn(t,r=>({value:(r+1).toString(),label:(r+1).toString()}))},Wo=(n="id-ID")=>Yn(12,e=>({value:(e+1).toString(),label:new Date(2024,e,1).toLocaleString(n,{month:"long"})})),Ko=()=>{const n=new Date().getFullYear(),e=n-60,r=n+20-e+1;return Yn(r,s=>{const i=e+s;return{value:i.toString(),label:i.toString()}})},wa=n=>{const e=new Date(n);return e instanceof Date&&!isNaN(e.getTime())},wu=["Min","Sen","Sel","Rab","Kam","Jum","Sab"],Tu=n=>{const[e,t]=_.useState(n);return{selectedDate:e,handlePrevMonth:()=>{const c=new Date(e);c.setMonth(e.getMonth()-1),t(c)},handleNextMonth:()=>{const c=new Date(e);c.setMonth(e.getMonth()+1),t(c)},handleDateClick:(c,u,p,g)=>{const h=new Date(parseInt(p,10),parseInt(u,10),parseInt(c,10));t(h),g(Vo(h))},isSelectedDate:(c,u,p)=>parseInt(p,10)===e.getFullYear()&&parseInt(u,10)===e.getMonth()+1&&parseInt(c,10)===e.getDate(),setDate:c=>{t(c)}}},Yo=({onSelect:n,defaultDate:e,full:t=!1})=>{const r=_.useRef(null),s=Go(r),i=wa(e)?new Date(e):new Date,{selectedDate:a,handlePrevMonth:l,handleNextMonth:c,handleDateClick:u,isSelectedDate:p,setDate:g}=Tu(i),[h,m]=_.useState(Rr(i.getMonth(),i.getFullYear()));_.useEffect(()=>{if(e&&wa(e)){const y=new Date(e);g(y)}},[e,g]),_.useEffect(()=>{m(Rr(a.getMonth(),a.getFullYear()))},[a]);const E=(y,N)=>{const T=parseInt(y,10),A=T+1;return h.map((k,D)=>k.value!==""?d.jsx("div",{className:`calendar-day ${p(k.value,A.toString(),N)?"selected-date":""}`,onClick:()=>{const v=new Date(parseInt(N,10),T,parseInt(k.value,10)),S=t?Eu(v):Vo(v);u(k.value,y,N,()=>n(S))},children:k.label},`day-${D}`):d.jsx("div",{className:"calendar-day empty"},`day-${D}`))};return d.jsxs("div",{className:`date-picker shadow-sm ${s?"position-top":""}`,ref:r,children:[d.jsxs("div",{className:"calendar-nav",children:[d.jsx("button",{type:"button",className:"btn rounded-circle",onClick:l,children:d.jsx(yu,{size:16})}),d.jsxs("div",{className:"calendar-select",children:[d.jsx(Qe,{className:"select-month",name:"month",size:"sm",options:Wo(),value:(a.getMonth()+1).toString(),onChange:y=>{const N=parseInt(y.target.value,10)-1,T=new Date(a.getFullYear(),N,a.getDate());g(T),m(Rr(N,T.getFullYear()))}}),d.jsx(Qe,{className:"select-year",name:"year",size:"sm",options:Ko(),value:a.getFullYear().toString(),onChange:y=>{const N=parseInt(y.target.value,10),T=new Date(N,a.getMonth(),a.getDate());g(T),m(Rr(T.getMonth(),N))}})]}),d.jsx("button",{type:"button",className:"btn rounded-circle",onClick:c,children:d.jsx(xu,{size:16})})]}),d.jsxs("div",{className:"calendar",children:[d.jsx("div",{className:"calendar-header",children:wu.map((y,N)=>d.jsx("div",{className:"calendar-day-name",children:y},`day-${N}`))}),d.jsx("div",{className:"calendar-body",children:E(a.getMonth().toString(),a.getFullYear().toString())})]})]})},Xo=_.forwardRef(({name:n,label:e,message:t,floatingLabel:r,locale:s="id",error:i,value:a,...l},c)=>{const u=A=>{if(!A)return new Date;const k=new Date(A);return isNaN(k.getTime())?new Date:k},p=u(a),[g,h]=_.useState({day:p.getDate(),month:p.getMonth()+1,year:p.getFullYear()});_.useEffect(()=>{if(a){const A=u(a);h({day:A.getDate(),month:A.getMonth()+1,year:A.getFullYear()})}},[a]),_.useEffect(()=>{const A=new Date(g.year,g.month,0).getDate();g.day>A&&h(k=>({...k,day:A}))},[g.month,g.year]);const m=(A,k)=>{const D=parseInt(k,10);if(isNaN(D))return;const v={...g,[A]:D};if(h(v),l.onChange){const S=`${v.year}-${String(v.month).padStart(2,"0")}-${String(v.day).padStart(2,"0")}`;l.onChange({target:{name:n,value:S}})}},E=_.useMemo(()=>Nu(g.month-1,g.year),[g.month,g.year]),y=_.useMemo(()=>Wo(s),[s]),N=_.useMemo(()=>Ko(),[]),T=d.jsxs("label",{htmlFor:n,children:[e," ",l.required&&d.jsx("span",{className:"text-danger",children:"*"})]});return d.jsxs(d.Fragment,{children:[!r&&T,d.jsxs("div",{className:"row",ref:c,children:[d.jsx("div",{className:"col-md-3",children:d.jsx(Qe,{name:`${n}-day`,disabled:l.disabled,options:E,value:g.day.toString(),onChange:A=>m("day",A.target.value),"aria-label":"Day"})}),d.jsx("div",{className:"col-md-5",children:d.jsx(Qe,{name:`${n}-month`,disabled:l.disabled,options:y,value:g.month.toString(),onChange:A=>m("month",A.target.value),"aria-label":"Month"})}),d.jsx("div",{className:"col-md-4",children:d.jsx(Qe,{name:`${n}-year`,disabled:l.disabled,options:N,value:g.year.toString(),onChange:A=>m("year",A.target.value),"aria-label":"Year"})})]}),r&&T,i?d.jsx("small",{className:"form-message text-danger",children:i}):t&&d.jsx("small",{className:"form-message",children:t})]})});Xo.displayName="DropdownDatePicker";const Zo=({onSelect:n,defaultTime:e,format24:t=!0})=>{const r=_.useRef(null),s=Go(r),i=T=>{if(T){const[k,D]=T.split(":");return{hours:parseInt(k,10),minutes:parseInt(D,10)}}const A=new Date;return{hours:A.getHours(),minutes:A.getMinutes()}},a=i(e),[l,c]=_.useState(a.hours),[u,p]=_.useState(a.minutes);_.useEffect(()=>{if(e){const T=i(e);c(T.hours),p(T.minutes)}},[e]);const g=()=>{const T=[],A=t?23:12,k=t?0:1;for(let D=k;D<=A;D++){const v=D.toString().padStart(2,"0");T.push({value:v,label:v})}return T},h=()=>{const T=[];for(let A=0;A<60;A++){const k=A.toString().padStart(2,"0");T.push({value:k,label:k})}return T},m=(T,A)=>{const k=T.toString().padStart(2,"0"),D=A.toString().padStart(2,"0");return`${k}:${D}`},E=T=>{const A=parseInt(T.target.value,10);c(A)},y=T=>{const A=parseInt(T.target.value,10);p(A)},N=()=>{const T=m(l,u);n(T)};return d.jsxs("div",{className:`time-picker shadow-sm ${s?"position-top":""}`,ref:r,children:[d.jsx("div",{className:"time-picker-header",children:d.jsx("h6",{className:"mb-0",children:"Pilih Waktu"})}),d.jsx("div",{className:"time-picker-body",children:d.jsxs("div",{className:"time-select-group",children:[d.jsxs("div",{className:"time-select-item",children:[d.jsx("label",{className:"time-label",children:"Jam"}),d.jsx(Qe,{className:"select-hour",name:"hour",size:"sm",options:g(),value:l.toString().padStart(2,"0"),onChange:E})]}),d.jsx("div",{className:"time-separator",children:":"}),d.jsxs("div",{className:"time-select-item",children:[d.jsx("label",{className:"time-label",children:"Menit"}),d.jsx(Qe,{className:"select-minute",name:"minute",size:"sm",options:h(),value:u.toString().padStart(2,"0"),onChange:y})]})]})}),d.jsx("div",{className:"time-picker-footer",children:d.jsx("button",{type:"button",className:"btn btn-primary btn-sm w-100",onClick:N,children:"Pilih"})})]})},Au=({type:n="text",className:e,...t})=>d.jsx("input",{type:n,className:`clear ${e}`,...t}),di=_.forwardRef(({className:n="",name:e,label:t,message:r,floatingLabel:s,error:i,id:a,...l},c)=>{const u=a||e;return d.jsxs(d.Fragment,{children:[!s&&t&&d.jsxs("label",{htmlFor:u,children:[t," ",l.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsx("input",{type:"text",className:`form-control ${n}`,id:u,name:e,placeholder:s?"":" ",ref:c,...l}),s&&t&&d.jsxs("label",{htmlFor:u,children:[t," ",l.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),i?d.jsx("small",{className:"form-message text-danger",children:i}):r&&d.jsx("small",{className:"form-message",children:r})]})}),Su=_.forwardRef(({className:n,name:e,label:t,message:r,floatingLabel:s,error:i,actionIcon:a,actionButtonLabel:l,actionButtonHandler:c,...u},p)=>d.jsxs(d.Fragment,{children:[!s&&t&&d.jsxs("label",{htmlFor:e,children:[t," ",u.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsxs("div",{className:"input-group-icon",children:[d.jsx("input",{type:"text",className:`form-control pr-35 ${n}`,id:e,name:e,placeholder:s?"":" ",ref:p,...u}),a&&d.jsx(Pe,{role:"button",className:"icon",onClick:c,tabIndex:0,"aria-label":l,disabled:u.disabled,children:a})]}),s&&t&&d.jsxs("label",{htmlFor:e,children:[t," ",u.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),i?d.jsx("small",{className:"form-message text-danger",children:i}):r&&d.jsx("small",{className:"form-message",children:r})]})),Jo=_.forwardRef(({name:n,label:e,message:t,floatingLabel:r,full:s,error:i,onChange:a,value:l,...c},u)=>{const[p,g]=_.useState(!1),h=_.useRef(null),m=_.useRef(null);_.useImperativeHandle(u,()=>h.current),_.useEffect(()=>{l!==void 0&&h.current&&(h.current.value=l)},[l]);const E=y=>{h.current&&(h.current.value=y,a?.({target:h.current,currentTarget:h.current}),g(!1))};return wt([m],()=>g(!1)),d.jsxs(d.Fragment,{children:[!r&&e&&d.jsxs("label",{htmlFor:n,children:[e," ",c.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsxs("div",{className:"input-group-icon",children:[d.jsx("input",{type:"text",className:"form-control",id:n,name:n,placeholder:r?"":" ",ref:h,onChange:a,...c}),d.jsx(Pe,{role:"button",className:"icon",onClick:y=>{y.stopPropagation(),g(N=>!N)},"aria-label":"Open date picker",disabled:c.disabled,children:d.jsx(bu,{})})]}),d.jsx("div",{ref:m,className:`date-picker-container ${p?"show":"hide"}`,style:{display:p?"block":"none"},children:d.jsx(Yo,{full:s,onSelect:E,defaultDate:l||void 0})}),r&&e&&d.jsxs("label",{htmlFor:n,children:[e," ",c.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),i?d.jsx("small",{className:"form-message text-danger",children:i}):t&&d.jsx("small",{className:"form-message",children:t})]})});Jo.displayName="InputDate";const Qo=_.forwardRef(({name:n,label:e,message:t,floatingLabel:r,format24:s=!0,error:i,onChange:a,value:l,...c},u)=>{const[p,g]=_.useState(!1),h=_.useRef(null),m=_.useRef(null);_.useImperativeHandle(u,()=>h.current),_.useEffect(()=>{l!==void 0&&h.current&&(h.current.value=l)},[l]);const E=y=>{h.current&&(h.current.value=y,a?.({target:h.current,currentTarget:h.current}),g(!1))};return wt([m],()=>g(!1)),d.jsxs(d.Fragment,{children:[!r&&e&&d.jsxs("label",{htmlFor:n,children:[e," ",c.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsxs("div",{className:"input-group-icon",children:[d.jsx("input",{type:"text",className:"form-control",id:n,name:n,placeholder:r?"":" ",ref:h,onChange:a,...c}),d.jsx(Pe,{role:"button",className:"icon",onClick:y=>{y.stopPropagation(),g(N=>!N)},"aria-label":"Open time picker",disabled:c.disabled,children:d.jsx(vu,{})})]}),d.jsx("div",{ref:m,className:`time-picker-container ${p?"show":"hide"}`,style:{display:p?"block":"none"},children:d.jsx(Zo,{format24:s,onSelect:E,defaultTime:l||void 0})}),r&&e&&d.jsxs("label",{htmlFor:n,children:[e," ",c.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),i?d.jsx("small",{className:"form-message text-danger",children:i}):t&&d.jsx("small",{className:"form-message",children:t})]})});Qo.displayName="InputTime";const el=_.forwardRef(({className:n,name:e,label:t,message:r,accept:s,floatingLabel:i,error:a,onChange:l,id:c,...u},p)=>{const g=c||e,h=m=>{l&&l(m)};return d.jsxs(d.Fragment,{children:[!i&&t&&d.jsxs("label",{htmlFor:g,children:[t," ",u.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsx("input",{type:"file",className:`form-control ${n||""}`,id:g,name:e,accept:s,onChange:h,ref:p,...u}),i&&t&&d.jsxs("label",{htmlFor:g,children:[t," ",u.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),a?d.jsx("small",{className:"form-message text-danger",children:a}):r&&d.jsx("small",{className:"form-message",children:r})]})});el.displayName="InputFile";const Cu=()=>d.jsx("div",{children:"InputImageSize"}),tl=_.forwardRef(({className:n,name:e,label:t,message:r,floatingLabel:s,error:i,id:a,...l},c)=>{const u=a||e;return d.jsxs(d.Fragment,{children:[!s&&t&&d.jsxs("label",{htmlFor:u,children:[t," ",l.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsx("textarea",{className:`form-control ${n||""}`,id:u,name:e,placeholder:s?"":" ",ref:c,...l}),s&&t&&d.jsxs("label",{htmlFor:u,children:[t," ",l.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),i?d.jsx("small",{className:"form-message text-danger",children:i}):r&&d.jsx("small",{className:"form-message",children:r})]})});tl.displayName="InputTextArea";const nl=_.forwardRef(({className:n,name:e,label:t,message:r,options:s,error:i,...a},l)=>d.jsxs(d.Fragment,{children:[t&&d.jsxs("label",{htmlFor:e,children:[t," ",a.required&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsx("div",{className:`form-control ${n||""}`,children:s.map(c=>{const u=`${zo()}-${c.value}`;return d.jsxs("div",{className:"d-flex align-items-center",children:[d.jsx("input",{type:"radio",id:u,name:e,value:c.value,ref:l,...a}),d.jsx("label",{htmlFor:u,children:c.label})]},c.value)})}),i?d.jsx("small",{className:"form-message text-danger",children:i}):r&&d.jsx("small",{className:"form-message",children:r})]}));nl.displayName="Radio";const rl=_.forwardRef(({name:n,label:e,message:t,size:r="md",options:s,selectedValue:i,error:a,required:l,...c},u)=>d.jsxs(d.Fragment,{children:[e&&d.jsxs("label",{htmlFor:n,children:[e," ",l&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsx("div",{className:"btn-group","data-toggle":"buttons",children:s.map(p=>{const g=p.value.toString()===i?.toString();return d.jsxs("label",{className:`btn auto btn-default btn-${r} ${g?"active":""}`,children:[d.jsx("input",{type:"radio",id:p.value.toString(),name:n,value:p.value.toString(),ref:u,...c}),d.jsx("span",{children:p.label})]},p.value.toString())})}),a?d.jsx("small",{className:"form-message text-danger",children:a}):t&&d.jsx("small",{className:"form-message",children:t})]}));rl.displayName="RadioButtonGroup";const sl=_.forwardRef(({name:n,label:e,message:t,selectLabel:r,floatingLabel:s=!1,error:i,options:a,value:l=[],onChange:c,required:u,disabled:p,className:g},h)=>{const[m,E]=_.useState(!1),[y,N]=_.useState(l),T=_.useRef(null),A=_.useRef(null);_.useEffect(()=>{JSON.stringify(l)!==JSON.stringify(y)&&N(l)},[y,l]);const k=v=>{const S=y.includes(v)?y.filter(j=>j!==v):[...y,v];N(S),c&&c({target:{name:n,value:S}})};wt([T],()=>{E(!1)}),Li(m,A);const D=y.map(v=>a.find(S=>S.value===v)?.label).filter(Boolean).join(", ");return d.jsxs(d.Fragment,{children:[e&&!s&&d.jsxs("label",{htmlFor:n,children:[e," ",u&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsxs("div",{className:`dropdown-select-container ${g||""}`,ref:T,children:[d.jsxs("div",{className:`dropdown-header ${m?"open":""} ${p?"disabled":""}`,onClick:()=>!p&&E(!m),ref:h,children:[d.jsx("span",{className:"label",children:D||r||"Select an option"}),d.jsx(Kn,{className:`arrow ${m?"open":""}`})]}),m&&!p&&d.jsx("div",{className:"dropdown-options scrollbar",ref:A,role:"listbox",children:a?.map(v=>d.jsx("div",{className:`option ${y.includes(v.value)?"selected":""}`,children:d.jsx(Ri,{name:v.value.toString(),label:v.label,checked:y.includes(v.value),onChange:()=>k(v.value)})},v.value))})]}),e&&s&&d.jsxs("label",{htmlFor:n,children:[e," ",u&&d.jsx("span",{className:"text-danger",children:"*"})]}),i?d.jsx("small",{className:"form-message text-danger",children:i}):t&&d.jsx("small",{className:"form-message",children:t})]})});sl.displayName="SelectMultiple";const il=_.forwardRef((n,e)=>{const{id:t,name:r,label:s,message:i,selectLabel:a="Select an option",size:l="md",floatingLabel:c=!1,error:u,options:p=[],value:g="",onChange:h,onBlur:m,required:E,disabled:y,selectSearch:N="",setSelectSearch:T,isLoading:A=!1}=n,k=t||r,[D,v]=_.useState(!1),S=_.useRef(null),j=_.useRef(null),B=_.useRef(null);_.useImperativeHandle(e,()=>B.current),wt([S],()=>v(!1)),Li(D,j);const z=g?p.find(b=>b.value===g)?.label:a,ee=b=>{h?.({target:{name:r,value:b}}),B.current&&(B.current.value=String(b),B.current.dispatchEvent(new Event("change",{bubbles:!0}))),v(!1)};return c?d.jsxs("div",{className:"form-floating",children:[d.jsxs("select",{ref:B,name:r,value:g,onChange:h,onBlur:m,required:E,disabled:y,style:{position:"absolute",left:"-9999px"},tabIndex:-1,children:[d.jsx("option",{value:"",children:"Select an option"}),p.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))]}),d.jsxs("div",{className:`dropdown-select-container ${l}`,ref:S,children:[d.jsxs("div",{className:`dropdown-header ${D?"open":""} ${y?"disabled":""}`,onClick:()=>!y&&v(!D),"aria-haspopup":"listbox","aria-expanded":D,children:[d.jsx("span",{className:"label",children:z}),d.jsx(Kn,{className:"arrow"})]}),D&&d.jsxs("div",{className:"dropdown-options scrollbar",ref:j,role:"listbox",children:[d.jsx("div",{className:"search-input",children:d.jsx(di,{name:"search",placeholder:"Ketik untuk mencari..",type:"search",autoFocus:!0,value:N,onChange:b=>T?.(b.currentTarget.value)})}),A?d.jsx("div",{className:"pt-2 pb-3 text-center",children:"Loading options..."}):p.length===0?d.jsx("div",{className:"pt-2 pb-3 text-center",children:"Tidak ada hasil ditemukan"}):p.map(b=>d.jsx("div",{className:`option ${g===b.value?"selected":""}`,onClick:()=>ee(b.value),role:"option","aria-selected":g===b.value,children:b.label},b.value))]})]}),d.jsxs("label",{htmlFor:k,children:[s," ",E&&d.jsx("span",{className:"text-danger",children:"*"})]}),u?d.jsx("small",{className:"form-message text-danger",children:u}):i&&d.jsx("small",{className:"form-message",children:i})]}):d.jsxs("div",{className:"form-group",children:[s&&d.jsxs("label",{htmlFor:k,children:[s," ",E&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsxs("select",{ref:B,name:r,value:g,onChange:h,onBlur:m,required:E,disabled:y,style:{position:"absolute",left:"-9999px"},tabIndex:-1,children:[d.jsx("option",{value:"",children:"Select an option"}),p.map(b=>d.jsx("option",{value:b.value,children:b.label},b.value))]}),d.jsxs("div",{className:`dropdown-select-container ${l}`,ref:S,children:[d.jsxs("div",{className:`dropdown-header ${D?"open":""} ${y?"disabled":""}`,onClick:()=>!y&&v(!D),"aria-haspopup":"listbox","aria-expanded":D,children:[d.jsx("span",{className:"label",children:z}),d.jsx(Kn,{className:"arrow"})]}),D&&d.jsxs("div",{className:"dropdown-options scrollbar",ref:j,role:"listbox",children:[d.jsx("div",{className:"search-input",children:d.jsx(di,{name:"search",placeholder:"Ketik untuk mencari..",type:"search",autoFocus:!0,value:N,onChange:b=>T?.(b.currentTarget.value)})}),A?d.jsx("div",{className:"pt-2 pb-3 text-center",children:"Loading options..."}):p.length===0?d.jsx("div",{className:"pt-2 pb-3 text-center",children:"Tidak ada hasil ditemukan"}):p.map(b=>d.jsx("div",{className:`option ${g===b.value?"selected":""}`,onClick:()=>ee(b.value),role:"option","aria-selected":g===b.value,children:b.label},b.value))]})]}),u?d.jsx("small",{className:"form-message text-danger",children:u}):i&&d.jsx("small",{className:"form-message",children:i})]})});il.displayName="SelectWithSearch";const al=_.forwardRef(({name:n,className:e="",error:t,checked:r=!1,onChange:s,...i},a)=>{const l=c=>{s&&s(c)};return d.jsx(d.Fragment,{children:d.jsxs("label",{className:`switch ${e} ${t?"has-error":""}`,children:[d.jsx("input",{type:"checkbox",id:n,name:n,ref:a,checked:r,onChange:l,disabled:i.disabled,...i}),d.jsx("span",{className:"slider round"})]})})});al.displayName="Switch";var ol=typeof global=="object"&&global&&global.Object===Object&&global,_u=typeof self=="object"&&self&&self.Object===Object&&self,nt=ol||_u||Function("return this")(),Nt=nt.Symbol,ll=Object.prototype,Ou=ll.hasOwnProperty,Ru=ll.toString,Fn=Nt?Nt.toStringTag:void 0;function Lu(n){var e=Ou.call(n,Fn),t=n[Fn];try{n[Fn]=void 0;var r=!0}catch{}var s=Ru.call(n);return r&&(e?n[Fn]=t:delete n[Fn]),s}var ku=Object.prototype,ju=ku.toString;function Iu(n){return ju.call(n)}var qu="[object Null]",Mu="[object Undefined]",Ta=Nt?Nt.toStringTag:void 0;function mn(n){return n==null?n===void 0?Mu:qu:Ta&&Ta in Object(n)?Lu(n):Iu(n)}function ut(n){return n!=null&&typeof n=="object"}var qt=Array.isArray;function Tt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function cl(n){return n}var Du="[object AsyncFunction]",Pu="[object Function]",$u="[object GeneratorFunction]",Bu="[object Proxy]";function ki(n){if(!Tt(n))return!1;var e=mn(n);return e==Pu||e==$u||e==Du||e==Bu}var Xs=nt["__core-js_shared__"],Aa=function(){var n=/[^.]+$/.exec(Xs&&Xs.keys&&Xs.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Fu(n){return!!Aa&&Aa in n}var Uu=Function.prototype,Hu=Uu.toString;function $t(n){if(n!=null){try{return Hu.call(n)}catch{}try{return n+""}catch{}}return""}var zu=/[\\^$.*+?()[\]{}|]/g,Gu=/^\[object .+?Constructor\]$/,Vu=Function.prototype,Wu=Object.prototype,Ku=Vu.toString,Yu=Wu.hasOwnProperty,Xu=RegExp("^"+Ku.call(Yu).replace(zu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zu(n){if(!Tt(n)||Fu(n))return!1;var e=ki(n)?Xu:Gu;return e.test($t(n))}function Ju(n,e){return n?.[e]}function Bt(n,e){var t=Ju(n,e);return Zu(t)?t:void 0}var fi=Bt(nt,"WeakMap"),Sa=Object.create,Qu=function(){function n(){}return function(e){if(!Tt(e))return{};if(Sa)return Sa(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function eh(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 th(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var nh=800,rh=16,sh=Date.now;function ih(n){var e=0,t=0;return function(){var r=sh(),s=rh-(r-t);if(t=r,s>0){if(++e>=nh)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function ah(n){return function(){return n}}var zr=function(){try{var n=Bt(Object,"defineProperty");return n({},"",{}),n}catch{}}(),oh=zr?function(n,e){return zr(n,"toString",{configurable:!0,enumerable:!1,value:ah(e),writable:!0})}:cl,lh=ih(oh);function ch(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var uh=9007199254740991,hh=/^(?:0|[1-9]\d*)$/;function ul(n,e){var t=typeof n;return e=e??uh,!!e&&(t=="number"||t!="symbol"&&hh.test(n))&&n>-1&&n%1==0&&n<e}function ji(n,e,t){e=="__proto__"&&zr?zr(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function rr(n,e){return n===e||n!==n&&e!==e}var dh=Object.prototype,fh=dh.hasOwnProperty;function hl(n,e,t){var r=n[e];(!(fh.call(n,e)&&rr(r,t))||t===void 0&&!(e in n))&&ji(n,e,t)}function ph(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var l=e[i],c=void 0;c===void 0&&(c=n[l]),s?ji(t,l,c):hl(t,l,c)}return t}var Ca=Math.max;function gh(n,e,t){return e=Ca(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=Ca(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=r[s];return l[e]=t(a),eh(n,this,l)}}function mh(n,e){return lh(gh(n,e,cl),n+"")}var bh=9007199254740991;function dl(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=bh}function Xr(n){return n!=null&&dl(n.length)&&!ki(n)}function vh(n,e,t){if(!Tt(t))return!1;var r=typeof e;return(r=="number"?Xr(t)&&ul(e,t.length):r=="string"&&e in t)?rr(t[e],n):!1}function yh(n){return mh(function(e,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,a=s>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,a&&vh(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var l=t[r];l&&n(e,l,r,i)}return e})}var xh=Object.prototype;function Ii(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||xh;return n===t}function Eh(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Nh="[object Arguments]";function _a(n){return ut(n)&&mn(n)==Nh}var fl=Object.prototype,wh=fl.hasOwnProperty,Th=fl.propertyIsEnumerable,pi=_a(function(){return arguments}())?_a:function(n){return ut(n)&&wh.call(n,"callee")&&!Th.call(n,"callee")};function Ah(){return!1}var pl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oa=pl&&typeof module=="object"&&module&&!module.nodeType&&module,Sh=Oa&&Oa.exports===pl,Ra=Sh?nt.Buffer:void 0,Ch=Ra?Ra.isBuffer:void 0,Xn=Ch||Ah,_h="[object Arguments]",Oh="[object Array]",Rh="[object Boolean]",Lh="[object Date]",kh="[object Error]",jh="[object Function]",Ih="[object Map]",qh="[object Number]",Mh="[object Object]",Dh="[object RegExp]",Ph="[object Set]",$h="[object String]",Bh="[object WeakMap]",Fh="[object ArrayBuffer]",Uh="[object DataView]",Hh="[object Float32Array]",zh="[object Float64Array]",Gh="[object Int8Array]",Vh="[object Int16Array]",Wh="[object Int32Array]",Kh="[object Uint8Array]",Yh="[object Uint8ClampedArray]",Xh="[object Uint16Array]",Zh="[object Uint32Array]",fe={};fe[Hh]=fe[zh]=fe[Gh]=fe[Vh]=fe[Wh]=fe[Kh]=fe[Yh]=fe[Xh]=fe[Zh]=!0;fe[_h]=fe[Oh]=fe[Fh]=fe[Rh]=fe[Uh]=fe[Lh]=fe[kh]=fe[jh]=fe[Ih]=fe[qh]=fe[Mh]=fe[Dh]=fe[Ph]=fe[$h]=fe[Bh]=!1;function Jh(n){return ut(n)&&dl(n.length)&&!!fe[mn(n)]}function qi(n){return function(e){return n(e)}}var gl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vn=gl&&typeof module=="object"&&module&&!module.nodeType&&module,Qh=Vn&&Vn.exports===gl,Zs=Qh&&ol.process,pn=function(){try{var n=Vn&&Vn.require&&Vn.require("util").types;return n||Zs&&Zs.binding&&Zs.binding("util")}catch{}}(),La=pn&&pn.isTypedArray,Mi=La?qi(La):Jh,ed=Object.prototype,td=ed.hasOwnProperty;function ml(n,e){var t=qt(n),r=!t&&pi(n),s=!t&&!r&&Xn(n),i=!t&&!r&&!s&&Mi(n),a=t||r||s||i,l=a?Eh(n.length,String):[],c=l.length;for(var u in n)(e||td.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ul(u,c)))&&l.push(u);return l}function bl(n,e){return function(t){return n(e(t))}}var nd=bl(Object.keys,Object),rd=Object.prototype,sd=rd.hasOwnProperty;function id(n){if(!Ii(n))return nd(n);var e=[];for(var t in Object(n))sd.call(n,t)&&t!="constructor"&&e.push(t);return e}function ad(n){return Xr(n)?ml(n):id(n)}function od(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var ld=Object.prototype,cd=ld.hasOwnProperty;function ud(n){if(!Tt(n))return od(n);var e=Ii(n),t=[];for(var r in n)r=="constructor"&&(e||!cd.call(n,r))||t.push(r);return t}function vl(n){return Xr(n)?ml(n,!0):ud(n)}var Zn=Bt(Object,"create");function hd(){this.__data__=Zn?Zn(null):{},this.size=0}function dd(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var fd="__lodash_hash_undefined__",pd=Object.prototype,gd=pd.hasOwnProperty;function md(n){var e=this.__data__;if(Zn){var t=e[n];return t===fd?void 0:t}return gd.call(e,n)?e[n]:void 0}var bd=Object.prototype,vd=bd.hasOwnProperty;function yd(n){var e=this.__data__;return Zn?e[n]!==void 0:vd.call(e,n)}var xd="__lodash_hash_undefined__";function Ed(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Zn&&e===void 0?xd:e,this}function Mt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Mt.prototype.clear=hd;Mt.prototype.delete=dd;Mt.prototype.get=md;Mt.prototype.has=yd;Mt.prototype.set=Ed;function Nd(){this.__data__=[],this.size=0}function Zr(n,e){for(var t=n.length;t--;)if(rr(n[t][0],e))return t;return-1}var wd=Array.prototype,Td=wd.splice;function Ad(n){var e=this.__data__,t=Zr(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Td.call(e,t,1),--this.size,!0}function Sd(n){var e=this.__data__,t=Zr(e,n);return t<0?void 0:e[t][1]}function Cd(n){return Zr(this.__data__,n)>-1}function _d(n,e){var t=this.__data__,r=Zr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function dt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}dt.prototype.clear=Nd;dt.prototype.delete=Ad;dt.prototype.get=Sd;dt.prototype.has=Cd;dt.prototype.set=_d;var Jn=Bt(nt,"Map");function Od(){this.size=0,this.__data__={hash:new Mt,map:new(Jn||dt),string:new Mt}}function Rd(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Jr(n,e){var t=n.__data__;return Rd(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Ld(n){var e=Jr(this,n).delete(n);return this.size-=e?1:0,e}function kd(n){return Jr(this,n).get(n)}function jd(n){return Jr(this,n).has(n)}function Id(n,e){var t=Jr(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Ft(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ft.prototype.clear=Od;Ft.prototype.delete=Ld;Ft.prototype.get=kd;Ft.prototype.has=jd;Ft.prototype.set=Id;function qd(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var yl=bl(Object.getPrototypeOf,Object),Md="[object Object]",Dd=Function.prototype,Pd=Object.prototype,xl=Dd.toString,$d=Pd.hasOwnProperty,Bd=xl.call(Object);function Fd(n){if(!ut(n)||mn(n)!=Md)return!1;var e=yl(n);if(e===null)return!0;var t=$d.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&xl.call(t)==Bd}function Ud(){this.__data__=new dt,this.size=0}function Hd(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function zd(n){return this.__data__.get(n)}function Gd(n){return this.__data__.has(n)}var Vd=200;function Wd(n,e){var t=this.__data__;if(t instanceof dt){var r=t.__data__;if(!Jn||r.length<Vd-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Ft(r)}return t.set(n,e),this.size=t.size,this}function et(n){var e=this.__data__=new dt(n);this.size=e.size}et.prototype.clear=Ud;et.prototype.delete=Hd;et.prototype.get=zd;et.prototype.has=Gd;et.prototype.set=Wd;var El=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ka=El&&typeof module=="object"&&module&&!module.nodeType&&module,Kd=ka&&ka.exports===El,ja=Kd?nt.Buffer:void 0,Ia=ja?ja.allocUnsafe:void 0;function Nl(n,e){if(e)return n.slice();var t=n.length,r=Ia?Ia(t):new n.constructor(t);return n.copy(r),r}function Yd(n,e){for(var t=-1,r=n==null?0:n.length,s=0,i=[];++t<r;){var a=n[t];e(a,t,n)&&(i[s++]=a)}return i}function Xd(){return[]}var Zd=Object.prototype,Jd=Zd.propertyIsEnumerable,qa=Object.getOwnPropertySymbols,Qd=qa?function(n){return n==null?[]:(n=Object(n),Yd(qa(n),function(e){return Jd.call(n,e)}))}:Xd;function ef(n,e,t){var r=e(n);return qt(n)?r:qd(r,t(n))}function gi(n){return ef(n,ad,Qd)}var mi=Bt(nt,"DataView"),bi=Bt(nt,"Promise"),vi=Bt(nt,"Set"),Ma="[object Map]",tf="[object Object]",Da="[object Promise]",Pa="[object Set]",$a="[object WeakMap]",Ba="[object DataView]",nf=$t(mi),rf=$t(Jn),sf=$t(bi),af=$t(vi),of=$t(fi),He=mn;(mi&&He(new mi(new ArrayBuffer(1)))!=Ba||Jn&&He(new Jn)!=Ma||bi&&He(bi.resolve())!=Da||vi&&He(new vi)!=Pa||fi&&He(new fi)!=$a)&&(He=function(n){var e=mn(n),t=e==tf?n.constructor:void 0,r=t?$t(t):"";if(r)switch(r){case nf:return Ba;case rf:return Ma;case sf:return Da;case af:return Pa;case of:return $a}return e});var lf=Object.prototype,cf=lf.hasOwnProperty;function uf(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&cf.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Gr=nt.Uint8Array;function Di(n){var e=new n.constructor(n.byteLength);return new Gr(e).set(new Gr(n)),e}function hf(n,e){var t=Di(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var df=/\w*$/;function ff(n){var e=new n.constructor(n.source,df.exec(n));return e.lastIndex=n.lastIndex,e}var Fa=Nt?Nt.prototype:void 0,Ua=Fa?Fa.valueOf:void 0;function pf(n){return Ua?Object(Ua.call(n)):{}}function wl(n,e){var t=e?Di(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var gf="[object Boolean]",mf="[object Date]",bf="[object Map]",vf="[object Number]",yf="[object RegExp]",xf="[object Set]",Ef="[object String]",Nf="[object Symbol]",wf="[object ArrayBuffer]",Tf="[object DataView]",Af="[object Float32Array]",Sf="[object Float64Array]",Cf="[object Int8Array]",_f="[object Int16Array]",Of="[object Int32Array]",Rf="[object Uint8Array]",Lf="[object Uint8ClampedArray]",kf="[object Uint16Array]",jf="[object Uint32Array]";function If(n,e,t){var r=n.constructor;switch(e){case wf:return Di(n);case gf:case mf:return new r(+n);case Tf:return hf(n);case Af:case Sf:case Cf:case _f:case Of:case Rf:case Lf:case kf:case jf:return wl(n,t);case bf:return new r;case vf:case Ef:return new r(n);case yf:return ff(n);case xf:return new r;case Nf:return pf(n)}}function Tl(n){return typeof n.constructor=="function"&&!Ii(n)?Qu(yl(n)):{}}var qf="[object Map]";function Mf(n){return ut(n)&&He(n)==qf}var Ha=pn&&pn.isMap,Df=Ha?qi(Ha):Mf,Pf="[object Set]";function $f(n){return ut(n)&&He(n)==Pf}var za=pn&&pn.isSet,Bf=za?qi(za):$f,Ff=1,Al="[object Arguments]",Uf="[object Array]",Hf="[object Boolean]",zf="[object Date]",Gf="[object Error]",Sl="[object Function]",Vf="[object GeneratorFunction]",Wf="[object Map]",Kf="[object Number]",Cl="[object Object]",Yf="[object RegExp]",Xf="[object Set]",Zf="[object String]",Jf="[object Symbol]",Qf="[object WeakMap]",ep="[object ArrayBuffer]",tp="[object DataView]",np="[object Float32Array]",rp="[object Float64Array]",sp="[object Int8Array]",ip="[object Int16Array]",ap="[object Int32Array]",op="[object Uint8Array]",lp="[object Uint8ClampedArray]",cp="[object Uint16Array]",up="[object Uint32Array]",de={};de[Al]=de[Uf]=de[ep]=de[tp]=de[Hf]=de[zf]=de[np]=de[rp]=de[sp]=de[ip]=de[ap]=de[Wf]=de[Kf]=de[Cl]=de[Yf]=de[Xf]=de[Zf]=de[Jf]=de[op]=de[lp]=de[cp]=de[up]=!0;de[Gf]=de[Sl]=de[Qf]=!1;function Fr(n,e,t,r,s,i){var a,l=e&Ff;if(a!==void 0)return a;if(!Tt(n))return n;var c=qt(n);if(c)a=uf(n);else{var u=He(n),p=u==Sl||u==Vf;if(Xn(n))return Nl(n,l);if(u==Cl||u==Al||p&&!s)a=p?{}:Tl(n);else{if(!de[u])return s?n:{};a=If(n,u,l)}}i||(i=new et);var g=i.get(n);if(g)return g;i.set(n,a),Bf(n)?n.forEach(function(E){a.add(Fr(E,e,t,E,n,i))}):Df(n)&&n.forEach(function(E,y){a.set(y,Fr(E,e,t,y,n,i))});var h=gi,m=c?void 0:h(n);return ch(m||n,function(E,y){m&&(y=E,E=n[y]),hl(a,y,Fr(E,e,t,y,n,i))}),a}var hp=1,dp=4;function hn(n){return Fr(n,hp|dp)}var fp="__lodash_hash_undefined__";function pp(n){return this.__data__.set(n,fp),this}function gp(n){return this.__data__.has(n)}function Vr(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Ft;++e<t;)this.add(n[e])}Vr.prototype.add=Vr.prototype.push=pp;Vr.prototype.has=gp;function mp(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function bp(n,e){return n.has(e)}var vp=1,yp=2;function _l(n,e,t,r,s,i){var a=t&vp,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(n),p=i.get(e);if(u&&p)return u==e&&p==n;var g=-1,h=!0,m=t&yp?new Vr:void 0;for(i.set(n,e),i.set(e,n);++g<l;){var E=n[g],y=e[g];if(r)var N=a?r(y,E,g,e,n,i):r(E,y,g,n,e,i);if(N!==void 0){if(N)continue;h=!1;break}if(m){if(!mp(e,function(T,A){if(!bp(m,A)&&(E===T||s(E,T,t,r,i)))return m.push(A)})){h=!1;break}}else if(!(E===y||s(E,y,t,r,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function xp(n){var e=-1,t=Array(n.size);return n.forEach(function(r,s){t[++e]=[s,r]}),t}function Ep(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var Np=1,wp=2,Tp="[object Boolean]",Ap="[object Date]",Sp="[object Error]",Cp="[object Map]",_p="[object Number]",Op="[object RegExp]",Rp="[object Set]",Lp="[object String]",kp="[object Symbol]",jp="[object ArrayBuffer]",Ip="[object DataView]",Ga=Nt?Nt.prototype:void 0,Js=Ga?Ga.valueOf:void 0;function qp(n,e,t,r,s,i,a){switch(t){case Ip:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case jp:return!(n.byteLength!=e.byteLength||!i(new Gr(n),new Gr(e)));case Tp:case Ap:case _p:return rr(+n,+e);case Sp:return n.name==e.name&&n.message==e.message;case Op:case Lp:return n==e+"";case Cp:var l=xp;case Rp:var c=r&Np;if(l||(l=Ep),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=wp,a.set(n,e);var p=_l(l(n),l(e),r,s,i,a);return a.delete(n),p;case kp:if(Js)return Js.call(n)==Js.call(e)}return!1}var Mp=1,Dp=Object.prototype,Pp=Dp.hasOwnProperty;function $p(n,e,t,r,s,i){var a=t&Mp,l=gi(n),c=l.length,u=gi(e),p=u.length;if(c!=p&&!a)return!1;for(var g=c;g--;){var h=l[g];if(!(a?h in e:Pp.call(e,h)))return!1}var m=i.get(n),E=i.get(e);if(m&&E)return m==e&&E==n;var y=!0;i.set(n,e),i.set(e,n);for(var N=a;++g<c;){h=l[g];var T=n[h],A=e[h];if(r)var k=a?r(A,T,h,e,n,i):r(T,A,h,n,e,i);if(!(k===void 0?T===A||s(T,A,t,r,i):k)){y=!1;break}N||(N=h=="constructor")}if(y&&!N){var D=n.constructor,v=e.constructor;D!=v&&"constructor"in n&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof v=="function"&&v instanceof v)&&(y=!1)}return i.delete(n),i.delete(e),y}var Bp=1,Va="[object Arguments]",Wa="[object Array]",Lr="[object Object]",Fp=Object.prototype,Ka=Fp.hasOwnProperty;function Up(n,e,t,r,s,i){var a=qt(n),l=qt(e),c=a?Wa:He(n),u=l?Wa:He(e);c=c==Va?Lr:c,u=u==Va?Lr:u;var p=c==Lr,g=u==Lr,h=c==u;if(h&&Xn(n)){if(!Xn(e))return!1;a=!0,p=!1}if(h&&!p)return i||(i=new et),a||Mi(n)?_l(n,e,t,r,s,i):qp(n,e,c,t,r,s,i);if(!(t&Bp)){var m=p&&Ka.call(n,"__wrapped__"),E=g&&Ka.call(e,"__wrapped__");if(m||E){var y=m?n.value():n,N=E?e.value():e;return i||(i=new et),s(y,N,t,r,i)}}return h?(i||(i=new et),$p(n,e,t,r,s,i)):!1}function Ol(n,e,t,r,s){return n===e?!0:n==null||e==null||!ut(n)&&!ut(e)?n!==n&&e!==e:Up(n,e,t,r,Ol,s)}function Hp(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),l=a.length;l--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var zp=Hp();function yi(n,e,t){(t!==void 0&&!rr(n[e],t)||t===void 0&&!(e in n))&&ji(n,e,t)}function Gp(n){return ut(n)&&Xr(n)}function xi(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Vp(n){return ph(n,vl(n))}function Wp(n,e,t,r,s,i,a){var l=xi(n,t),c=xi(e,t),u=a.get(c);if(u){yi(n,t,u);return}var p=i?i(l,c,t+"",n,e,a):void 0,g=p===void 0;if(g){var h=qt(c),m=!h&&Xn(c),E=!h&&!m&&Mi(c);p=c,h||m||E?qt(l)?p=l:Gp(l)?p=th(l):m?(g=!1,p=Nl(c,!0)):E?(g=!1,p=wl(c,!0)):p=[]:Fd(c)||pi(c)?(p=l,pi(l)?p=Vp(l):(!Tt(l)||ki(l))&&(p=Tl(c))):g=!1}g&&(a.set(c,p),s(p,c,r,i,a),a.delete(c)),yi(n,t,p)}function Rl(n,e,t,r,s){n!==e&&zp(e,function(i,a){if(s||(s=new et),Tt(i))Wp(n,e,a,t,Rl,r,s);else{var l=r?r(xi(n,a),i,a+"",n,e,s):void 0;l===void 0&&(l=i),yi(n,a,l)}},vl)}function bt(n,e){return Ol(n,e)}var xt=yh(function(n,e,t){Rl(n,e,t)}),W=(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))(W||{});class tt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=W.TYPE&W.ATTRIBUTE;this.scope=r.scope!=null?r.scope&W.LEVEL|s:W.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.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 dn extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Ll=class Ei{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 r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new dn(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),l=new i(e,a,r);return Ei.blots.set(l.domNode,l),l}find(e,t=!1){return Ei.find(e,t)}query(e,t=W.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&W.LEVEL&W.BLOCK?r=this.types.block:e&W.LEVEL&W.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&W.LEVEL&r.scope&&t&W.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new dn("Invalid definition");if(r&&t.blotName==="abstract")throw new dn("Cannot register abstract class");const i=r?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(a=>a.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)}))),t})}};Ll.blots=new WeakMap;let gn=Ll;function Ya(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class Kp extends tt{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){Ya(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(Ya(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const We=Kp;function Qs(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class Yp extends tt{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[Qs(this.keyName)]=t,!0):!1}remove(e){e.style[Qs(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Qs(this.keyName)];return this.canAdd(e,t)?t:""}}const At=Yp;class Xp{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=gn.find(this.domNode);if(e==null)return;const t=tt.keys(this.domNode),r=We.keys(this.domNode),s=At.keys(this.domNode);t.concat(r).concat(s).forEach(i=>{const a=e.scroll.query(i,W.ATTRIBUTE);a instanceof tt&&(this.attributes[a.attrName]=a)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}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 Qr=Xp,kl=class{constructor(e,t){this.scroll=e,this.domNode=t,gn.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new dn("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),gn.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const i=this.isolate(e,t);if(this.scroll.query(r,W.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,W.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);i.wrap(a),a.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){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(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new dn(`Cannot wrap ${e}`);return r.appendChild(this),r}};kl.blotName="abstract";let jl=kl;const Il=class extends jl{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Il.scope=W.INLINE_BLOT;let Zp=Il;const Ae=Zp;class Jp{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 r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=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,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.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 r=this.iterator();let s=r();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,i]=this.find(e);let a=e-i;const l=this.iterator(s);let c=l();for(;c&&a<e+t;){const u=c.length();e>a?r(c,e-a,Math.min(t,a+u-e)):r(c,0,Math.min(u,e+t-a)),a+=u,c=l()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function Xa(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(W.INLINE);return Array.from(n.childNodes).forEach(s=>{r.domNode.appendChild(s)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const ql=class mt extends jl{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,mt.uiClass&&this.uiNode.classList.add(mt.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Jp,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Xa(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof dn)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,s,i)=>{r.deleteAt(s,i)})}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof mt?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(t,r,(a,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof mt&&(s=s.concat(a.descendants(e,l,i))),i-=c}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===W.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof mt?t.unwrap():t.remove())})}formatAt(e,t,r,s){this.children.forEachAt(e,t,(i,a,l)=>{i.formatAt(a,l,r,s)})}insertAt(e,t,r){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,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[r,s]=this.children.find(e,t),i=[[this,e]];return r instanceof mt?i.concat(r.path(s,t)):(r!=null&&i.push([r,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof mt&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,i,a)=>{const l=s.split(i,t);l!=null&&r.appendChild(l)}),r}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 r=[],s=[];e.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(i);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),r.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,a)=>i===a?0:i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let a=null;i.nextSibling!=null&&(a=this.scroll.find(i.nextSibling));const l=Xa(i,this.scroll);(l.next!==a||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,a||void 0))}),this.enforceAllowedChildren()}};ql.uiClass="";let Qp=ql;const Ge=Qp;function eg(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 an=class on extends Ge{static create(e){return super.create(e)}static formats(e,t){const r=t.query(on.blotName);if(!(r!=null&&e.tagName===r.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 Qr(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof on||(r=r.wrap(on.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,W.INLINE);if(r==null)return;r instanceof tt?this.attributes.attribute(r,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,r,s){this.formats()[r]!=null||this.scroll.query(r,W.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof on&&r.prev===this&&eg(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof on&&this.attributes.move(r),r}};an.allowedChildren=[an,Ae],an.blotName="inline",an.scope=W.INLINE_BLOT,an.tagName="SPAN";let tg=an;const Pi=tg,ln=class Ni extends Ge{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Ni.blotName);if(!(r!=null&&e.tagName===r.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 Qr(this.domNode)}format(e,t){const r=this.scroll.query(e,W.BLOCK);r!=null&&(r instanceof tt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Ni.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,r,s){this.scroll.query(r,W.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,W.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};ln.blotName="block",ln.scope=W.BLOCK_BLOT,ln.tagName="P",ln.allowedChildren=[Pi,ln,Ae];let ng=ln;const Qn=ng,wi=class extends Ge{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};wi.blotName="container",wi.scope=W.BLOCK_BLOT;let rg=wi;const es=rg;class sg extends Ae{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ke=sg,ig={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},ag=100,cn=class extends Ge{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,ig),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=W.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&i(c.parent))},a=c=>{r.has(c.domNode)&&(c instanceof Ge&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=ag)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const p=this.find(u.target,!0);p!=null&&(p.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(g=>{const h=this.find(g,!1);i(h,!1),h instanceof Ge&&h.children.forEach(m=>{i(m,!1)})})):u.type==="attributes"&&i(p.prev)),i(p))}),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),s=l.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};cn.blotName="scroll",cn.defaultChild=Qn,cn.allowedChildren=[Qn,es],cn.scope=W.BLOCK_BLOT,cn.tagName="DIV";let og=cn;const $i=og,Ti=class Ml extends Ae{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,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}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 Ml&&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 r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ti.blotName="text",Ti.scope=W.INLINE_BLOT;let lg=Ti;const Wr=lg,cg=Object.freeze(Object.defineProperty({__proto__:null,Attributor:tt,AttributorStore:Qr,BlockBlot:Qn,ClassAttributor:We,ContainerBlot:es,EmbedBlot:ke,InlineBlot:Pi,LeafBlot:Ae,ParentBlot:Ge,Registry:gn,Scope:W,ScrollBlot:$i,StyleAttributor:At,TextBlot:Wr},Symbol.toStringTag,{value:"Module"}));var kr={exports:{}},ei,Za;function ug(){if(Za)return ei;Za=1;var n=-1,e=1,t=0;function r(b,q,w,R,M){if(b===q)return b?[[t,b]]:[];if(w!=null){var I=z(b,q,w);if(I)return I}var P=l(b,q),U=b.substring(0,P);b=b.substring(P),q=q.substring(P),P=u(b,q);var K=b.substring(b.length-P);b=b.substring(0,b.length-P),q=q.substring(0,q.length-P);var C=s(b,q);return U&&C.unshift([t,U]),K&&C.push([t,K]),A(C,M),R&&g(C),C}function s(b,q){var w;if(!b)return[[e,q]];if(!q)return[[n,b]];var R=b.length>q.length?b:q,M=b.length>q.length?q:b,I=R.indexOf(M);if(I!==-1)return w=[[e,R.substring(0,I)],[t,M],[e,R.substring(I+M.length)]],b.length>q.length&&(w[0][0]=w[2][0]=n),w;if(M.length===1)return[[n,b],[e,q]];var P=p(b,q);if(P){var U=P[0],K=P[1],C=P[2],$=P[3],F=P[4],Z=r(U,C),J=r(K,$);return Z.concat([[t,F]],J)}return i(b,q)}function i(b,q){for(var w=b.length,R=q.length,M=Math.ceil((w+R)/2),I=M,P=2*M,U=new Array(P),K=new Array(P),C=0;C<P;C++)U[C]=-1,K[C]=-1;U[I+1]=0,K[I+1]=0;for(var $=w-R,F=$%2!==0,Z=0,J=0,H=0,le=0,ue=0;ue<M;ue++){for(var Y=-ue+Z;Y<=ue-J;Y+=2){var ne=I+Y,re;Y===-ue||Y!==ue&&U[ne-1]<U[ne+1]?re=U[ne+1]:re=U[ne-1]+1;for(var ie=re-Y;re<w&&ie<R&&b.charAt(re)===q.charAt(ie);)re++,ie++;if(U[ne]=re,re>w)J+=2;else if(ie>R)Z+=2;else if(F){var ce=I+$-Y;if(ce>=0&&ce<P&&K[ce]!==-1){var he=w-K[ce];if(re>=he)return a(b,q,re,ie)}}}for(var pe=-ue+H;pe<=ue-le;pe+=2){var ce=I+pe,he;pe===-ue||pe!==ue&&K[ce-1]<K[ce+1]?he=K[ce+1]:he=K[ce-1]+1;for(var Ee=he-pe;he<w&&Ee<R&&b.charAt(w-he-1)===q.charAt(R-Ee-1);)he++,Ee++;if(K[ce]=he,he>w)le+=2;else if(Ee>R)H+=2;else if(!F){var ne=I+$-pe;if(ne>=0&&ne<P&&U[ne]!==-1){var re=U[ne],ie=I+re-ne;if(he=w-he,re>=he)return a(b,q,re,ie)}}}}return[[n,b],[e,q]]}function a(b,q,w,R){var M=b.substring(0,w),I=q.substring(0,R),P=b.substring(w),U=q.substring(R),K=r(M,I),C=r(P,U);return K.concat(C)}function l(b,q){if(!b||!q||b.charAt(0)!==q.charAt(0))return 0;for(var w=0,R=Math.min(b.length,q.length),M=R,I=0;w<M;)b.substring(I,M)==q.substring(I,M)?(w=M,I=w):R=M,M=Math.floor((R-w)/2+w);return k(b.charCodeAt(M-1))&&M--,M}function c(b,q){var w=b.length,R=q.length;if(w==0||R==0)return 0;w>R?b=b.substring(w-R):w<R&&(q=q.substring(0,w));var M=Math.min(w,R);if(b==q)return M;for(var I=0,P=1;;){var U=b.substring(M-P),K=q.indexOf(U);if(K==-1)return I;P+=K,(K==0||b.substring(M-P)==q.substring(0,P))&&(I=P,P++)}}function u(b,q){if(!b||!q||b.slice(-1)!==q.slice(-1))return 0;for(var w=0,R=Math.min(b.length,q.length),M=R,I=0;w<M;)b.substring(b.length-M,b.length-I)==q.substring(q.length-M,q.length-I)?(w=M,I=w):R=M,M=Math.floor((R-w)/2+w);return D(b.charCodeAt(b.length-M))&&M--,M}function p(b,q){var w=b.length>q.length?b:q,R=b.length>q.length?q:b;if(w.length<4||R.length*2<w.length)return null;function M(J,H,le){for(var ue=J.substring(le,le+Math.floor(J.length/4)),Y=-1,ne="",re,ie,ce,he;(Y=H.indexOf(ue,Y+1))!==-1;){var pe=l(J.substring(le),H.substring(Y)),Ee=u(J.substring(0,le),H.substring(0,Y));ne.length<Ee+pe&&(ne=H.substring(Y-Ee,Y)+H.substring(Y,Y+pe),re=J.substring(0,le-Ee),ie=J.substring(le+pe),ce=H.substring(0,Y-Ee),he=H.substring(Y+pe))}return ne.length*2>=J.length?[re,ie,ce,he,ne]:null}var I=M(w,R,Math.ceil(w.length/4)),P=M(w,R,Math.ceil(w.length/2)),U;if(!I&&!P)return null;P?I?U=I[4].length>P[4].length?I:P:U=P:U=I;var K,C,$,F;b.length>q.length?(K=U[0],C=U[1],$=U[2],F=U[3]):($=U[0],F=U[1],K=U[2],C=U[3]);var Z=U[4];return[K,C,$,F,Z]}function g(b){for(var q=!1,w=[],R=0,M=null,I=0,P=0,U=0,K=0,C=0;I<b.length;)b[I][0]==t?(w[R++]=I,P=K,U=C,K=0,C=0,M=b[I][1]):(b[I][0]==e?K+=b[I][1].length:C+=b[I][1].length,M&&M.length<=Math.max(P,U)&&M.length<=Math.max(K,C)&&(b.splice(w[R-1],0,[n,M]),b[w[R-1]+1][0]=e,R--,R--,I=R>0?w[R-1]:-1,P=0,U=0,K=0,C=0,M=null,q=!0)),I++;for(q&&A(b),T(b),I=1;I<b.length;){if(b[I-1][0]==n&&b[I][0]==e){var $=b[I-1][1],F=b[I][1],Z=c($,F),J=c(F,$);Z>=J?(Z>=$.length/2||Z>=F.length/2)&&(b.splice(I,0,[t,F.substring(0,Z)]),b[I-1][1]=$.substring(0,$.length-Z),b[I+1][1]=F.substring(Z),I++):(J>=$.length/2||J>=F.length/2)&&(b.splice(I,0,[t,$.substring(0,J)]),b[I-1][0]=e,b[I-1][1]=F.substring(0,F.length-J),b[I+1][0]=n,b[I+1][1]=$.substring(J),I++),I++}I++}}var h=/[^a-zA-Z0-9]/,m=/\s/,E=/[\r\n]/,y=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(b){function q(J,H){if(!J||!H)return 6;var le=J.charAt(J.length-1),ue=H.charAt(0),Y=le.match(h),ne=ue.match(h),re=Y&&le.match(m),ie=ne&&ue.match(m),ce=re&&le.match(E),he=ie&&ue.match(E),pe=ce&&J.match(y),Ee=he&&H.match(N);return pe||Ee?5:ce||he?4:Y&&!re&&ie?3:re||ie?2:Y||ne?1:0}for(var w=1;w<b.length-1;){if(b[w-1][0]==t&&b[w+1][0]==t){var R=b[w-1][1],M=b[w][1],I=b[w+1][1],P=u(R,M);if(P){var U=M.substring(M.length-P);R=R.substring(0,R.length-P),M=U+M.substring(0,M.length-P),I=U+I}for(var K=R,C=M,$=I,F=q(R,M)+q(M,I);M.charAt(0)===I.charAt(0);){R+=M.charAt(0),M=M.substring(1)+I.charAt(0),I=I.substring(1);var Z=q(R,M)+q(M,I);Z>=F&&(F=Z,K=R,C=M,$=I)}b[w-1][1]!=K&&(K?b[w-1][1]=K:(b.splice(w-1,1),w--),b[w][1]=C,$?b[w+1][1]=$:(b.splice(w+1,1),w--))}w++}}function A(b,q){b.push([t,""]);for(var w=0,R=0,M=0,I="",P="",U;w<b.length;){if(w<b.length-1&&!b[w][1]){b.splice(w,1);continue}switch(b[w][0]){case e:M++,P+=b[w][1],w++;break;case n:R++,I+=b[w][1],w++;break;case t:var K=w-M-R-1;if(q){if(K>=0&&S(b[K][1])){var C=b[K][1].slice(-1);if(b[K][1]=b[K][1].slice(0,-1),I=C+I,P=C+P,!b[K][1]){b.splice(K,1),w--;var $=K-1;b[$]&&b[$][0]===e&&(M++,P=b[$][1]+P,$--),b[$]&&b[$][0]===n&&(R++,I=b[$][1]+I,$--),K=$}}if(v(b[w][1])){var C=b[w][1].charAt(0);b[w][1]=b[w][1].slice(1),I+=C,P+=C}}if(w<b.length-1&&!b[w][1]){b.splice(w,1);break}if(I.length>0||P.length>0){I.length>0&&P.length>0&&(U=l(P,I),U!==0&&(K>=0?b[K][1]+=P.substring(0,U):(b.splice(0,0,[t,P.substring(0,U)]),w++),P=P.substring(U),I=I.substring(U)),U=u(P,I),U!==0&&(b[w][1]=P.substring(P.length-U)+b[w][1],P=P.substring(0,P.length-U),I=I.substring(0,I.length-U)));var F=M+R;I.length===0&&P.length===0?(b.splice(w-F,F),w=w-F):I.length===0?(b.splice(w-F,F,[e,P]),w=w-F+1):P.length===0?(b.splice(w-F,F,[n,I]),w=w-F+1):(b.splice(w-F,F,[n,I],[e,P]),w=w-F+2)}w!==0&&b[w-1][0]===t?(b[w-1][1]+=b[w][1],b.splice(w,1)):w++,M=0,R=0,I="",P="";break}}b[b.length-1][1]===""&&b.pop();var Z=!1;for(w=1;w<b.length-1;)b[w-1][0]===t&&b[w+1][0]===t&&(b[w][1].substring(b[w][1].length-b[w-1][1].length)===b[w-1][1]?(b[w][1]=b[w-1][1]+b[w][1].substring(0,b[w][1].length-b[w-1][1].length),b[w+1][1]=b[w-1][1]+b[w+1][1],b.splice(w-1,1),Z=!0):b[w][1].substring(0,b[w+1][1].length)==b[w+1][1]&&(b[w-1][1]+=b[w+1][1],b[w][1]=b[w][1].substring(b[w+1][1].length)+b[w+1][1],b.splice(w+1,1),Z=!0)),w++;Z&&A(b,q)}function k(b){return b>=55296&&b<=56319}function D(b){return b>=56320&&b<=57343}function v(b){return D(b.charCodeAt(0))}function S(b){return k(b.charCodeAt(b.length-1))}function j(b){for(var q=[],w=0;w<b.length;w++)b[w][1].length>0&&q.push(b[w]);return q}function B(b,q,w,R){return S(b)||v(R)?null:j([[t,b],[n,q],[e,w],[t,R]])}function z(b,q,w){var R=typeof w=="number"?{index:w,length:0}:w.oldRange,M=typeof w=="number"?null:w.newRange,I=b.length,P=q.length;if(R.length===0&&(M===null||M.length===0)){var U=R.index,K=b.slice(0,U),C=b.slice(U),$=M?M.index:null;e:{var F=U+P-I;if($!==null&&$!==F||F<0||F>P)break e;var Z=q.slice(0,F),J=q.slice(F);if(J!==C)break e;var H=Math.min(U,F),le=K.slice(0,H),ue=Z.slice(0,H);if(le!==ue)break e;var Y=K.slice(H),ne=Z.slice(H);return B(le,Y,ne,C)}e:{if($!==null&&$!==U)break e;var re=U,Z=q.slice(0,re),J=q.slice(re);if(Z!==K)break e;var ie=Math.min(I-re,P-re),ce=C.slice(C.length-ie),he=J.slice(J.length-ie);if(ce!==he)break e;var Y=C.slice(0,C.length-ie),ne=J.slice(0,J.length-ie);return B(K,Y,ne,ce)}}if(R.length>0&&M&&M.length===0)e:{var le=b.slice(0,R.index),ce=b.slice(R.index+R.length),H=le.length,ie=ce.length;if(P<H+ie)break e;var ue=q.slice(0,H),he=q.slice(P-ie);if(le!==ue||ce!==he)break e;var Y=b.slice(H,I-ie),ne=q.slice(H,P-ie);return B(le,Y,ne,ce)}return null}function ee(b,q,w,R){return r(b,q,w,R,!0)}return ee.INSERT=e,ee.DELETE=n,ee.EQUAL=t,ei=ee,ei}var Hn={exports:{}};Hn.exports;var Ja;function Dl(){return Ja||(Ja=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",p="[object Function]",g="[object GeneratorFunction]",h="[object Map]",m="[object Number]",E="[object Object]",y="[object Promise]",N="[object RegExp]",T="[object Set]",A="[object String]",k="[object Symbol]",D="[object WeakMap]",v="[object ArrayBuffer]",S="[object DataView]",j="[object Float32Array]",B="[object Float64Array]",z="[object Int8Array]",ee="[object Int16Array]",b="[object Int32Array]",q="[object Uint8Array]",w="[object Uint8ClampedArray]",R="[object Uint16Array]",M="[object Uint32Array]",I=/[\\^$.*+?()[\]{}|]/g,P=/\w*$/,U=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,C={};C[i]=C[a]=C[v]=C[S]=C[l]=C[c]=C[j]=C[B]=C[z]=C[ee]=C[b]=C[h]=C[m]=C[E]=C[N]=C[T]=C[A]=C[k]=C[q]=C[w]=C[R]=C[M]=!0,C[u]=C[p]=C[D]=!1;var $=typeof vt=="object"&&vt&&vt.Object===Object&&vt,F=typeof self=="object"&&self&&self.Object===Object&&self,Z=$||F||Function("return this")(),J=e&&!e.nodeType&&e,H=J&&!0&&n&&!n.nodeType&&n,le=H&&H.exports===J;function ue(o,f){return o.set(f[0],f[1]),o}function Y(o,f){return o.add(f),o}function ne(o,f){for(var x=-1,O=o?o.length:0;++x<O&&f(o[x],x,o)!==!1;);return o}function re(o,f){for(var x=-1,O=f.length,Q=o.length;++x<O;)o[Q+x]=f[x];return o}function ie(o,f,x,O){for(var Q=-1,X=o?o.length:0;++Q<X;)x=f(x,o[Q],Q,o);return x}function ce(o,f){for(var x=-1,O=Array(o);++x<o;)O[x]=f(x);return O}function he(o,f){return o?.[f]}function pe(o){var f=!1;if(o!=null&&typeof o.toString!="function")try{f=!!(o+"")}catch{}return f}function Ee(o){var f=-1,x=Array(o.size);return o.forEach(function(O,Q){x[++f]=[Q,O]}),x}function vn(o,f){return function(x){return o(f(x))}}function lr(o){var f=-1,x=Array(o.size);return o.forEach(function(O){x[++f]=O}),x}var is=Array.prototype,as=Function.prototype,Gt=Object.prototype,yn=Z["__core-js_shared__"],cr=function(){var o=/[^.]+$/.exec(yn&&yn.keys&&yn.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),ur=as.toString,Ye=Gt.hasOwnProperty,Vt=Gt.toString,os=RegExp("^"+ur.call(Ye).replace(I,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),St=le?Z.Buffer:void 0,Wt=Z.Symbol,xn=Z.Uint8Array,je=vn(Object.getPrototypeOf,Object),hr=Object.create,dr=Gt.propertyIsEnumerable,ls=is.splice,En=Object.getOwnPropertySymbols,Kt=St?St.isBuffer:void 0,fr=vn(Object.keys,Object),Yt=Fe(Z,"DataView"),Ct=Fe(Z,"Map"),Be=Fe(Z,"Promise"),Xt=Fe(Z,"Set"),Nn=Fe(Z,"WeakMap"),_t=Fe(Object,"create"),wn=Se(Yt),Ot=Se(Ct),Tn=Se(Be),An=Se(Xt),Sn=Se(Nn),pt=Wt?Wt.prototype:void 0,pr=pt?pt.valueOf:void 0;function st(o){var f=-1,x=o?o.length:0;for(this.clear();++f<x;){var O=o[f];this.set(O[0],O[1])}}function cs(){this.__data__=_t?_t(null):{}}function us(o){return this.has(o)&&delete this.__data__[o]}function hs(o){var f=this.__data__;if(_t){var x=f[o];return x===r?void 0:x}return Ye.call(f,o)?f[o]:void 0}function gr(o){var f=this.__data__;return _t?f[o]!==void 0:Ye.call(f,o)}function Cn(o,f){var x=this.__data__;return x[o]=_t&&f===void 0?r:f,this}st.prototype.clear=cs,st.prototype.delete=us,st.prototype.get=hs,st.prototype.has=gr,st.prototype.set=Cn;function be(o){var f=-1,x=o?o.length:0;for(this.clear();++f<x;){var O=o[f];this.set(O[0],O[1])}}function ds(){this.__data__=[]}function fs(o){var f=this.__data__,x=Jt(f,o);if(x<0)return!1;var O=f.length-1;return x==O?f.pop():ls.call(f,x,1),!0}function ps(o){var f=this.__data__,x=Jt(f,o);return x<0?void 0:f[x][1]}function gs(o){return Jt(this.__data__,o)>-1}function ms(o,f){var x=this.__data__,O=Jt(x,o);return O<0?x.push([o,f]):x[O][1]=f,this}be.prototype.clear=ds,be.prototype.delete=fs,be.prototype.get=ps,be.prototype.has=gs,be.prototype.set=ms;function Ne(o){var f=-1,x=o?o.length:0;for(this.clear();++f<x;){var O=o[f];this.set(O[0],O[1])}}function bs(){this.__data__={hash:new st,map:new(Ct||be),string:new st}}function vs(o){return Lt(this,o).delete(o)}function ys(o){return Lt(this,o).get(o)}function xs(o){return Lt(this,o).has(o)}function Es(o,f){return Lt(this,o).set(o,f),this}Ne.prototype.clear=bs,Ne.prototype.delete=vs,Ne.prototype.get=ys,Ne.prototype.has=xs,Ne.prototype.set=Es;function Re(o){this.__data__=new be(o)}function Ns(){this.__data__=new be}function ws(o){return this.__data__.delete(o)}function Ts(o){return this.__data__.get(o)}function As(o){return this.__data__.has(o)}function Ss(o,f){var x=this.__data__;if(x instanceof be){var O=x.__data__;if(!Ct||O.length<t-1)return O.push([o,f]),this;x=this.__data__=new Ne(O)}return x.set(o,f),this}Re.prototype.clear=Ns,Re.prototype.delete=ws,Re.prototype.get=Ts,Re.prototype.has=As,Re.prototype.set=Ss;function Zt(o,f){var x=Ln(o)||en(o)?ce(o.length,String):[],O=x.length,Q=!!O;for(var X in o)Ye.call(o,X)&&!(Q&&(X=="length"||Bs(X,O)))&&x.push(X);return x}function mr(o,f,x){var O=o[f];(!(Ye.call(o,f)&&Er(O,x))||x===void 0&&!(f in o))&&(o[f]=x)}function Jt(o,f){for(var x=o.length;x--;)if(Er(o[x][0],f))return x;return-1}function Xe(o,f){return o&&Rn(f,jn(f),o)}function _n(o,f,x,O,Q,X,ae){var se;if(O&&(se=X?O(o,Q,X,ae):O(o)),se!==void 0)return se;if(!Je(o))return o;var ge=Ln(o);if(ge){if(se=Ps(o),!f)return qs(o,se)}else{var oe=at(o),we=oe==p||oe==g;if(Nr(o))return Qt(o,f);if(oe==E||oe==i||we&&!X){if(pe(o))return X?o:{};if(se=Ze(we?{}:o),!f)return Ms(o,Xe(se,o))}else{if(!C[oe])return X?o:{};se=$s(o,oe,_n,f)}}ae||(ae=new Re);var Le=ae.get(o);if(Le)return Le;if(ae.set(o,se),!ge)var me=x?Ds(o):jn(o);return ne(me||o,function(Te,ve){me&&(ve=Te,Te=o[ve]),mr(se,ve,_n(Te,f,x,O,ve,o,ae))}),se}function Cs(o){return Je(o)?hr(o):{}}function _s(o,f,x){var O=f(o);return Ln(o)?O:re(O,x(o))}function Os(o){return Vt.call(o)}function Rs(o){if(!Je(o)||Us(o))return!1;var f=kn(o)||pe(o)?os:U;return f.test(Se(o))}function Ls(o){if(!yr(o))return fr(o);var f=[];for(var x in Object(o))Ye.call(o,x)&&x!="constructor"&&f.push(x);return f}function Qt(o,f){if(f)return o.slice();var x=new o.constructor(o.length);return o.copy(x),x}function On(o){var f=new o.constructor(o.byteLength);return new xn(f).set(new xn(o)),f}function Rt(o,f){var x=f?On(o.buffer):o.buffer;return new o.constructor(x,o.byteOffset,o.byteLength)}function br(o,f,x){var O=f?x(Ee(o),!0):Ee(o);return ie(O,ue,new o.constructor)}function vr(o){var f=new o.constructor(o.source,P.exec(o));return f.lastIndex=o.lastIndex,f}function ks(o,f,x){var O=f?x(lr(o),!0):lr(o);return ie(O,Y,new o.constructor)}function js(o){return pr?Object(pr.call(o)):{}}function Is(o,f){var x=f?On(o.buffer):o.buffer;return new o.constructor(x,o.byteOffset,o.length)}function qs(o,f){var x=-1,O=o.length;for(f||(f=Array(O));++x<O;)f[x]=o[x];return f}function Rn(o,f,x,O){x||(x={});for(var Q=-1,X=f.length;++Q<X;){var ae=f[Q],se=void 0;mr(x,ae,se===void 0?o[ae]:se)}return x}function Ms(o,f){return Rn(o,it(o),f)}function Ds(o){return _s(o,jn,it)}function Lt(o,f){var x=o.__data__;return Fs(f)?x[typeof f=="string"?"string":"hash"]:x.map}function Fe(o,f){var x=he(o,f);return Rs(x)?x:void 0}var it=En?vn(En,Object):zs,at=Os;(Yt&&at(new Yt(new ArrayBuffer(1)))!=S||Ct&&at(new Ct)!=h||Be&&at(Be.resolve())!=y||Xt&&at(new Xt)!=T||Nn&&at(new Nn)!=D)&&(at=function(o){var f=Vt.call(o),x=f==E?o.constructor:void 0,O=x?Se(x):void 0;if(O)switch(O){case wn:return S;case Ot:return h;case Tn:return y;case An:return T;case Sn:return D}return f});function Ps(o){var f=o.length,x=o.constructor(f);return f&&typeof o[0]=="string"&&Ye.call(o,"index")&&(x.index=o.index,x.input=o.input),x}function Ze(o){return typeof o.constructor=="function"&&!yr(o)?Cs(je(o)):{}}function $s(o,f,x,O){var Q=o.constructor;switch(f){case v:return On(o);case l:case c:return new Q(+o);case S:return Rt(o,O);case j:case B:case z:case ee:case b:case q:case w:case R:case M:return Is(o,O);case h:return br(o,O,x);case m:case A:return new Q(o);case N:return vr(o);case T:return ks(o,O,x);case k:return js(o)}}function Bs(o,f){return f=f??s,!!f&&(typeof o=="number"||K.test(o))&&o>-1&&o%1==0&&o<f}function Fs(o){var f=typeof o;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?o!=="__proto__":o===null}function Us(o){return!!cr&&cr in o}function yr(o){var f=o&&o.constructor,x=typeof f=="function"&&f.prototype||Gt;return o===x}function Se(o){if(o!=null){try{return ur.call(o)}catch{}try{return o+""}catch{}}return""}function xr(o){return _n(o,!0,!0)}function Er(o,f){return o===f||o!==o&&f!==f}function en(o){return Hs(o)&&Ye.call(o,"callee")&&(!dr.call(o,"callee")||Vt.call(o)==i)}var Ln=Array.isArray;function tn(o){return o!=null&&wr(o.length)&&!kn(o)}function Hs(o){return Tr(o)&&tn(o)}var Nr=Kt||Gs;function kn(o){var f=Je(o)?Vt.call(o):"";return f==p||f==g}function wr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function Je(o){var f=typeof o;return!!o&&(f=="object"||f=="function")}function Tr(o){return!!o&&typeof o=="object"}function jn(o){return tn(o)?Zt(o):Ls(o)}function zs(){return[]}function Gs(){return!1}n.exports=xr}(Hn,Hn.exports)),Hn.exports}var zn={exports:{}};zn.exports;var Qa;function Pl(){return Qa||(Qa=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",p="[object Boolean]",g="[object Date]",h="[object Error]",m="[object Function]",E="[object GeneratorFunction]",y="[object Map]",N="[object Number]",T="[object Null]",A="[object Object]",k="[object Promise]",D="[object Proxy]",v="[object RegExp]",S="[object Set]",j="[object String]",B="[object Symbol]",z="[object Undefined]",ee="[object WeakMap]",b="[object ArrayBuffer]",q="[object DataView]",w="[object Float32Array]",R="[object Float64Array]",M="[object Int8Array]",I="[object Int16Array]",P="[object Int32Array]",U="[object Uint8Array]",K="[object Uint8ClampedArray]",C="[object Uint16Array]",$="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,H={};H[w]=H[R]=H[M]=H[I]=H[P]=H[U]=H[K]=H[C]=H[$]=!0,H[l]=H[c]=H[b]=H[p]=H[q]=H[g]=H[h]=H[m]=H[y]=H[N]=H[A]=H[v]=H[S]=H[j]=H[ee]=!1;var le=typeof vt=="object"&&vt&&vt.Object===Object&&vt,ue=typeof self=="object"&&self&&self.Object===Object&&self,Y=le||ue||Function("return this")(),ne=e&&!e.nodeType&&e,re=ne&&!0&&n&&!n.nodeType&&n,ie=re&&re.exports===ne,ce=ie&&le.process,he=function(){try{return ce&&ce.binding&&ce.binding("util")}catch{}}(),pe=he&&he.isTypedArray;function Ee(o,f){for(var x=-1,O=o==null?0:o.length,Q=0,X=[];++x<O;){var ae=o[x];f(ae,x,o)&&(X[Q++]=ae)}return X}function vn(o,f){for(var x=-1,O=f.length,Q=o.length;++x<O;)o[Q+x]=f[x];return o}function lr(o,f){for(var x=-1,O=o==null?0:o.length;++x<O;)if(f(o[x],x,o))return!0;return!1}function is(o,f){for(var x=-1,O=Array(o);++x<o;)O[x]=f(x);return O}function as(o){return function(f){return o(f)}}function Gt(o,f){return o.has(f)}function yn(o,f){return o?.[f]}function cr(o){var f=-1,x=Array(o.size);return o.forEach(function(O,Q){x[++f]=[Q,O]}),x}function ur(o,f){return function(x){return o(f(x))}}function Ye(o){var f=-1,x=Array(o.size);return o.forEach(function(O){x[++f]=O}),x}var Vt=Array.prototype,os=Function.prototype,St=Object.prototype,Wt=Y["__core-js_shared__"],xn=os.toString,je=St.hasOwnProperty,hr=function(){var o=/[^.]+$/.exec(Wt&&Wt.keys&&Wt.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),dr=St.toString,ls=RegExp("^"+xn.call(je).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),En=ie?Y.Buffer:void 0,Kt=Y.Symbol,fr=Y.Uint8Array,Yt=St.propertyIsEnumerable,Ct=Vt.splice,Be=Kt?Kt.toStringTag:void 0,Xt=Object.getOwnPropertySymbols,Nn=En?En.isBuffer:void 0,_t=ur(Object.keys,Object),wn=it(Y,"DataView"),Ot=it(Y,"Map"),Tn=it(Y,"Promise"),An=it(Y,"Set"),Sn=it(Y,"WeakMap"),pt=it(Object,"create"),pr=Se(wn),st=Se(Ot),cs=Se(Tn),us=Se(An),hs=Se(Sn),gr=Kt?Kt.prototype:void 0,Cn=gr?gr.valueOf:void 0;function be(o){var f=-1,x=o==null?0:o.length;for(this.clear();++f<x;){var O=o[f];this.set(O[0],O[1])}}function ds(){this.__data__=pt?pt(null):{},this.size=0}function fs(o){var f=this.has(o)&&delete this.__data__[o];return this.size-=f?1:0,f}function ps(o){var f=this.__data__;if(pt){var x=f[o];return x===r?void 0:x}return je.call(f,o)?f[o]:void 0}function gs(o){var f=this.__data__;return pt?f[o]!==void 0:je.call(f,o)}function ms(o,f){var x=this.__data__;return this.size+=this.has(o)?0:1,x[o]=pt&&f===void 0?r:f,this}be.prototype.clear=ds,be.prototype.delete=fs,be.prototype.get=ps,be.prototype.has=gs,be.prototype.set=ms;function Ne(o){var f=-1,x=o==null?0:o.length;for(this.clear();++f<x;){var O=o[f];this.set(O[0],O[1])}}function bs(){this.__data__=[],this.size=0}function vs(o){var f=this.__data__,x=Qt(f,o);if(x<0)return!1;var O=f.length-1;return x==O?f.pop():Ct.call(f,x,1),--this.size,!0}function ys(o){var f=this.__data__,x=Qt(f,o);return x<0?void 0:f[x][1]}function xs(o){return Qt(this.__data__,o)>-1}function Es(o,f){var x=this.__data__,O=Qt(x,o);return O<0?(++this.size,x.push([o,f])):x[O][1]=f,this}Ne.prototype.clear=bs,Ne.prototype.delete=vs,Ne.prototype.get=ys,Ne.prototype.has=xs,Ne.prototype.set=Es;function Re(o){var f=-1,x=o==null?0:o.length;for(this.clear();++f<x;){var O=o[f];this.set(O[0],O[1])}}function Ns(){this.size=0,this.__data__={hash:new be,map:new(Ot||Ne),string:new be}}function ws(o){var f=Fe(this,o).delete(o);return this.size-=f?1:0,f}function Ts(o){return Fe(this,o).get(o)}function As(o){return Fe(this,o).has(o)}function Ss(o,f){var x=Fe(this,o),O=x.size;return x.set(o,f),this.size+=x.size==O?0:1,this}Re.prototype.clear=Ns,Re.prototype.delete=ws,Re.prototype.get=Ts,Re.prototype.has=As,Re.prototype.set=Ss;function Zt(o){var f=-1,x=o==null?0:o.length;for(this.__data__=new Re;++f<x;)this.add(o[f])}function mr(o){return this.__data__.set(o,r),this}function Jt(o){return this.__data__.has(o)}Zt.prototype.add=Zt.prototype.push=mr,Zt.prototype.has=Jt;function Xe(o){var f=this.__data__=new Ne(o);this.size=f.size}function _n(){this.__data__=new Ne,this.size=0}function Cs(o){var f=this.__data__,x=f.delete(o);return this.size=f.size,x}function _s(o){return this.__data__.get(o)}function Os(o){return this.__data__.has(o)}function Rs(o,f){var x=this.__data__;if(x instanceof Ne){var O=x.__data__;if(!Ot||O.length<t-1)return O.push([o,f]),this.size=++x.size,this;x=this.__data__=new Re(O)}return x.set(o,f),this.size=x.size,this}Xe.prototype.clear=_n,Xe.prototype.delete=Cs,Xe.prototype.get=_s,Xe.prototype.has=Os,Xe.prototype.set=Rs;function Ls(o,f){var x=en(o),O=!x&&Er(o),Q=!x&&!O&&tn(o),X=!x&&!O&&!Q&&Tr(o),ae=x||O||Q||X,se=ae?is(o.length,String):[],ge=se.length;for(var oe in o)je.call(o,oe)&&!(ae&&(oe=="length"||Q&&(oe=="offset"||oe=="parent")||X&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||$s(oe,ge)))&&se.push(oe);return se}function Qt(o,f){for(var x=o.length;x--;)if(xr(o[x][0],f))return x;return-1}function On(o,f,x){var O=f(o);return en(o)?O:vn(O,x(o))}function Rt(o){return o==null?o===void 0?z:T:Be&&Be in Object(o)?at(o):yr(o)}function br(o){return Je(o)&&Rt(o)==l}function vr(o,f,x,O,Q){return o===f?!0:o==null||f==null||!Je(o)&&!Je(f)?o!==o&&f!==f:ks(o,f,x,O,vr,Q)}function ks(o,f,x,O,Q,X){var ae=en(o),se=en(f),ge=ae?c:Ze(o),oe=se?c:Ze(f);ge=ge==l?A:ge,oe=oe==l?A:oe;var we=ge==A,Le=oe==A,me=ge==oe;if(me&&tn(o)){if(!tn(f))return!1;ae=!0,we=!1}if(me&&!we)return X||(X=new Xe),ae||Tr(o)?Rn(o,f,x,O,Q,X):Ms(o,f,ge,x,O,Q,X);if(!(x&s)){var Te=we&&je.call(o,"__wrapped__"),ve=Le&&je.call(f,"__wrapped__");if(Te||ve){var gt=Te?o.value():o,ot=ve?f.value():f;return X||(X=new Xe),Q(gt,ot,x,O,X)}}return me?(X||(X=new Xe),Ds(o,f,x,O,Q,X)):!1}function js(o){if(!wr(o)||Fs(o))return!1;var f=Nr(o)?ls:Z;return f.test(Se(o))}function Is(o){return Je(o)&&kn(o.length)&&!!H[Rt(o)]}function qs(o){if(!Us(o))return _t(o);var f=[];for(var x in Object(o))je.call(o,x)&&x!="constructor"&&f.push(x);return f}function Rn(o,f,x,O,Q,X){var ae=x&s,se=o.length,ge=f.length;if(se!=ge&&!(ae&&ge>se))return!1;var oe=X.get(o);if(oe&&X.get(f))return oe==f;var we=-1,Le=!0,me=x&i?new Zt:void 0;for(X.set(o,f),X.set(f,o);++we<se;){var Te=o[we],ve=f[we];if(O)var gt=ae?O(ve,Te,we,f,o,X):O(Te,ve,we,o,f,X);if(gt!==void 0){if(gt)continue;Le=!1;break}if(me){if(!lr(f,function(ot,kt){if(!Gt(me,kt)&&(Te===ot||Q(Te,ot,x,O,X)))return me.push(kt)})){Le=!1;break}}else if(!(Te===ve||Q(Te,ve,x,O,X))){Le=!1;break}}return X.delete(o),X.delete(f),Le}function Ms(o,f,x,O,Q,X,ae){switch(x){case q:if(o.byteLength!=f.byteLength||o.byteOffset!=f.byteOffset)return!1;o=o.buffer,f=f.buffer;case b:return!(o.byteLength!=f.byteLength||!X(new fr(o),new fr(f)));case p:case g:case N:return xr(+o,+f);case h:return o.name==f.name&&o.message==f.message;case v:case j:return o==f+"";case y:var se=cr;case S:var ge=O&s;if(se||(se=Ye),o.size!=f.size&&!ge)return!1;var oe=ae.get(o);if(oe)return oe==f;O|=i,ae.set(o,f);var we=Rn(se(o),se(f),O,Q,X,ae);return ae.delete(o),we;case B:if(Cn)return Cn.call(o)==Cn.call(f)}return!1}function Ds(o,f,x,O,Q,X){var ae=x&s,se=Lt(o),ge=se.length,oe=Lt(f),we=oe.length;if(ge!=we&&!ae)return!1;for(var Le=ge;Le--;){var me=se[Le];if(!(ae?me in f:je.call(f,me)))return!1}var Te=X.get(o);if(Te&&X.get(f))return Te==f;var ve=!0;X.set(o,f),X.set(f,o);for(var gt=ae;++Le<ge;){me=se[Le];var ot=o[me],kt=f[me];if(O)var Zi=ae?O(kt,ot,me,f,o,X):O(ot,kt,me,o,f,X);if(!(Zi===void 0?ot===kt||Q(ot,kt,x,O,X):Zi)){ve=!1;break}gt||(gt=me=="constructor")}if(ve&&!gt){var Ar=o.constructor,Sr=f.constructor;Ar!=Sr&&"constructor"in o&&"constructor"in f&&!(typeof Ar=="function"&&Ar instanceof Ar&&typeof Sr=="function"&&Sr instanceof Sr)&&(ve=!1)}return X.delete(o),X.delete(f),ve}function Lt(o){return On(o,jn,Ps)}function Fe(o,f){var x=o.__data__;return Bs(f)?x[typeof f=="string"?"string":"hash"]:x.map}function it(o,f){var x=yn(o,f);return js(x)?x:void 0}function at(o){var f=je.call(o,Be),x=o[Be];try{o[Be]=void 0;var O=!0}catch{}var Q=dr.call(o);return O&&(f?o[Be]=x:delete o[Be]),Q}var Ps=Xt?function(o){return o==null?[]:(o=Object(o),Ee(Xt(o),function(f){return Yt.call(o,f)}))}:zs,Ze=Rt;(wn&&Ze(new wn(new ArrayBuffer(1)))!=q||Ot&&Ze(new Ot)!=y||Tn&&Ze(Tn.resolve())!=k||An&&Ze(new An)!=S||Sn&&Ze(new Sn)!=ee)&&(Ze=function(o){var f=Rt(o),x=f==A?o.constructor:void 0,O=x?Se(x):"";if(O)switch(O){case pr:return q;case st:return y;case cs:return k;case us:return S;case hs:return ee}return f});function $s(o,f){return f=f??a,!!f&&(typeof o=="number"||J.test(o))&&o>-1&&o%1==0&&o<f}function Bs(o){var f=typeof o;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?o!=="__proto__":o===null}function Fs(o){return!!hr&&hr in o}function Us(o){var f=o&&o.constructor,x=typeof f=="function"&&f.prototype||St;return o===x}function yr(o){return dr.call(o)}function Se(o){if(o!=null){try{return xn.call(o)}catch{}try{return o+""}catch{}}return""}function xr(o,f){return o===f||o!==o&&f!==f}var Er=br(function(){return arguments}())?br:function(o){return Je(o)&&je.call(o,"callee")&&!Yt.call(o,"callee")},en=Array.isArray;function Ln(o){return o!=null&&kn(o.length)&&!Nr(o)}var tn=Nn||Gs;function Hs(o,f){return vr(o,f)}function Nr(o){if(!wr(o))return!1;var f=Rt(o);return f==m||f==E||f==u||f==D}function kn(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=a}function wr(o){var f=typeof o;return o!=null&&(f=="object"||f=="function")}function Je(o){return o!=null&&typeof o=="object"}var Tr=pe?as(pe):Is;function jn(o){return Ln(o)?Ls(o):qs(o)}function zs(){return[]}function Gs(){return!1}n.exports=Hs}(zn,zn.exports)),zn.exports}var jr={},eo;function hg(){if(eo)return jr;eo=1,Object.defineProperty(jr,"__esModule",{value:!0});const n=Dl(),e=Pl();var t;return function(r){function s(c={},u={},p=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let g=n(u);p||(g=Object.keys(g).reduce((h,m)=>(g[m]!=null&&(h[m]=g[m]),h),{}));for(const h in c)c[h]!==void 0&&u[h]===void 0&&(g[h]=c[h]);return Object.keys(g).length>0?g:void 0}r.compose=s;function i(c={},u={}){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});const p=Object.keys(c).concat(Object.keys(u)).reduce((g,h)=>(e(c[h],u[h])||(g[h]=u[h]===void 0?null:u[h]),g),{});return Object.keys(p).length>0?p:void 0}r.diff=i;function a(c={},u={}){c=c||{};const p=Object.keys(u).reduce((g,h)=>(u[h]!==c[h]&&c[h]!==void 0&&(g[h]=u[h]),g),{});return Object.keys(c).reduce((g,h)=>(c[h]!==u[h]&&u[h]===void 0&&(g[h]=null),g),p)}r.invert=a;function l(c,u,p=!1){if(typeof c!="object")return u;if(typeof u!="object")return;if(!p)return u;const g=Object.keys(u).reduce((h,m)=>(c[m]===void 0&&(h[m]=u[m]),h),{});return Object.keys(g).length>0?g:void 0}r.transform=l}(t||(t={})),jr.default=t,jr}var Ir={},to;function $l(){if(to)return Ir;to=1,Object.defineProperty(Ir,"__esModule",{value:!0});var n;return function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t}(n||(n={})),Ir.default=n,Ir}var qr={},no;function dg(){if(no)return qr;no=1,Object.defineProperty(qr,"__esModule",{value:!0});const n=$l();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,a=n.default.length(s);if(r>=a-i?(r=a-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const l={};return s.attributes&&(l.attributes=s.attributes),typeof s.retain=="number"?l.retain=r:typeof s.retain=="object"&&s.retain!==null?l.retain=s.retain:typeof s.insert=="string"?l.insert=s.insert.substr(i,r):l.insert=s.insert,l}}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 r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(a)}}else return[]}}return qr.default=e,qr}var ro;function fg(){return ro||(ro=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=ug(),r=Dl(),s=Pl(),i=hg();e.AttributeMap=i.default;const a=$l();e.Op=a.default;const l=dg();e.OpIterator=l.default;const c="\0",u=(g,h)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const m=Object.keys(g)[0];if(!m||m!==Object.keys(h)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(h)[0]}`);return[m,g[m],h[m]]};class p{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,m){this.handlers[h]=m}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const m=this.handlers[h];if(!m)throw new Error(`no handlers for embed type "${h}"`);return m}insert(h,m){const E={};return typeof h=="string"&&h.length===0?this:(E.insert=h,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(E.attributes=m),this.push(E))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,m){if(typeof h=="number"&&h<=0)return this;const E={retain:h};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(E.attributes=m),this.push(E)}push(h){let m=this.ops.length,E=this.ops[m-1];if(h=r(h),typeof E=="object"){if(typeof h.delete=="number"&&typeof E.delete=="number")return this.ops[m-1]={delete:E.delete+h.delete},this;if(typeof E.delete=="number"&&h.insert!=null&&(m-=1,E=this.ops[m-1],typeof E!="object"))return this.ops.unshift(h),this;if(s(h.attributes,E.attributes)){if(typeof h.insert=="string"&&typeof E.insert=="string")return this.ops[m-1]={insert:E.insert+h.insert},typeof h.attributes=="object"&&(this.ops[m-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof E.retain=="number")return this.ops[m-1]={retain:E.retain+h.retain},typeof h.attributes=="object"&&(this.ops[m-1].attributes=h.attributes),this}}return m===this.ops.length?this.ops.push(h):this.ops.splice(m,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 m=[],E=[];return this.forEach(y=>{(h(y)?m:E).push(y)}),[m,E]}reduce(h,m){return this.ops.reduce(h,m)}changeLength(){return this.reduce((h,m)=>m.insert?h+a.default.length(m):m.delete?h-m.delete:h,0)}length(){return this.reduce((h,m)=>h+a.default.length(m),0)}slice(h=0,m=1/0){const E=[],y=new l.default(this.ops);let N=0;for(;N<m&&y.hasNext();){let T;N<h?T=y.next(h-N):(T=y.next(m-N),E.push(T)),N+=a.default.length(T)}return new p(E)}compose(h){const m=new l.default(this.ops),E=new l.default(h.ops),y=[],N=E.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let A=N.retain;for(;m.peekType()==="insert"&&m.peekLength()<=A;)A-=m.peekLength(),y.push(m.next());N.retain-A>0&&E.next(N.retain-A)}const T=new p(y);for(;m.hasNext()||E.hasNext();)if(E.peekType()==="insert")T.push(E.next());else if(m.peekType()==="delete")T.push(m.next());else{const A=Math.min(m.peekLength(),E.peekLength()),k=m.next(A),D=E.next(A);if(D.retain){const v={};if(typeof k.retain=="number")v.retain=typeof D.retain=="number"?A:D.retain;else if(typeof D.retain=="number")k.retain==null?v.insert=k.insert:v.retain=k.retain;else{const j=k.retain==null?"insert":"retain",[B,z,ee]=u(k[j],D.retain),b=p.getHandler(B);v[j]={[B]:b.compose(z,ee,j==="retain")}}const S=i.default.compose(k.attributes,D.attributes,typeof k.retain=="number");if(S&&(v.attributes=S),T.push(v),!E.hasNext()&&s(T.ops[T.ops.length-1],v)){const j=new p(m.rest());return T.concat(j).chop()}}else typeof D.delete=="number"&&(typeof k.retain=="number"||typeof k.retain=="object"&&k.retain!==null)&&T.push(D)}return T.chop()}concat(h){const m=new p(this.ops.slice());return h.ops.length>0&&(m.push(h.ops[0]),m.ops=m.ops.concat(h.ops.slice(1))),m}diff(h,m){if(this.ops===h.ops)return new p;const E=[this,h].map(k=>k.map(D=>{if(D.insert!=null)return typeof D.insert=="string"?D.insert:c;const v=k===h?"on":"with";throw new Error("diff() called "+v+" non-document")}).join("")),y=new p,N=t(E[0],E[1],m,!0),T=new l.default(this.ops),A=new l.default(h.ops);return N.forEach(k=>{let D=k[1].length;for(;D>0;){let v=0;switch(k[0]){case t.INSERT:v=Math.min(A.peekLength(),D),y.push(A.next(v));break;case t.DELETE:v=Math.min(D,T.peekLength()),T.next(v),y.delete(v);break;case t.EQUAL:v=Math.min(T.peekLength(),A.peekLength(),D);const S=T.next(v),j=A.next(v);s(S.insert,j.insert)?y.retain(v,i.default.diff(S.attributes,j.attributes)):y.push(j).delete(v);break}D-=v}}),y.chop()}eachLine(h,m=`
24
- `){const E=new l.default(this.ops);let y=new p,N=0;for(;E.hasNext();){if(E.peekType()!=="insert")return;const T=E.peek(),A=a.default.length(T)-E.peekLength(),k=typeof T.insert=="string"?T.insert.indexOf(m,A)-A:-1;if(k<0)y.push(E.next());else if(k>0)y.push(E.next(k));else{if(h(y,E.next(1).attributes||{},N)===!1)return;N+=1,y=new p}}y.length()>0&&h(y,{},N)}invert(h){const m=new p;return this.reduce((E,y)=>{if(y.insert)m.delete(a.default.length(y));else{if(typeof y.retain=="number"&&y.attributes==null)return m.retain(y.retain),E+y.retain;if(y.delete||typeof y.retain=="number"){const N=y.delete||y.retain;return h.slice(E,E+N).forEach(A=>{y.delete?m.push(A):y.retain&&y.attributes&&m.retain(a.default.length(A),i.default.invert(y.attributes,A.attributes))}),E+N}else if(typeof y.retain=="object"&&y.retain!==null){const N=h.slice(E,E+1),T=new l.default(N.ops).next(),[A,k,D]=u(y.retain,T.insert),v=p.getHandler(A);return m.retain({[A]:v.invert(k,D)},i.default.invert(y.attributes,T.attributes)),E+1}}return E},0),m.chop()}transform(h,m=!1){if(m=!!m,typeof h=="number")return this.transformPosition(h,m);const E=h,y=new l.default(this.ops),N=new l.default(E.ops),T=new p;for(;y.hasNext()||N.hasNext();)if(y.peekType()==="insert"&&(m||N.peekType()!=="insert"))T.retain(a.default.length(y.next()));else if(N.peekType()==="insert")T.push(N.next());else{const A=Math.min(y.peekLength(),N.peekLength()),k=y.next(A),D=N.next(A);if(k.delete)continue;if(D.delete)T.push(D);else{const v=k.retain,S=D.retain;let j=typeof S=="object"&&S!==null?S:A;if(typeof v=="object"&&v!==null&&typeof S=="object"&&S!==null){const B=Object.keys(v)[0];if(B===Object.keys(S)[0]){const z=p.getHandler(B);z&&(j={[B]:z.transform(v[B],S[B],m)})}}T.retain(j,i.default.transform(k.attributes,D.attributes,m))}}return T.chop()}transformPosition(h,m=!1){m=!!m;const E=new l.default(this.ops);let y=0;for(;E.hasNext()&&y<=h;){const N=E.peekLength(),T=E.peekType();if(E.next(),T==="delete"){h-=Math.min(N,h-y);continue}else T==="insert"&&(y<h||!m)&&(h+=N);y+=N}return h}}p.Op=a.default,p.OpIterator=l.default,p.AttributeMap=i.default,p.handlers={},e.default=p,n.exports=p,n.exports.default=p}(kr,kr.exports)),kr.exports}var $e=fg();const V=Oi($e);class Ke extends ke{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ke.blotName="break";Ke.tagName="BR";let Ve=class extends Wr{};const pg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ts(n){return n.replace(/[&<>"']/g,e=>pg[e])}class Ce extends Pi{static allowedChildren=[Ce,Ke,ke,Ve];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=Ce.order.indexOf(e),s=Ce.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(Ce.compare(this.statics.blotName,r)<0&&this.scroll.query(r,W.BLOT)){const i=this.isolate(e,t);s&&i.wrap(r,s)}else super.formatAt(e,t,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof Ce&&Ce.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}const so=1;class xe extends Qn{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Bl(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,W.BLOCK)?e+t===this.length()&&this.format(r,s):super.formatAt(e,Math.min(t,this.length()-e-1),r,s),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const s=t.split(`
25
- `),i=s.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 a=this;s.reduce((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ke&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+so),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()-so)){const s=this.clone();return e===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(e,t);return this.cache={},r}}xe.blotName="block";xe.tagName="P";xe.defaultChild=Ke;xe.allowedChildren=[Ke,Ce,ke,Ve];class De extends ke{attach(){super.attach(),this.attributes=new Qr(this.domNode)}delta(){return new V().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,W.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,s){this.format(r,s)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const s=t.split(`
22
+ <%s key={someKey} {...props} />`,Z,Y,ne,Y),K[Y+Z]=!0)}if(Y=null,F!==void 0&&(t(F),Y=""+F),a($)&&(t($.key),Y=""+$.key),"key"in $){F={};for(var re in $)re!=="key"&&(F[re]=$[re])}else F=$;return Y&&l(F,typeof C=="function"?C.displayName||C.name||"Unknown":C),u(C,Y,H,J,s(),F,le,ue)}function g(C){typeof C=="object"&&C!==null&&C.$$typeof===m&&C._store&&(C._store.validated=1)}var d=_,m=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),O=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),ee=Symbol.for("react.client.reference"),b=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,N=Array.isArray,L=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(C){return C()}};var M,I={},P=d.react_stack_bottom_frame.bind(d,i)(),U=L(r(i)),K={};Mn.Fragment=x,Mn.jsx=function(C,$,F,Z,J){var H=1e4>b.recentlyCreatedOwnerStacks++;return f(C,$,F,!1,Z,J,H?Error("react-stack-top-frame"):P,H?L(r(C)):U)},Mn.jsxs=function(C,$,F,Z,J){var H=1e4>b.recentlyCreatedOwnerStacks++;return f(C,$,F,!0,Z,J,H?Error("react-stack-top-frame"):P,H?L(r(C)):U)}}()),Mn}var ta;function dc(){return ta||(ta=1,process.env.NODE_ENV==="production"?Cr.exports=uc():Cr.exports=hc()),Cr.exports}var h=dc();const Je=({type:n="button",className:e,children:t,...r})=>h.jsx("button",{type:n==="submit"?"submit":"button",className:e,...r,children:t}),fc=({children:n,className:e})=>h.jsx("div",{className:`card-header ${e}`,children:n}),pc=({children:n,className:e="",...t})=>h.jsx("div",{className:`card-body ${e}`,...t,children:n}),gc=({children:n,className:e=""})=>h.jsx("div",{className:`card-footer ${e}`,children:n}),mc=({children:n,className:e="",...t})=>h.jsx("div",{className:`card ${e}`,...t,children:n}),bc=()=>h.jsx("div",{className:"spinner",children:h.jsx("svg",{className:"spinner-icon",width:"30px",height:"30px",viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{className:"path",fill:"none",strokeWidth:"6",strokeLinecap:"round",cx:"33",cy:"33",r:"30"})})}),Nt=(n,e)=>{_.useEffect(()=>{if(!Array.isArray(n)||n.length===0)return;const t=r=>{n.every(i=>i.current&&!i.current.contains(r.target))&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[n,e])},vc=({children:n,items:e,position:t="bottom-left",className:r=""})=>{const[s,i]=_.useState(!1),[a,l]=_.useState({top:0,left:0}),c=_.useRef(null),u=_.useRef(null);Nt([c,u],()=>{i(!1)}),_.useEffect(()=>{if(s&&c.current&&u.current){const g=()=>{if(!c.current||!u.current)return;const m=c.current.getBoundingClientRect(),y=u.current.getBoundingClientRect();let x=0,w=0;switch(t){case"bottom-left":x=m.bottom+4,w=m.left;break;case"bottom-right":x=m.bottom+4,w=m.right-y.width;break;case"top-left":x=m.top-y.height-4,w=m.left;break;case"top-right":x=m.top-y.height-4,w=m.right-y.width;break}l({top:Math.round(x),left:Math.round(w)})};g();const d=()=>{g()};return window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}}},[s,t]);const f=()=>{switch(t){case"bottom-right":return"dropdown-menu-end";case"top-left":return"dropup";case"top-right":return"dropup dropdown-menu-end";default:return""}};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"dropdown",ref:c,onClick:()=>i(!s),children:n}),s&&$t.createPortal(h.jsx("ul",{ref:u,style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`},className:`dropdown-menu ${f()} show ${r}`,children:e.map((g,d)=>g.divider?h.jsx("li",{children:h.jsx("hr",{className:"dropdown-divider"})},d):h.jsx("li",{children:h.jsxs("a",{className:`dropdown-item ${g.className||""}`,href:"#",onClick:m=>{m.preventDefault(),g.onClick(),i(!1)},children:[g.icon&&h.jsx("span",{className:"me-2",children:g.icon}),g.label]})},d))}),document.body)]})},yc=({children:n,className:e="",position:t="bottom-left"})=>{const[r,s]=_.useState(!1),i=_.useRef(null),a=_.useRef(null),l=_.useRef(`dropdown-${Math.random().toString(36).substr(2,9)}`),c=()=>{s(!r)};return Nt([i,a],()=>{s(!1)}),h.jsx("div",{className:`dropdown ${e}`,ref:i,id:l.current,children:_.Children.map(n,u=>_.isValidElement(u)?_.cloneElement(u,{toggleDropdown:c,isOpen:r,position:t,contentRef:a,dropdownId:l.current}):u)})},xc=({children:n,className:e="",toggleDropdown:t,dropdownId:r})=>h.jsx("div",{className:`dropdown-toggle ${e}`,onClick:t,"data-dropdown-id":r,children:n}),Ec=({children:n,className:e="",isOpen:t=!1,position:r="bottom-left",contentRef:s,dropdownId:i})=>{const[a,l]=_.useState({top:0,left:0});return _.useEffect(()=>{if(t&&s?.current){const c=()=>{const f=document.querySelector(`[data-dropdown-id="${i}"]`);if(!f||!s?.current)return;const g=f.getBoundingClientRect(),d=s.current.getBoundingClientRect();let m=0,y=0;switch(r){case"bottom-left":m=g.bottom+4,y=g.left;break;case"bottom-right":m=g.bottom+4,y=g.right-d.width;break;case"top-left":m=g.top-d.height-4,y=g.left;break;case"top-right":m=g.top-d.height-4,y=g.right-d.width;break}l({top:Math.round(m),left:Math.round(y)})};c();const u=()=>{c()};return window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}}},[t,r,s,i]),t?$t.createPortal(h.jsx("div",{ref:s,style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`},className:`dropdown-content ${r} ${e}`,children:n}),document.body):null},wc=({className:n,children:e,style:t})=>h.jsx("span",{className:n,style:t,children:e}),Nc=({children:n,className:e="",...t})=>h.jsx("div",{className:`box ${e}`,...t,children:n}),hi=({children:n})=>h.jsx(h.Fragment,{children:n}),Ro=({children:n})=>h.jsx(h.Fragment,{children:n}),Tc=({className:n="",navClassName:e="",contentClassName:t="",children:r,activeTab:s,handleActiveTab:i,customHeader:a})=>{const{tabs:l,groups:c,tabIdMap:u}=_.useMemo(()=>{const d=[],m=[],y=new Map;return _.Children.forEach(r,x=>{if(_.isValidElement(x)){if(x.type===Ro){const w=[],T=x.props;_.Children.forEach(T.children,A=>{if(_.isValidElement(A)&&A.type===hi){const O=A.props.id||`tab-${d.length}`;d.push({title:A.props.title,icon:A.props.icon,children:A.props.children,id:O});const D=d.length-1;y.set(O,D),w.push(D)}}),m.push({title:T.title,tabIndices:w})}else if(x.type===hi){const w=x.props,T=w.id||`tab-${d.length}`;d.push({title:w.title,icon:w.icon,children:w.children,id:T});const A=d.length-1;y.set(T,A)}}}),{tabs:d,groups:m,tabIdMap:y}},[r]),f=_.useMemo(()=>typeof s=="number"?s:u.get(s)??0,[s,u]);_.useEffect(()=>{l.length>0&&(f<0||f>=l.length)&&i(0)},[l.length,f,i]);const g=(d,m)=>{const y=m===f,x=()=>i(d.id);return h.jsxs("div",{className:`tab-item ${y?"active":""}`,onClick:x,role:"button",tabIndex:0,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),x())},children:[d.icon&&h.jsx("span",{className:"tab-icon",children:d.icon}),h.jsx("span",{className:"tab-title",children:d.title})]},`tab-nav-${m}`)};return h.jsxs("div",{className:`card tabs ${n}`,children:[h.jsxs("div",{className:`card-header ${e}`,children:[a,h.jsx("div",{className:"nav-tabs",role:"tablist",children:c.length>0?c.map(d=>h.jsxs(_.Fragment,{children:[h.jsx("legend",{className:"tab-item-legend",children:d.title}),d.tabIndices.map(m=>g(l[m],m))]},`group-${d.title}`)):l.map((d,m)=>g(d,m))})]}),h.jsx("div",{className:`card-body ${t}`,children:h.jsx("div",{className:"tab-content",children:h.jsx("div",{className:"tab-panel",children:l[f]?h.jsx("div",{children:l[f].children},`tab-content-${f}`):h.jsx("div",{children:"No content available"})})})})]})};var Lo={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},na=_.createContext&&_.createContext(Lo),Ac=["attr","size","title"];function Sc(n,e){if(n==null)return{};var t=Cc(n,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);for(s=0;s<i.length;s++)r=i[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}function Cc(n,e){if(n==null)return{};var t={};for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){if(e.indexOf(r)>=0)continue;t[r]=n[r]}return t}function Ur(){return Ur=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ur.apply(this,arguments)}function ra(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Hr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(t),!0).forEach(function(r){_c(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ra(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function _c(n,e,t){return e=Oc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Oc(n){var e=Rc(n,"string");return typeof e=="symbol"?e:e+""}function Rc(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ko(n){return n&&n.map((e,t)=>_.createElement(e.tag,Hr({key:t},e.attr),ko(e.child)))}function Oe(n){return e=>_.createElement(Lc,Ur({attr:Hr({},n.attr)},e),ko(n.child))}function Lc(n){var e=t=>{var{attr:r,size:s,title:i}=n,a=Sc(n,Ac),l=s||t.size||"1em",c;return t.className&&(c=t.className),n.className&&(c=(c?c+" ":"")+n.className),_.createElement("svg",Ur({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,a,{className:c,style:Hr(Hr({color:n.color||t.color},t.style),n.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&_.createElement("title",null,i),n.children)};return na!==void 0?_.createElement(na.Consumer,null,t=>e(t)):e(Lo)}function kc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"19",y1:"12",x2:"5",y2:"12"},child:[]},{tag:"polyline",attr:{points:"12 19 5 12 12 5"},child:[]}]})(n)}function di(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(n)}function Yn(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(n)}function jc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 18 9 12 15 6"},child:[]}]})(n)}function Ic(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(n)}function qc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},child:[]}]})(n)}function Mc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},child:[]}]})(n)}function Dc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"19 20 9 12 19 4 19 20"},child:[]},{tag:"line",attr:{x1:"5",y1:"19",x2:"5",y2:"5"},child:[]}]})(n)}function Pc(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polygon",attr:{points:"5 4 15 12 5 20 5 4"},child:[]},{tag:"line",attr:{x1:"19",y1:"5",x2:"19",y2:"19"},child:[]}]})(n)}function $c(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]}]})(n)}function jo(n){return Oe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(n)}var Dn={},rn={},_r={},jt={},It={},Ws={},sa;function Io(){return sa||(sa=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Doctype=n.CDATA=n.Tag=n.Style=n.Script=n.Comment=n.Directive=n.Text=n.Root=n.isTag=n.ElementType=void 0;var e;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(e=n.ElementType||(n.ElementType={}));function t(r){return r.type===e.Tag||r.type===e.Script||r.type===e.Style}n.isTag=t,n.Root=e.Root,n.Text=e.Text,n.Directive=e.Directive,n.Comment=e.Comment,n.Script=e.Script,n.Style=e.Style,n.Tag=e.Tag,n.CDATA=e.CDATA,n.Doctype=e.Doctype}(Ws)),Ws}var te={},ia;function aa(){if(ia)return te;ia=1;var n=te&&te.__extends||function(){var v=function(S,j){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,z){B.__proto__=z}||function(B,z){for(var ee in z)Object.prototype.hasOwnProperty.call(z,ee)&&(B[ee]=z[ee])},v(S,j)};return function(S,j){if(typeof j!="function"&&j!==null)throw new TypeError("Class extends value "+String(j)+" is not a constructor or null");v(S,j);function B(){this.constructor=S}S.prototype=j===null?Object.create(j):(B.prototype=j.prototype,new B)}}(),e=te&&te.__assign||function(){return e=Object.assign||function(v){for(var S,j=1,B=arguments.length;j<B;j++){S=arguments[j];for(var z in S)Object.prototype.hasOwnProperty.call(S,z)&&(v[z]=S[z])}return v},e.apply(this,arguments)};Object.defineProperty(te,"__esModule",{value:!0}),te.cloneNode=te.hasChildren=te.isDocument=te.isDirective=te.isComment=te.isText=te.isCDATA=te.isTag=te.Element=te.Document=te.CDATA=te.NodeWithChildren=te.ProcessingInstruction=te.Comment=te.Text=te.DataNode=te.Node=void 0;var t=Io(),r=function(){function v(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(v.prototype,"parentNode",{get:function(){return this.parent},set:function(S){this.parent=S},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"previousSibling",{get:function(){return this.prev},set:function(S){this.prev=S},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"nextSibling",{get:function(){return this.next},set:function(S){this.next=S},enumerable:!1,configurable:!0}),v.prototype.cloneNode=function(S){return S===void 0&&(S=!1),O(this,S)},v}();te.Node=r;var s=function(v){n(S,v);function S(j){var B=v.call(this)||this;return B.data=j,B}return Object.defineProperty(S.prototype,"nodeValue",{get:function(){return this.data},set:function(j){this.data=j},enumerable:!1,configurable:!0}),S}(r);te.DataNode=s;var i=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.Text,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),S}(s);te.Text=i;var a=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.Comment,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),S}(s);te.Comment=a;var l=function(v){n(S,v);function S(j,B){var z=v.call(this,B)||this;return z.name=j,z.type=t.ElementType.Directive,z}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),S}(s);te.ProcessingInstruction=l;var c=function(v){n(S,v);function S(j){var B=v.call(this)||this;return B.children=j,B}return Object.defineProperty(S.prototype,"firstChild",{get:function(){var j;return(j=this.children[0])!==null&&j!==void 0?j:null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"childNodes",{get:function(){return this.children},set:function(j){this.children=j},enumerable:!1,configurable:!0}),S}(r);te.NodeWithChildren=c;var u=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.CDATA,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),S}(c);te.CDATA=u;var f=function(v){n(S,v);function S(){var j=v!==null&&v.apply(this,arguments)||this;return j.type=t.ElementType.Root,j}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),S}(c);te.Document=f;var g=function(v){n(S,v);function S(j,B,z,ee){z===void 0&&(z=[]),ee===void 0&&(ee=j==="script"?t.ElementType.Script:j==="style"?t.ElementType.Style:t.ElementType.Tag);var b=v.call(this,z)||this;return b.name=j,b.attribs=B,b.type=ee,b}return Object.defineProperty(S.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"tagName",{get:function(){return this.name},set:function(j){this.name=j},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"attributes",{get:function(){var j=this;return Object.keys(this.attribs).map(function(B){var z,ee;return{name:B,value:j.attribs[B],namespace:(z=j["x-attribsNamespace"])===null||z===void 0?void 0:z[B],prefix:(ee=j["x-attribsPrefix"])===null||ee===void 0?void 0:ee[B]}})},enumerable:!1,configurable:!0}),S}(c);te.Element=g;function d(v){return(0,t.isTag)(v)}te.isTag=d;function m(v){return v.type===t.ElementType.CDATA}te.isCDATA=m;function y(v){return v.type===t.ElementType.Text}te.isText=y;function x(v){return v.type===t.ElementType.Comment}te.isComment=x;function w(v){return v.type===t.ElementType.Directive}te.isDirective=w;function T(v){return v.type===t.ElementType.Root}te.isDocument=T;function A(v){return Object.prototype.hasOwnProperty.call(v,"children")}te.hasChildren=A;function O(v,S){S===void 0&&(S=!1);var j;if(y(v))j=new i(v.data);else if(x(v))j=new a(v.data);else if(d(v)){var B=S?D(v.children):[],z=new g(v.name,e({},v.attribs),B);B.forEach(function(N){return N.parent=z}),v.namespace!=null&&(z.namespace=v.namespace),v["x-attribsNamespace"]&&(z["x-attribsNamespace"]=e({},v["x-attribsNamespace"])),v["x-attribsPrefix"]&&(z["x-attribsPrefix"]=e({},v["x-attribsPrefix"])),j=z}else if(m(v)){var B=S?D(v.children):[],ee=new u(B);B.forEach(function(L){return L.parent=ee}),j=ee}else if(T(v)){var B=S?D(v.children):[],b=new f(B);B.forEach(function(L){return L.parent=b}),v["x-mode"]&&(b["x-mode"]=v["x-mode"]),j=b}else if(w(v)){var q=new l(v.name,v.data);v["x-name"]!=null&&(q["x-name"]=v["x-name"],q["x-publicId"]=v["x-publicId"],q["x-systemId"]=v["x-systemId"]),j=q}else throw new Error("Not implemented yet: ".concat(v.type));return j.startIndex=v.startIndex,j.endIndex=v.endIndex,v.sourceCodeLocation!=null&&(j.sourceCodeLocation=v.sourceCodeLocation),j}te.cloneNode=O;function D(v){for(var S=v.map(function(B){return O(B,!0)}),j=1;j<S.length;j++)S[j].prev=S[j-1],S[j-1].next=S[j];return S}return te}var oa;function qo(){return oa||(oa=1,function(n){var e=It&&It.__createBinding||(Object.create?function(l,c,u,f){f===void 0&&(f=u);var g=Object.getOwnPropertyDescriptor(c,u);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,f,g)}:function(l,c,u,f){f===void 0&&(f=u),l[f]=c[u]}),t=It&&It.__exportStar||function(l,c){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&e(c,l,u)};Object.defineProperty(n,"__esModule",{value:!0}),n.DomHandler=void 0;var r=Io(),s=aa();t(aa(),n);var i={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},a=function(){function l(c,u,f){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof u=="function"&&(f=u,u=i),typeof c=="object"&&(u=c,c=void 0),this.callback=c??null,this.options=u??i,this.elementCB=f??null}return l.prototype.onparserinit=function(c){this.parser=c},l.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},l.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},l.prototype.onerror=function(c){this.handleCallback(c)},l.prototype.onclosetag=function(){this.lastNode=null;var c=this.tagStack.pop();this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(c)},l.prototype.onopentag=function(c,u){var f=this.options.xmlMode?r.ElementType.Tag:void 0,g=new s.Element(c,u,void 0,f);this.addNode(g),this.tagStack.push(g)},l.prototype.ontext=function(c){var u=this.lastNode;if(u&&u.type===r.ElementType.Text)u.data+=c,this.options.withEndIndices&&(u.endIndex=this.parser.endIndex);else{var f=new s.Text(c);this.addNode(f),this.lastNode=f}},l.prototype.oncomment=function(c){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=c;return}var u=new s.Comment(c);this.addNode(u),this.lastNode=u},l.prototype.oncommentend=function(){this.lastNode=null},l.prototype.oncdatastart=function(){var c=new s.Text(""),u=new s.CDATA([c]);this.addNode(u),c.parent=u,this.lastNode=c},l.prototype.oncdataend=function(){this.lastNode=null},l.prototype.onprocessinginstruction=function(c,u){var f=new s.ProcessingInstruction(c,u);this.addNode(f)},l.prototype.handleCallback=function(c){if(typeof this.callback=="function")this.callback(c,this.dom);else if(c)throw c},l.prototype.addNode=function(c){var u=this.tagStack[this.tagStack.length-1],f=u.children[u.children.length-1];this.options.withStartIndices&&(c.startIndex=this.parser.startIndex),this.options.withEndIndices&&(c.endIndex=this.parser.endIndex),u.children.push(c),f&&(c.prev=f,f.next=c),c.parent=u,this.lastNode=null},l}();n.DomHandler=a,n.default=a}(It)),It}var Ks={},la;function Bc(){return la||(la=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.CARRIAGE_RETURN_PLACEHOLDER_REGEX=n.CARRIAGE_RETURN_PLACEHOLDER=n.CARRIAGE_RETURN_REGEX=n.CARRIAGE_RETURN=n.CASE_SENSITIVE_TAG_NAMES_MAP=n.CASE_SENSITIVE_TAG_NAMES=void 0,n.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],n.CASE_SENSITIVE_TAG_NAMES_MAP=n.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),n.CARRIAGE_RETURN="\r",n.CARRIAGE_RETURN_REGEX=new RegExp(n.CARRIAGE_RETURN,"g"),n.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(),"__"),n.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(n.CARRIAGE_RETURN_PLACEHOLDER,"g")}(Ks)),Ks}var ca;function Mo(){if(ca)return jt;ca=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.formatAttributes=r,jt.escapeSpecialCharacters=i,jt.revertEscapedCharacters=a,jt.formatDOM=l;var n=qo(),e=Bc();function t(c){return e.CASE_SENSITIVE_TAG_NAMES_MAP[c]}function r(c){for(var u={},f=0,g=c.length;f<g;f++){var d=c[f];u[d.name]=d.value}return u}function s(c){c=c.toLowerCase();var u=t(c);return u||c}function i(c){return c.replace(e.CARRIAGE_RETURN_REGEX,e.CARRIAGE_RETURN_PLACEHOLDER)}function a(c){return c.replace(e.CARRIAGE_RETURN_PLACEHOLDER_REGEX,e.CARRIAGE_RETURN)}function l(c,u,f){u===void 0&&(u=null);for(var g=[],d,m=0,y=c.length;m<y;m++){var x=c[m];switch(x.nodeType){case 1:{var w=s(x.nodeName);d=new n.Element(w,r(x.attributes)),d.children=l(w==="template"?x.content.childNodes:x.childNodes,d);break}case 3:d=new n.Text(a(x.nodeValue));break;case 8:d=new n.Comment(x.nodeValue);break;default:continue}var T=g[m-1]||null;T&&(T.next=d),d.parent=u,d.prev=T,d.next=null,g.push(d)}return f&&(d=new n.ProcessingInstruction(f.substring(0,f.indexOf(" ")).toLowerCase(),f),d.next=g[0]||null,d.parent=u,g.unshift(d),g[1]&&(g[1].prev=g[0])),g}return jt}var ua;function Fc(){if(ua)return _r;ua=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.default=x;var n=Mo(),e="html",t="head",r="body",s=/<([a-zA-Z]+[0-9]?)/,i=/<head[^]*>/i,a=/<body[^]*>/i,l=function(w,T){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(w,T){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u=typeof window=="object"&&window.DOMParser;if(typeof u=="function"){var f=new u,g="text/html";c=function(w,T){return T&&(w="<".concat(T,">").concat(w,"</").concat(T,">")),f.parseFromString(w,g)},l=c}if(typeof document=="object"&&document.implementation){var d=document.implementation.createHTMLDocument();l=function(w,T){if(T){var A=d.documentElement.querySelector(T);return A&&(A.innerHTML=w),d}return d.documentElement.innerHTML=w,d}}var m=typeof document=="object"&&document.createElement("template"),y;m&&m.content&&(y=function(w){return m.innerHTML=w,m.content.childNodes});function x(w){var T,A;w=(0,n.escapeSpecialCharacters)(w);var O=w.match(s),D=O&&O[1]?O[1].toLowerCase():"";switch(D){case e:{var v=c(w);if(!i.test(w)){var S=v.querySelector(t);(T=S?.parentNode)===null||T===void 0||T.removeChild(S)}if(!a.test(w)){var S=v.querySelector(r);(A=S?.parentNode)===null||A===void 0||A.removeChild(S)}return v.querySelectorAll(e)}case t:case r:{var j=l(w).querySelectorAll(D);return a.test(w)&&i.test(w)?j[0].parentNode.childNodes:j}default:{if(y)return y(w);var S=l(w,r).querySelector(r);return S.childNodes}}}return _r}var ha;function Uc(){if(ha)return rn;ha=1;var n=rn&&rn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(rn,"__esModule",{value:!0}),rn.default=s;var e=n(Fc()),t=Mo(),r=/<(![a-zA-Z\s]+)>/;function s(i){if(typeof i!="string")throw new TypeError("First argument must be a string");if(!i)return[];var a=i.match(r),l=a?a[1]:void 0;return(0,t.formatDOM)((0,e.default)(i),null,l)}return rn}var Or={},Ie={},Pn={},da;function Hc(){if(da)return Pn;da=1;var n=0;Pn.SAME=n;var e=1;return Pn.CAMELCASE=e,Pn.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1},Pn}var fa;function zc(){if(fa)return Ie;fa=1;const n=0,e=1,t=2,r=3,s=4,i=5,a=6;function l(v){return u.hasOwnProperty(v)?u[v]:null}function c(v,S,j,B,z,ee,b){this.acceptsBooleans=S===t||S===r||S===s,this.attributeName=B,this.attributeNamespace=z,this.mustUseProperty=j,this.propertyName=v,this.type=S,this.sanitizeURL=ee,this.removeEmptyString=b}const u={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(v=>{u[v]=new c(v,n,!1,v,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([v,S])=>{u[v]=new c(v,e,!1,S,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(v=>{u[v]=new c(v,t,!1,v.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(v=>{u[v]=new c(v,t,!1,v,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(v=>{u[v]=new c(v,r,!1,v.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(v=>{u[v]=new c(v,r,!0,v,null,!1,!1)}),["capture","download"].forEach(v=>{u[v]=new c(v,s,!1,v,null,!1,!1)}),["cols","rows","size","span"].forEach(v=>{u[v]=new c(v,a,!1,v,null,!1,!1)}),["rowSpan","start"].forEach(v=>{u[v]=new c(v,i,!1,v.toLowerCase(),null,!1,!1)});const g=/[\-\:]([a-z])/g,d=v=>v[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(v=>{const S=v.replace(g,d);u[S]=new c(S,e,!1,v,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(v=>{const S=v.replace(g,d);u[S]=new c(S,e,!1,v,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(v=>{const S=v.replace(g,d);u[S]=new c(S,e,!1,v,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(v=>{u[v]=new c(v,e,!1,v.toLowerCase(),null,!1,!1)});const m="xlinkHref";u[m]=new c("xlinkHref",e,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(v=>{u[v]=new c(v,e,!1,v.toLowerCase(),null,!0,!0)});const{CAMELCASE:y,SAME:x,possibleStandardNames:w}=Hc(),A=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",O=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+A+"]*$")),D=Object.keys(w).reduce((v,S)=>{const j=w[S];return j===x?v[S]=S:j===y?v[S.toLowerCase()]=S:v[S]=j,v},{});return Ie.BOOLEAN=r,Ie.BOOLEANISH_STRING=t,Ie.NUMERIC=i,Ie.OVERLOADED_BOOLEAN=s,Ie.POSITIVE_NUMERIC=a,Ie.RESERVED=n,Ie.STRING=e,Ie.getPropertyInfo=l,Ie.isCustomAttribute=O,Ie.possibleStandardNames=D,Ie}var $n={},sn={},Ys,pa;function Gc(){if(pa)return Ys;pa=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
23
+ `,u="/",f="*",g="",d="comment",m="declaration";Ys=function(x,w){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];w=w||{};var T=1,A=1;function O(N){var L=N.match(e);L&&(T+=L.length);var M=N.lastIndexOf(c);A=~M?N.length-M:A+N.length}function D(){var N={line:T,column:A};return function(L){return L.position=new v(N),B(),L}}function v(N){this.start=N,this.end={line:T,column:A},this.source=w.source}v.prototype.content=x;function S(N){var L=new Error(w.source+":"+T+":"+A+": "+N);if(L.reason=N,L.filename=w.source,L.line=T,L.column=A,L.source=x,!w.silent)throw L}function j(N){var L=N.exec(x);if(L){var M=L[0];return O(M),x=x.slice(M.length),L}}function B(){j(t)}function z(N){var L;for(N=N||[];L=ee();)L!==!1&&N.push(L);return N}function ee(){var N=D();if(!(u!=x.charAt(0)||f!=x.charAt(1))){for(var L=2;g!=x.charAt(L)&&(f!=x.charAt(L)||u!=x.charAt(L+1));)++L;if(L+=2,g===x.charAt(L-1))return S("End of comment missing");var M=x.slice(2,L-2);return A+=2,O(M),x=x.slice(L),A+=2,N({type:d,comment:M})}}function b(){var N=D(),L=j(r);if(L){if(ee(),!j(s))return S("property missing ':'");var M=j(i),I=N({type:m,property:y(L[0].replace(n,g)),value:M?y(M[0].replace(n,g)):g});return j(a),I}}function q(){var N=[];z(N);for(var L;L=b();)L!==!1&&(N.push(L),z(N));return N}return B(),q()};function y(x){return x?x.replace(l,g):g}return Ys}var ga;function Vc(){if(ga)return sn;ga=1;var n=sn&&sn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sn,"__esModule",{value:!0}),sn.default=t;var e=n(Gc());function t(r,s){var i=null;if(!r||typeof r!="string")return i;var a=(0,e.default)(r),l=typeof s=="function";return a.forEach(function(c){if(c.type==="declaration"){var u=c.property,f=c.value;l?s(u,f,c):f&&(i=i||{},i[u]=f)}}),i}return sn}var Bn={},ma;function Wc(){if(ma)return Bn;ma=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||n.test(u)},a=function(u,f){return f.toUpperCase()},l=function(u,f){return"".concat(f,"-")},c=function(u,f){return f===void 0&&(f={}),i(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(s,l):u=u.replace(r,l),u.replace(e,a))};return Bn.camelCase=c,Bn}var Fn,ba;function Kc(){if(ba)return Fn;ba=1;var n=Fn&&Fn.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=n(Vc()),t=Wc();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(a[(0,t.camelCase)(l,i)]=c)}),a}return r.default=r,Fn=r,Fn}var va;function Do(){return va||(va=1,function(n){var e=$n&&$n.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(n,"__esModule",{value:!0}),n.returnFirstArg=n.canTextBeChildOfNode=n.ELEMENTS_WITH_NO_TEXT_CHILDREN=n.PRESERVE_CUSTOM_ATTRIBUTES=void 0,n.isCustomComponent=i,n.setStyleProp=l;var t=_,r=e(Kc()),s=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function i(f,g){return f.includes("-")?!s.has(f):!!(g&&typeof g.is=="string")}var a={reactCompat:!0};function l(f,g){if(typeof f=="string"){if(!f.trim()){g.style={};return}try{g.style=(0,r.default)(f,a)}catch{g.style={}}}}n.PRESERVE_CUSTOM_ATTRIBUTES=Number(t.version.split(".")[0])>=16,n.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var c=function(f){return!n.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(f.name)};n.canTextBeChildOfNode=c;var u=function(f){return f};n.returnFirstArg=u}($n)),$n}var ya;function Po(){if(ya)return Or;ya=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.default=i;var n=zc(),e=Do(),t=["checked","value"],r=["input","select","textarea"],s={reset:!0,submit:!0};function i(l,c){l===void 0&&(l={});var u={},f=!!(l.type&&s[l.type]);for(var g in l){var d=l[g];if((0,n.isCustomAttribute)(g)){u[g]=d;continue}var m=g.toLowerCase(),y=a(m);if(y){var x=(0,n.getPropertyInfo)(y);switch(t.includes(y)&&r.includes(c)&&!f&&(y=a("default"+m)),u[y]=d,x&&x.type){case n.BOOLEAN:u[y]=!0;break;case n.OVERLOADED_BOOLEAN:d===""&&(u[y]=!0);break}continue}e.PRESERVE_CUSTOM_ATTRIBUTES&&(u[g]=d)}return(0,e.setStyleProp)(l.style,u),u}function a(l){return n.possibleStandardNames[l]}return Or}var an={},xa;function Yc(){if(xa)return an;xa=1;var n=an&&an.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(an,"__esModule",{value:!0}),an.default=i;var e=_,t=n(Po()),r=Do(),s={cloneElement:e.cloneElement,createElement:e.createElement,isValidElement:e.isValidElement};function i(l,c){c===void 0&&(c={});for(var u=[],f=typeof c.replace=="function",g=c.transform||r.returnFirstArg,d=c.library||s,m=d.cloneElement,y=d.createElement,x=d.isValidElement,w=l.length,T=0;T<w;T++){var A=l[T];if(f){var O=c.replace(A,T);if(x(O)){w>1&&(O=m(O,{key:O.key||T})),u.push(g(O,A,T));continue}}if(A.type==="text"){var D=!A.data.trim().length;if(D&&A.parent&&!(0,r.canTextBeChildOfNode)(A.parent)||c.trim&&D)continue;u.push(g(A.data,A,T));continue}var v=A,S={};a(v)?((0,r.setStyleProp)(v.attribs.style,v.attribs),S=v.attribs):v.attribs&&(S=(0,t.default)(v.attribs,v.name));var j=void 0;switch(A.type){case"script":case"style":A.children[0]&&(S.dangerouslySetInnerHTML={__html:A.children[0].data});break;case"tag":A.name==="textarea"&&A.children[0]?S.defaultValue=A.children[0].data:A.children&&A.children.length&&(j=i(A.children,c));break;default:continue}w>1&&(S.key=T),u.push(g(y(A.name,S,j),A,T))}return u.length===1?u[0]:u}function a(l){return r.PRESERVE_CUSTOM_ATTRIBUTES&&l.type==="tag"&&(0,r.isCustomComponent)(l.name,l.attribs)}return an}var Ea;function Xc(){return Ea||(Ea=1,function(n){var e=Dn&&Dn.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(n,"__esModule",{value:!0}),n.htmlToDOM=n.domToReact=n.attributesToProps=n.Text=n.ProcessingInstruction=n.Element=n.Comment=void 0,n.default=l;var t=e(Uc());n.htmlToDOM=t.default;var r=e(Po());n.attributesToProps=r.default;var s=e(Yc());n.domToReact=s.default;var i=qo();Object.defineProperty(n,"Comment",{enumerable:!0,get:function(){return i.Comment}}),Object.defineProperty(n,"Element",{enumerable:!0,get:function(){return i.Element}}),Object.defineProperty(n,"ProcessingInstruction",{enumerable:!0,get:function(){return i.ProcessingInstruction}}),Object.defineProperty(n,"Text",{enumerable:!0,get:function(){return i.Text}});var a={lowerCaseAttributeNames:!1};function l(c,u){if(typeof c!="string")throw new TypeError("First argument must be a string");return c?(0,s.default)((0,t.default)(c,u?.htmlparser2||a),u):[]}}(Dn)),Dn}var Zc=Xc();const wa=Ri(Zc),Jc=wa.default||wa,Qc=({type:n,text:e})=>{const[t,r]=_.useState(!0),s=_.useRef(null),i=_.useRef(null),a=()=>{i.current&&(i.current.style.transition="opacity 0.4s",i.current.style.opacity="0"),s.current=window.setTimeout(()=>{r(!t)},500)};return _.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),t?h.jsxs("div",{ref:i,className:`alert ${n}`,role:"alert",children:[h.jsx("p",{children:Jc(e)}),h.jsx("button",{className:"close",type:"button","data-toggle":"close",onClick:a,children:h.jsx(jo,{})})]}):null},$o=({children:n,className:e="",...t})=>h.jsx("div",{className:`modal-header ${e}`,...t,children:n}),Bo=({children:n,className:e="",...t})=>h.jsx("div",{className:`modal-body ${e}`,...t,children:n}),Fo=({children:n,className:e="",...t})=>h.jsx("div",{className:`modal-footer ${e}`,...t,children:n}),Uo=({children:n,className:e="",...t})=>(_.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]),$t.createPortal(h.jsx("div",{className:"modal",...t,children:h.jsx("div",{className:`modal-dialog ${e}`,children:n})}),document.body)),eu=({labelIcon:n,label:e="Confirmation",message:t,onCancel:r,onConfirm:s})=>h.jsxs(Uo,{className:"modal-sm",children:[h.jsxs($o,{className:"bg-danger",children:[h.jsxs("div",{className:"modal-header-title",children:[n||h.jsx(di,{className:"icon"}),h.jsx("span",{children:e})]}),h.jsx("div",{className:"tools",children:h.jsx(jo,{className:"icon",onClick:r})})]}),h.jsx(Bo,{children:h.jsx("p",{children:t})}),h.jsxs(Fo,{className:"justify-content-space-between",children:[h.jsxs(Je,{type:"button",className:"btn btn-default",onClick:r,children:[h.jsx(kc,{})," Batalkan"]}),h.jsxs(Je,{type:"button",className:"btn btn-primary",onClick:s,children:[h.jsx(di,{})," Konfirmasi"]})]})]}),tu=({className:n="",type:e,title:t,text:r})=>h.jsxs("div",{className:`callout ${e} ${n}`,children:[t&&h.jsx("h5",{children:t}),typeof r=="string"?h.jsx("p",{children:r}):r]}),nu=({children:n,text:e,position:t="top",className:r="",offset:s=5})=>{const[i,a]=_.useState(!1),[l,c]=_.useState({top:0,left:0}),u=_.useRef(null),f=_.useRef(null);return _.useEffect(()=>{if(i&&u.current&&f.current){const g=u.current.getBoundingClientRect(),d=f.current.getBoundingClientRect(),{scrollX:m,scrollY:y}=window;let x=0,w=0;switch(t){case"top":x=g.top-d.height-s,w=g.left+(g.width-d.width)/2;break;case"bottom":x=g.bottom+s,w=g.left+(g.width-d.width)/2;break;case"left":x=g.top+(g.height-d.height)/2,w=g.left-d.width-s;break;case"right":x=g.top+(g.height-d.height)/2,w=g.right+s;break}c({top:Math.round(x+y),left:Math.round(w+m)})}},[i,t,s]),h.jsxs("div",{ref:u,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[n,i&&$t.createPortal(h.jsx("div",{ref:f,style:{position:"absolute",top:`${l.top}px`,left:`${l.left}px`},className:`tooltip ${t} ${r}`,children:e}),document.body)]})},ru=({className:n,children:e,text:t,title:r,dismissible:s=!0})=>{const[i,a]=_.useState(!1),[l,c]=_.useState({top:0,left:0}),u=_.useRef(null),f=_.useRef(null);Nt([u,f],()=>{s&&a(!1)}),_.useEffect(()=>{if(i&&u.current&&f.current){const d=u.current.getBoundingClientRect(),m=f.current.getBoundingClientRect(),{scrollX:y,scrollY:x}=window;let w=0,T=0;n.includes("top")?(w=d.top-m.height-10,T=d.left+(d.width-m.width)/2):n.includes("bottom")?(w=d.bottom+10,T=d.left+(d.width-m.width)/2):n.includes("left")?(w=d.top+(d.height-m.height)/2,T=d.left-m.width-10):n.includes("right")&&(w=d.top+(d.height-m.height)/2,T=d.right+10),c({top:Math.round(w+x),left:Math.round(T+y)})}},[i,n]);function g(){a(!i)}return h.jsxs("div",{ref:u,onClick:g,children:[e,i&&$t.createPortal(h.jsxs("div",{ref:f,className:`popover ${n}`,role:"tooltip",style:{position:"absolute",top:`${l.top}px`,left:`${l.left}px`},children:[h.jsx("div",{className:"arrow"}),r&&h.jsx("h3",{className:"popover-title",children:r}),h.jsx("div",{className:"popover-content",children:t})]}),document.body)]})},su=({defaultIndex:n=null,alwaysOpen:e=!1,flush:t=!1,children:r})=>{const[s,i]=_.useState(n!==null?[n]:[]),a=l=>{i(e?c=>c.includes(l)?c.filter(u=>u!==l):[...c,l]:c=>c.includes(l)?[]:[l])};return h.jsx("div",{className:`accordion ${t?"accordion-flush":""}`,children:_.Children.map(r,(l,c)=>_.cloneElement(l,{isOpen:s.includes(c),onClick:()=>a(c)}))})},iu=({title:n,titleIcon:e,children:t,isOpen:r=!1,onClick:s})=>{const i=_.useRef(null),[a,l]=_.useState(0);_.useEffect(()=>{i.current&&l(i.current.scrollHeight)},[t]);const c=_.Children.toArray(t).find(f=>f.type===Ho),u=_.Children.toArray(t).find(f=>f.type===zo);return h.jsxs("div",{className:"accordion-item",children:[h.jsxs("div",{className:"accordion-header",role:"button",tabIndex:0,onClick:s,onKeyDown:s,children:[h.jsxs("div",{className:"accordion-title",children:[e,h.jsx("span",{children:n})]}),h.jsx(Yn,{className:`accordion-icon ${r?"active":""}`})]}),h.jsxs("div",{ref:i,className:`accordion-collapse ${r?"show":""}`,style:{maxHeight:r?`${a}px`:"0px"},children:[c,u]})]})},Ho=({className:n="",children:e})=>h.jsx("div",{className:`accordion-body ${n}`,children:e}),zo=({className:n="",children:e})=>h.jsx("div",{className:`accordion-footer ${n}`,children:e}),au=({size:n=40,className:e="",color:t})=>h.jsx("span",{className:`circular-progress ${e} ${t?`brand-${t}`:""}`,style:{width:`${n}px`,height:`${n}px`}}),ou=({showLabel:n=!1,progress:e=0,className:t="",color:r})=>{const s=t.includes("indeterminate");return h.jsxs("div",{className:`linear-progress ${t}`,children:[h.jsx("div",{className:`progress-bar ${r?`brand-${r}`:""}`,children:h.jsx("span",{className:"progress",style:{width:`${e}%`}})}),n&&!s&&h.jsxs("span",{className:"progress-label",children:[e,"%"]})]})},lu=({progress:n=0,size:e=40,className:t="",color:r,strokeWidth:s=4})=>{const[i,a]=_.useState(0);return _.useEffect(()=>{if(i<n){const l=setTimeout(()=>{a(i+1)},10);return()=>clearTimeout(l)}},[i,n]),h.jsxs("div",{className:`circular-progress-with-label ${t}`,children:[h.jsx("span",{className:`progress ${r?`brand-${r}`:""}`,style:{width:`${e}px`,height:`${e}px`,borderWidth:`${s}px`,background:r?`radial-gradient(closest-side, var(--secondary-bg) 79%, transparent 80% 100%), conic-gradient(var(--brand-${r}) ${i}%, var(--primary-bg) 0)`:`radial-gradient(closest-side, var(--secondary-bg) 79%, transparent 80% 100%), conic-gradient(#888 ${i}%, var(--primary-bg) 0)`}}),h.jsxs("span",{className:"progress-label",children:[i,"%"]})]})},ye=[];for(let n=0;n<256;++n)ye.push((n+256).toString(16).slice(1));function cu(n,e=0){return(ye[n[e+0]]+ye[n[e+1]]+ye[n[e+2]]+ye[n[e+3]]+"-"+ye[n[e+4]]+ye[n[e+5]]+"-"+ye[n[e+6]]+ye[n[e+7]]+"-"+ye[n[e+8]]+ye[n[e+9]]+"-"+ye[n[e+10]]+ye[n[e+11]]+ye[n[e+12]]+ye[n[e+13]]+ye[n[e+14]]+ye[n[e+15]]).toLowerCase()}let Xs;const uu=new Uint8Array(16);function hu(){if(!Xs){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Xs=crypto.getRandomValues.bind(crypto)}return Xs(uu)}const du=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Na={randomUUID:du};function Go(n,e,t){if(Na.randomUUID&&!n)return Na.randomUUID();n=n||{};const r=n.random??n.rng?.()??hu();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,cu(r)}const Li=_.forwardRef(({name:n,label:e,message:t,error:r,checked:s=!1,onChange:i,...a},l)=>{const c=Go(),u=f=>{i(f)};return h.jsxs(h.Fragment,{children:[h.jsxs("label",{className:"custom-checkbox",htmlFor:c,children:[h.jsx("input",{type:"checkbox",id:c,name:n,ref:l,role:"checkbox",checked:s,onChange:u,...a}),h.jsx("span",{className:"checkmark"}),e&&h.jsx("span",{className:a.required?"required":"",children:e})]}),r?h.jsx("small",{className:"form-message text-danger",children:r}):t&&h.jsx("small",{className:"form-message",children:t})]})});Li.displayName="Checkbox";const fu=({children:n})=>h.jsx("div",{className:"form",children:n}),pu=({className:n="",children:e})=>h.jsx("div",{className:`form-group ${n}`,children:e}),gu=({className:n="",children:e})=>h.jsx("div",{className:`form-checkbox ${n}`,children:e}),mu=({className:n="",children:e})=>h.jsx("div",{className:`form-radio ${n}`,children:e});function bu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zM9 14H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm-8 4H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2z"},child:[]}]})(n)}function vu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},child:[]},{tag:"path",attr:{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},child:[]}]})(n)}function yu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"},child:[]}]})(n)}function xu(n){return Oe({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(n)}const ki=(n,e)=>{_.useEffect(()=>{if(n&&e.current){const t=e.current.getBoundingClientRect(),r=window.innerHeight;t.bottom>r?e.current.classList.add("position-top"):e.current.classList.remove("position-top");const s=e.current.querySelector(".option.selected");s&&s.scrollIntoView({block:"nearest"})}},[n,e])},Qe=_.forwardRef((n,e)=>{const{className:t="",id:r,name:s,label:i,message:a,selectLabel:l="Select an option",size:c="md",floatingLabel:u=!1,error:f,options:g,value:d="",onChange:m,onBlur:y,required:x,disabled:w}=n,T=r||s,[A,O]=_.useState(!1),D=_.useRef(null),v=_.useRef(null),S=_.useRef(null),j=g.find(z=>z.value===d)?.label??l;_.useImperativeHandle(e,()=>S.current),_.useEffect(()=>O(!1),[]),Nt([D],()=>{O(!1),S.current?.blur()}),ki(A,v);const B=z=>{const ee=g.find(N=>N.value===z);if(!ee)return;const b=ee.value;if(m?.({target:{name:s,value:b,type:"select-one"},currentTarget:{name:s,value:b}}),S.current){S.current.value=String(b);const N=new CustomEvent("change",{bubbles:!0,detail:{originalValue:b}});S.current.dispatchEvent(N)}O(!1)};return h.jsxs(h.Fragment,{children:[!u&&i&&h.jsxs("label",{htmlFor:T,children:[i," ",x&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsxs("select",{ref:S,name:s,value:d!=null&&!Number.isNaN(d)?d:"",onChange:m,onBlur:y,required:x,disabled:w,style:{position:"absolute",left:"-9999px"},tabIndex:-1,children:[h.jsx("option",{value:"",children:"Select an option"}),g.map(z=>h.jsx("option",{value:String(z.value),children:z.label},z.value))]}),h.jsxs("div",{className:`dropdown-select-container ${t} ${c}`,ref:D,children:[h.jsxs("div",{className:`dropdown-header ${A?"open":""} ${w?"disabled":""}`,onClick:()=>!w&&O(!A),"aria-haspopup":"listbox","aria-expanded":A,children:[h.jsx("span",{className:"label",children:j}),h.jsx(Yn,{className:"arrow"})]}),A&&h.jsx("div",{className:"dropdown-options scrollbar",ref:v,role:"listbox",children:g.map(z=>h.jsx("div",{className:`option ${z.value===d?"selected":""}`,onClick:()=>B(z.value),role:"option","aria-selected":z.value===d,children:z.label},z.value))})]}),u&&i&&h.jsxs("label",{htmlFor:T,children:[i," ",x&&h.jsx("span",{className:"text-danger",children:"*"})]}),f?h.jsx("small",{className:"form-message text-danger",children:f}):a&&h.jsx("small",{className:"form-message",children:a})]})});Qe.displayName="Select";const Xr=n=>{const[e,t]=_.useState(!1);return _.useEffect(()=>{const r=()=>{if(!n.current)return;const{top:i,height:a}=n.current.getBoundingClientRect(),l=window.innerHeight;t(i+a>l)};r();const s=()=>{r()};return window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[n]),e},Vo=n=>{const e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`},Eu=n=>n.toLocaleDateString("id-ID",{timeZone:"Asia/Jakarta",year:"numeric",month:"long",day:"numeric"}),Xn=(n,e)=>Array.from({length:n},(t,r)=>e(r)),Rr=(n,e)=>{const t=new Date(e,n,1).getDay(),r=new Date(e,n+1,0).getDate(),s=Xn(t,()=>({value:"",label:""})),i=Xn(r,a=>({value:(a+1).toString(),label:(a+1).toString()}));return[...s,...i]},wu=(n,e)=>{const t=new Date(e,n+1,0).getDate();return Xn(t,r=>({value:(r+1).toString(),label:(r+1).toString()}))},Wo=(n="id-ID")=>Xn(12,e=>({value:(e+1).toString(),label:new Date(2024,e,1).toLocaleString(n,{month:"long"})})),Ko=()=>{const n=new Date().getFullYear(),e=n-60,r=n+20-e+1;return Xn(r,s=>{const i=e+s;return{value:i.toString(),label:i.toString()}})},Ta=n=>{const e=new Date(n);return e instanceof Date&&!isNaN(e.getTime())},Nu=["Min","Sen","Sel","Rab","Kam","Jum","Sab"],Tu=n=>{const[e,t]=_.useState(n);return{selectedDate:e,handlePrevMonth:()=>{const c=new Date(e);c.setMonth(e.getMonth()-1),t(c)},handleNextMonth:()=>{const c=new Date(e);c.setMonth(e.getMonth()+1),t(c)},handleDateClick:(c,u,f,g)=>{const d=new Date(parseInt(f,10),parseInt(u,10),parseInt(c,10));t(d),g(Vo(d))},isSelectedDate:(c,u,f)=>parseInt(f,10)===e.getFullYear()&&parseInt(u,10)===e.getMonth()+1&&parseInt(c,10)===e.getDate(),setDate:c=>{t(c)}}},Yo=({onSelect:n,defaultDate:e,full:t=!1})=>{const r=_.useRef(null),s=Xr(r),i=Ta(e)?new Date(e):new Date,{selectedDate:a,handlePrevMonth:l,handleNextMonth:c,handleDateClick:u,isSelectedDate:f,setDate:g}=Tu(i),[d,m]=_.useState(Rr(i.getMonth(),i.getFullYear()));_.useEffect(()=>{if(e&&Ta(e)){const x=new Date(e);g(x)}},[e,g]),_.useEffect(()=>{m(Rr(a.getMonth(),a.getFullYear()))},[a]);const y=(x,w)=>{const T=parseInt(x,10),A=T+1;return d.map((O,D)=>O.value!==""?h.jsx("div",{className:`calendar-day ${f(O.value,A.toString(),w)?"selected-date":""}`,onClick:()=>{const v=new Date(parseInt(w,10),T,parseInt(O.value,10)),S=t?Eu(v):Vo(v);u(O.value,x,w,()=>n(S))},children:O.label},`day-${D}`):h.jsx("div",{className:"calendar-day empty"},`day-${D}`))};return h.jsxs("div",{className:`date-picker shadow-sm ${s?"position-top":""}`,ref:r,children:[h.jsxs("div",{className:"calendar-nav",children:[h.jsx("button",{type:"button",className:"btn rounded-circle",onClick:l,children:h.jsx(yu,{size:16})}),h.jsxs("div",{className:"calendar-select",children:[h.jsx(Qe,{className:"select-month",name:"month",size:"sm",options:Wo(),value:(a.getMonth()+1).toString(),onChange:x=>{const w=parseInt(x.target.value,10)-1,T=new Date(a.getFullYear(),w,a.getDate());g(T),m(Rr(w,T.getFullYear()))}}),h.jsx(Qe,{className:"select-year",name:"year",size:"sm",options:Ko(),value:a.getFullYear().toString(),onChange:x=>{const w=parseInt(x.target.value,10),T=new Date(w,a.getMonth(),a.getDate());g(T),m(Rr(T.getMonth(),w))}})]}),h.jsx("button",{type:"button",className:"btn rounded-circle",onClick:c,children:h.jsx(xu,{size:16})})]}),h.jsxs("div",{className:"calendar",children:[h.jsx("div",{className:"calendar-header",children:Nu.map((x,w)=>h.jsx("div",{className:"calendar-day-name",children:x},`day-${w}`))}),h.jsx("div",{className:"calendar-body",children:y(a.getMonth().toString(),a.getFullYear().toString())})]})]})},Xo=_.forwardRef(({name:n,label:e,message:t,floatingLabel:r,locale:s="id",error:i,value:a,...l},c)=>{const u=A=>{if(!A)return new Date;const O=new Date(A);return isNaN(O.getTime())?new Date:O},f=u(a),[g,d]=_.useState({day:f.getDate(),month:f.getMonth()+1,year:f.getFullYear()});_.useEffect(()=>{if(a){const A=u(a);d({day:A.getDate(),month:A.getMonth()+1,year:A.getFullYear()})}},[a]),_.useEffect(()=>{const A=new Date(g.year,g.month,0).getDate();g.day>A&&d(O=>({...O,day:A}))},[g.month,g.year]);const m=(A,O)=>{const D=parseInt(O,10);if(isNaN(D))return;const v={...g,[A]:D};if(d(v),l.onChange){const S=`${v.year}-${String(v.month).padStart(2,"0")}-${String(v.day).padStart(2,"0")}`;l.onChange({target:{name:n,value:S}})}},y=_.useMemo(()=>wu(g.month-1,g.year),[g.month,g.year]),x=_.useMemo(()=>Wo(s),[s]),w=_.useMemo(()=>Ko(),[]),T=h.jsxs("label",{htmlFor:n,children:[e," ",l.required&&h.jsx("span",{className:"text-danger",children:"*"})]});return h.jsxs(h.Fragment,{children:[!r&&T,h.jsxs("div",{className:"row",ref:c,children:[h.jsx("div",{className:"col-md-3",children:h.jsx(Qe,{name:`${n}-day`,disabled:l.disabled,options:y,value:g.day.toString(),onChange:A=>m("day",A.target.value),"aria-label":"Day"})}),h.jsx("div",{className:"col-md-5",children:h.jsx(Qe,{name:`${n}-month`,disabled:l.disabled,options:x,value:g.month.toString(),onChange:A=>m("month",A.target.value),"aria-label":"Month"})}),h.jsx("div",{className:"col-md-4",children:h.jsx(Qe,{name:`${n}-year`,disabled:l.disabled,options:w,value:g.year.toString(),onChange:A=>m("year",A.target.value),"aria-label":"Year"})})]}),r&&T,i?h.jsx("small",{className:"form-message text-danger",children:i}):t&&h.jsx("small",{className:"form-message",children:t})]})});Xo.displayName="DropdownDatePicker";const Zo=({onSelect:n,defaultTime:e,format24:t=!0})=>{const r=_.useRef(null),s=Xr(r),i=T=>{if(T){const[O,D]=T.split(":");return{hours:parseInt(O,10),minutes:parseInt(D,10)}}const A=new Date;return{hours:A.getHours(),minutes:A.getMinutes()}},a=i(e),[l,c]=_.useState(a.hours),[u,f]=_.useState(a.minutes);_.useEffect(()=>{if(e){const T=i(e);c(T.hours),f(T.minutes)}},[e]);const g=()=>{const T=[],A=t?23:12,O=t?0:1;for(let D=O;D<=A;D++){const v=D.toString().padStart(2,"0");T.push({value:v,label:v})}return T},d=()=>{const T=[];for(let A=0;A<60;A++){const O=A.toString().padStart(2,"0");T.push({value:O,label:O})}return T},m=(T,A)=>{const O=T.toString().padStart(2,"0"),D=A.toString().padStart(2,"0");return`${O}:${D}`},y=T=>{const A=parseInt(T.target.value,10);c(A)},x=T=>{const A=parseInt(T.target.value,10);f(A)},w=()=>{const T=m(l,u);n(T)};return h.jsxs("div",{className:`time-picker shadow-sm ${s?"position-top":""}`,ref:r,children:[h.jsx("div",{className:"time-picker-header",children:h.jsx("h6",{className:"mb-0",children:"Pilih Waktu"})}),h.jsx("div",{className:"time-picker-body",children:h.jsxs("div",{className:"time-select-group",children:[h.jsxs("div",{className:"time-select-item",children:[h.jsx("label",{className:"time-label",children:"Jam"}),h.jsx(Qe,{className:"select-hour",name:"hour",size:"sm",options:g(),value:l.toString().padStart(2,"0"),onChange:y})]}),h.jsx("div",{className:"time-separator",children:":"}),h.jsxs("div",{className:"time-select-item",children:[h.jsx("label",{className:"time-label",children:"Menit"}),h.jsx(Qe,{className:"select-minute",name:"minute",size:"sm",options:d(),value:u.toString().padStart(2,"0"),onChange:x})]})]})}),h.jsx("div",{className:"time-picker-footer",children:h.jsx("button",{type:"button",className:"btn btn-primary btn-sm w-100",onClick:w,children:"Pilih"})})]})},Au=({type:n="text",className:e,...t})=>h.jsx("input",{type:n,className:`clear ${e}`,...t}),fi=_.forwardRef(({className:n="",name:e,label:t,message:r,floatingLabel:s,error:i,id:a,...l},c)=>{const u=a||e;return h.jsxs(h.Fragment,{children:[!s&&t&&h.jsxs("label",{htmlFor:u,children:[t," ",l.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsx("input",{type:"text",className:`form-control ${n}`,id:u,name:e,placeholder:s?"":" ",ref:c,...l}),s&&t&&h.jsxs("label",{htmlFor:u,children:[t," ",l.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),i?h.jsx("small",{className:"form-message text-danger",children:i}):r&&h.jsx("small",{className:"form-message",children:r})]})}),Su=_.forwardRef(({className:n,name:e,label:t,message:r,floatingLabel:s,error:i,actionIcon:a,actionButtonLabel:l,actionButtonHandler:c,...u},f)=>h.jsxs(h.Fragment,{children:[!s&&t&&h.jsxs("label",{htmlFor:e,children:[t," ",u.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsxs("div",{className:"input-group-icon",children:[h.jsx("input",{type:"text",className:`form-control pr-35 ${n}`,id:e,name:e,placeholder:s?"":" ",ref:f,...u}),a&&h.jsx(Je,{role:"button",className:"icon",onClick:c,tabIndex:0,"aria-label":l,disabled:u.disabled,children:a})]}),s&&t&&h.jsxs("label",{htmlFor:e,children:[t," ",u.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),i?h.jsx("small",{className:"form-message text-danger",children:i}):r&&h.jsx("small",{className:"form-message",children:r})]})),Jo=_.forwardRef(({name:n,label:e,message:t,floatingLabel:r,full:s,error:i,onChange:a,value:l,...c},u)=>{const[f,g]=_.useState(!1),[d,m]=_.useState({top:0,left:0,width:0}),y=_.useRef(null),x=_.useRef(null),w=_.useRef(null),T=Xr(w);_.useImperativeHandle(u,()=>y.current),_.useEffect(()=>{l!==void 0&&y.current&&(y.current.value=l)},[l]),_.useEffect(()=>{if(f&&x.current){const O=x.current.getBoundingClientRect();m({top:O.bottom+window.scrollY,left:O.left+window.scrollX,width:O.width})}},[f]);const A=O=>{y.current&&(y.current.value=O,a?.({target:y.current,currentTarget:y.current}),g(!1))};return Nt([w],()=>g(!1)),h.jsxs(h.Fragment,{children:[!r&&e&&h.jsxs("label",{htmlFor:n,children:[e," ",c.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsxs("div",{className:"input-group-icon",ref:x,children:[h.jsx("input",{type:"text",className:"form-control",id:n,name:n,placeholder:r?"":" ",ref:y,onChange:a,...c}),h.jsx("div",{className:"icon",role:"button",onClick:O=>{O.stopPropagation(),g(D=>!D)},"aria-label":"Open date picker",style:{pointerEvents:c.disabled?"none":"auto",opacity:c.disabled?.5:1},children:h.jsx(bu,{})})]}),f&&$t.createPortal(h.jsx("div",{ref:w,className:`date-picker-portal ${T?"position-top":""}`,style:{position:"absolute",top:`${d.top}px`,left:`${d.left}px`,minWidth:`${d.width}px`,zIndex:1050},children:h.jsx(Yo,{full:s,onSelect:A,defaultDate:l||void 0})}),document.body),r&&e&&h.jsxs("label",{htmlFor:n,children:[e," ",c.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),i?h.jsx("small",{className:"form-message text-danger",children:i}):t&&h.jsx("small",{className:"form-message",children:t})]})});Jo.displayName="InputDate";const Qo=_.forwardRef(({name:n,label:e,message:t,floatingLabel:r,format24:s=!0,error:i,onChange:a,value:l,...c},u)=>{const[f,g]=_.useState(!1),[d,m]=_.useState({top:0,left:0,width:0}),y=_.useRef(null),x=_.useRef(null),w=_.useRef(null),T=Xr(w);_.useImperativeHandle(u,()=>y.current),_.useEffect(()=>{l!==void 0&&y.current&&(y.current.value=l)},[l]),_.useEffect(()=>{if(f&&x.current){const O=x.current.getBoundingClientRect();m({top:O.bottom+window.scrollY,left:O.left+window.scrollX,width:O.width})}},[f]);const A=O=>{y.current&&(y.current.value=O,a?.({target:y.current,currentTarget:y.current}),g(!1))};return Nt([w],()=>g(!1)),h.jsxs(h.Fragment,{children:[!r&&e&&h.jsxs("label",{htmlFor:n,children:[e," ",c.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsxs("div",{className:"input-group-icon",ref:x,children:[h.jsx("input",{type:"text",className:"form-control",id:n,name:n,placeholder:r?"":" ",ref:y,onChange:a,...c}),h.jsx("div",{className:"icon",role:"button",onClick:O=>{O.stopPropagation(),g(D=>!D)},"aria-label":"Open time picker",style:{pointerEvents:c.disabled?"none":"auto",opacity:c.disabled?.5:1},children:h.jsx(vu,{})})]}),f&&$t.createPortal(h.jsx("div",{ref:w,className:`time-picker-portal ${T?"position-top":""}`,style:{position:"absolute",top:`${d.top}px`,left:`${d.left}px`,minWidth:`${d.width}px`,zIndex:1050},children:h.jsx(Zo,{format24:s,onSelect:A,defaultTime:l||void 0})}),document.body),r&&e&&h.jsxs("label",{htmlFor:n,children:[e," ",c.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),i?h.jsx("small",{className:"form-message text-danger",children:i}):t&&h.jsx("small",{className:"form-message",children:t})]})});Qo.displayName="InputTime";const el=_.forwardRef(({className:n,name:e,label:t,message:r,accept:s,floatingLabel:i,error:a,onChange:l,id:c,...u},f)=>{const g=c||e,d=m=>{l&&l(m)};return h.jsxs(h.Fragment,{children:[!i&&t&&h.jsxs("label",{htmlFor:g,children:[t," ",u.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsx("input",{type:"file",className:`form-control ${n||""}`,id:g,name:e,accept:s,onChange:d,ref:f,...u}),i&&t&&h.jsxs("label",{htmlFor:g,children:[t," ",u.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),a?h.jsx("small",{className:"form-message text-danger",children:a}):r&&h.jsx("small",{className:"form-message",children:r})]})});el.displayName="InputFile";const Cu=()=>h.jsx("div",{children:"InputImageSize"}),tl=_.forwardRef(({className:n,name:e,label:t,message:r,floatingLabel:s,error:i,id:a,...l},c)=>{const u=a||e;return h.jsxs(h.Fragment,{children:[!s&&t&&h.jsxs("label",{htmlFor:u,children:[t," ",l.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsx("textarea",{className:`form-control ${n||""}`,id:u,name:e,placeholder:s?"":" ",ref:c,...l}),s&&t&&h.jsxs("label",{htmlFor:u,children:[t," ",l.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),i?h.jsx("small",{className:"form-message text-danger",children:i}):r&&h.jsx("small",{className:"form-message",children:r})]})});tl.displayName="InputTextArea";const nl=_.forwardRef(({className:n,name:e,label:t,message:r,options:s,error:i,...a},l)=>h.jsxs(h.Fragment,{children:[t&&h.jsxs("label",{htmlFor:e,children:[t," ",a.required&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsx("div",{className:`form-control ${n||""}`,children:s.map(c=>{const u=`${Go()}-${c.value}`;return h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("input",{type:"radio",id:u,name:e,value:c.value,ref:l,...a}),h.jsx("label",{htmlFor:u,children:c.label})]},c.value)})}),i?h.jsx("small",{className:"form-message text-danger",children:i}):r&&h.jsx("small",{className:"form-message",children:r})]}));nl.displayName="Radio";const rl=_.forwardRef(({name:n,label:e,message:t,size:r="md",options:s,selectedValue:i,error:a,required:l,...c},u)=>h.jsxs(h.Fragment,{children:[e&&h.jsxs("label",{htmlFor:n,children:[e," ",l&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsx("div",{className:"btn-group","data-toggle":"buttons",children:s.map(f=>{const g=f.value.toString()===i?.toString();return h.jsxs("label",{className:`btn auto btn-default btn-${r} ${g?"active":""}`,children:[h.jsx("input",{type:"radio",id:f.value.toString(),name:n,value:f.value.toString(),ref:u,...c}),h.jsx("span",{children:f.label})]},f.value.toString())})}),a?h.jsx("small",{className:"form-message text-danger",children:a}):t&&h.jsx("small",{className:"form-message",children:t})]}));rl.displayName="RadioButtonGroup";const sl=_.forwardRef(({name:n,label:e,message:t,selectLabel:r,floatingLabel:s=!1,error:i,options:a,value:l=[],onChange:c,required:u,disabled:f,className:g},d)=>{const[m,y]=_.useState(!1),[x,w]=_.useState(l),T=_.useRef(null),A=_.useRef(null);_.useEffect(()=>{JSON.stringify(l)!==JSON.stringify(x)&&w(l)},[x,l]);const O=v=>{const S=x.includes(v)?x.filter(j=>j!==v):[...x,v];w(S),c&&c({target:{name:n,value:S}})};Nt([T],()=>{y(!1)}),ki(m,A);const D=x.map(v=>a.find(S=>S.value===v)?.label).filter(Boolean).join(", ");return h.jsxs(h.Fragment,{children:[e&&!s&&h.jsxs("label",{htmlFor:n,children:[e," ",u&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsxs("div",{className:`dropdown-select-container ${g||""}`,ref:T,children:[h.jsxs("div",{className:`dropdown-header ${m?"open":""} ${f?"disabled":""}`,onClick:()=>!f&&y(!m),ref:d,children:[h.jsx("span",{className:"label",children:D||r||"Select an option"}),h.jsx(Yn,{className:`arrow ${m?"open":""}`})]}),m&&!f&&h.jsx("div",{className:"dropdown-options scrollbar",ref:A,role:"listbox",children:a?.map(v=>h.jsx("div",{className:`option ${x.includes(v.value)?"selected":""}`,children:h.jsx(Li,{name:v.value.toString(),label:v.label,checked:x.includes(v.value),onChange:()=>O(v.value)})},v.value))})]}),e&&s&&h.jsxs("label",{htmlFor:n,children:[e," ",u&&h.jsx("span",{className:"text-danger",children:"*"})]}),i?h.jsx("small",{className:"form-message text-danger",children:i}):t&&h.jsx("small",{className:"form-message",children:t})]})});sl.displayName="SelectMultiple";const il=_.forwardRef((n,e)=>{const{id:t,name:r,label:s,message:i,selectLabel:a="Select an option",size:l="md",floatingLabel:c=!1,error:u,options:f=[],value:g="",onChange:d,onBlur:m,required:y,disabled:x,selectSearch:w="",setSelectSearch:T,isLoading:A=!1}=n,O=t||r,[D,v]=_.useState(!1),S=_.useRef(null),j=_.useRef(null),B=_.useRef(null);_.useImperativeHandle(e,()=>B.current),Nt([S],()=>v(!1)),ki(D,j);const z=g?f.find(b=>b.value===g)?.label:a,ee=b=>{d?.({target:{name:r,value:b}}),B.current&&(B.current.value=String(b),B.current.dispatchEvent(new Event("change",{bubbles:!0}))),v(!1)};return c?h.jsxs("div",{className:"form-floating",children:[h.jsxs("select",{ref:B,name:r,value:g,onChange:d,onBlur:m,required:y,disabled:x,style:{position:"absolute",left:"-9999px"},tabIndex:-1,children:[h.jsx("option",{value:"",children:"Select an option"}),f.map(b=>h.jsx("option",{value:b.value,children:b.label},b.value))]}),h.jsxs("div",{className:`dropdown-select-container ${l}`,ref:S,children:[h.jsxs("div",{className:`dropdown-header ${D?"open":""} ${x?"disabled":""}`,onClick:()=>!x&&v(!D),"aria-haspopup":"listbox","aria-expanded":D,children:[h.jsx("span",{className:"label",children:z}),h.jsx(Yn,{className:"arrow"})]}),D&&h.jsxs("div",{className:"dropdown-options scrollbar",ref:j,role:"listbox",children:[h.jsx("div",{className:"search-input",children:h.jsx(fi,{name:"search",placeholder:"Ketik untuk mencari..",type:"search",autoFocus:!0,value:w,onChange:b=>T?.(b.currentTarget.value)})}),A?h.jsx("div",{className:"pt-2 pb-3 text-center",children:"Loading options..."}):f.length===0?h.jsx("div",{className:"pt-2 pb-3 text-center",children:"Tidak ada hasil ditemukan"}):f.map(b=>h.jsx("div",{className:`option ${g===b.value?"selected":""}`,onClick:()=>ee(b.value),role:"option","aria-selected":g===b.value,children:b.label},b.value))]})]}),h.jsxs("label",{htmlFor:O,children:[s," ",y&&h.jsx("span",{className:"text-danger",children:"*"})]}),u?h.jsx("small",{className:"form-message text-danger",children:u}):i&&h.jsx("small",{className:"form-message",children:i})]}):h.jsxs("div",{className:"form-group",children:[s&&h.jsxs("label",{htmlFor:O,children:[s," ",y&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsxs("select",{ref:B,name:r,value:g,onChange:d,onBlur:m,required:y,disabled:x,style:{position:"absolute",left:"-9999px"},tabIndex:-1,children:[h.jsx("option",{value:"",children:"Select an option"}),f.map(b=>h.jsx("option",{value:b.value,children:b.label},b.value))]}),h.jsxs("div",{className:`dropdown-select-container ${l}`,ref:S,children:[h.jsxs("div",{className:`dropdown-header ${D?"open":""} ${x?"disabled":""}`,onClick:()=>!x&&v(!D),"aria-haspopup":"listbox","aria-expanded":D,children:[h.jsx("span",{className:"label",children:z}),h.jsx(Yn,{className:"arrow"})]}),D&&h.jsxs("div",{className:"dropdown-options scrollbar",ref:j,role:"listbox",children:[h.jsx("div",{className:"search-input",children:h.jsx(fi,{name:"search",placeholder:"Ketik untuk mencari..",type:"search",autoFocus:!0,value:w,onChange:b=>T?.(b.currentTarget.value)})}),A?h.jsx("div",{className:"pt-2 pb-3 text-center",children:"Loading options..."}):f.length===0?h.jsx("div",{className:"pt-2 pb-3 text-center",children:"Tidak ada hasil ditemukan"}):f.map(b=>h.jsx("div",{className:`option ${g===b.value?"selected":""}`,onClick:()=>ee(b.value),role:"option","aria-selected":g===b.value,children:b.label},b.value))]})]}),u?h.jsx("small",{className:"form-message text-danger",children:u}):i&&h.jsx("small",{className:"form-message",children:i})]})});il.displayName="SelectWithSearch";const al=_.forwardRef(({name:n,className:e="",error:t,checked:r=!1,onChange:s,...i},a)=>{const l=c=>{s&&s(c)};return h.jsx(h.Fragment,{children:h.jsxs("label",{className:`switch ${e} ${t?"has-error":""}`,children:[h.jsx("input",{type:"checkbox",id:n,name:n,ref:a,checked:r,onChange:l,disabled:i.disabled,...i}),h.jsx("span",{className:"slider round"})]})})});al.displayName="Switch";var ol=typeof global=="object"&&global&&global.Object===Object&&global,_u=typeof self=="object"&&self&&self.Object===Object&&self,nt=ol||_u||Function("return this")(),wt=nt.Symbol,ll=Object.prototype,Ou=ll.hasOwnProperty,Ru=ll.toString,Un=wt?wt.toStringTag:void 0;function Lu(n){var e=Ou.call(n,Un),t=n[Un];try{n[Un]=void 0;var r=!0}catch{}var s=Ru.call(n);return r&&(e?n[Un]=t:delete n[Un]),s}var ku=Object.prototype,ju=ku.toString;function Iu(n){return ju.call(n)}var qu="[object Null]",Mu="[object Undefined]",Aa=wt?wt.toStringTag:void 0;function bn(n){return n==null?n===void 0?Mu:qu:Aa&&Aa in Object(n)?Lu(n):Iu(n)}function ut(n){return n!=null&&typeof n=="object"}var qt=Array.isArray;function Tt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function cl(n){return n}var Du="[object AsyncFunction]",Pu="[object Function]",$u="[object GeneratorFunction]",Bu="[object Proxy]";function ji(n){if(!Tt(n))return!1;var e=bn(n);return e==Pu||e==$u||e==Du||e==Bu}var Zs=nt["__core-js_shared__"],Sa=function(){var n=/[^.]+$/.exec(Zs&&Zs.keys&&Zs.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Fu(n){return!!Sa&&Sa in n}var Uu=Function.prototype,Hu=Uu.toString;function Bt(n){if(n!=null){try{return Hu.call(n)}catch{}try{return n+""}catch{}}return""}var zu=/[\\^$.*+?()[\]{}|]/g,Gu=/^\[object .+?Constructor\]$/,Vu=Function.prototype,Wu=Object.prototype,Ku=Vu.toString,Yu=Wu.hasOwnProperty,Xu=RegExp("^"+Ku.call(Yu).replace(zu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zu(n){if(!Tt(n)||Fu(n))return!1;var e=ji(n)?Xu:Gu;return e.test(Bt(n))}function Ju(n,e){return n?.[e]}function Ft(n,e){var t=Ju(n,e);return Zu(t)?t:void 0}var pi=Ft(nt,"WeakMap"),Ca=Object.create,Qu=function(){function n(){}return function(e){if(!Tt(e))return{};if(Ca)return Ca(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function eh(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 th(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var nh=800,rh=16,sh=Date.now;function ih(n){var e=0,t=0;return function(){var r=sh(),s=rh-(r-t);if(t=r,s>0){if(++e>=nh)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function ah(n){return function(){return n}}var zr=function(){try{var n=Ft(Object,"defineProperty");return n({},"",{}),n}catch{}}(),oh=zr?function(n,e){return zr(n,"toString",{configurable:!0,enumerable:!1,value:ah(e),writable:!0})}:cl,lh=ih(oh);function ch(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var uh=9007199254740991,hh=/^(?:0|[1-9]\d*)$/;function ul(n,e){var t=typeof n;return e=e??uh,!!e&&(t=="number"||t!="symbol"&&hh.test(n))&&n>-1&&n%1==0&&n<e}function Ii(n,e,t){e=="__proto__"&&zr?zr(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function rr(n,e){return n===e||n!==n&&e!==e}var dh=Object.prototype,fh=dh.hasOwnProperty;function hl(n,e,t){var r=n[e];(!(fh.call(n,e)&&rr(r,t))||t===void 0&&!(e in n))&&Ii(n,e,t)}function ph(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var l=e[i],c=void 0;c===void 0&&(c=n[l]),s?Ii(t,l,c):hl(t,l,c)}return t}var _a=Math.max;function gh(n,e,t){return e=_a(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=_a(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=r[s];return l[e]=t(a),eh(n,this,l)}}function mh(n,e){return lh(gh(n,e,cl),n+"")}var bh=9007199254740991;function dl(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=bh}function Zr(n){return n!=null&&dl(n.length)&&!ji(n)}function vh(n,e,t){if(!Tt(t))return!1;var r=typeof e;return(r=="number"?Zr(t)&&ul(e,t.length):r=="string"&&e in t)?rr(t[e],n):!1}function yh(n){return mh(function(e,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,a=s>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,a&&vh(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var l=t[r];l&&n(e,l,r,i)}return e})}var xh=Object.prototype;function qi(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||xh;return n===t}function Eh(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var wh="[object Arguments]";function Oa(n){return ut(n)&&bn(n)==wh}var fl=Object.prototype,Nh=fl.hasOwnProperty,Th=fl.propertyIsEnumerable,gi=Oa(function(){return arguments}())?Oa:function(n){return ut(n)&&Nh.call(n,"callee")&&!Th.call(n,"callee")};function Ah(){return!1}var pl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ra=pl&&typeof module=="object"&&module&&!module.nodeType&&module,Sh=Ra&&Ra.exports===pl,La=Sh?nt.Buffer:void 0,Ch=La?La.isBuffer:void 0,Zn=Ch||Ah,_h="[object Arguments]",Oh="[object Array]",Rh="[object Boolean]",Lh="[object Date]",kh="[object Error]",jh="[object Function]",Ih="[object Map]",qh="[object Number]",Mh="[object Object]",Dh="[object RegExp]",Ph="[object Set]",$h="[object String]",Bh="[object WeakMap]",Fh="[object ArrayBuffer]",Uh="[object DataView]",Hh="[object Float32Array]",zh="[object Float64Array]",Gh="[object Int8Array]",Vh="[object Int16Array]",Wh="[object Int32Array]",Kh="[object Uint8Array]",Yh="[object Uint8ClampedArray]",Xh="[object Uint16Array]",Zh="[object Uint32Array]",fe={};fe[Hh]=fe[zh]=fe[Gh]=fe[Vh]=fe[Wh]=fe[Kh]=fe[Yh]=fe[Xh]=fe[Zh]=!0;fe[_h]=fe[Oh]=fe[Fh]=fe[Rh]=fe[Uh]=fe[Lh]=fe[kh]=fe[jh]=fe[Ih]=fe[qh]=fe[Mh]=fe[Dh]=fe[Ph]=fe[$h]=fe[Bh]=!1;function Jh(n){return ut(n)&&dl(n.length)&&!!fe[bn(n)]}function Mi(n){return function(e){return n(e)}}var gl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wn=gl&&typeof module=="object"&&module&&!module.nodeType&&module,Qh=Wn&&Wn.exports===gl,Js=Qh&&ol.process,gn=function(){try{var n=Wn&&Wn.require&&Wn.require("util").types;return n||Js&&Js.binding&&Js.binding("util")}catch{}}(),ka=gn&&gn.isTypedArray,Di=ka?Mi(ka):Jh,ed=Object.prototype,td=ed.hasOwnProperty;function ml(n,e){var t=qt(n),r=!t&&gi(n),s=!t&&!r&&Zn(n),i=!t&&!r&&!s&&Di(n),a=t||r||s||i,l=a?Eh(n.length,String):[],c=l.length;for(var u in n)(e||td.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ul(u,c)))&&l.push(u);return l}function bl(n,e){return function(t){return n(e(t))}}var nd=bl(Object.keys,Object),rd=Object.prototype,sd=rd.hasOwnProperty;function id(n){if(!qi(n))return nd(n);var e=[];for(var t in Object(n))sd.call(n,t)&&t!="constructor"&&e.push(t);return e}function ad(n){return Zr(n)?ml(n):id(n)}function od(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var ld=Object.prototype,cd=ld.hasOwnProperty;function ud(n){if(!Tt(n))return od(n);var e=qi(n),t=[];for(var r in n)r=="constructor"&&(e||!cd.call(n,r))||t.push(r);return t}function vl(n){return Zr(n)?ml(n,!0):ud(n)}var Jn=Ft(Object,"create");function hd(){this.__data__=Jn?Jn(null):{},this.size=0}function dd(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var fd="__lodash_hash_undefined__",pd=Object.prototype,gd=pd.hasOwnProperty;function md(n){var e=this.__data__;if(Jn){var t=e[n];return t===fd?void 0:t}return gd.call(e,n)?e[n]:void 0}var bd=Object.prototype,vd=bd.hasOwnProperty;function yd(n){var e=this.__data__;return Jn?e[n]!==void 0:vd.call(e,n)}var xd="__lodash_hash_undefined__";function Ed(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Jn&&e===void 0?xd:e,this}function Mt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Mt.prototype.clear=hd;Mt.prototype.delete=dd;Mt.prototype.get=md;Mt.prototype.has=yd;Mt.prototype.set=Ed;function wd(){this.__data__=[],this.size=0}function Jr(n,e){for(var t=n.length;t--;)if(rr(n[t][0],e))return t;return-1}var Nd=Array.prototype,Td=Nd.splice;function Ad(n){var e=this.__data__,t=Jr(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Td.call(e,t,1),--this.size,!0}function Sd(n){var e=this.__data__,t=Jr(e,n);return t<0?void 0:e[t][1]}function Cd(n){return Jr(this.__data__,n)>-1}function _d(n,e){var t=this.__data__,r=Jr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function dt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}dt.prototype.clear=wd;dt.prototype.delete=Ad;dt.prototype.get=Sd;dt.prototype.has=Cd;dt.prototype.set=_d;var Qn=Ft(nt,"Map");function Od(){this.size=0,this.__data__={hash:new Mt,map:new(Qn||dt),string:new Mt}}function Rd(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Qr(n,e){var t=n.__data__;return Rd(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Ld(n){var e=Qr(this,n).delete(n);return this.size-=e?1:0,e}function kd(n){return Qr(this,n).get(n)}function jd(n){return Qr(this,n).has(n)}function Id(n,e){var t=Qr(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Ut(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Ut.prototype.clear=Od;Ut.prototype.delete=Ld;Ut.prototype.get=kd;Ut.prototype.has=jd;Ut.prototype.set=Id;function qd(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var yl=bl(Object.getPrototypeOf,Object),Md="[object Object]",Dd=Function.prototype,Pd=Object.prototype,xl=Dd.toString,$d=Pd.hasOwnProperty,Bd=xl.call(Object);function Fd(n){if(!ut(n)||bn(n)!=Md)return!1;var e=yl(n);if(e===null)return!0;var t=$d.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&xl.call(t)==Bd}function Ud(){this.__data__=new dt,this.size=0}function Hd(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function zd(n){return this.__data__.get(n)}function Gd(n){return this.__data__.has(n)}var Vd=200;function Wd(n,e){var t=this.__data__;if(t instanceof dt){var r=t.__data__;if(!Qn||r.length<Vd-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Ut(r)}return t.set(n,e),this.size=t.size,this}function et(n){var e=this.__data__=new dt(n);this.size=e.size}et.prototype.clear=Ud;et.prototype.delete=Hd;et.prototype.get=zd;et.prototype.has=Gd;et.prototype.set=Wd;var El=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ja=El&&typeof module=="object"&&module&&!module.nodeType&&module,Kd=ja&&ja.exports===El,Ia=Kd?nt.Buffer:void 0,qa=Ia?Ia.allocUnsafe:void 0;function wl(n,e){if(e)return n.slice();var t=n.length,r=qa?qa(t):new n.constructor(t);return n.copy(r),r}function Yd(n,e){for(var t=-1,r=n==null?0:n.length,s=0,i=[];++t<r;){var a=n[t];e(a,t,n)&&(i[s++]=a)}return i}function Xd(){return[]}var Zd=Object.prototype,Jd=Zd.propertyIsEnumerable,Ma=Object.getOwnPropertySymbols,Qd=Ma?function(n){return n==null?[]:(n=Object(n),Yd(Ma(n),function(e){return Jd.call(n,e)}))}:Xd;function ef(n,e,t){var r=e(n);return qt(n)?r:qd(r,t(n))}function mi(n){return ef(n,ad,Qd)}var bi=Ft(nt,"DataView"),vi=Ft(nt,"Promise"),yi=Ft(nt,"Set"),Da="[object Map]",tf="[object Object]",Pa="[object Promise]",$a="[object Set]",Ba="[object WeakMap]",Fa="[object DataView]",nf=Bt(bi),rf=Bt(Qn),sf=Bt(vi),af=Bt(yi),of=Bt(pi),Ue=bn;(bi&&Ue(new bi(new ArrayBuffer(1)))!=Fa||Qn&&Ue(new Qn)!=Da||vi&&Ue(vi.resolve())!=Pa||yi&&Ue(new yi)!=$a||pi&&Ue(new pi)!=Ba)&&(Ue=function(n){var e=bn(n),t=e==tf?n.constructor:void 0,r=t?Bt(t):"";if(r)switch(r){case nf:return Fa;case rf:return Da;case sf:return Pa;case af:return $a;case of:return Ba}return e});var lf=Object.prototype,cf=lf.hasOwnProperty;function uf(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&cf.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Gr=nt.Uint8Array;function Pi(n){var e=new n.constructor(n.byteLength);return new Gr(e).set(new Gr(n)),e}function hf(n,e){var t=Pi(n.buffer);return new n.constructor(t,n.byteOffset,n.byteLength)}var df=/\w*$/;function ff(n){var e=new n.constructor(n.source,df.exec(n));return e.lastIndex=n.lastIndex,e}var Ua=wt?wt.prototype:void 0,Ha=Ua?Ua.valueOf:void 0;function pf(n){return Ha?Object(Ha.call(n)):{}}function Nl(n,e){var t=e?Pi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var gf="[object Boolean]",mf="[object Date]",bf="[object Map]",vf="[object Number]",yf="[object RegExp]",xf="[object Set]",Ef="[object String]",wf="[object Symbol]",Nf="[object ArrayBuffer]",Tf="[object DataView]",Af="[object Float32Array]",Sf="[object Float64Array]",Cf="[object Int8Array]",_f="[object Int16Array]",Of="[object Int32Array]",Rf="[object Uint8Array]",Lf="[object Uint8ClampedArray]",kf="[object Uint16Array]",jf="[object Uint32Array]";function If(n,e,t){var r=n.constructor;switch(e){case Nf:return Pi(n);case gf:case mf:return new r(+n);case Tf:return hf(n);case Af:case Sf:case Cf:case _f:case Of:case Rf:case Lf:case kf:case jf:return Nl(n,t);case bf:return new r;case vf:case Ef:return new r(n);case yf:return ff(n);case xf:return new r;case wf:return pf(n)}}function Tl(n){return typeof n.constructor=="function"&&!qi(n)?Qu(yl(n)):{}}var qf="[object Map]";function Mf(n){return ut(n)&&Ue(n)==qf}var za=gn&&gn.isMap,Df=za?Mi(za):Mf,Pf="[object Set]";function $f(n){return ut(n)&&Ue(n)==Pf}var Ga=gn&&gn.isSet,Bf=Ga?Mi(Ga):$f,Ff=1,Al="[object Arguments]",Uf="[object Array]",Hf="[object Boolean]",zf="[object Date]",Gf="[object Error]",Sl="[object Function]",Vf="[object GeneratorFunction]",Wf="[object Map]",Kf="[object Number]",Cl="[object Object]",Yf="[object RegExp]",Xf="[object Set]",Zf="[object String]",Jf="[object Symbol]",Qf="[object WeakMap]",ep="[object ArrayBuffer]",tp="[object DataView]",np="[object Float32Array]",rp="[object Float64Array]",sp="[object Int8Array]",ip="[object Int16Array]",ap="[object Int32Array]",op="[object Uint8Array]",lp="[object Uint8ClampedArray]",cp="[object Uint16Array]",up="[object Uint32Array]",de={};de[Al]=de[Uf]=de[ep]=de[tp]=de[Hf]=de[zf]=de[np]=de[rp]=de[sp]=de[ip]=de[ap]=de[Wf]=de[Kf]=de[Cl]=de[Yf]=de[Xf]=de[Zf]=de[Jf]=de[op]=de[lp]=de[cp]=de[up]=!0;de[Gf]=de[Sl]=de[Qf]=!1;function Fr(n,e,t,r,s,i){var a,l=e&Ff;if(a!==void 0)return a;if(!Tt(n))return n;var c=qt(n);if(c)a=uf(n);else{var u=Ue(n),f=u==Sl||u==Vf;if(Zn(n))return wl(n,l);if(u==Cl||u==Al||f&&!s)a=f?{}:Tl(n);else{if(!de[u])return s?n:{};a=If(n,u,l)}}i||(i=new et);var g=i.get(n);if(g)return g;i.set(n,a),Bf(n)?n.forEach(function(y){a.add(Fr(y,e,t,y,n,i))}):Df(n)&&n.forEach(function(y,x){a.set(x,Fr(y,e,t,x,n,i))});var d=mi,m=c?void 0:d(n);return ch(m||n,function(y,x){m&&(x=y,y=n[x]),hl(a,x,Fr(y,e,t,x,n,i))}),a}var hp=1,dp=4;function dn(n){return Fr(n,hp|dp)}var fp="__lodash_hash_undefined__";function pp(n){return this.__data__.set(n,fp),this}function gp(n){return this.__data__.has(n)}function Vr(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Ut;++e<t;)this.add(n[e])}Vr.prototype.add=Vr.prototype.push=pp;Vr.prototype.has=gp;function mp(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function bp(n,e){return n.has(e)}var vp=1,yp=2;function _l(n,e,t,r,s,i){var a=t&vp,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(n),f=i.get(e);if(u&&f)return u==e&&f==n;var g=-1,d=!0,m=t&yp?new Vr:void 0;for(i.set(n,e),i.set(e,n);++g<l;){var y=n[g],x=e[g];if(r)var w=a?r(x,y,g,e,n,i):r(y,x,g,n,e,i);if(w!==void 0){if(w)continue;d=!1;break}if(m){if(!mp(e,function(T,A){if(!bp(m,A)&&(y===T||s(y,T,t,r,i)))return m.push(A)})){d=!1;break}}else if(!(y===x||s(y,x,t,r,i))){d=!1;break}}return i.delete(n),i.delete(e),d}function xp(n){var e=-1,t=Array(n.size);return n.forEach(function(r,s){t[++e]=[s,r]}),t}function Ep(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var wp=1,Np=2,Tp="[object Boolean]",Ap="[object Date]",Sp="[object Error]",Cp="[object Map]",_p="[object Number]",Op="[object RegExp]",Rp="[object Set]",Lp="[object String]",kp="[object Symbol]",jp="[object ArrayBuffer]",Ip="[object DataView]",Va=wt?wt.prototype:void 0,Qs=Va?Va.valueOf:void 0;function qp(n,e,t,r,s,i,a){switch(t){case Ip:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case jp:return!(n.byteLength!=e.byteLength||!i(new Gr(n),new Gr(e)));case Tp:case Ap:case _p:return rr(+n,+e);case Sp:return n.name==e.name&&n.message==e.message;case Op:case Lp:return n==e+"";case Cp:var l=xp;case Rp:var c=r&wp;if(l||(l=Ep),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=Np,a.set(n,e);var f=_l(l(n),l(e),r,s,i,a);return a.delete(n),f;case kp:if(Qs)return Qs.call(n)==Qs.call(e)}return!1}var Mp=1,Dp=Object.prototype,Pp=Dp.hasOwnProperty;function $p(n,e,t,r,s,i){var a=t&Mp,l=mi(n),c=l.length,u=mi(e),f=u.length;if(c!=f&&!a)return!1;for(var g=c;g--;){var d=l[g];if(!(a?d in e:Pp.call(e,d)))return!1}var m=i.get(n),y=i.get(e);if(m&&y)return m==e&&y==n;var x=!0;i.set(n,e),i.set(e,n);for(var w=a;++g<c;){d=l[g];var T=n[d],A=e[d];if(r)var O=a?r(A,T,d,e,n,i):r(T,A,d,n,e,i);if(!(O===void 0?T===A||s(T,A,t,r,i):O)){x=!1;break}w||(w=d=="constructor")}if(x&&!w){var D=n.constructor,v=e.constructor;D!=v&&"constructor"in n&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof v=="function"&&v instanceof v)&&(x=!1)}return i.delete(n),i.delete(e),x}var Bp=1,Wa="[object Arguments]",Ka="[object Array]",Lr="[object Object]",Fp=Object.prototype,Ya=Fp.hasOwnProperty;function Up(n,e,t,r,s,i){var a=qt(n),l=qt(e),c=a?Ka:Ue(n),u=l?Ka:Ue(e);c=c==Wa?Lr:c,u=u==Wa?Lr:u;var f=c==Lr,g=u==Lr,d=c==u;if(d&&Zn(n)){if(!Zn(e))return!1;a=!0,f=!1}if(d&&!f)return i||(i=new et),a||Di(n)?_l(n,e,t,r,s,i):qp(n,e,c,t,r,s,i);if(!(t&Bp)){var m=f&&Ya.call(n,"__wrapped__"),y=g&&Ya.call(e,"__wrapped__");if(m||y){var x=m?n.value():n,w=y?e.value():e;return i||(i=new et),s(x,w,t,r,i)}}return d?(i||(i=new et),$p(n,e,t,r,s,i)):!1}function Ol(n,e,t,r,s){return n===e?!0:n==null||e==null||!ut(n)&&!ut(e)?n!==n&&e!==e:Up(n,e,t,r,Ol,s)}function Hp(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),l=a.length;l--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var zp=Hp();function xi(n,e,t){(t!==void 0&&!rr(n[e],t)||t===void 0&&!(e in n))&&Ii(n,e,t)}function Gp(n){return ut(n)&&Zr(n)}function Ei(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function Vp(n){return ph(n,vl(n))}function Wp(n,e,t,r,s,i,a){var l=Ei(n,t),c=Ei(e,t),u=a.get(c);if(u){xi(n,t,u);return}var f=i?i(l,c,t+"",n,e,a):void 0,g=f===void 0;if(g){var d=qt(c),m=!d&&Zn(c),y=!d&&!m&&Di(c);f=c,d||m||y?qt(l)?f=l:Gp(l)?f=th(l):m?(g=!1,f=wl(c,!0)):y?(g=!1,f=Nl(c,!0)):f=[]:Fd(c)||gi(c)?(f=l,gi(l)?f=Vp(l):(!Tt(l)||ji(l))&&(f=Tl(c))):g=!1}g&&(a.set(c,f),s(f,c,r,i,a),a.delete(c)),xi(n,t,f)}function Rl(n,e,t,r,s){n!==e&&zp(e,function(i,a){if(s||(s=new et),Tt(i))Wp(n,e,a,t,Rl,r,s);else{var l=r?r(Ei(n,a),i,a+"",n,e,s):void 0;l===void 0&&(l=i),xi(n,a,l)}},vl)}function bt(n,e){return Ol(n,e)}var xt=yh(function(n,e,t){Rl(n,e,t)}),W=(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))(W||{});class tt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=W.TYPE&W.ATTRIBUTE;this.scope=r.scope!=null?r.scope&W.LEVEL|s:W.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.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 fn extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Ll=class wi{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 r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new fn(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),l=new i(e,a,r);return wi.blots.set(l.domNode,l),l}find(e,t=!1){return wi.find(e,t)}query(e,t=W.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&W.LEVEL&W.BLOCK?r=this.types.block:e&W.LEVEL&W.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&W.LEVEL&r.scope&&t&W.TYPE&r.scope?r:null}register(...e){return e.map(t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new fn("Invalid definition");if(r&&t.blotName==="abstract")throw new fn("Cannot register abstract class");const i=r?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map(a=>a.toUpperCase()):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach(a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)}))),t})}};Ll.blots=new WeakMap;let mn=Ll;function Xa(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter(t=>t.indexOf(`${e}-`)===0)}class Kp extends tt{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){Xa(e,this.keyName).forEach(t=>{e.classList.remove(t)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(Xa(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Ve=Kp;function ei(n){const e=n.split("-"),t=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+t}class Yp extends tt{static keys(e){return(e.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(e,t){return this.canAdd(e,t)?(e.style[ei(this.keyName)]=t,!0):!1}remove(e){e.style[ei(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[ei(this.keyName)];return this.canAdd(e,t)?t:""}}const At=Yp;class Xp{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=mn.find(this.domNode);if(e==null)return;const t=tt.keys(this.domNode),r=Ve.keys(this.domNode),s=At.keys(this.domNode);t.concat(r).concat(s).forEach(i=>{const a=e.scroll.query(i,W.ATTRIBUTE);a instanceof tt&&(this.attributes[a.attrName]=a)})}copy(e){Object.keys(this.attributes).forEach(t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)})}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 es=Xp,kl=class{constructor(e,t){this.scroll=e,this.domNode=t,mn.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new fn("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),mn.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const i=this.isolate(e,t);if(this.scroll.query(r,W.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,W.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);i.wrap(a),a.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){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(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new fn(`Cannot wrap ${e}`);return r.appendChild(this),r}};kl.blotName="abstract";let jl=kl;const Il=class extends jl{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Il.scope=W.INLINE_BLOT;let Zp=Il;const Ae=Zp;class Jp{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 r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=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,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.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 r=this.iterator();let s=r();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,i]=this.find(e);let a=e-i;const l=this.iterator(s);let c=l();for(;c&&a<e+t;){const u=c.length();e>a?r(c,e-a,Math.min(t,a+u-e)):r(c,0,Math.min(u,e+t-a)),a+=u,c=l()}}map(e){return this.reduce((t,r)=>(t.push(e(r)),t),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function Za(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(W.INLINE);return Array.from(n.childNodes).forEach(s=>{r.domNode.appendChild(s)}),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const ql=class mt extends jl{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,mt.uiClass&&this.uiNode.classList.add(mt.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new Jp,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=Za(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof fn)return;throw t}})}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,(r,s,i)=>{r.deleteAt(s,i)})}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof mt?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(t,r,(a,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof mt&&(s=s.concat(a.descendants(e,l,i))),i-=c}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(t=>{e||this.statics.allowedChildren.some(r=>t instanceof r)||(t.statics.scope===W.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof mt?t.unwrap():t.remove())})}formatAt(e,t,r,s){this.children.forEachAt(e,t,(i,a,l)=>{i.formatAt(a,l,r,s)})}insertAt(e,t,r){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(r=>{e.insertBefore(r,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[r,s]=this.children.find(e,t),i=[[this,e]];return r instanceof mt?i.concat(r.path(s,t)):(r!=null&&i.push([r,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof mt&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,i,a)=>{const l=s.split(i,t);l!=null&&r.appendChild(l)}),r}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 r=[],s=[];e.forEach(i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))}),s.forEach(i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(i);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()}),r.filter(i=>i.parentNode===this.domNode&&i!==this.uiNode).sort((i,a)=>i===a?0:i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(i=>{let a=null;i.nextSibling!=null&&(a=this.scroll.find(i.nextSibling));const l=Za(i,this.scroll);(l.next!==a||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,a||void 0))}),this.enforceAllowedChildren()}};ql.uiClass="";let Qp=ql;const ze=Qp;function eg(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 on=class ln extends ze{static create(e){return super.create(e)}static formats(e,t){const r=t.query(ln.blotName);if(!(r!=null&&e.tagName===r.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 es(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach(r=>{r instanceof ln||(r=r.wrap(ln.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,W.INLINE);if(r==null)return;r instanceof tt?this.attributes.attribute(r,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,r,s){this.formats()[r]!=null||this.scroll.query(r,W.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof ln&&r.prev===this&&eg(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof ln&&this.attributes.move(r),r}};on.allowedChildren=[on,Ae],on.blotName="inline",on.scope=W.INLINE_BLOT,on.tagName="SPAN";let tg=on;const $i=tg,cn=class Ni extends ze{static create(e){return super.create(e)}static formats(e,t){const r=t.query(Ni.blotName);if(!(r!=null&&e.tagName===r.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 es(this.domNode)}format(e,t){const r=this.scroll.query(e,W.BLOCK);r!=null&&(r instanceof tt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(Ni.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,r,s){this.scroll.query(r,W.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,W.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};cn.blotName="block",cn.scope=W.BLOCK_BLOT,cn.tagName="P",cn.allowedChildren=[$i,cn,Ae];let ng=cn;const er=ng,Ti=class extends ze{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Ti.blotName="container",Ti.scope=W.BLOCK_BLOT;let rg=Ti;const ts=rg;class sg extends Ae{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ke=sg,ig={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},ag=100,un=class extends ze{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,ig),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=W.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&i(c.parent))},a=c=>{r.has(c.domNode)&&(c instanceof ze&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=ag)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach(u=>{const f=this.find(u.target,!0);f!=null&&(f.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach(g=>{const d=this.find(g,!1);i(d,!1),d instanceof ze&&d.children.forEach(m=>{i(m,!1)})})):u.type==="attributes"&&i(f.prev)),i(f))}),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),s=l.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)}),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};un.blotName="scroll",un.defaultChild=er,un.allowedChildren=[er,ts],un.scope=W.BLOCK_BLOT,un.tagName="DIV";let og=un;const Bi=og,Ai=class Ml extends Ae{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,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}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 Ml&&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 r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Ai.blotName="text",Ai.scope=W.INLINE_BLOT;let lg=Ai;const Wr=lg,cg=Object.freeze(Object.defineProperty({__proto__:null,Attributor:tt,AttributorStore:es,BlockBlot:er,ClassAttributor:Ve,ContainerBlot:ts,EmbedBlot:ke,InlineBlot:$i,LeafBlot:Ae,ParentBlot:ze,Registry:mn,Scope:W,ScrollBlot:Bi,StyleAttributor:At,TextBlot:Wr},Symbol.toStringTag,{value:"Module"}));var kr={exports:{}},ti,Ja;function ug(){if(Ja)return ti;Ja=1;var n=-1,e=1,t=0;function r(b,q,N,L,M){if(b===q)return b?[[t,b]]:[];if(N!=null){var I=z(b,q,N);if(I)return I}var P=l(b,q),U=b.substring(0,P);b=b.substring(P),q=q.substring(P),P=u(b,q);var K=b.substring(b.length-P);b=b.substring(0,b.length-P),q=q.substring(0,q.length-P);var C=s(b,q);return U&&C.unshift([t,U]),K&&C.push([t,K]),A(C,M),L&&g(C),C}function s(b,q){var N;if(!b)return[[e,q]];if(!q)return[[n,b]];var L=b.length>q.length?b:q,M=b.length>q.length?q:b,I=L.indexOf(M);if(I!==-1)return N=[[e,L.substring(0,I)],[t,M],[e,L.substring(I+M.length)]],b.length>q.length&&(N[0][0]=N[2][0]=n),N;if(M.length===1)return[[n,b],[e,q]];var P=f(b,q);if(P){var U=P[0],K=P[1],C=P[2],$=P[3],F=P[4],Z=r(U,C),J=r(K,$);return Z.concat([[t,F]],J)}return i(b,q)}function i(b,q){for(var N=b.length,L=q.length,M=Math.ceil((N+L)/2),I=M,P=2*M,U=new Array(P),K=new Array(P),C=0;C<P;C++)U[C]=-1,K[C]=-1;U[I+1]=0,K[I+1]=0;for(var $=N-L,F=$%2!==0,Z=0,J=0,H=0,le=0,ue=0;ue<M;ue++){for(var Y=-ue+Z;Y<=ue-J;Y+=2){var ne=I+Y,re;Y===-ue||Y!==ue&&U[ne-1]<U[ne+1]?re=U[ne+1]:re=U[ne-1]+1;for(var ie=re-Y;re<N&&ie<L&&b.charAt(re)===q.charAt(ie);)re++,ie++;if(U[ne]=re,re>N)J+=2;else if(ie>L)Z+=2;else if(F){var ce=I+$-Y;if(ce>=0&&ce<P&&K[ce]!==-1){var he=N-K[ce];if(re>=he)return a(b,q,re,ie)}}}for(var pe=-ue+H;pe<=ue-le;pe+=2){var ce=I+pe,he;pe===-ue||pe!==ue&&K[ce-1]<K[ce+1]?he=K[ce+1]:he=K[ce-1]+1;for(var Ee=he-pe;he<N&&Ee<L&&b.charAt(N-he-1)===q.charAt(L-Ee-1);)he++,Ee++;if(K[ce]=he,he>N)le+=2;else if(Ee>L)H+=2;else if(!F){var ne=I+$-pe;if(ne>=0&&ne<P&&U[ne]!==-1){var re=U[ne],ie=I+re-ne;if(he=N-he,re>=he)return a(b,q,re,ie)}}}}return[[n,b],[e,q]]}function a(b,q,N,L){var M=b.substring(0,N),I=q.substring(0,L),P=b.substring(N),U=q.substring(L),K=r(M,I),C=r(P,U);return K.concat(C)}function l(b,q){if(!b||!q||b.charAt(0)!==q.charAt(0))return 0;for(var N=0,L=Math.min(b.length,q.length),M=L,I=0;N<M;)b.substring(I,M)==q.substring(I,M)?(N=M,I=N):L=M,M=Math.floor((L-N)/2+N);return O(b.charCodeAt(M-1))&&M--,M}function c(b,q){var N=b.length,L=q.length;if(N==0||L==0)return 0;N>L?b=b.substring(N-L):N<L&&(q=q.substring(0,N));var M=Math.min(N,L);if(b==q)return M;for(var I=0,P=1;;){var U=b.substring(M-P),K=q.indexOf(U);if(K==-1)return I;P+=K,(K==0||b.substring(M-P)==q.substring(0,P))&&(I=P,P++)}}function u(b,q){if(!b||!q||b.slice(-1)!==q.slice(-1))return 0;for(var N=0,L=Math.min(b.length,q.length),M=L,I=0;N<M;)b.substring(b.length-M,b.length-I)==q.substring(q.length-M,q.length-I)?(N=M,I=N):L=M,M=Math.floor((L-N)/2+N);return D(b.charCodeAt(b.length-M))&&M--,M}function f(b,q){var N=b.length>q.length?b:q,L=b.length>q.length?q:b;if(N.length<4||L.length*2<N.length)return null;function M(J,H,le){for(var ue=J.substring(le,le+Math.floor(J.length/4)),Y=-1,ne="",re,ie,ce,he;(Y=H.indexOf(ue,Y+1))!==-1;){var pe=l(J.substring(le),H.substring(Y)),Ee=u(J.substring(0,le),H.substring(0,Y));ne.length<Ee+pe&&(ne=H.substring(Y-Ee,Y)+H.substring(Y,Y+pe),re=J.substring(0,le-Ee),ie=J.substring(le+pe),ce=H.substring(0,Y-Ee),he=H.substring(Y+pe))}return ne.length*2>=J.length?[re,ie,ce,he,ne]:null}var I=M(N,L,Math.ceil(N.length/4)),P=M(N,L,Math.ceil(N.length/2)),U;if(!I&&!P)return null;P?I?U=I[4].length>P[4].length?I:P:U=P:U=I;var K,C,$,F;b.length>q.length?(K=U[0],C=U[1],$=U[2],F=U[3]):($=U[0],F=U[1],K=U[2],C=U[3]);var Z=U[4];return[K,C,$,F,Z]}function g(b){for(var q=!1,N=[],L=0,M=null,I=0,P=0,U=0,K=0,C=0;I<b.length;)b[I][0]==t?(N[L++]=I,P=K,U=C,K=0,C=0,M=b[I][1]):(b[I][0]==e?K+=b[I][1].length:C+=b[I][1].length,M&&M.length<=Math.max(P,U)&&M.length<=Math.max(K,C)&&(b.splice(N[L-1],0,[n,M]),b[N[L-1]+1][0]=e,L--,L--,I=L>0?N[L-1]:-1,P=0,U=0,K=0,C=0,M=null,q=!0)),I++;for(q&&A(b),T(b),I=1;I<b.length;){if(b[I-1][0]==n&&b[I][0]==e){var $=b[I-1][1],F=b[I][1],Z=c($,F),J=c(F,$);Z>=J?(Z>=$.length/2||Z>=F.length/2)&&(b.splice(I,0,[t,F.substring(0,Z)]),b[I-1][1]=$.substring(0,$.length-Z),b[I+1][1]=F.substring(Z),I++):(J>=$.length/2||J>=F.length/2)&&(b.splice(I,0,[t,$.substring(0,J)]),b[I-1][0]=e,b[I-1][1]=F.substring(0,F.length-J),b[I+1][0]=n,b[I+1][1]=$.substring(J),I++),I++}I++}}var d=/[^a-zA-Z0-9]/,m=/\s/,y=/[\r\n]/,x=/\n\r?\n$/,w=/^\r?\n\r?\n/;function T(b){function q(J,H){if(!J||!H)return 6;var le=J.charAt(J.length-1),ue=H.charAt(0),Y=le.match(d),ne=ue.match(d),re=Y&&le.match(m),ie=ne&&ue.match(m),ce=re&&le.match(y),he=ie&&ue.match(y),pe=ce&&J.match(x),Ee=he&&H.match(w);return pe||Ee?5:ce||he?4:Y&&!re&&ie?3:re||ie?2:Y||ne?1:0}for(var N=1;N<b.length-1;){if(b[N-1][0]==t&&b[N+1][0]==t){var L=b[N-1][1],M=b[N][1],I=b[N+1][1],P=u(L,M);if(P){var U=M.substring(M.length-P);L=L.substring(0,L.length-P),M=U+M.substring(0,M.length-P),I=U+I}for(var K=L,C=M,$=I,F=q(L,M)+q(M,I);M.charAt(0)===I.charAt(0);){L+=M.charAt(0),M=M.substring(1)+I.charAt(0),I=I.substring(1);var Z=q(L,M)+q(M,I);Z>=F&&(F=Z,K=L,C=M,$=I)}b[N-1][1]!=K&&(K?b[N-1][1]=K:(b.splice(N-1,1),N--),b[N][1]=C,$?b[N+1][1]=$:(b.splice(N+1,1),N--))}N++}}function A(b,q){b.push([t,""]);for(var N=0,L=0,M=0,I="",P="",U;N<b.length;){if(N<b.length-1&&!b[N][1]){b.splice(N,1);continue}switch(b[N][0]){case e:M++,P+=b[N][1],N++;break;case n:L++,I+=b[N][1],N++;break;case t:var K=N-M-L-1;if(q){if(K>=0&&S(b[K][1])){var C=b[K][1].slice(-1);if(b[K][1]=b[K][1].slice(0,-1),I=C+I,P=C+P,!b[K][1]){b.splice(K,1),N--;var $=K-1;b[$]&&b[$][0]===e&&(M++,P=b[$][1]+P,$--),b[$]&&b[$][0]===n&&(L++,I=b[$][1]+I,$--),K=$}}if(v(b[N][1])){var C=b[N][1].charAt(0);b[N][1]=b[N][1].slice(1),I+=C,P+=C}}if(N<b.length-1&&!b[N][1]){b.splice(N,1);break}if(I.length>0||P.length>0){I.length>0&&P.length>0&&(U=l(P,I),U!==0&&(K>=0?b[K][1]+=P.substring(0,U):(b.splice(0,0,[t,P.substring(0,U)]),N++),P=P.substring(U),I=I.substring(U)),U=u(P,I),U!==0&&(b[N][1]=P.substring(P.length-U)+b[N][1],P=P.substring(0,P.length-U),I=I.substring(0,I.length-U)));var F=M+L;I.length===0&&P.length===0?(b.splice(N-F,F),N=N-F):I.length===0?(b.splice(N-F,F,[e,P]),N=N-F+1):P.length===0?(b.splice(N-F,F,[n,I]),N=N-F+1):(b.splice(N-F,F,[n,I],[e,P]),N=N-F+2)}N!==0&&b[N-1][0]===t?(b[N-1][1]+=b[N][1],b.splice(N,1)):N++,M=0,L=0,I="",P="";break}}b[b.length-1][1]===""&&b.pop();var Z=!1;for(N=1;N<b.length-1;)b[N-1][0]===t&&b[N+1][0]===t&&(b[N][1].substring(b[N][1].length-b[N-1][1].length)===b[N-1][1]?(b[N][1]=b[N-1][1]+b[N][1].substring(0,b[N][1].length-b[N-1][1].length),b[N+1][1]=b[N-1][1]+b[N+1][1],b.splice(N-1,1),Z=!0):b[N][1].substring(0,b[N+1][1].length)==b[N+1][1]&&(b[N-1][1]+=b[N+1][1],b[N][1]=b[N][1].substring(b[N+1][1].length)+b[N+1][1],b.splice(N+1,1),Z=!0)),N++;Z&&A(b,q)}function O(b){return b>=55296&&b<=56319}function D(b){return b>=56320&&b<=57343}function v(b){return D(b.charCodeAt(0))}function S(b){return O(b.charCodeAt(b.length-1))}function j(b){for(var q=[],N=0;N<b.length;N++)b[N][1].length>0&&q.push(b[N]);return q}function B(b,q,N,L){return S(b)||v(L)?null:j([[t,b],[n,q],[e,N],[t,L]])}function z(b,q,N){var L=typeof N=="number"?{index:N,length:0}:N.oldRange,M=typeof N=="number"?null:N.newRange,I=b.length,P=q.length;if(L.length===0&&(M===null||M.length===0)){var U=L.index,K=b.slice(0,U),C=b.slice(U),$=M?M.index:null;e:{var F=U+P-I;if($!==null&&$!==F||F<0||F>P)break e;var Z=q.slice(0,F),J=q.slice(F);if(J!==C)break e;var H=Math.min(U,F),le=K.slice(0,H),ue=Z.slice(0,H);if(le!==ue)break e;var Y=K.slice(H),ne=Z.slice(H);return B(le,Y,ne,C)}e:{if($!==null&&$!==U)break e;var re=U,Z=q.slice(0,re),J=q.slice(re);if(Z!==K)break e;var ie=Math.min(I-re,P-re),ce=C.slice(C.length-ie),he=J.slice(J.length-ie);if(ce!==he)break e;var Y=C.slice(0,C.length-ie),ne=J.slice(0,J.length-ie);return B(K,Y,ne,ce)}}if(L.length>0&&M&&M.length===0)e:{var le=b.slice(0,L.index),ce=b.slice(L.index+L.length),H=le.length,ie=ce.length;if(P<H+ie)break e;var ue=q.slice(0,H),he=q.slice(P-ie);if(le!==ue||ce!==he)break e;var Y=b.slice(H,I-ie),ne=q.slice(H,P-ie);return B(le,Y,ne,ce)}return null}function ee(b,q,N,L){return r(b,q,N,L,!0)}return ee.INSERT=e,ee.DELETE=n,ee.EQUAL=t,ti=ee,ti}var zn={exports:{}};zn.exports;var Qa;function Dl(){return Qa||(Qa=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Function]",g="[object GeneratorFunction]",d="[object Map]",m="[object Number]",y="[object Object]",x="[object Promise]",w="[object RegExp]",T="[object Set]",A="[object String]",O="[object Symbol]",D="[object WeakMap]",v="[object ArrayBuffer]",S="[object DataView]",j="[object Float32Array]",B="[object Float64Array]",z="[object Int8Array]",ee="[object Int16Array]",b="[object Int32Array]",q="[object Uint8Array]",N="[object Uint8ClampedArray]",L="[object Uint16Array]",M="[object Uint32Array]",I=/[\\^$.*+?()[\]{}|]/g,P=/\w*$/,U=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,C={};C[i]=C[a]=C[v]=C[S]=C[l]=C[c]=C[j]=C[B]=C[z]=C[ee]=C[b]=C[d]=C[m]=C[y]=C[w]=C[T]=C[A]=C[O]=C[q]=C[N]=C[L]=C[M]=!0,C[u]=C[f]=C[D]=!1;var $=typeof vt=="object"&&vt&&vt.Object===Object&&vt,F=typeof self=="object"&&self&&self.Object===Object&&self,Z=$||F||Function("return this")(),J=e&&!e.nodeType&&e,H=J&&!0&&n&&!n.nodeType&&n,le=H&&H.exports===J;function ue(o,p){return o.set(p[0],p[1]),o}function Y(o,p){return o.add(p),o}function ne(o,p){for(var E=-1,R=o?o.length:0;++E<R&&p(o[E],E,o)!==!1;);return o}function re(o,p){for(var E=-1,R=p.length,Q=o.length;++E<R;)o[Q+E]=p[E];return o}function ie(o,p,E,R){for(var Q=-1,X=o?o.length:0;++Q<X;)E=p(E,o[Q],Q,o);return E}function ce(o,p){for(var E=-1,R=Array(o);++E<o;)R[E]=p(E);return R}function he(o,p){return o?.[p]}function pe(o){var p=!1;if(o!=null&&typeof o.toString!="function")try{p=!!(o+"")}catch{}return p}function Ee(o){var p=-1,E=Array(o.size);return o.forEach(function(R,Q){E[++p]=[Q,R]}),E}function yn(o,p){return function(E){return o(p(E))}}function lr(o){var p=-1,E=Array(o.size);return o.forEach(function(R){E[++p]=R}),E}var as=Array.prototype,os=Function.prototype,Vt=Object.prototype,xn=Z["__core-js_shared__"],cr=function(){var o=/[^.]+$/.exec(xn&&xn.keys&&xn.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),ur=os.toString,Ke=Vt.hasOwnProperty,Wt=Vt.toString,ls=RegExp("^"+ur.call(Ke).replace(I,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),St=le?Z.Buffer:void 0,Kt=Z.Symbol,En=Z.Uint8Array,je=yn(Object.getPrototypeOf,Object),hr=Object.create,dr=Vt.propertyIsEnumerable,cs=as.splice,wn=Object.getOwnPropertySymbols,Yt=St?St.isBuffer:void 0,fr=yn(Object.keys,Object),Xt=Be(Z,"DataView"),Ct=Be(Z,"Map"),$e=Be(Z,"Promise"),Zt=Be(Z,"Set"),Nn=Be(Z,"WeakMap"),_t=Be(Object,"create"),Tn=Se(Xt),Ot=Se(Ct),An=Se($e),Sn=Se(Zt),Cn=Se(Nn),pt=Kt?Kt.prototype:void 0,pr=pt?pt.valueOf:void 0;function st(o){var p=-1,E=o?o.length:0;for(this.clear();++p<E;){var R=o[p];this.set(R[0],R[1])}}function us(){this.__data__=_t?_t(null):{}}function hs(o){return this.has(o)&&delete this.__data__[o]}function ds(o){var p=this.__data__;if(_t){var E=p[o];return E===r?void 0:E}return Ke.call(p,o)?p[o]:void 0}function gr(o){var p=this.__data__;return _t?p[o]!==void 0:Ke.call(p,o)}function _n(o,p){var E=this.__data__;return E[o]=_t&&p===void 0?r:p,this}st.prototype.clear=us,st.prototype.delete=hs,st.prototype.get=ds,st.prototype.has=gr,st.prototype.set=_n;function be(o){var p=-1,E=o?o.length:0;for(this.clear();++p<E;){var R=o[p];this.set(R[0],R[1])}}function fs(){this.__data__=[]}function ps(o){var p=this.__data__,E=Qt(p,o);if(E<0)return!1;var R=p.length-1;return E==R?p.pop():cs.call(p,E,1),!0}function gs(o){var p=this.__data__,E=Qt(p,o);return E<0?void 0:p[E][1]}function ms(o){return Qt(this.__data__,o)>-1}function bs(o,p){var E=this.__data__,R=Qt(E,o);return R<0?E.push([o,p]):E[R][1]=p,this}be.prototype.clear=fs,be.prototype.delete=ps,be.prototype.get=gs,be.prototype.has=ms,be.prototype.set=bs;function we(o){var p=-1,E=o?o.length:0;for(this.clear();++p<E;){var R=o[p];this.set(R[0],R[1])}}function vs(){this.__data__={hash:new st,map:new(Ct||be),string:new st}}function ys(o){return Lt(this,o).delete(o)}function xs(o){return Lt(this,o).get(o)}function Es(o){return Lt(this,o).has(o)}function ws(o,p){return Lt(this,o).set(o,p),this}we.prototype.clear=vs,we.prototype.delete=ys,we.prototype.get=xs,we.prototype.has=Es,we.prototype.set=ws;function Re(o){this.__data__=new be(o)}function Ns(){this.__data__=new be}function Ts(o){return this.__data__.delete(o)}function As(o){return this.__data__.get(o)}function Ss(o){return this.__data__.has(o)}function Cs(o,p){var E=this.__data__;if(E instanceof be){var R=E.__data__;if(!Ct||R.length<t-1)return R.push([o,p]),this;E=this.__data__=new we(R)}return E.set(o,p),this}Re.prototype.clear=Ns,Re.prototype.delete=Ts,Re.prototype.get=As,Re.prototype.has=Ss,Re.prototype.set=Cs;function Jt(o,p){var E=kn(o)||tn(o)?ce(o.length,String):[],R=E.length,Q=!!R;for(var X in o)Ke.call(o,X)&&!(Q&&(X=="length"||Fs(X,R)))&&E.push(X);return E}function mr(o,p,E){var R=o[p];(!(Ke.call(o,p)&&Er(R,E))||E===void 0&&!(p in o))&&(o[p]=E)}function Qt(o,p){for(var E=o.length;E--;)if(Er(o[E][0],p))return E;return-1}function Ye(o,p){return o&&Ln(p,In(p),o)}function On(o,p,E,R,Q,X,ae){var se;if(R&&(se=X?R(o,Q,X,ae):R(o)),se!==void 0)return se;if(!Ze(o))return o;var ge=kn(o);if(ge){if(se=$s(o),!p)return Ms(o,se)}else{var oe=at(o),Ne=oe==f||oe==g;if(wr(o))return en(o,p);if(oe==y||oe==i||Ne&&!X){if(pe(o))return X?o:{};if(se=Xe(Ne?{}:o),!p)return Ds(o,Ye(se,o))}else{if(!C[oe])return X?o:{};se=Bs(o,oe,On,p)}}ae||(ae=new Re);var Le=ae.get(o);if(Le)return Le;if(ae.set(o,se),!ge)var me=E?Ps(o):In(o);return ne(me||o,function(Te,ve){me&&(ve=Te,Te=o[ve]),mr(se,ve,On(Te,p,E,R,ve,o,ae))}),se}function _s(o){return Ze(o)?hr(o):{}}function Os(o,p,E){var R=p(o);return kn(o)?R:re(R,E(o))}function Rs(o){return Wt.call(o)}function Ls(o){if(!Ze(o)||Hs(o))return!1;var p=jn(o)||pe(o)?ls:U;return p.test(Se(o))}function ks(o){if(!yr(o))return fr(o);var p=[];for(var E in Object(o))Ke.call(o,E)&&E!="constructor"&&p.push(E);return p}function en(o,p){if(p)return o.slice();var E=new o.constructor(o.length);return o.copy(E),E}function Rn(o){var p=new o.constructor(o.byteLength);return new En(p).set(new En(o)),p}function Rt(o,p){var E=p?Rn(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.byteLength)}function br(o,p,E){var R=p?E(Ee(o),!0):Ee(o);return ie(R,ue,new o.constructor)}function vr(o){var p=new o.constructor(o.source,P.exec(o));return p.lastIndex=o.lastIndex,p}function js(o,p,E){var R=p?E(lr(o),!0):lr(o);return ie(R,Y,new o.constructor)}function Is(o){return pr?Object(pr.call(o)):{}}function qs(o,p){var E=p?Rn(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.length)}function Ms(o,p){var E=-1,R=o.length;for(p||(p=Array(R));++E<R;)p[E]=o[E];return p}function Ln(o,p,E,R){E||(E={});for(var Q=-1,X=p.length;++Q<X;){var ae=p[Q],se=void 0;mr(E,ae,se===void 0?o[ae]:se)}return E}function Ds(o,p){return Ln(o,it(o),p)}function Ps(o){return Os(o,In,it)}function Lt(o,p){var E=o.__data__;return Us(p)?E[typeof p=="string"?"string":"hash"]:E.map}function Be(o,p){var E=he(o,p);return Ls(E)?E:void 0}var it=wn?yn(wn,Object):Gs,at=Rs;(Xt&&at(new Xt(new ArrayBuffer(1)))!=S||Ct&&at(new Ct)!=d||$e&&at($e.resolve())!=x||Zt&&at(new Zt)!=T||Nn&&at(new Nn)!=D)&&(at=function(o){var p=Wt.call(o),E=p==y?o.constructor:void 0,R=E?Se(E):void 0;if(R)switch(R){case Tn:return S;case Ot:return d;case An:return x;case Sn:return T;case Cn:return D}return p});function $s(o){var p=o.length,E=o.constructor(p);return p&&typeof o[0]=="string"&&Ke.call(o,"index")&&(E.index=o.index,E.input=o.input),E}function Xe(o){return typeof o.constructor=="function"&&!yr(o)?_s(je(o)):{}}function Bs(o,p,E,R){var Q=o.constructor;switch(p){case v:return Rn(o);case l:case c:return new Q(+o);case S:return Rt(o,R);case j:case B:case z:case ee:case b:case q:case N:case L:case M:return qs(o,R);case d:return br(o,R,E);case m:case A:return new Q(o);case w:return vr(o);case T:return js(o,R,E);case O:return Is(o)}}function Fs(o,p){return p=p??s,!!p&&(typeof o=="number"||K.test(o))&&o>-1&&o%1==0&&o<p}function Us(o){var p=typeof o;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?o!=="__proto__":o===null}function Hs(o){return!!cr&&cr in o}function yr(o){var p=o&&o.constructor,E=typeof p=="function"&&p.prototype||Vt;return o===E}function Se(o){if(o!=null){try{return ur.call(o)}catch{}try{return o+""}catch{}}return""}function xr(o){return On(o,!0,!0)}function Er(o,p){return o===p||o!==o&&p!==p}function tn(o){return zs(o)&&Ke.call(o,"callee")&&(!dr.call(o,"callee")||Wt.call(o)==i)}var kn=Array.isArray;function nn(o){return o!=null&&Nr(o.length)&&!jn(o)}function zs(o){return Tr(o)&&nn(o)}var wr=Yt||Vs;function jn(o){var p=Ze(o)?Wt.call(o):"";return p==f||p==g}function Nr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function Ze(o){var p=typeof o;return!!o&&(p=="object"||p=="function")}function Tr(o){return!!o&&typeof o=="object"}function In(o){return nn(o)?Jt(o):ks(o)}function Gs(){return[]}function Vs(){return!1}n.exports=xr}(zn,zn.exports)),zn.exports}var Gn={exports:{}};Gn.exports;var eo;function Pl(){return eo||(eo=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",f="[object Boolean]",g="[object Date]",d="[object Error]",m="[object Function]",y="[object GeneratorFunction]",x="[object Map]",w="[object Number]",T="[object Null]",A="[object Object]",O="[object Promise]",D="[object Proxy]",v="[object RegExp]",S="[object Set]",j="[object String]",B="[object Symbol]",z="[object Undefined]",ee="[object WeakMap]",b="[object ArrayBuffer]",q="[object DataView]",N="[object Float32Array]",L="[object Float64Array]",M="[object Int8Array]",I="[object Int16Array]",P="[object Int32Array]",U="[object Uint8Array]",K="[object Uint8ClampedArray]",C="[object Uint16Array]",$="[object Uint32Array]",F=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,H={};H[N]=H[L]=H[M]=H[I]=H[P]=H[U]=H[K]=H[C]=H[$]=!0,H[l]=H[c]=H[b]=H[f]=H[q]=H[g]=H[d]=H[m]=H[x]=H[w]=H[A]=H[v]=H[S]=H[j]=H[ee]=!1;var le=typeof vt=="object"&&vt&&vt.Object===Object&&vt,ue=typeof self=="object"&&self&&self.Object===Object&&self,Y=le||ue||Function("return this")(),ne=e&&!e.nodeType&&e,re=ne&&!0&&n&&!n.nodeType&&n,ie=re&&re.exports===ne,ce=ie&&le.process,he=function(){try{return ce&&ce.binding&&ce.binding("util")}catch{}}(),pe=he&&he.isTypedArray;function Ee(o,p){for(var E=-1,R=o==null?0:o.length,Q=0,X=[];++E<R;){var ae=o[E];p(ae,E,o)&&(X[Q++]=ae)}return X}function yn(o,p){for(var E=-1,R=p.length,Q=o.length;++E<R;)o[Q+E]=p[E];return o}function lr(o,p){for(var E=-1,R=o==null?0:o.length;++E<R;)if(p(o[E],E,o))return!0;return!1}function as(o,p){for(var E=-1,R=Array(o);++E<o;)R[E]=p(E);return R}function os(o){return function(p){return o(p)}}function Vt(o,p){return o.has(p)}function xn(o,p){return o?.[p]}function cr(o){var p=-1,E=Array(o.size);return o.forEach(function(R,Q){E[++p]=[Q,R]}),E}function ur(o,p){return function(E){return o(p(E))}}function Ke(o){var p=-1,E=Array(o.size);return o.forEach(function(R){E[++p]=R}),E}var Wt=Array.prototype,ls=Function.prototype,St=Object.prototype,Kt=Y["__core-js_shared__"],En=ls.toString,je=St.hasOwnProperty,hr=function(){var o=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),dr=St.toString,cs=RegExp("^"+En.call(je).replace(F,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wn=ie?Y.Buffer:void 0,Yt=Y.Symbol,fr=Y.Uint8Array,Xt=St.propertyIsEnumerable,Ct=Wt.splice,$e=Yt?Yt.toStringTag:void 0,Zt=Object.getOwnPropertySymbols,Nn=wn?wn.isBuffer:void 0,_t=ur(Object.keys,Object),Tn=it(Y,"DataView"),Ot=it(Y,"Map"),An=it(Y,"Promise"),Sn=it(Y,"Set"),Cn=it(Y,"WeakMap"),pt=it(Object,"create"),pr=Se(Tn),st=Se(Ot),us=Se(An),hs=Se(Sn),ds=Se(Cn),gr=Yt?Yt.prototype:void 0,_n=gr?gr.valueOf:void 0;function be(o){var p=-1,E=o==null?0:o.length;for(this.clear();++p<E;){var R=o[p];this.set(R[0],R[1])}}function fs(){this.__data__=pt?pt(null):{},this.size=0}function ps(o){var p=this.has(o)&&delete this.__data__[o];return this.size-=p?1:0,p}function gs(o){var p=this.__data__;if(pt){var E=p[o];return E===r?void 0:E}return je.call(p,o)?p[o]:void 0}function ms(o){var p=this.__data__;return pt?p[o]!==void 0:je.call(p,o)}function bs(o,p){var E=this.__data__;return this.size+=this.has(o)?0:1,E[o]=pt&&p===void 0?r:p,this}be.prototype.clear=fs,be.prototype.delete=ps,be.prototype.get=gs,be.prototype.has=ms,be.prototype.set=bs;function we(o){var p=-1,E=o==null?0:o.length;for(this.clear();++p<E;){var R=o[p];this.set(R[0],R[1])}}function vs(){this.__data__=[],this.size=0}function ys(o){var p=this.__data__,E=en(p,o);if(E<0)return!1;var R=p.length-1;return E==R?p.pop():Ct.call(p,E,1),--this.size,!0}function xs(o){var p=this.__data__,E=en(p,o);return E<0?void 0:p[E][1]}function Es(o){return en(this.__data__,o)>-1}function ws(o,p){var E=this.__data__,R=en(E,o);return R<0?(++this.size,E.push([o,p])):E[R][1]=p,this}we.prototype.clear=vs,we.prototype.delete=ys,we.prototype.get=xs,we.prototype.has=Es,we.prototype.set=ws;function Re(o){var p=-1,E=o==null?0:o.length;for(this.clear();++p<E;){var R=o[p];this.set(R[0],R[1])}}function Ns(){this.size=0,this.__data__={hash:new be,map:new(Ot||we),string:new be}}function Ts(o){var p=Be(this,o).delete(o);return this.size-=p?1:0,p}function As(o){return Be(this,o).get(o)}function Ss(o){return Be(this,o).has(o)}function Cs(o,p){var E=Be(this,o),R=E.size;return E.set(o,p),this.size+=E.size==R?0:1,this}Re.prototype.clear=Ns,Re.prototype.delete=Ts,Re.prototype.get=As,Re.prototype.has=Ss,Re.prototype.set=Cs;function Jt(o){var p=-1,E=o==null?0:o.length;for(this.__data__=new Re;++p<E;)this.add(o[p])}function mr(o){return this.__data__.set(o,r),this}function Qt(o){return this.__data__.has(o)}Jt.prototype.add=Jt.prototype.push=mr,Jt.prototype.has=Qt;function Ye(o){var p=this.__data__=new we(o);this.size=p.size}function On(){this.__data__=new we,this.size=0}function _s(o){var p=this.__data__,E=p.delete(o);return this.size=p.size,E}function Os(o){return this.__data__.get(o)}function Rs(o){return this.__data__.has(o)}function Ls(o,p){var E=this.__data__;if(E instanceof we){var R=E.__data__;if(!Ot||R.length<t-1)return R.push([o,p]),this.size=++E.size,this;E=this.__data__=new Re(R)}return E.set(o,p),this.size=E.size,this}Ye.prototype.clear=On,Ye.prototype.delete=_s,Ye.prototype.get=Os,Ye.prototype.has=Rs,Ye.prototype.set=Ls;function ks(o,p){var E=tn(o),R=!E&&Er(o),Q=!E&&!R&&nn(o),X=!E&&!R&&!Q&&Tr(o),ae=E||R||Q||X,se=ae?as(o.length,String):[],ge=se.length;for(var oe in o)je.call(o,oe)&&!(ae&&(oe=="length"||Q&&(oe=="offset"||oe=="parent")||X&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||Bs(oe,ge)))&&se.push(oe);return se}function en(o,p){for(var E=o.length;E--;)if(xr(o[E][0],p))return E;return-1}function Rn(o,p,E){var R=p(o);return tn(o)?R:yn(R,E(o))}function Rt(o){return o==null?o===void 0?z:T:$e&&$e in Object(o)?at(o):yr(o)}function br(o){return Ze(o)&&Rt(o)==l}function vr(o,p,E,R,Q){return o===p?!0:o==null||p==null||!Ze(o)&&!Ze(p)?o!==o&&p!==p:js(o,p,E,R,vr,Q)}function js(o,p,E,R,Q,X){var ae=tn(o),se=tn(p),ge=ae?c:Xe(o),oe=se?c:Xe(p);ge=ge==l?A:ge,oe=oe==l?A:oe;var Ne=ge==A,Le=oe==A,me=ge==oe;if(me&&nn(o)){if(!nn(p))return!1;ae=!0,Ne=!1}if(me&&!Ne)return X||(X=new Ye),ae||Tr(o)?Ln(o,p,E,R,Q,X):Ds(o,p,ge,E,R,Q,X);if(!(E&s)){var Te=Ne&&je.call(o,"__wrapped__"),ve=Le&&je.call(p,"__wrapped__");if(Te||ve){var gt=Te?o.value():o,ot=ve?p.value():p;return X||(X=new Ye),Q(gt,ot,E,R,X)}}return me?(X||(X=new Ye),Ps(o,p,E,R,Q,X)):!1}function Is(o){if(!Nr(o)||Us(o))return!1;var p=wr(o)?cs:Z;return p.test(Se(o))}function qs(o){return Ze(o)&&jn(o.length)&&!!H[Rt(o)]}function Ms(o){if(!Hs(o))return _t(o);var p=[];for(var E in Object(o))je.call(o,E)&&E!="constructor"&&p.push(E);return p}function Ln(o,p,E,R,Q,X){var ae=E&s,se=o.length,ge=p.length;if(se!=ge&&!(ae&&ge>se))return!1;var oe=X.get(o);if(oe&&X.get(p))return oe==p;var Ne=-1,Le=!0,me=E&i?new Jt:void 0;for(X.set(o,p),X.set(p,o);++Ne<se;){var Te=o[Ne],ve=p[Ne];if(R)var gt=ae?R(ve,Te,Ne,p,o,X):R(Te,ve,Ne,o,p,X);if(gt!==void 0){if(gt)continue;Le=!1;break}if(me){if(!lr(p,function(ot,kt){if(!Vt(me,kt)&&(Te===ot||Q(Te,ot,E,R,X)))return me.push(kt)})){Le=!1;break}}else if(!(Te===ve||Q(Te,ve,E,R,X))){Le=!1;break}}return X.delete(o),X.delete(p),Le}function Ds(o,p,E,R,Q,X,ae){switch(E){case q:if(o.byteLength!=p.byteLength||o.byteOffset!=p.byteOffset)return!1;o=o.buffer,p=p.buffer;case b:return!(o.byteLength!=p.byteLength||!X(new fr(o),new fr(p)));case f:case g:case w:return xr(+o,+p);case d:return o.name==p.name&&o.message==p.message;case v:case j:return o==p+"";case x:var se=cr;case S:var ge=R&s;if(se||(se=Ke),o.size!=p.size&&!ge)return!1;var oe=ae.get(o);if(oe)return oe==p;R|=i,ae.set(o,p);var Ne=Ln(se(o),se(p),R,Q,X,ae);return ae.delete(o),Ne;case B:if(_n)return _n.call(o)==_n.call(p)}return!1}function Ps(o,p,E,R,Q,X){var ae=E&s,se=Lt(o),ge=se.length,oe=Lt(p),Ne=oe.length;if(ge!=Ne&&!ae)return!1;for(var Le=ge;Le--;){var me=se[Le];if(!(ae?me in p:je.call(p,me)))return!1}var Te=X.get(o);if(Te&&X.get(p))return Te==p;var ve=!0;X.set(o,p),X.set(p,o);for(var gt=ae;++Le<ge;){me=se[Le];var ot=o[me],kt=p[me];if(R)var Ji=ae?R(kt,ot,me,p,o,X):R(ot,kt,me,o,p,X);if(!(Ji===void 0?ot===kt||Q(ot,kt,E,R,X):Ji)){ve=!1;break}gt||(gt=me=="constructor")}if(ve&&!gt){var Ar=o.constructor,Sr=p.constructor;Ar!=Sr&&"constructor"in o&&"constructor"in p&&!(typeof Ar=="function"&&Ar instanceof Ar&&typeof Sr=="function"&&Sr instanceof Sr)&&(ve=!1)}return X.delete(o),X.delete(p),ve}function Lt(o){return Rn(o,In,$s)}function Be(o,p){var E=o.__data__;return Fs(p)?E[typeof p=="string"?"string":"hash"]:E.map}function it(o,p){var E=xn(o,p);return Is(E)?E:void 0}function at(o){var p=je.call(o,$e),E=o[$e];try{o[$e]=void 0;var R=!0}catch{}var Q=dr.call(o);return R&&(p?o[$e]=E:delete o[$e]),Q}var $s=Zt?function(o){return o==null?[]:(o=Object(o),Ee(Zt(o),function(p){return Xt.call(o,p)}))}:Gs,Xe=Rt;(Tn&&Xe(new Tn(new ArrayBuffer(1)))!=q||Ot&&Xe(new Ot)!=x||An&&Xe(An.resolve())!=O||Sn&&Xe(new Sn)!=S||Cn&&Xe(new Cn)!=ee)&&(Xe=function(o){var p=Rt(o),E=p==A?o.constructor:void 0,R=E?Se(E):"";if(R)switch(R){case pr:return q;case st:return x;case us:return O;case hs:return S;case ds:return ee}return p});function Bs(o,p){return p=p??a,!!p&&(typeof o=="number"||J.test(o))&&o>-1&&o%1==0&&o<p}function Fs(o){var p=typeof o;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?o!=="__proto__":o===null}function Us(o){return!!hr&&hr in o}function Hs(o){var p=o&&o.constructor,E=typeof p=="function"&&p.prototype||St;return o===E}function yr(o){return dr.call(o)}function Se(o){if(o!=null){try{return En.call(o)}catch{}try{return o+""}catch{}}return""}function xr(o,p){return o===p||o!==o&&p!==p}var Er=br(function(){return arguments}())?br:function(o){return Ze(o)&&je.call(o,"callee")&&!Xt.call(o,"callee")},tn=Array.isArray;function kn(o){return o!=null&&jn(o.length)&&!wr(o)}var nn=Nn||Vs;function zs(o,p){return vr(o,p)}function wr(o){if(!Nr(o))return!1;var p=Rt(o);return p==m||p==y||p==u||p==D}function jn(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=a}function Nr(o){var p=typeof o;return o!=null&&(p=="object"||p=="function")}function Ze(o){return o!=null&&typeof o=="object"}var Tr=pe?os(pe):qs;function In(o){return kn(o)?ks(o):Ms(o)}function Gs(){return[]}function Vs(){return!1}n.exports=zs}(Gn,Gn.exports)),Gn.exports}var jr={},to;function hg(){if(to)return jr;to=1,Object.defineProperty(jr,"__esModule",{value:!0});const n=Dl(),e=Pl();var t;return function(r){function s(c={},u={},f=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let g=n(u);f||(g=Object.keys(g).reduce((d,m)=>(g[m]!=null&&(d[m]=g[m]),d),{}));for(const d in c)c[d]!==void 0&&u[d]===void 0&&(g[d]=c[d]);return Object.keys(g).length>0?g:void 0}r.compose=s;function i(c={},u={}){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});const f=Object.keys(c).concat(Object.keys(u)).reduce((g,d)=>(e(c[d],u[d])||(g[d]=u[d]===void 0?null:u[d]),g),{});return Object.keys(f).length>0?f:void 0}r.diff=i;function a(c={},u={}){c=c||{};const f=Object.keys(u).reduce((g,d)=>(u[d]!==c[d]&&c[d]!==void 0&&(g[d]=u[d]),g),{});return Object.keys(c).reduce((g,d)=>(c[d]!==u[d]&&u[d]===void 0&&(g[d]=null),g),f)}r.invert=a;function l(c,u,f=!1){if(typeof c!="object")return u;if(typeof u!="object")return;if(!f)return u;const g=Object.keys(u).reduce((d,m)=>(c[m]===void 0&&(d[m]=u[m]),d),{});return Object.keys(g).length>0?g:void 0}r.transform=l}(t||(t={})),jr.default=t,jr}var Ir={},no;function $l(){if(no)return Ir;no=1,Object.defineProperty(Ir,"__esModule",{value:!0});var n;return function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t}(n||(n={})),Ir.default=n,Ir}var qr={},ro;function dg(){if(ro)return qr;ro=1,Object.defineProperty(qr,"__esModule",{value:!0});const n=$l();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,a=n.default.length(s);if(r>=a-i?(r=a-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const l={};return s.attributes&&(l.attributes=s.attributes),typeof s.retain=="number"?l.retain=r:typeof s.retain=="object"&&s.retain!==null?l.retain=s.retain:typeof s.insert=="string"?l.insert=s.insert.substr(i,r):l.insert=s.insert,l}}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 r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(a)}}else return[]}}return qr.default=e,qr}var so;function fg(){return so||(so=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=ug(),r=Dl(),s=Pl(),i=hg();e.AttributeMap=i.default;const a=$l();e.Op=a.default;const l=dg();e.OpIterator=l.default;const c="\0",u=(g,d)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof d!="object"||d===null)throw new Error(`cannot retain a ${typeof d}`);const m=Object.keys(g)[0];if(!m||m!==Object.keys(d)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(d)[0]}`);return[m,g[m],d[m]]};class f{constructor(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]}static registerEmbed(d,m){this.handlers[d]=m}static unregisterEmbed(d){delete this.handlers[d]}static getHandler(d){const m=this.handlers[d];if(!m)throw new Error(`no handlers for embed type "${d}"`);return m}insert(d,m){const y={};return typeof d=="string"&&d.length===0?this:(y.insert=d,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y))}delete(d){return d<=0?this:this.push({delete:d})}retain(d,m){if(typeof d=="number"&&d<=0)return this;const y={retain:d};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(y.attributes=m),this.push(y)}push(d){let m=this.ops.length,y=this.ops[m-1];if(d=r(d),typeof y=="object"){if(typeof d.delete=="number"&&typeof y.delete=="number")return this.ops[m-1]={delete:y.delete+d.delete},this;if(typeof y.delete=="number"&&d.insert!=null&&(m-=1,y=this.ops[m-1],typeof y!="object"))return this.ops.unshift(d),this;if(s(d.attributes,y.attributes)){if(typeof d.insert=="string"&&typeof y.insert=="string")return this.ops[m-1]={insert:y.insert+d.insert},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof y.retain=="number")return this.ops[m-1]={retain:y.retain+d.retain},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this}}return m===this.ops.length?this.ops.push(d):this.ops.splice(m,0,d),this}chop(){const d=this.ops[this.ops.length-1];return d&&typeof d.retain=="number"&&!d.attributes&&this.ops.pop(),this}filter(d){return this.ops.filter(d)}forEach(d){this.ops.forEach(d)}map(d){return this.ops.map(d)}partition(d){const m=[],y=[];return this.forEach(x=>{(d(x)?m:y).push(x)}),[m,y]}reduce(d,m){return this.ops.reduce(d,m)}changeLength(){return this.reduce((d,m)=>m.insert?d+a.default.length(m):m.delete?d-m.delete:d,0)}length(){return this.reduce((d,m)=>d+a.default.length(m),0)}slice(d=0,m=1/0){const y=[],x=new l.default(this.ops);let w=0;for(;w<m&&x.hasNext();){let T;w<d?T=x.next(d-w):(T=x.next(m-w),y.push(T)),w+=a.default.length(T)}return new f(y)}compose(d){const m=new l.default(this.ops),y=new l.default(d.ops),x=[],w=y.peek();if(w!=null&&typeof w.retain=="number"&&w.attributes==null){let A=w.retain;for(;m.peekType()==="insert"&&m.peekLength()<=A;)A-=m.peekLength(),x.push(m.next());w.retain-A>0&&y.next(w.retain-A)}const T=new f(x);for(;m.hasNext()||y.hasNext();)if(y.peekType()==="insert")T.push(y.next());else if(m.peekType()==="delete")T.push(m.next());else{const A=Math.min(m.peekLength(),y.peekLength()),O=m.next(A),D=y.next(A);if(D.retain){const v={};if(typeof O.retain=="number")v.retain=typeof D.retain=="number"?A:D.retain;else if(typeof D.retain=="number")O.retain==null?v.insert=O.insert:v.retain=O.retain;else{const j=O.retain==null?"insert":"retain",[B,z,ee]=u(O[j],D.retain),b=f.getHandler(B);v[j]={[B]:b.compose(z,ee,j==="retain")}}const S=i.default.compose(O.attributes,D.attributes,typeof O.retain=="number");if(S&&(v.attributes=S),T.push(v),!y.hasNext()&&s(T.ops[T.ops.length-1],v)){const j=new f(m.rest());return T.concat(j).chop()}}else typeof D.delete=="number"&&(typeof O.retain=="number"||typeof O.retain=="object"&&O.retain!==null)&&T.push(D)}return T.chop()}concat(d){const m=new f(this.ops.slice());return d.ops.length>0&&(m.push(d.ops[0]),m.ops=m.ops.concat(d.ops.slice(1))),m}diff(d,m){if(this.ops===d.ops)return new f;const y=[this,d].map(O=>O.map(D=>{if(D.insert!=null)return typeof D.insert=="string"?D.insert:c;const v=O===d?"on":"with";throw new Error("diff() called "+v+" non-document")}).join("")),x=new f,w=t(y[0],y[1],m,!0),T=new l.default(this.ops),A=new l.default(d.ops);return w.forEach(O=>{let D=O[1].length;for(;D>0;){let v=0;switch(O[0]){case t.INSERT:v=Math.min(A.peekLength(),D),x.push(A.next(v));break;case t.DELETE:v=Math.min(D,T.peekLength()),T.next(v),x.delete(v);break;case t.EQUAL:v=Math.min(T.peekLength(),A.peekLength(),D);const S=T.next(v),j=A.next(v);s(S.insert,j.insert)?x.retain(v,i.default.diff(S.attributes,j.attributes)):x.push(j).delete(v);break}D-=v}}),x.chop()}eachLine(d,m=`
24
+ `){const y=new l.default(this.ops);let x=new f,w=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const T=y.peek(),A=a.default.length(T)-y.peekLength(),O=typeof T.insert=="string"?T.insert.indexOf(m,A)-A:-1;if(O<0)x.push(y.next());else if(O>0)x.push(y.next(O));else{if(d(x,y.next(1).attributes||{},w)===!1)return;w+=1,x=new f}}x.length()>0&&d(x,{},w)}invert(d){const m=new f;return this.reduce((y,x)=>{if(x.insert)m.delete(a.default.length(x));else{if(typeof x.retain=="number"&&x.attributes==null)return m.retain(x.retain),y+x.retain;if(x.delete||typeof x.retain=="number"){const w=x.delete||x.retain;return d.slice(y,y+w).forEach(A=>{x.delete?m.push(A):x.retain&&x.attributes&&m.retain(a.default.length(A),i.default.invert(x.attributes,A.attributes))}),y+w}else if(typeof x.retain=="object"&&x.retain!==null){const w=d.slice(y,y+1),T=new l.default(w.ops).next(),[A,O,D]=u(x.retain,T.insert),v=f.getHandler(A);return m.retain({[A]:v.invert(O,D)},i.default.invert(x.attributes,T.attributes)),y+1}}return y},0),m.chop()}transform(d,m=!1){if(m=!!m,typeof d=="number")return this.transformPosition(d,m);const y=d,x=new l.default(this.ops),w=new l.default(y.ops),T=new f;for(;x.hasNext()||w.hasNext();)if(x.peekType()==="insert"&&(m||w.peekType()!=="insert"))T.retain(a.default.length(x.next()));else if(w.peekType()==="insert")T.push(w.next());else{const A=Math.min(x.peekLength(),w.peekLength()),O=x.next(A),D=w.next(A);if(O.delete)continue;if(D.delete)T.push(D);else{const v=O.retain,S=D.retain;let j=typeof S=="object"&&S!==null?S:A;if(typeof v=="object"&&v!==null&&typeof S=="object"&&S!==null){const B=Object.keys(v)[0];if(B===Object.keys(S)[0]){const z=f.getHandler(B);z&&(j={[B]:z.transform(v[B],S[B],m)})}}T.retain(j,i.default.transform(O.attributes,D.attributes,m))}}return T.chop()}transformPosition(d,m=!1){m=!!m;const y=new l.default(this.ops);let x=0;for(;y.hasNext()&&x<=d;){const w=y.peekLength(),T=y.peekType();if(y.next(),T==="delete"){d-=Math.min(w,d-x);continue}else T==="insert"&&(x<d||!m)&&(d+=w);x+=w}return d}}f.Op=a.default,f.OpIterator=l.default,f.AttributeMap=i.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(kr,kr.exports)),kr.exports}var Pe=fg();const V=Ri(Pe);class We extends ke{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}We.blotName="break";We.tagName="BR";let Ge=class extends Wr{};const pg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ns(n){return n.replace(/[&<>"']/g,e=>pg[e])}class Ce extends $i{static allowedChildren=[Ce,We,ke,Ge];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=Ce.order.indexOf(e),s=Ce.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(Ce.compare(this.statics.blotName,r)<0&&this.scroll.query(r,W.BLOT)){const i=this.isolate(e,t);s&&i.wrap(r,s)}else super.formatAt(e,t,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof Ce&&Ce.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}}const io=1;class xe extends er{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Bl(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,W.BLOCK)?e+t===this.length()&&this.format(r,s):super.formatAt(e,Math.min(t,this.length()-e-1),r,s),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const s=t.split(`
25
+ `),i=s.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 a=this;s.reduce((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof We&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+io),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()-io)){const s=this.clone();return e===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(e,t);return this.cache={},r}}xe.blotName="block";xe.tagName="P";xe.defaultChild=We;xe.allowedChildren=[We,Ce,ke,Ge];class De extends ke{attach(){super.attach(),this.attributes=new es(this.domNode)}delta(){return new V().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,W.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,s){this.format(r,s)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const s=t.split(`
26
26
  `),i=s.pop(),a=s.map(c=>{const u=this.scroll.create(xe.blotName);return u.insertAt(0,c),u}),l=this.split(e);a.forEach(c=>{this.parent.insertBefore(c,l)}),i&&this.parent.insertBefore(this.scroll.create("text",i),l)}}De.scope=W.BLOCK_BLOT;function Bl(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(Ae).reduce((t,r)=>r.length()===0?t:t.insert(r.value(),qe(r,{},e)),new V).insert(`
27
- `,qe(n))}function qe(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:qe(n.parent,e,t)}class ze extends ke{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(ze.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 r=this,s=0;for(;r!=null&&r.statics.scope!==W.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=ze.CONTENTS.length,r.optimize(),r.formatAt(s,ze.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 Ve?this.prev:null,r=t?t.length():0,s=this.next instanceof Ve?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(ze.CONTENTS).join("");a.data=ze.CONTENTS;let c;if(t)c=t,(l||s)&&(t.insertAt(t.length(),l+i),s&&s.remove());else if(s)c=s,s.insertAt(0,l);else{const u=document.createTextNode(l);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(h,m)=>t&&h===t.domNode?m:h===a?r+m-1:s&&h===s.domNode?r+l.length+m:null,p=u(e.start.node,e.start.offset),g=u(e.end.node,e.end.offset);if(p!==null&&g!==null)return{startNode:c.domNode,startOffset:p,endNode:c.domNode,endOffset:g}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=ze.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var ti={exports:{}},io;function gg(){return io||(io=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(c,u,p){this.fn=c,this.context=u,this.once=p||!1}function i(c,u,p,g,h){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new s(p,g||c,h),E=t?t+u:u;return c._events[E]?c._events[E].fn?c._events[E]=[c._events[E],m]:c._events[E].push(m):(c._events[E]=m,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],p,g;if(this._eventsCount===0)return u;for(g in p=this._events)e.call(p,g)&&u.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(p)):u},l.prototype.listeners=function(u){var p=t?t+u:u,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var h=0,m=g.length,E=new Array(m);h<m;h++)E[h]=g[h].fn;return E},l.prototype.listenerCount=function(u){var p=t?t+u:u,g=this._events[p];return g?g.fn?1:g.length:0},l.prototype.emit=function(u,p,g,h,m,E){var y=t?t+u:u;if(!this._events[y])return!1;var N=this._events[y],T=arguments.length,A,k;if(N.fn){switch(N.once&&this.removeListener(u,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,p),!0;case 3:return N.fn.call(N.context,p,g),!0;case 4:return N.fn.call(N.context,p,g,h),!0;case 5:return N.fn.call(N.context,p,g,h,m),!0;case 6:return N.fn.call(N.context,p,g,h,m,E),!0}for(k=1,A=new Array(T-1);k<T;k++)A[k-1]=arguments[k];N.fn.apply(N.context,A)}else{var D=N.length,v;for(k=0;k<D;k++)switch(N[k].once&&this.removeListener(u,N[k].fn,void 0,!0),T){case 1:N[k].fn.call(N[k].context);break;case 2:N[k].fn.call(N[k].context,p);break;case 3:N[k].fn.call(N[k].context,p,g);break;case 4:N[k].fn.call(N[k].context,p,g,h);break;default:if(!A)for(v=1,A=new Array(T-1);v<T;v++)A[v-1]=arguments[v];N[k].fn.apply(N[k].context,A)}}return!0},l.prototype.on=function(u,p,g){return i(this,u,p,g,!1)},l.prototype.once=function(u,p,g){return i(this,u,p,g,!0)},l.prototype.removeListener=function(u,p,g,h){var m=t?t+u:u;if(!this._events[m])return this;if(!p)return a(this,m),this;var E=this._events[m];if(E.fn)E.fn===p&&(!h||E.once)&&(!g||E.context===g)&&a(this,m);else{for(var y=0,N=[],T=E.length;y<T;y++)(E[y].fn!==p||h&&!E[y].once||g&&E[y].context!==g)&&N.push(E[y]);N.length?this._events[m]=N.length===1?N[0]:N:a(this,m)}return this},l.prototype.removeAllListeners=function(u){var p;return u?(p=t?t+u:u,this._events[p]&&a(this,p)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l}(ti)),ti.exports}var mg=gg();const bg=Oi(mg),Ai=new WeakMap,Si=["error","warn","log","info"];let Ci="warn";function Fl(n){if(Ci&&Si.indexOf(n)<=Si.indexOf(Ci)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function ft(n){return Si.reduce((e,t)=>(e[t]=Fl.bind(console,t,n),e),{})}ft.level=n=>{Ci=n};Fl.level=ft.level;const ni=ft("quill:events"),vg=["selectionchange","mousedown","mouseup","click"];vg.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=Ai.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)})})});class G extends bg{static 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"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",ni.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ni.log.call(ni,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(i=>{let{node:a,handler:l}=i;(e.target===a||a.contains(e.target))&&l(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const ri=ft("quill:selection");class Dt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class yg{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 Dt(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,G.sources.USER),1)}),this.emitter.on(G.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(G.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=i.some(l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root);this.update(a?G.sources.SILENT:s)}catch{}})}),this.emitter.on(G.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:l,endOffset:c}=s.range;this.setNativeRange(i,a,l,c),this.update(G.sources.SILENT)}}),this.update(G.sources.SILENT)}handleComposition(){this.emitter.on(G.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(G.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(G.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,W.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Ae){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.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 r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){const[p]=this.scroll.leaf(e+1);if(p){const[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===h&&(i=p,a=0)}}[s,a]=i.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),l.setEnd(s,a),l.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(l.setStart(s,a),l.setEnd(s,a+1)):(l.setStart(s,a-1),l.setEnd(s,a),c="right"),u=l.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect(),a>0&&(c="right")}return{bottom:u.top+u.height,height:u.height,left:u[c],right:u[c],top:u.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 r=this.normalizeNative(t);return ri.info("getNativeRange",r),r}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&&si(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 r=t.map(a=>{const[l,c]=a,u=this.scroll.find(l,!0),p=u.offset(this.scroll);return c===0?p:u instanceof Ae?p+u.index(l,c):p+u.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new Dt(i,s-i)}normalizeNative(e){if(!si(this.root,e.startContainer)||!e.collapsed&&!si(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(r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i}),t}rangeToNative(e){const t=this.scroll.length(),r=(s,i)=>{s=Math.min(t-1,s);const[a,l]=this.scroll.leaf(s);return a?a.position(l,i):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ri.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:l}=this.getNativeRange()||{};if(l==null||i||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||s!==l.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,s),a.removeAllRanges(),a.addRange(c)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;if(typeof t=="string"&&(r=t,t=!1),ri.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!bt(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const i=[G.events.SELECTION_CHANGE,hn(this.lastRange),hn(t),e];this.emitter.emit(G.events.EDITOR_CHANGE,...i),e!==G.sources.SILENT&&this.emitter.emit(...i)}}}function si(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const xg=/^[ -~]*$/;class Eg{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=ao(e),s=new V;return wg(r.ops.slice()).reduce((a,l)=>{const c=$e.Op.length(l);let u=l.attributes||{},p=!1,g=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const E=l.insert;g=!E.endsWith(`
28
- `)&&(t<=a||!!this.scroll.descendant(De,a)[0]),this.scroll.insertAt(a,E);const[y,N]=this.scroll.line(a);let T=xt({},qe(y));if(y instanceof xe){const[A]=y.descendant(Ae,N);A&&(T=xt(T,qe(A)))}u=$e.AttributeMap.diff(T,u)||{}}else if(typeof l.insert=="object"){const E=Object.keys(l.insert)[0];if(E==null)return a;const y=this.scroll.query(E,W.INLINE)!=null;if(y)(t<=a||this.scroll.descendant(De,a)[0])&&(g=!0);else if(a>0){const[N,T]=this.scroll.descendant(Ae,a-1);N instanceof Ve?N.value()[T]!==`
29
- `&&(p=!0):N instanceof ke&&N.statics.scope===W.INLINE_BLOT&&(p=!0)}if(this.scroll.insertAt(a,E,l.insert[E]),y){const[N]=this.scroll.descendant(Ae,a);if(N){const T=xt({},qe(N));u=$e.AttributeMap.diff(T,u)||{}}}}t+=c}else if(s.push(l),l.retain!==null&&typeof l.retain=="object"){const E=Object.keys(l.retain)[0];if(E==null)return a;this.scroll.updateEmbedAt(a,E,l.retain[E])}Object.keys(u).forEach(E=>{this.scroll.formatAt(a,c,E,u[E])});const h=p?1:0,m=g?1:0;return t+=h+m,s.retain(h),s.delete(m),a+c+h+m},0),s.reduce((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+$e.Op.length(l),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new V().retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(i=>{this.scroll.lines(e,Math.max(t,1)).forEach(a=>{a.format(i,r[i])})}),this.scroll.optimize();const s=new V().retain(e).retain(t,hn(r));return this.update(s)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(i=>{this.scroll.formatAt(e,t,i,r[i])});const s=new V().retain(e).retain(t,hn(r));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new V)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];t===0?this.scroll.path(e).forEach(l=>{const[c]=l;c instanceof xe?r.push(c):c instanceof Ae&&s.push(c)}):(r=this.scroll.lines(e,t),s=this.scroll.descendants(Ae,e,t));const[i,a]=[r,s].map(l=>{const c=l.shift();if(c==null)return{};let u=qe(c);for(;Object.keys(u).length>0;){const p=l.shift();if(p==null)return u;u=Ng(qe(p),u)}return u});return{...i,...a}}getHTML(e,t){const[r,s]=this.scroll.line(e);if(r){const i=r.length();return r.length()>=s+t&&!(s===0&&t===i)?er(r,s,t,!0):er(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,t){const r=ao(t),s=new V().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update(new V().retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
27
+ `,qe(n))}function qe(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:qe(n.parent,e,t)}class He extends ke{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\uFEFF";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(He.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 r=this,s=0;for(;r!=null&&r.statics.scope!==W.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=He.CONTENTS.length,r.optimize(),r.formatAt(s,He.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 Ge?this.prev:null,r=t?t.length():0,s=this.next instanceof Ge?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(He.CONTENTS).join("");a.data=He.CONTENTS;let c;if(t)c=t,(l||s)&&(t.insertAt(t.length(),l+i),s&&s.remove());else if(s)c=s,s.insertAt(0,l);else{const u=document.createTextNode(l);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(d,m)=>t&&d===t.domNode?m:d===a?r+m-1:s&&d===s.domNode?r+l.length+m:null,f=u(e.start.node,e.start.offset),g=u(e.end.node,e.end.offset);if(f!==null&&g!==null)return{startNode:c.domNode,startOffset:f,endNode:c.domNode,endOffset:g}}return null}update(e,t){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=He.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var ni={exports:{}},ao;function gg(){return ao||(ao=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,g,d){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new s(f,g||c,d),y=t?t+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],m]:c._events[y].push(m):(c._events[y]=m,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,g;if(this._eventsCount===0)return u;for(g in f=this._events)e.call(f,g)&&u.push(t?g.slice(1):g);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var d=0,m=g.length,y=new Array(m);d<m;d++)y[d]=g[d].fn;return y},l.prototype.listenerCount=function(u){var f=t?t+u:u,g=this._events[f];return g?g.fn?1:g.length:0},l.prototype.emit=function(u,f,g,d,m,y){var x=t?t+u:u;if(!this._events[x])return!1;var w=this._events[x],T=arguments.length,A,O;if(w.fn){switch(w.once&&this.removeListener(u,w.fn,void 0,!0),T){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,f),!0;case 3:return w.fn.call(w.context,f,g),!0;case 4:return w.fn.call(w.context,f,g,d),!0;case 5:return w.fn.call(w.context,f,g,d,m),!0;case 6:return w.fn.call(w.context,f,g,d,m,y),!0}for(O=1,A=new Array(T-1);O<T;O++)A[O-1]=arguments[O];w.fn.apply(w.context,A)}else{var D=w.length,v;for(O=0;O<D;O++)switch(w[O].once&&this.removeListener(u,w[O].fn,void 0,!0),T){case 1:w[O].fn.call(w[O].context);break;case 2:w[O].fn.call(w[O].context,f);break;case 3:w[O].fn.call(w[O].context,f,g);break;case 4:w[O].fn.call(w[O].context,f,g,d);break;default:if(!A)for(v=1,A=new Array(T-1);v<T;v++)A[v-1]=arguments[v];w[O].fn.apply(w[O].context,A)}}return!0},l.prototype.on=function(u,f,g){return i(this,u,f,g,!1)},l.prototype.once=function(u,f,g){return i(this,u,f,g,!0)},l.prototype.removeListener=function(u,f,g,d){var m=t?t+u:u;if(!this._events[m])return this;if(!f)return a(this,m),this;var y=this._events[m];if(y.fn)y.fn===f&&(!d||y.once)&&(!g||y.context===g)&&a(this,m);else{for(var x=0,w=[],T=y.length;x<T;x++)(y[x].fn!==f||d&&!y[x].once||g&&y[x].context!==g)&&w.push(y[x]);w.length?this._events[m]=w.length===1?w[0]:w:a(this,m)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&a(this,f)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l}(ni)),ni.exports}var mg=gg();const bg=Ri(mg),Si=new WeakMap,Ci=["error","warn","log","info"];let _i="warn";function Fl(n){if(_i&&Ci.indexOf(n)<=Ci.indexOf(_i)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function ft(n){return Ci.reduce((e,t)=>(e[t]=Fl.bind(console,t,n),e),{})}ft.level=n=>{_i=n};Fl.level=ft.level;const ri=ft("quill:events"),vg=["selectionchange","mousedown","mouseup","click"];vg.forEach(n=>{document.addEventListener(n,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const i=Si.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)})})});class G extends bg{static 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"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",ri.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ri.log.call(ri,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(i=>{let{node:a,handler:l}=i;(e.target===a||a.contains(e.target))&&l(e,...r)})}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const si=ft("quill:selection");class Dt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class yg{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 Dt(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,G.sources.USER),1)}),this.emitter.on(G.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(G.events.SCROLL_UPDATE,(s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=i.some(l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root);this.update(a?G.sources.SILENT:s)}catch{}})}),this.emitter.on(G.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:l,endOffset:c}=s.range;this.setNativeRange(i,a,l,c),this.update(G.sources.SILENT)}}),this.update(G.sources.SILENT)}handleComposition(){this.emitter.on(G.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(G.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(G.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,W.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Ae){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.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 r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){const[f]=this.scroll.leaf(e+1);if(f){const[g]=this.scroll.line(e),[d]=this.scroll.line(e+1);g===d&&(i=f,a=0)}}[s,a]=i.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),l.setEnd(s,a),l.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(l.setStart(s,a),l.setEnd(s,a+1)):(l.setStart(s,a-1),l.setEnd(s,a),c="right"),u=l.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect(),a>0&&(c="right")}return{bottom:u.top+u.height,height:u.height,left:u[c],right:u[c],top:u.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 r=this.normalizeNative(t);return si.info("getNativeRange",r),r}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&&ii(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 r=t.map(a=>{const[l,c]=a,u=this.scroll.find(l,!0),f=u.offset(this.scroll);return c===0?f:u instanceof Ae?f+u.index(l,c):f+u.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new Dt(i,s-i)}normalizeNative(e){if(!ii(this.root,e.startContainer)||!e.collapsed&&!ii(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(r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i}),t}rangeToNative(e){const t=this.scroll.length(),r=(s,i)=>{s=Math.min(t-1,s);const[a,l]=this.scroll.leaf(s);return a?a.position(l,i):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(si.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:l}=this.getNativeRange()||{};if(l==null||i||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||s!==l.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,s),a.removeAllRanges(),a.addRange(c)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;if(typeof t=="string"&&(r=t,t=!1),si.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!bt(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const i=[G.events.SELECTION_CHANGE,dn(this.lastRange),dn(t),e];this.emitter.emit(G.events.EDITOR_CHANGE,...i),e!==G.sources.SILENT&&this.emitter.emit(...i)}}}function ii(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const xg=/^[ -~]*$/;class Eg{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=oo(e),s=new V;return Ng(r.ops.slice()).reduce((a,l)=>{const c=Pe.Op.length(l);let u=l.attributes||{},f=!1,g=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const y=l.insert;g=!y.endsWith(`
28
+ `)&&(t<=a||!!this.scroll.descendant(De,a)[0]),this.scroll.insertAt(a,y);const[x,w]=this.scroll.line(a);let T=xt({},qe(x));if(x instanceof xe){const[A]=x.descendant(Ae,w);A&&(T=xt(T,qe(A)))}u=Pe.AttributeMap.diff(T,u)||{}}else if(typeof l.insert=="object"){const y=Object.keys(l.insert)[0];if(y==null)return a;const x=this.scroll.query(y,W.INLINE)!=null;if(x)(t<=a||this.scroll.descendant(De,a)[0])&&(g=!0);else if(a>0){const[w,T]=this.scroll.descendant(Ae,a-1);w instanceof Ge?w.value()[T]!==`
29
+ `&&(f=!0):w instanceof ke&&w.statics.scope===W.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(a,y,l.insert[y]),x){const[w]=this.scroll.descendant(Ae,a);if(w){const T=xt({},qe(w));u=Pe.AttributeMap.diff(T,u)||{}}}}t+=c}else if(s.push(l),l.retain!==null&&typeof l.retain=="object"){const y=Object.keys(l.retain)[0];if(y==null)return a;this.scroll.updateEmbedAt(a,y,l.retain[y])}Object.keys(u).forEach(y=>{this.scroll.formatAt(a,c,y,u[y])});const d=f?1:0,m=g?1:0;return t+=d+m,s.retain(d),s.delete(m),a+c+d+m},0),s.reduce((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+Pe.Op.length(l),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update(new V().retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(i=>{this.scroll.lines(e,Math.max(t,1)).forEach(a=>{a.format(i,r[i])})}),this.scroll.optimize();const s=new V().retain(e).retain(t,dn(r));return this.update(s)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(i=>{this.scroll.formatAt(e,t,i,r[i])});const s=new V().retain(e).retain(t,dn(r));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce((e,t)=>e.concat(t.delta()),new V)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];t===0?this.scroll.path(e).forEach(l=>{const[c]=l;c instanceof xe?r.push(c):c instanceof Ae&&s.push(c)}):(r=this.scroll.lines(e,t),s=this.scroll.descendants(Ae,e,t));const[i,a]=[r,s].map(l=>{const c=l.shift();if(c==null)return{};let u=qe(c);for(;Object.keys(u).length>0;){const f=l.shift();if(f==null)return u;u=wg(qe(f),u)}return u});return{...i,...a}}getHTML(e,t){const[r,s]=this.scroll.line(e);if(r){const i=r.length();return r.length()>=s+t&&!(s===0&&t===i)?tr(r,s,t,!0):tr(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,t){const r=oo(t),s=new V().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update(new V().retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`
30
30
  `).replace(/\r/g,`
31
- `),this.scroll.insertAt(e,t),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,t.length,s,r[s])}),this.update(new V().retain(e).insert(t,hn(r)))}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?.statics.blotName!==xe.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ke}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,l=new V;s!=null&&(a=s.length()-i,l=s.delta().slice(i,i+a-1).insert(`
32
- `));const u=this.getContents(e,t+a).diff(new V().insert(r).concat(l)),p=new V().retain(e).concat(u);return this.applyDelta(p)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(xg)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=qe(i),l=i.offset(this.scroll),c=t[0].oldValue.replace(ze.CONTENTS,""),u=new V().insert(c),p=new V().insert(i.value()),g=r&&{oldRange:oo(r.oldRange,-l),newRange:oo(r.newRange,-l)};e=new V().retain(l).concat(u.diff(p,g)).reduce((m,E)=>E.insert?m.insert(E.insert,a):m.push(E),new V),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!bt(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function un(n,e,t){if(n.length===0){const[m]=ii(t.pop());return e<=0?`</li></${m}>`:`</li></${m}>${un([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,p]=ii(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${p}>${er(r,s,i)}${un(c,a,t)}`:`<${u}><li>${un(n,e+1,t)}`;const g=t[t.length-1];if(a===e&&l===g)return`</li><li${p}>${er(r,s,i)}${un(c,a,t)}`;const[h]=ii(t.pop());return`</li></${h}>${un(n,e-1,t)}`}function er(n,e,t){let r=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 Ve)return ts(n.value().slice(e,e+t)).replaceAll(" ","&nbsp;");if(n instanceof Ge){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,(p,g,h)=>{const m="formats"in p&&typeof p.formats=="function"?p.formats():{};u.push({child:p,offset:g,length:h,indent:m.indent||0,type:m.list})}),un(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,(u,p,g)=>{s.push(er(u,p,g))}),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[l,c]=i.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${l}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function Ng(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const s=e[r];return s===n[r]?t[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?t[r]=s.concat([n[r]]):t[r]=s:t[r]=[s,n[r]],t},{})}function ii(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 ao(n){return n.reduce((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`
31
+ `),this.scroll.insertAt(e,t),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,t.length,s,r[s])}),this.update(new V().retain(e).insert(t,dn(r)))}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?.statics.blotName!==xe.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof We}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,l=new V;s!=null&&(a=s.length()-i,l=s.delta().slice(i,i+a-1).insert(`
32
+ `));const u=this.getContents(e,t+a).diff(new V().insert(r).concat(l)),f=new V().retain(e).concat(u);return this.applyDelta(f)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(xg)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=qe(i),l=i.offset(this.scroll),c=t[0].oldValue.replace(He.CONTENTS,""),u=new V().insert(c),f=new V().insert(i.value()),g=r&&{oldRange:lo(r.oldRange,-l),newRange:lo(r.newRange,-l)};e=new V().retain(l).concat(u.diff(f,g)).reduce((m,y)=>y.insert?m.insert(y.insert,a):m.push(y),new V),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!bt(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function hn(n,e,t){if(n.length===0){const[m]=ai(t.pop());return e<=0?`</li></${m}>`:`</li></${m}>${hn([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,f]=ai(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${tr(r,s,i)}${hn(c,a,t)}`:`<${u}><li>${hn(n,e+1,t)}`;const g=t[t.length-1];if(a===e&&l===g)return`</li><li${f}>${tr(r,s,i)}${hn(c,a,t)}`;const[d]=ai(t.pop());return`</li></${d}>${hn(n,e-1,t)}`}function tr(n,e,t){let r=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 Ge)return ns(n.value().slice(e,e+t)).replaceAll(" ","&nbsp;");if(n instanceof ze){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,(f,g,d)=>{const m="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:g,length:d,indent:m.indent||0,type:m.list})}),hn(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,(u,f,g)=>{s.push(tr(u,f,g))}),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[l,c]=i.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${l}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function wg(n,e){return Object.keys(e).reduce((t,r)=>{if(n[r]==null)return t;const s=e[r];return s===n[r]?t[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?t[r]=s.concat([n[r]]):t[r]=s:t[r]=[s,n[r]],t},{})}function ai(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 oo(n){return n.reduce((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`
33
33
  `).replace(/\r/g,`
34
- `);return e.insert(r,t.attributes)}return e.push(t)},new V)}function oo(n,e){let{index:t,length:r}=n;return new Dt(t+e,r)}function wg(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
34
+ `);return e.insert(r,t.attributes)}return e.push(t)},new V)}function lo(n,e){let{index:t,length:r}=n;return new Dt(t+e,r)}function Ng(n){const e=[];return n.forEach(t=>{typeof t.insert=="string"?t.insert.split(`
35
35
  `).forEach((s,i)=>{i&&e.push({insert:`
36
- `,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class rt{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const Mr="\uFEFF";class Bi extends ke{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(Mr),this.rightGuard=document.createTextNode(Mr),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,r;const s=e.data.split(Mr).join("");if(e===this.leftGuard)if(this.prev instanceof Ve){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof Ve?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:s.length}));return e.data=Mr,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(t.range=s)}})}}class Tg{isComposing=!1;constructor(e,t){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 Bi)&&(this.emitter.emit(G.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(G.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(G.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(G.events.COMPOSITION_END,e),this.isComposing=!1}}class bn{static DEFAULTS={modules:{}};static themes={default:bn};modules={};constructor(e,t){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]}}const Ag=n=>n.parentElement||n.getRootNode().host||null,Sg=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="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*r,left:e.left}},Dr=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},lo=(n,e,t,r,s,i)=>n<t&&e>r?0:n<t?-(t-n+s):e>r?e-n>r-t?n+s-t:e-r+i:0,Cg=(n,e)=>{const t=n.ownerDocument;let r=e,s=n;for(;s;){const i=s===t.body,a=i?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:Sg(s),l=getComputedStyle(s),c=lo(r.left,r.right,a.left,a.right,Dr(l.scrollPaddingLeft),Dr(l.scrollPaddingRight)),u=lo(r.top,r.bottom,a.top,a.bottom,Dr(l.scrollPaddingTop),Dr(l.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:p,scrollTop:g}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const h=s.scrollLeft-p,m=s.scrollTop-g;r={left:r.left-h,top:r.top-m,right:r.right-h,bottom:r.bottom-m}}s=i||l.position==="fixed"?null:Ag(s)}},_g=100,Og=["block","break","cursor","inline","scroll","text"],Rg=(n,e,t)=>{const r=new gn;return Og.forEach(s=>{const i=e.query(s);i&&r.register(i)}),n.forEach(s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>_g){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},fn=ft("quill"),Pr=new gn;Ge.uiClass="ql-ui";class L{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Pr,theme:"default"};static events=G.events;static sources=G.sources;static version="2.0.3";static imports={delta:V,parchment:cg,"core/module":rt,"core/theme":bn};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 Ai.get(e)||Pr.find(e,t)}static import(e){return this.imports[e]==null&&fn.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]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach(s=>{this.register(s,e[s],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&fn.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&Pr.register(t),typeof t.register=="function"&&t.register(Pr)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Lg(e,t),this.container=this.options.container,this.container==null){fn.error("Invalid Quill container",e);return}this.options.debug&&L.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Ai.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new G;const s=$i.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Eg(this.scroll),this.selection=new yg(this.scroll,this.emitter),this.composition=new Tg(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(G.events.EDITOR_CHANGE,a=>{a===G.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(G.events.SCROLL_UPDATE,(a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),p=c&&u?{oldRange:c,newRange:u}:void 0;Ue.call(this,()=>this.editor.update(null,l,p),a)}),this.emitter.on(G.events.SCROLL_EMBED_UPDATE,(a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),p=c&&u?{oldRange:c,newRange:u}:void 0;Ue.call(this,()=>{const g=new V().retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(g,[],p)},L.sources.USER)}),r){const a=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
37
- `});this.setContents(a)}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 r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=lt(e,t,r),Ue.call(this,()=>this.editor.deleteText(e,t),r,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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;return Ue.call(this,()=>{const s=this.getSelection(!0);let i=new V;if(s==null)return i;if(this.scroll.query(e,W.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,G.sources.SILENT),i},r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=lt(e,t,r,s,i),Ue.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=lt(e,t,r,s,i),Ue.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.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]=lt(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]:!1)&&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]=lt(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]=lt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:L.sources.API;return Ue.call(this,()=>this.editor.insertEmbed(e,t,r),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=lt(e,0,r,s,i),Ue.call(this,()=>this.editor.insertText(e,t,a),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,r){return[e,t,,r]=lt(e,t,r),Ue.call(this,()=>this.editor.removeFormat(e,t),r,e)}scrollRectIntoView(e){Cg(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]:G.sources.API;return Ue.call(this,()=>{e=new V(e);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(a)},t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||L.sources.API):([e,t,,r]=lt(e,t,r),this.selection.setRange(new Dt(Math.max(0,e),t),r),r!==G.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;const r=new V().insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.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]:G.sources.API;return Ue.call(this,()=>(e=new V(e),this.editor.applyDelta(e)),t,!0)}}function co(n){return typeof n=="string"?document.querySelector(n):n}function ai(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}},{})}function uo(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function Lg(n,e){const t=co(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===L.DEFAULTS.theme?bn:L.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=L.DEFAULTS,{modules:l,...c}=s.DEFAULTS;let u=ai(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const p=xt({},ai(i),ai(l),u),g={...a,...uo(c),...uo(e)};let h=e.registry;return h?e.formats&&fn.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Rg(e.formats,g.registry,fn):g.registry,{...g,registry:h,container:t,theme:s,modules:Object.entries(p).reduce((m,E)=>{let[y,N]=E;if(!N)return m;const T=L.import(`modules/${y}`);return T==null?(fn.error(`Cannot load ${y} module. Are you sure you registered it?`),m):{...m,[y]:xt({},T.DEFAULTS||{},N)}},{}),bounds:co(g.bounds)}}function Ue(n,e,t,r){if(!this.isEnabled()&&e===G.sources.USER&&!this.allowReadOnlyEdits)return new V;let s=t==null?null:this.getSelection();const i=this.editor.delta,a=n();if(s!=null&&(t===!0&&(t=s.index),r==null?s=ho(s,a,e):r!==0&&(s=ho(s,t,r,e)),this.setSelection(s,G.sources.SILENT)),a.length()>0){const l=[G.events.TEXT_CHANGE,a,i,e];this.emitter.emit(G.events.EDITOR_CHANGE,...l),e!==G.sources.SILENT&&this.emitter.emit(...l)}return a}function lt(n,e,t,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(s=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(s=r,r=t,t=e,e=0),typeof t=="object"?(i=t,s=r):typeof t=="string"&&(r!=null?i[t]=r:s=t),s=s||G.sources.API,[n,e,i,s]}function ho(n,e,t,r){const s=typeof t=="number"?t:0;if(n==null)return null;let i,a;return e&&typeof e.transformPosition=="function"?[i,a]=[n.index,n.index+n.length].map(l=>e.transformPosition(l,r!==G.sources.USER)):[i,a]=[n.index,n.index+n.length].map(l=>l<e||l===e&&r===G.sources.USER?l:s>=0?l+s:Math.max(e,l+s)),new Dt(i,a-i)}class Ut extends es{}function fo(n){return n instanceof xe||n instanceof De}function po(n){return typeof n.updateContent=="function"}class kg extends $i{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=xe;static allowedChildren=[xe,De,Ut];constructor(e,t,r){let{emitter:s}=r;super(e,t),this.emitter=s,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(G.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(G.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(G.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&r!==i&&s>0){if(r instanceof De||i instanceof De){this.optimize();return}const a=i.children.head instanceof Ke?null:i.children.head;r.moveChildren(i,a),r.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,r,s){super.formatAt(e,t,r,s),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,W.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&t.endsWith(`
36
+ `,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})}):e.push(t)}),e}class rt{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const Mr="\uFEFF";class Fi extends ke{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(Mr),this.rightGuard=document.createTextNode(Mr),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,r;const s=e.data.split(Mr).join("");if(e===this.leftGuard)if(this.prev instanceof Ge){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof Ge?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:s.length}));return e.data=Mr,t}update(e,t){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(t.range=s)}})}}class Tg{isComposing=!1;constructor(e,t){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 Fi)&&(this.emitter.emit(G.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(G.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(G.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(G.events.COMPOSITION_END,e),this.isComposing=!1}}class vn{static DEFAULTS={modules:{}};static themes={default:vn};modules={};constructor(e,t){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]}}const Ag=n=>n.parentElement||n.getRootNode().host||null,Sg=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="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*r,left:e.left}},Dr=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},co=(n,e,t,r,s,i)=>n<t&&e>r?0:n<t?-(t-n+s):e>r?e-n>r-t?n+s-t:e-r+i:0,Cg=(n,e)=>{const t=n.ownerDocument;let r=e,s=n;for(;s;){const i=s===t.body,a=i?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:Sg(s),l=getComputedStyle(s),c=co(r.left,r.right,a.left,a.right,Dr(l.scrollPaddingLeft),Dr(l.scrollPaddingRight)),u=co(r.top,r.bottom,a.top,a.bottom,Dr(l.scrollPaddingTop),Dr(l.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:f,scrollTop:g}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const d=s.scrollLeft-f,m=s.scrollTop-g;r={left:r.left-d,top:r.top-m,right:r.right-d,bottom:r.bottom-m}}s=i||l.position==="fixed"?null:Ag(s)}},_g=100,Og=["block","break","cursor","inline","scroll","text"],Rg=(n,e,t)=>{const r=new mn;return Og.forEach(s=>{const i=e.query(s);i&&r.register(i)}),n.forEach(s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>_g){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},pn=ft("quill"),Pr=new mn;ze.uiClass="ql-ui";class k{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Pr,theme:"default"};static events=G.events;static sources=G.sources;static version="2.0.3";static imports={delta:V,parchment:cg,"core/module":rt,"core/theme":vn};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 Si.get(e)||Pr.find(e,t)}static import(e){return this.imports[e]==null&&pn.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]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach(s=>{this.register(s,e[s],t)})}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&pn.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&Pr.register(t),typeof t.register=="function"&&t.register(Pr)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Lg(e,t),this.container=this.options.container,this.container==null){pn.error("Invalid Quill container",e);return}this.options.debug&&k.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Si.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new G;const s=Bi.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Eg(this.scroll),this.selection=new yg(this.scroll,this.emitter),this.composition=new Tg(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(G.events.EDITOR_CHANGE,a=>{a===G.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(G.events.SCROLL_UPDATE,(a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Fe.call(this,()=>this.editor.update(null,l,f),a)}),this.emitter.on(G.events.SCROLL_EMBED_UPDATE,(a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Fe.call(this,()=>{const g=new V().retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(g,[],f)},k.sources.USER)}),r){const a=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
37
+ `});this.setContents(a)}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 r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=lt(e,t,r),Fe.call(this,()=>this.editor.deleteText(e,t),r,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 r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;return Fe.call(this,()=>{const s=this.getSelection(!0);let i=new V;if(s==null)return i;if(this.scroll.query(e,W.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,G.sources.SILENT),i},r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=lt(e,t,r,s,i),Fe.call(this,()=>this.editor.formatLine(e,t,a),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=lt(e,t,r,s,i),Fe.call(this,()=>this.editor.formatText(e,t,a),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.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]=lt(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]:!1)&&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]=lt(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]=lt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k.sources.API;return Fe.call(this,()=>this.editor.insertEmbed(e,t,r),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=lt(e,0,r,s,i),Fe.call(this,()=>this.editor.insertText(e,t,a),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,r){return[e,t,,r]=lt(e,t,r),Fe.call(this,()=>this.editor.removeFormat(e,t),r,e)}scrollRectIntoView(e){Cg(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]:G.sources.API;return Fe.call(this,()=>{e=new V(e);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(a)},t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||k.sources.API):([e,t,,r]=lt(e,t,r),this.selection.setRange(new Dt(Math.max(0,e),t),r),r!==G.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;const r=new V().insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.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]:G.sources.API;return Fe.call(this,()=>(e=new V(e),this.editor.applyDelta(e)),t,!0)}}function uo(n){return typeof n=="string"?document.querySelector(n):n}function oi(n){return Object.entries(n??{}).reduce((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}},{})}function ho(n){return Object.fromEntries(Object.entries(n).filter(e=>e[1]!==void 0))}function Lg(n,e){const t=uo(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===k.DEFAULTS.theme?vn:k.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=k.DEFAULTS,{modules:l,...c}=s.DEFAULTS;let u=oi(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=xt({},oi(i),oi(l),u),g={...a,...ho(c),...ho(e)};let d=e.registry;return d?e.formats&&pn.warn('Ignoring "formats" option because "registry" is specified'):d=e.formats?Rg(e.formats,g.registry,pn):g.registry,{...g,registry:d,container:t,theme:s,modules:Object.entries(f).reduce((m,y)=>{let[x,w]=y;if(!w)return m;const T=k.import(`modules/${x}`);return T==null?(pn.error(`Cannot load ${x} module. Are you sure you registered it?`),m):{...m,[x]:xt({},T.DEFAULTS||{},w)}},{}),bounds:uo(g.bounds)}}function Fe(n,e,t,r){if(!this.isEnabled()&&e===G.sources.USER&&!this.allowReadOnlyEdits)return new V;let s=t==null?null:this.getSelection();const i=this.editor.delta,a=n();if(s!=null&&(t===!0&&(t=s.index),r==null?s=fo(s,a,e):r!==0&&(s=fo(s,t,r,e)),this.setSelection(s,G.sources.SILENT)),a.length()>0){const l=[G.events.TEXT_CHANGE,a,i,e];this.emitter.emit(G.events.EDITOR_CHANGE,...l),e!==G.sources.SILENT&&this.emitter.emit(...l)}return a}function lt(n,e,t,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(s=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(s=r,r=t,t=e,e=0),typeof t=="object"?(i=t,s=r):typeof t=="string"&&(r!=null?i[t]=r:s=t),s=s||G.sources.API,[n,e,i,s]}function fo(n,e,t,r){const s=typeof t=="number"?t:0;if(n==null)return null;let i,a;return e&&typeof e.transformPosition=="function"?[i,a]=[n.index,n.index+n.length].map(l=>e.transformPosition(l,r!==G.sources.USER)):[i,a]=[n.index,n.index+n.length].map(l=>l<e||l===e&&r===G.sources.USER?l:s>=0?l+s:Math.max(e,l+s)),new Dt(i,a-i)}class Ht extends ts{}function po(n){return n instanceof xe||n instanceof De}function go(n){return typeof n.updateContent=="function"}class kg extends Bi{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=xe;static allowedChildren=[xe,De,Ht];constructor(e,t,r){let{emitter:s}=r;super(e,t),this.emitter=s,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(G.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(G.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(G.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&r!==i&&s>0){if(r instanceof De||i instanceof De){this.optimize();return}const a=i.children.head instanceof We?null:i.children.head;r.moveChildren(i,a),r.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,r,s){super.formatAt(e,t,r,s),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,W.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&t.endsWith(`
38
38
  `)?s.insertAt(0,t.slice(0,-1),r):s.insertAt(0,t,r)}else{const s=this.scroll.create(t,r);this.appendChild(s)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===W.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat(new V().insert(`
39
- `))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(De,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:new V().insert({[i.key]:i.value});oi(this,e,u);const p=i.type==="block"?1:0,g=e+u.length()+p;c&&this.insertAt(g-1,`
40
- `);const h=qe(this.line(e)[0]),m=$e.AttributeMap.diff(h,i.attributes)||{};Object.keys(m).forEach(E=>{this.formatAt(g-1,1,E,m[E])}),e=g}let[a,l]=this.children.find(e);if(r.length&&(a&&(a=a.split(l),l=0),r.forEach(c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);oi(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach(p=>{u.format(p,c.attributes[p])})}})),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();oi(this,c,s.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[r,s]=t;return r instanceof Ae?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(fo,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 r=(s,i,a)=>{let l=[],c=a;return s.children.forEachAt(i,a,(u,p,g)=>{fo(u)?l.push(u):u instanceof es&&(l=l.concat(r(u,p,c))),c-=g}),l};return r(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(G.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=G.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!po(i)}),e.length>0&&this.emitter.emit(G.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(G.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant(i=>i instanceof De,e);s&&s.statics.blotName===t&&po(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new V;return e.forEach(s=>{const i=s?.insert;if(i)if(typeof i=="string"){const a=i.split(`
41
- `);a.slice(0,-1).forEach(c=>{r.insert(c,s.attributes),t.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new V});const l=a[a.length-1];l&&r.insert(l,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,W.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new V,t.push({type:"blockEmbed",key:a,value:i[a],attributes:s.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const s={};Object.entries(e).forEach(l=>{let[c,u]=l;this.query(c,W.BLOCK&W.BLOT)!=null?r=c:s[c]=u});const i=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(i,t||void 0);const a=i.length();return Object.entries(s).forEach(l=>{let[c,u]=l;i.formatAt(0,a,c,u)}),i}}function oi(n,e,t){t.reduce((r,s)=>{const i=$e.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const l=s.insert;n.insertAt(r,l);const[c]=n.descendant(Ae,r),u=qe(c);a=$e.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const l=Object.keys(s.insert)[0];if(l==null)return r;if(n.insertAt(r,l,s.insert[l]),n.scroll.query(l,W.INLINE)!=null){const[u]=n.descendant(Ae,r),p=qe(u);a=$e.AttributeMap.diff(p,a)||{}}}}return Object.keys(a).forEach(l=>{n.formatAt(r,i,l,a[l])}),r+i},e)}const Fi={scope:W.BLOCK,whitelist:["right","center","justify"]},jg=new tt("align","align",Fi),Ul=new We("align","ql-align",Fi),Hl=new At("align","text-align",Fi);class zl extends At{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 Ig=new We("color","ql-color",{scope:W.INLINE}),Ui=new zl("color","color",{scope:W.INLINE}),qg=new We("background","ql-bg",{scope:W.INLINE}),Hi=new zl("background","background-color",{scope:W.INLINE});class Ht extends Ut{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
39
+ `))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(De,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:new V().insert({[i.key]:i.value});li(this,e,u);const f=i.type==="block"?1:0,g=e+u.length()+f;c&&this.insertAt(g-1,`
40
+ `);const d=qe(this.line(e)[0]),m=Pe.AttributeMap.diff(d,i.attributes)||{};Object.keys(m).forEach(y=>{this.formatAt(g-1,1,y,m[y])}),e=g}let[a,l]=this.children.find(e);if(r.length&&(a&&(a=a.split(l),l=0),r.forEach(c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);li(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach(f=>{u.format(f,c.attributes[f])})}})),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();li(this,c,s.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[r,s]=t;return r instanceof Ae?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(po,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 r=(s,i,a)=>{let l=[],c=a;return s.children.forEachAt(i,a,(u,f,g)=>{po(u)?l.push(u):u instanceof ts&&(l=l.concat(r(u,f,c))),c-=g}),l};return r(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(G.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=G.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!go(i)}),e.length>0&&this.emitter.emit(G.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(G.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant(i=>i instanceof De,e);s&&s.statics.blotName===t&&go(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new V;return e.forEach(s=>{const i=s?.insert;if(i)if(typeof i=="string"){const a=i.split(`
41
+ `);a.slice(0,-1).forEach(c=>{r.insert(c,s.attributes),t.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new V});const l=a[a.length-1];l&&r.insert(l,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,W.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new V,t.push({type:"blockEmbed",key:a,value:i[a],attributes:s.attributes??{}}))}}),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const s={};Object.entries(e).forEach(l=>{let[c,u]=l;this.query(c,W.BLOCK&W.BLOT)!=null?r=c:s[c]=u});const i=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(i,t||void 0);const a=i.length();return Object.entries(s).forEach(l=>{let[c,u]=l;i.formatAt(0,a,c,u)}),i}}function li(n,e,t){t.reduce((r,s)=>{const i=Pe.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const l=s.insert;n.insertAt(r,l);const[c]=n.descendant(Ae,r),u=qe(c);a=Pe.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const l=Object.keys(s.insert)[0];if(l==null)return r;if(n.insertAt(r,l,s.insert[l]),n.scroll.query(l,W.INLINE)!=null){const[u]=n.descendant(Ae,r),f=qe(u);a=Pe.AttributeMap.diff(f,a)||{}}}}return Object.keys(a).forEach(l=>{n.formatAt(r,i,l,a[l])}),r+i},e)}const Ui={scope:W.BLOCK,whitelist:["right","center","justify"]},jg=new tt("align","align",Ui),Ul=new Ve("align","ql-align",Ui),Hl=new At("align","text-align",Ui);class zl extends At{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 Ig=new Ve("color","ql-color",{scope:W.INLINE}),Hi=new zl("color","color",{scope:W.INLINE}),qg=new Ve("background","ql-bg",{scope:W.INLINE}),zi=new zl("background","background-color",{scope:W.INLINE});class zt extends Ht{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
42
42
  `).slice(e,e+t)}html(e,t){return`<pre>
43
- ${ts(this.code(e,t))}
44
- </pre>`}}class _e extends xe{static TAB=" ";static register(){L.register(Ht)}}class zi extends Ce{}zi.blotName="code";zi.tagName="CODE";_e.blotName="code-block";_e.className="ql-code-block";_e.tagName="DIV";Ht.blotName="code-block-container";Ht.className="ql-code-block-container";Ht.tagName="DIV";Ht.allowedChildren=[_e];_e.allowedChildren=[Ve,Ke,ze];_e.requiredContainer=Ht;const Gi={scope:W.BLOCK,whitelist:["rtl"]},Gl=new tt("direction","dir",Gi),Vl=new We("direction","ql-direction",Gi),Wl=new At("direction","direction",Gi),Kl={scope:W.INLINE,whitelist:["serif","monospace"]},Yl=new We("font","ql-font",Kl);class Mg extends At{value(e){return super.value(e).replace(/["']/g,"")}}const Xl=new Mg("font","font-family",Kl),Zl=new We("size","ql-size",{scope:W.INLINE,whitelist:["small","large","huge"]}),Jl=new At("size","font-size",{scope:W.INLINE,whitelist:["10px","18px","32px"]}),Dg=ft("quill:keyboard"),Pg=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class ns extends rt{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!t[r]!==e[r]&&t[r]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),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]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Bg(e);if(s==null){Dg.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(a=>{const l={...s,key:a,...t,...r};this.bindings[l.key]=this.bindings[l.key]||[],this.bindings[l.key].push(l)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(T=>ns.match(e,T));if(s.length===0)return;const i=L.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[l,c]=this.quill.getLine(a.index),[u,p]=this.quill.getLeaf(a.index),[g,h]=a.length===0?[u,p]:this.quill.getLeaf(a.index+a.length),m=u instanceof Wr?u.value().slice(0,p):"",E=g instanceof Wr?g.value().slice(h):"",y={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:m,suffix:E,event:e};s.some(T=>{if(T.collapsed!=null&&T.collapsed!==y.collapsed||T.empty!=null&&T.empty!==y.empty||T.offset!=null&&T.offset!==y.offset)return!1;if(Array.isArray(T.format)){if(T.format.every(A=>y.format[A]==null))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every(A=>T.format[A]===!0?y.format[A]!=null:T.format[A]===!1?y.format[A]==null:bt(T.format[A],y.format[A])))return!1;return T.prefix!=null&&!T.prefix.test(y.prefix)||T.suffix!=null&&!T.suffix.test(y.suffix)?!1:T.handler.call(this,a,y,T)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let a=new V().retain(e.index-r).delete(r);if(t.offset===0){const[l]=this.quill.getLine(e.index-1);if(l&&!(l.statics.blotName==="block"&&l.length()<=1)){const u=i.formats(),p=this.quill.getFormat(e.index-1,1);if(s=$e.AttributeMap.diff(u,p)||{},Object.keys(s).length>0){const g=new V().retain(e.index+i.length()-2).retain(1,s);a=a.compose(g)}}}this.quill.updateContents(a,L.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(e.index);let a=new V().retain(e.index).delete(r);if(t.offset>=i.length()-1){const[l]=this.quill.getLine(e.index+1);if(l){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=$e.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(l.length()-1).retain(1,s))}}this.quill.updateContents(a,L.sources.USER),this.quill.focus()}handleDeleteRange(e){Vi({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((i,a)=>(this.quill.scroll.query(a,W.BLOCK)&&!Array.isArray(t.format[a])&&(i[a]=t.format[a]),i),{}),s=new V().retain(e.index).delete(e.length).insert(`
45
- `,r);this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(e.index+1,L.sources.SILENT),this.quill.focus()}}const $g={bindings:{bold:li("bold"),italic:li("italic"),underline:li("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",L.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",L.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",L.sources.USER):e.format.list!=null&&this.quill.format("list",!1,L.sources.USER)}},"indent code-block":go(!0),"outdent code-block":go(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,L.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new V().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(t,L.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,L.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,L.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,L.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},s=new V().retain(n.index).insert(`
46
- `,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(n.index+1,L.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),s=new V().retain(n.index).insert(`
47
- `,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(n.index+1,L.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,r,s,i]=e.getTable(n),a=Fg(t,r,s,i);if(a==null)return;let l=t.offset();if(a<0){const c=new V().retain(l).insert(`
48
- `);this.quill.updateContents(c,L.sources.USER),this.quill.setSelection(n.index+1,n.length,L.sources.SILENT)}else if(a>0){l+=t.length();const c=new V().retain(l).insert(`
49
- `);this.quill.updateContents(c,L.sources.USER),this.quill.setSelection(l,L.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,s=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,L.sources.USER):this.quill.setSelection(s+r.length(),L.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,[r,s]=this.quill.getLine(n.index);if(s>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," ",L.sources.USER),this.quill.history.cutoff();const a=new V().retain(n.index-s).delete(t+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(a,L.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,L.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 r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=new V().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,L.sources.USER),this.quill.setSelection(n.index-1,L.sources.SILENT),!1}return!0}},"embed left":$r("ArrowLeft",!1),"embed left shift":$r("ArrowLeft",!0),"embed right":$r("ArrowRight",!1),"embed right shift":$r("ArrowRight",!0),"table down":mo(!1),"table up":mo(!0)}};ns.DEFAULTS=$g;function go(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,i,L.sources.USER),this.quill.setSelection(e.index+i.length,L.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:c}=e;a.forEach((u,p)=>{n?(u.insertAt(0,i),p===0?l+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),p===0?l-=i.length:c-=i.length)}),this.quill.update(L.sources.USER),this.quill.setSelection(l,c,L.sources.SILENT)}}}function $r(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof ke?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,L.sources.USER):this.quill.setSelection(r.index-1,L.sources.USER):e?this.quill.setSelection(r.index,r.length+1,L.sources.USER):this.quill.setSelection(r.index+r.length+1,L.sources.USER),!1):!0}}}function li(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],L.sources.USER)}}}function mo(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",s=t.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let a=i.children.head,l=s;for(;l.prev!=null;)l=l.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,L.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,L.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,L.sources.USER))}return!1}}}function Bg(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=hn(n);else return null;return n.shortKey&&(n[Pg]=n.shortKey,delete n.shortKey),n}function Vi(n){let{quill:e,range:t}=n;const r=e.getLines(t);let s={};if(r.length>1){const i=r[0].formats(),a=r[r.length-1].formats();s=$e.AttributeMap.diff(a,i)||{}}e.deleteText(t,L.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,L.sources.USER),e.setSelection(t.index,L.sources.SILENT)}function Fg(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Ug=/font-weight:\s*normal/,Hg=["P","OL","UL"],bo=n=>n&&Hg.includes(n.tagName),zg=n=>{Array.from(n.querySelectorAll("br")).filter(e=>bo(e.previousElementSibling)&&bo(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},Gg=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(Ug)).forEach(e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)})};function Vg(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Gg(n),zg(n))}const Wg=/\bmso-list:[^;]*ignore/i,Kg=/\bmso-list:[^;]*\bl(\d+)/i,Yg=/\bmso-list:[^;]*\blevel(\d+)/i,Xg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Kg);if(!r)return null;const s=Number(r[1]),i=t?.match(Yg),a=i?Number(i[1]):1,l=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},Zg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(a=>{(a.getAttribute("style")||"").match(Wg)?t.push(a):r.push(a)}),t.forEach(a=>a.parentNode?.removeChild(a));const s=n.documentElement.innerHTML,i=r.map(a=>Xg(a,s)).filter(a=>a);for(;i.length;){const a=[];let l=i.shift();for(;l;)a.push(l),l=i.length&&i[0]?.element===l.element.nextElementSibling&&i[0].id===l.id?i.shift():null;const c=document.createElement("ul");a.forEach(g=>{const h=document.createElement("li");h.setAttribute("data-list",g.type),g.indent>1&&h.setAttribute("class",`ql-indent-${g.indent-1}`),h.innerHTML=g.element.innerHTML,c.appendChild(h)});const u=a[0]?.element,{parentNode:p}=u??{};u&&p?.replaceChild(c,u),a.slice(1).forEach(g=>{let{element:h}=g;p?.removeChild(h)})}};function Jg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Zg(n)}const Qg=[Jg,Vg],em=n=>{n.documentElement&&Qg.forEach(e=>{e(n)})},tm=ft("quill:clipboard"),nm=[[Node.TEXT_NODE,gm],[Node.TEXT_NODE,yo],["br",lm],[Node.ELEMENT_NODE,yo],[Node.ELEMENT_NODE,om],[Node.ELEMENT_NODE,am],[Node.ELEMENT_NODE,fm],["li",hm],["ol, ul",dm],["pre",cm],["tr",pm],["b",ci("bold")],["i",ci("italic")],["strike",ci("strike")],["style",um]],rm=[jg,Gl].reduce((n,e)=>(n[e.keyName]=e,n),{}),vo=[Hl,Hi,Ui,Wl,Xl,Jl].reduce((n,e)=>(n[e.keyName]=e,n),{});class sm extends rt{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],nm.concat(this.options.matchers??[]).forEach(r=>{let[s,i]=r;this.addMatcher(s,i)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[_e.blotName])return new V().insert(r||"",{[_e.blotName]:s[_e.blotName]});if(!t)return new V().insert(r||"",s);const i=this.convertHTML(t);return sr(i,`
50
- `)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new V().retain(i.length()-1).delete(1)):i}normalizeHTML(e){em(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,s=new WeakMap,[i,a]=this.prepareMatching(r,s);return Wi(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:L.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,L.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents(new V().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),L.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",s),t&&Vi({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
51
- `)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let s=e.clipboardData?.getData("text/plain");if(!r&&!s){const a=e.clipboardData?.getData("text/uri-list");a&&(s=this.normalizeURIList(a))}const i=Array.from(e.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(t,i);return}if(r&&i.length>0){const a=new DOMParser().parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:r,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:s}=t;const i=this.quill.getFormat(e.index),a=this.convert({text:r,html:s},i);tm.log("onPaste",a,{text:r,html:s});const l=new V().retain(e.index).delete(e.length).concat(a);this.quill.updateContents(l,L.sources.USER),this.quill.setSelection(l.length()-e.length,L.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach(i=>{const[a,l]=i;switch(a){case Node.TEXT_NODE:s.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:Array.from(e.querySelectorAll(a)).forEach(c=>{t.has(c)?t.get(c)?.push(l):t.set(c,[l])});break}}),[r,s]}}function zt(n,e,t,r){return r.query(e)?n.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const a=t?{[e]:t}:{};return s.insert(i.insert,{...a,...i.attributes})},new V):n}function sr(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function yt(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof ke?!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 im(n,e){return n.previousElementSibling&&n.nextElementSibling&&!yt(n.previousElementSibling,e)&&!yt(n.nextElementSibling,e)}const Br=new WeakMap;function Ql(n){return n==null?!1:(Br.has(n)||(n.tagName==="PRE"?Br.set(n,!0):Br.set(n,Ql(n.parentNode))),Br.get(n))}function Wi(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((i,a)=>a(e,i,n),new V):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((i,a)=>{let l=Wi(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce((c,u)=>u(a,c,n),l),l=(s.get(a)||[]).reduce((c,u)=>u(a,c,n),l)),i.concat(l)},new V):new V}function ci(n){return(e,t,r)=>zt(t,n,!0,r)}function am(n,e,t){const r=tt.keys(n),s=We.keys(n),i=At.keys(n),a={};return r.concat(s).concat(i).forEach(l=>{let c=t.query(l,W.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=rm[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=vo[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=vo[l],a[c.attrName]=c.value(n)||void 0))}),Object.entries(a).reduce((l,c)=>{let[u,p]=c;return zt(l,u,p,t)},e)}function om(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ke){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,new V().insert(s,r.formats(n,t))}else if(r.prototype instanceof Qn&&!sr(e,`
43
+ ${ns(this.code(e,t))}
44
+ </pre>`}}class _e extends xe{static TAB=" ";static register(){k.register(zt)}}class Gi extends Ce{}Gi.blotName="code";Gi.tagName="CODE";_e.blotName="code-block";_e.className="ql-code-block";_e.tagName="DIV";zt.blotName="code-block-container";zt.className="ql-code-block-container";zt.tagName="DIV";zt.allowedChildren=[_e];_e.allowedChildren=[Ge,We,He];_e.requiredContainer=zt;const Vi={scope:W.BLOCK,whitelist:["rtl"]},Gl=new tt("direction","dir",Vi),Vl=new Ve("direction","ql-direction",Vi),Wl=new At("direction","direction",Vi),Kl={scope:W.INLINE,whitelist:["serif","monospace"]},Yl=new Ve("font","ql-font",Kl);class Mg extends At{value(e){return super.value(e).replace(/["']/g,"")}}const Xl=new Mg("font","font-family",Kl),Zl=new Ve("size","ql-size",{scope:W.INLINE,whitelist:["small","large","huge"]}),Jl=new At("size","font-size",{scope:W.INLINE,whitelist:["10px","18px","32px"]}),Dg=ft("quill:keyboard"),Pg=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class rs extends rt{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!t[r]!==e[r]&&t[r]!==null)?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),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]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Bg(e);if(s==null){Dg.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(a=>{const l={...s,key:a,...t,...r};this.bindings[l.key]=this.bindings[l.key]||[],this.bindings[l.key].push(l)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(T=>rs.match(e,T));if(s.length===0)return;const i=k.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[l,c]=this.quill.getLine(a.index),[u,f]=this.quill.getLeaf(a.index),[g,d]=a.length===0?[u,f]:this.quill.getLeaf(a.index+a.length),m=u instanceof Wr?u.value().slice(0,f):"",y=g instanceof Wr?g.value().slice(d):"",x={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:m,suffix:y,event:e};s.some(T=>{if(T.collapsed!=null&&T.collapsed!==x.collapsed||T.empty!=null&&T.empty!==x.empty||T.offset!=null&&T.offset!==x.offset)return!1;if(Array.isArray(T.format)){if(T.format.every(A=>x.format[A]==null))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every(A=>T.format[A]===!0?x.format[A]!=null:T.format[A]===!1?x.format[A]==null:bt(T.format[A],x.format[A])))return!1;return T.prefix!=null&&!T.prefix.test(x.prefix)||T.suffix!=null&&!T.suffix.test(x.suffix)?!1:T.handler.call(this,a,x,T)!==!0})&&e.preventDefault()})}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let a=new V().retain(e.index-r).delete(r);if(t.offset===0){const[l]=this.quill.getLine(e.index-1);if(l&&!(l.statics.blotName==="block"&&l.length()<=1)){const u=i.formats(),f=this.quill.getFormat(e.index-1,1);if(s=Pe.AttributeMap.diff(u,f)||{},Object.keys(s).length>0){const g=new V().retain(e.index+i.length()-2).retain(1,s);a=a.compose(g)}}}this.quill.updateContents(a,k.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(e.index);let a=new V().retain(e.index).delete(r);if(t.offset>=i.length()-1){const[l]=this.quill.getLine(e.index+1);if(l){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=Pe.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(l.length()-1).retain(1,s))}}this.quill.updateContents(a,k.sources.USER),this.quill.focus()}handleDeleteRange(e){Wi({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce((i,a)=>(this.quill.scroll.query(a,W.BLOCK)&&!Array.isArray(t.format[a])&&(i[a]=t.format[a]),i),{}),s=new V().retain(e.index).delete(e.length).insert(`
45
+ `,r);this.quill.updateContents(s,k.sources.USER),this.quill.setSelection(e.index+1,k.sources.SILENT),this.quill.focus()}}const $g={bindings:{bold:ci("bold"),italic:ci("italic"),underline:ci("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",k.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",k.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",k.sources.USER):e.format.list!=null&&this.quill.format("list",!1,k.sources.USER)}},"indent code-block":mo(!0),"outdent code-block":mo(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,k.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=new V().retain(n.index).delete(n.length).insert(" ");return this.quill.updateContents(t,k.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,k.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,k.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,k.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},s=new V().retain(n.index).insert(`
46
+ `,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,k.sources.USER),this.quill.setSelection(n.index+1,k.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),s=new V().retain(n.index).insert(`
47
+ `,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,k.sources.USER),this.quill.setSelection(n.index+1,k.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,r,s,i]=e.getTable(n),a=Fg(t,r,s,i);if(a==null)return;let l=t.offset();if(a<0){const c=new V().retain(l).insert(`
48
+ `);this.quill.updateContents(c,k.sources.USER),this.quill.setSelection(n.index+1,n.length,k.sources.SILENT)}else if(a>0){l+=t.length();const c=new V().retain(l).insert(`
49
+ `);this.quill.updateContents(c,k.sources.USER),this.quill.setSelection(l,k.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,s=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,k.sources.USER):this.quill.setSelection(s+r.length(),k.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,[r,s]=this.quill.getLine(n.index);if(s>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," ",k.sources.USER),this.quill.history.cutoff();const a=new V().retain(n.index-s).delete(t+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(a,k.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,k.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 r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=new V().retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,k.sources.USER),this.quill.setSelection(n.index-1,k.sources.SILENT),!1}return!0}},"embed left":$r("ArrowLeft",!1),"embed left shift":$r("ArrowLeft",!0),"embed right":$r("ArrowRight",!1),"embed right shift":$r("ArrowRight",!0),"table down":bo(!1),"table up":bo(!0)}};rs.DEFAULTS=$g;function mo(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,i,k.sources.USER),this.quill.setSelection(e.index+i.length,k.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:c}=e;a.forEach((u,f)=>{n?(u.insertAt(0,i),f===0?l+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),f===0?l-=i.length:c-=i.length)}),this.quill.update(k.sources.USER),this.quill.setSelection(l,c,k.sources.SILENT)}}}function $r(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof ke?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,k.sources.USER):this.quill.setSelection(r.index-1,k.sources.USER):e?this.quill.setSelection(r.index,r.length+1,k.sources.USER):this.quill.setSelection(r.index+r.length+1,k.sources.USER),!1):!0}}}function ci(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],k.sources.USER)}}}function bo(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",s=t.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let a=i.children.head,l=s;for(;l.prev!=null;)l=l.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,k.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,k.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,k.sources.USER))}return!1}}}function Bg(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=dn(n);else return null;return n.shortKey&&(n[Pg]=n.shortKey,delete n.shortKey),n}function Wi(n){let{quill:e,range:t}=n;const r=e.getLines(t);let s={};if(r.length>1){const i=r[0].formats(),a=r[r.length-1].formats();s=Pe.AttributeMap.diff(a,i)||{}}e.deleteText(t,k.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,k.sources.USER),e.setSelection(t.index,k.sources.SILENT)}function Fg(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Ug=/font-weight:\s*normal/,Hg=["P","OL","UL"],vo=n=>n&&Hg.includes(n.tagName),zg=n=>{Array.from(n.querySelectorAll("br")).filter(e=>vo(e.previousElementSibling)&&vo(e.nextElementSibling)).forEach(e=>{e.parentNode?.removeChild(e)})},Gg=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter(e=>e.getAttribute("style")?.match(Ug)).forEach(e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)})};function Vg(n){n.querySelector('[id^="docs-internal-guid-"]')&&(Gg(n),zg(n))}const Wg=/\bmso-list:[^;]*ignore/i,Kg=/\bmso-list:[^;]*\bl(\d+)/i,Yg=/\bmso-list:[^;]*\blevel(\d+)/i,Xg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(Kg);if(!r)return null;const s=Number(r[1]),i=t?.match(Yg),a=i?Number(i[1]):1,l=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},Zg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach(a=>{(a.getAttribute("style")||"").match(Wg)?t.push(a):r.push(a)}),t.forEach(a=>a.parentNode?.removeChild(a));const s=n.documentElement.innerHTML,i=r.map(a=>Xg(a,s)).filter(a=>a);for(;i.length;){const a=[];let l=i.shift();for(;l;)a.push(l),l=i.length&&i[0]?.element===l.element.nextElementSibling&&i[0].id===l.id?i.shift():null;const c=document.createElement("ul");a.forEach(g=>{const d=document.createElement("li");d.setAttribute("data-list",g.type),g.indent>1&&d.setAttribute("class",`ql-indent-${g.indent-1}`),d.innerHTML=g.element.innerHTML,c.appendChild(d)});const u=a[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(c,u),a.slice(1).forEach(g=>{let{element:d}=g;f?.removeChild(d)})}};function Jg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&Zg(n)}const Qg=[Jg,Vg],em=n=>{n.documentElement&&Qg.forEach(e=>{e(n)})},tm=ft("quill:clipboard"),nm=[[Node.TEXT_NODE,gm],[Node.TEXT_NODE,xo],["br",lm],[Node.ELEMENT_NODE,xo],[Node.ELEMENT_NODE,om],[Node.ELEMENT_NODE,am],[Node.ELEMENT_NODE,fm],["li",hm],["ol, ul",dm],["pre",cm],["tr",pm],["b",ui("bold")],["i",ui("italic")],["strike",ui("strike")],["style",um]],rm=[jg,Gl].reduce((n,e)=>(n[e.keyName]=e,n),{}),yo=[Hl,zi,Hi,Wl,Xl,Jl].reduce((n,e)=>(n[e.keyName]=e,n),{});class sm extends rt{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],nm.concat(this.options.matchers??[]).forEach(r=>{let[s,i]=r;this.addMatcher(s,i)})}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[_e.blotName])return new V().insert(r||"",{[_e.blotName]:s[_e.blotName]});if(!t)return new V().insert(r||"",s);const i=this.convertHTML(t);return sr(i,`
50
+ `)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose(new V().retain(i.length()-1).delete(1)):i}normalizeHTML(e){em(e)}convertHTML(e){const t=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,s=new WeakMap,[i,a]=this.prepareMatching(r,s);return Ki(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:k.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,k.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents(new V().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),k.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",s),t&&Wi({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(t=>t[0]!=="#").join(`
51
+ `)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let s=e.clipboardData?.getData("text/plain");if(!r&&!s){const a=e.clipboardData?.getData("text/uri-list");a&&(s=this.normalizeURIList(a))}const i=Array.from(e.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(t,i);return}if(r&&i.length>0){const a=new DOMParser().parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:r,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:s}=t;const i=this.quill.getFormat(e.index),a=this.convert({text:r,html:s},i);tm.log("onPaste",a,{text:r,html:s});const l=new V().retain(e.index).delete(e.length).concat(a);this.quill.updateContents(l,k.sources.USER),this.quill.setSelection(l.length()-e.length,k.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach(i=>{const[a,l]=i;switch(a){case Node.TEXT_NODE:s.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:Array.from(e.querySelectorAll(a)).forEach(c=>{t.has(c)?t.get(c)?.push(l):t.set(c,[l])});break}}),[r,s]}}function Gt(n,e,t,r){return r.query(e)?n.reduce((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const a=t?{[e]:t}:{};return s.insert(i.insert,{...a,...i.attributes})},new V):n}function sr(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function yt(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof ke?!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 im(n,e){return n.previousElementSibling&&n.nextElementSibling&&!yt(n.previousElementSibling,e)&&!yt(n.nextElementSibling,e)}const Br=new WeakMap;function Ql(n){return n==null?!1:(Br.has(n)||(n.tagName==="PRE"?Br.set(n,!0):Br.set(n,Ql(n.parentNode))),Br.get(n))}function Ki(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((i,a)=>a(e,i,n),new V):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((i,a)=>{let l=Ki(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce((c,u)=>u(a,c,n),l),l=(s.get(a)||[]).reduce((c,u)=>u(a,c,n),l)),i.concat(l)},new V):new V}function ui(n){return(e,t,r)=>Gt(t,n,!0,r)}function am(n,e,t){const r=tt.keys(n),s=Ve.keys(n),i=At.keys(n),a={};return r.concat(s).concat(i).forEach(l=>{let c=t.query(l,W.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=rm[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=yo[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=yo[l],a[c.attrName]=c.value(n)||void 0))}),Object.entries(a).reduce((l,c)=>{let[u,f]=c;return Gt(l,u,f,t)},e)}function om(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ke){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,new V().insert(s,r.formats(n,t))}else if(r.prototype instanceof er&&!sr(e,`
52
52
  `)&&e.insert(`
53
- `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return zt(e,r.blotName,r.formats(n,t),t);return e}function lm(n,e){return sr(e,`
53
+ `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Gt(e,r.blotName,r.formats(n,t),t);return e}function lm(n,e){return sr(e,`
54
54
  `)||e.insert(`
55
- `),e}function cm(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return zt(e,"code-block",s,t)}function um(){return new V}function hm(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!sr(e,`
56
- `))return e;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce((a,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:s,...l.attributes||{}}):a,new V)}function dm(n,e,t){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),zt(e,"list",s,t)}function yo(n,e,t){if(!sr(e,`
55
+ `),e}function cm(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Gt(e,"code-block",s,t)}function um(){return new V}function hm(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!sr(e,`
56
+ `))return e;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce((a,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:s,...l.attributes||{}}):a,new V)}function dm(n,e,t){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),Gt(e,"list",s,t)}function xo(n,e,t){if(!sr(e,`
57
57
  `)){if(yt(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`
58
58
  `);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(yt(r,t))return e.insert(`
59
59
  `);const s=t.query(r);if(s&&s.prototype instanceof De)return e.insert(`
60
- `);r=r.firstChild}}}return e}function fm(n,e,t){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,a)=>{let[l,c]=a;return zt(i,l,c,t)},e),parseFloat(s.textIndent||0)>0?new V().insert(" ").concat(e):e}function pm(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return zt(e,"table",i,t)}return e}function gm(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Ql(n)){if(r.trim().length===0&&r.includes(`
61
- `)&&!im(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&yt(n.parentElement,t)||n.previousSibling instanceof Element&&yt(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&yt(n.parentElement,t)||n.nextSibling instanceof Element&&yt(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class mm extends rt{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(L.events.EDITOR_CHANGE,(r,s,i,a)=>{r===L.events.SELECTION_CHANGE?s&&a!==L.sources.SILENT&&(this.currentRange=s):r===L.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===L.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=_i(this.currentRange,s))}),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",r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const s=this.quill.getContents(),i=r.delta.invert(s);this.stack[t].push({delta:i,range:_i(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,L.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),s=a.range)}else this.lastRecorded=i;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){xo(this.stack.undo,e),xo(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,L.sources.USER);else{const t=vm(this.quill.scroll,e.delta);this.quill.setSelection(t,L.sources.USER)}}}function xo(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:t.transform(s.delta,!0),range:s.range&&_i(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function bm(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
62
- `):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,W.BLOCK)!=null):!1}function vm(n,e){const t=e.reduce((s,i)=>s+(i.delete||0),0);let r=e.length()-t;return bm(n,e)&&(r-=1),r}function _i(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class ec extends rt{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}ec.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}));Promise.all(t).then(r=>{const s=r.reduce((i,a)=>i.insert({image:a}),new V().retain(n.index).delete(n.length));this.quill.updateContents(s,G.sources.USER),this.quill.setSelection(n.index+r.length,G.sources.SILENT)})}};const ym=["insertText","insertReplacementText"];class xm extends rt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(L.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Vi({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 r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new V().retain(e.index).insert(t,r),L.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,L.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!ym.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=Em(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function Em(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Nm=/Mac/i.test(navigator.platform),wm=100,Tm=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Nm&&n.key==="a"&&n.ctrlKey===!0);class Am extends rt{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:r,event:s}=t;if(!(r instanceof Ge)||!r.uiNode)return!0;const i=getComputedStyle(r.domNode).direction==="rtl";return i&&s.key!=="ArrowRight"||!i&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(s.shiftKey?1:0),L.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Tm(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+wm,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 r=this.quill.scroll.find(t.startContainer);if(!(r instanceof Ge)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}L.register({"blots/block":xe,"blots/block/embed":De,"blots/break":Ke,"blots/container":Ut,"blots/cursor":ze,"blots/embed":Bi,"blots/inline":Ce,"blots/scroll":kg,"blots/text":Ve,"modules/clipboard":sm,"modules/history":mm,"modules/keyboard":ns,"modules/uploader":ec,"modules/input":xm,"modules/uiNode":Am});class Sm extends We{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.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 Cm=new Sm("indent","ql-indent",{scope:W.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class _m extends xe{static blotName="blockquote";static tagName="blockquote"}class Om extends xe{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class ir extends Ut{}ir.blotName="list-container";ir.tagName="OL";let ar=class extends xe{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(){L.register(ir)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),i.preventDefault()):a==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}};ar.blotName="list";ar.tagName="LI";ir.allowedChildren=[ar];ar.requiredContainer=ir;class Ki extends Ce{static blotName="bold";static tagName=["STRONG","B"];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)}}class Rm extends Ki{static blotName="italic";static tagName=["EM","I"]}class Kr extends Ce{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];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 tc(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))}}function tc(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class Lm extends Ce{static blotName="script";static tagName=["SUB","SUP"];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"}}class km extends Ki{static blotName="strike";static tagName=["S","STRIKE"]}class jm extends Ce{static blotName="underline";static tagName="U"}class Im extends Bi{static blotName="formula";static className="ql-formula";static tagName="SPAN";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>`}}const Eo=["alt","height","width"];class qm extends ke{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Eo.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return tc(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Eo.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}const No=["height","width"];class Mm extends De{static blotName="video";static className="ql-video";static tagName="IFRAME";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 No.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return Kr.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){No.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>`}}const Gn=new We("code-token","hljs",{scope:W.INLINE});class ht extends Ce{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(_e.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Gn.add(this.domNode,r)}format(e,t){e!==ht.blotName?super.format(e,t):t?Gn.add(this.domNode,t):(Gn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Gn.value(this.domNode)||this.unwrap()}}ht.blotName="code-token";ht.className="ql-token";class Me extends _e{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(),ht.blotName,!1),super.replaceWith(e,t)}}class Wn extends Ht{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Me.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,s){r===Me.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}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(a=>a!==this.uiNode).map(a=>a.textContent).join(`
60
+ `);r=r.firstChild}}}return e}function fm(n,e,t){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,a)=>{let[l,c]=a;return Gt(i,l,c,t)},e),parseFloat(s.textIndent||0)>0?new V().insert(" ").concat(e):e}function pm(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Gt(e,"table",i,t)}return e}function gm(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Ql(n)){if(r.trim().length===0&&r.includes(`
61
+ `)&&!im(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&yt(n.parentElement,t)||n.previousSibling instanceof Element&&yt(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&yt(n.parentElement,t)||n.nextSibling instanceof Element&&yt(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class mm extends rt{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(k.events.EDITOR_CHANGE,(r,s,i,a)=>{r===k.events.SELECTION_CHANGE?s&&a!==k.sources.SILENT&&(this.currentRange=s):r===k.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===k.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=Oi(this.currentRange,s))}),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",r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())})}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const s=this.quill.getContents(),i=r.delta.invert(s);this.stack[t].push({delta:i,range:Oi(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,k.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),s=a.range)}else this.lastRecorded=i;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Eo(this.stack.undo,e),Eo(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,k.sources.USER);else{const t=vm(this.quill.scroll,e.delta);this.quill.setSelection(t,k.sources.USER)}}}function Eo(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:t.transform(s.delta,!0),range:s.range&&Oi(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function bm(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`
62
+ `):t.attributes!=null?Object.keys(t.attributes).some(r=>n.query(r,W.BLOCK)!=null):!1}function vm(n,e){const t=e.reduce((s,i)=>s+(i.delete||0),0);let r=e.length()-t;return bm(n,e)&&(r-=1),r}function Oi(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class ec extends rt{constructor(e,t){super(e,t),e.root.addEventListener("drop",r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}})}upload(e,t){const r=[];Array.from(t).forEach(s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}ec.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map(r=>new Promise(s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}));Promise.all(t).then(r=>{const s=r.reduce((i,a)=>i.insert({image:a}),new V().retain(n.index).delete(n.length));this.quill.updateContents(s,G.sources.USER),this.quill.setSelection(n.index+r.length,G.sources.SILENT)})}};const ym=["insertText","insertReplacementText"];class xm extends rt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(k.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Wi({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 r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new V().retain(e.index).insert(t,r),k.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,k.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!ym.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=Em(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function Em(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const wm=/Mac/i.test(navigator.platform),Nm=100,Tm=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||wm&&n.key==="a"&&n.ctrlKey===!0);class Am extends rt{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:r,event:s}=t;if(!(r instanceof ze)||!r.uiNode)return!0;const i=getComputedStyle(r.domNode).direction==="rtl";return i&&s.key!=="ArrowRight"||!i&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(s.shiftKey?1:0),k.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",e=>{!e.defaultPrevented&&Tm(e)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Nm,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 r=this.quill.scroll.find(t.startContainer);if(!(r instanceof ze)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}k.register({"blots/block":xe,"blots/block/embed":De,"blots/break":We,"blots/container":Ht,"blots/cursor":He,"blots/embed":Fi,"blots/inline":Ce,"blots/scroll":kg,"blots/text":Ge,"modules/clipboard":sm,"modules/history":mm,"modules/keyboard":rs,"modules/uploader":ec,"modules/input":xm,"modules/uiNode":Am});class Sm extends Ve{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.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 Cm=new Sm("indent","ql-indent",{scope:W.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class _m extends xe{static blotName="blockquote";static tagName="blockquote"}class Om extends xe{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class ir extends Ht{}ir.blotName="list-container";ir.tagName="OL";let ar=class extends xe{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(){k.register(ir)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),i.preventDefault()):a==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}};ar.blotName="list";ar.tagName="LI";ir.allowedChildren=[ar];ar.requiredContainer=ir;class Yi extends Ce{static blotName="bold";static tagName=["STRONG","B"];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)}}class Rm extends Yi{static blotName="italic";static tagName=["EM","I"]}class Kr extends Ce{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];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 tc(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))}}function tc(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class Lm extends Ce{static blotName="script";static tagName=["SUB","SUP"];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"}}class km extends Yi{static blotName="strike";static tagName=["S","STRIKE"]}class jm extends Ce{static blotName="underline";static tagName="U"}class Im extends Fi{static blotName="formula";static className="ql-formula";static tagName="SPAN";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>`}}const wo=["alt","height","width"];class qm extends ke{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return wo.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return tc(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){wo.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}}const No=["height","width"];class Mm extends De{static blotName="video";static className="ql-video";static tagName="IFRAME";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 No.reduce((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t),{})}static sanitize(e){return Kr.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){No.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>`}}const Vn=new Ve("code-token","hljs",{scope:W.INLINE});class ht extends Ce{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(_e.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Vn.add(this.domNode,r)}format(e,t){e!==ht.blotName?super.format(e,t):t?Vn.add(this.domNode,t):(Vn.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Vn.value(this.domNode)||this.unwrap()}}ht.blotName="code-token";ht.className="ql-token";class Me extends _e{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(),ht.blotName,!1),super.replaceWith(e,t)}}class Kn extends zt{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===Me.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,t)}))}formatAt(e,t,r,s){r===Me.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}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(a=>a!==this.uiNode).map(a=>a.textContent).join(`
63
63
  `)}
64
- `,i=Me.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const a=this.children.reduce((c,u)=>c.concat(Bl(u,!1)),new V),l=e(s,i);a.diff(l).reduce((c,u)=>{let{retain:p,attributes:g}=u;return p?(g&&Object.keys(g).forEach(h=>{[Me.blotName,ht.blotName].includes(h)&&this.formatAt(c,p,h,g[h])}),c+p):c},0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?Me.formats(r.domNode):"plain"}">
65
- ${ts(this.code(e,t))}
66
- </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=Me.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Wn.allowedChildren=[Me];Me.requiredContainer=Wn;Me.allowedChildren=[ht,ze,Ve,Ke];const Dm=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class nc extends rt{static register(){L.register(ht,!0),L.register(Me,!0),L.register(Wn,!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((r,s)=>{let{key:i}=s;return r[i]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(L.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Wn))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:i}=r;const a=t.ownerDocument.createElement("option");a.textContent=i,a.setAttribute("value",s),t.appendChild(a)}),t.addEventListener("change",()=>{e.format(Me.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=Me.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(L.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(L.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Wn):[e]).forEach(i=>{i.highlight(this.highlightBlot,t)}),this.quill.update(L.sources.SILENT),r!=null&&this.quill.setSelection(r,L.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 ts(e).split(`
64
+ `,i=Me.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const a=this.children.reduce((c,u)=>c.concat(Bl(u,!1)),new V),l=e(s,i);a.diff(l).reduce((c,u)=>{let{retain:f,attributes:g}=u;return f?(g&&Object.keys(g).forEach(d=>{[Me.blotName,ht.blotName].includes(d)&&this.formatAt(c,f,d,g[d])}),c+f):c},0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?Me.formats(r.domNode):"plain"}">
65
+ ${ns(this.code(e,t))}
66
+ </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=Me.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Kn.allowedChildren=[Me];Me.requiredContainer=Kn;Me.allowedChildren=[ht,He,Ge,We];const Dm=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class nc extends rt{static register(){k.register(ht,!0),k.register(Me,!0),k.register(Kn,!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((r,s)=>{let{key:i}=s;return r[i]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(k.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Kn))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:i}=r;const a=t.ownerDocument.createElement("option");a.textContent=i,a.setAttribute("value",s),t.appendChild(a)}),t.addEventListener("change",()=>{e.format(Me.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=Me.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(k.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(k.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Kn):[e]).forEach(i=>{i.highlight(this.highlightBlot,t)}),this.quill.update(k.sources.SILENT),r!=null&&this.quill.setSelection(r,k.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 ns(e).split(`
67
67
  `).reduce((s,i,a)=>(a!==0&&s.insert(`
68
- `,{[_e.blotName]:t}),s.insert(i)),new V);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(_e.className),r.innerHTML=Dm(this.options.hljs,t,e),Wi(this.quill.scroll,r,[(s,i)=>{const a=Gn.value(s);return a?i.compose(new V().retain(i.length(),{[ht.blotName]:a})):i}],[(s,i)=>s.data.split(`
68
+ `,{[_e.blotName]:t}),s.insert(i)),new V);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(_e.className),r.innerHTML=Dm(this.options.hljs,t,e),Ki(this.quill.scroll,r,[(s,i)=>{const a=Vn.value(s);return a?i.compose(new V().retain(i.length(),{[ht.blotName]:a})):i}],[(s,i)=>s.data.split(`
69
69
  `).reduce((a,l,c)=>(c!==0&&a.insert(`
70
- `,{[_e.blotName]:t}),a.insert(l)),i)],new WeakMap)}}nc.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"}]};let ct=class rc extends xe{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Yi()),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===rc.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()}},Pt=class extends Ut{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),s=t.next.formats();if(r.table!==s.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}},Et=class extends Ut{static blotName="table-body";static tagName="TBODY"};class Yr extends Ut{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Pt),t=e.reduce((r,s)=>Math.max(s.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=ct.formats(r.children.head.domNode));const i=this.scroll.create(ct.blotName,s);r.appendChild(i),i.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(Et);t==null||t.children.head==null||t.children.forEach(r=>{const s=r.children.at(e);s?.remove()})}insertColumn(e){const[t]=this.descendant(Et);t==null||t.children.head==null||t.children.forEach(r=>{const s=r.children.at(e),i=ct.formats(r.children.head.domNode),a=this.scroll.create(ct.blotName,i);r.insertBefore(a,s)})}insertRow(e){const[t]=this.descendant(Et);if(t==null||t.children.head==null)return;const r=Yi(),s=this.scroll.create(Pt.blotName);t.children.head.children.forEach(()=>{const a=this.scroll.create(ct.blotName,r);s.appendChild(a)});const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}Yr.allowedChildren=[Et];Et.requiredContainer=Yr;Et.allowedChildren=[Pt];Pt.requiredContainer=Et;Pt.allowedChildren=[ct];ct.requiredContainer=Pt;function Yi(){return`row-${Math.random().toString(36).slice(2,6)}`}let Pm=class extends rt{static register(){L.register(ct),L.register(Pt),L.register(Et),L.register(Yr)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Yr).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(L.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(L.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(L.sources.USER),this.quill.setSelection(t,L.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,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==ct.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=i.cellOffset();r.insertColumn(a+e),this.quill.update(L.sources.USER);let l=s.rowOffset();e===0&&(l+=1),this.quill.setSelection(t.index+l,t.length,L.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=s.rowOffset();r.insertRow(a+e),this.quill.update(L.sources.USER),e>0?this.quill.setSelection(t,L.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,L.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce(i=>{const a=new Array(t).fill(`
71
- `).join("");return i.insert(a,{table:Yi()})},new V().retain(r.index));this.quill.updateContents(s,L.sources.USER),this.quill.setSelection(r.index,L.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(L.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(L.events.TEXT_CHANGE,(r,s,i)=>{i===L.sources.USER&&this.balanceTables()}),!0):!1)})}};const wo=ft("quill:toolbar");class Xi extends rt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),$m(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){wo.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(r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(L.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(s=>s.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){wo.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const l=e.options[e.selectedIndex];l.hasAttribute("selected")?i=!1:i=l.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof ke){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents(new V().retain(a.index).delete(a.length).insert({[t]:i}),L.sources.USER)}else this.quill.format(t,i,L.sources.USER);this.update(a)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,i]=r;if(i.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[s]==null)a=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let l=t[s];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${l}"]`)}a==null?(i.value="",i.selectedIndex=-1):a.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const a=t[s],l=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}})}}Xi.DEFAULTS={};function To(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function $m(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(s=>{if(typeof s=="string")To(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Bm(r,i,a):To(r,i,a)}}),n.appendChild(r)})}function Bm(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)}),n.appendChild(r)}Xi.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,W.INLINE)!=null&&this.quill.format(t,!1,L.sources.USER)})}else this.quill.removeFormat(n.index,n.length,L.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",L.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,L.sources.USER),this.quill.format("direction",n,L.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,L.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,L.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,L.sources.USER):this.quill.format("list","unchecked",L.sources.USER):this.quill.format("list",n,L.sources.USER)}}};const Fm='<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>',Um='<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>',Hm='<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>',zm='<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>',Gm='<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>',Vm='<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>',Wm='<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>',Km='<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>',Ao='<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>',Ym='<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>',Xm='<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>',Zm='<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>',Jm='<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>',Qm='<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>',e1='<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>',t1='<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>',n1='<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>',r1='<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>',s1='<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>',i1='<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>',a1='<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>',o1='<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>',l1='<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>',c1='<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>',u1='<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>',h1='<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>',d1='<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>',f1='<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>',p1='<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>',g1='<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>',m1='<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>',b1='<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>',v1='<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>',tr={align:{"":Fm,center:Um,right:Hm,justify:zm},background:Gm,blockquote:Vm,bold:Wm,clean:Km,code:Ao,"code-block":Ao,color:Ym,direction:{"":Xm,rtl:Zm},formula:Jm,header:{1:Qm,2:e1,3:t1,4:n1,5:r1,6:s1},italic:i1,image:a1,indent:{"+1":o1,"-1":l1},link:c1,list:{bullet:u1,check:h1,ordered:d1},script:{sub:f1,super:p1},strike:g1,table:m1,underline:b1,video:v1},y1='<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 So=0;function Co(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class rs{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"),Co(this.label,"aria-expanded"),Co(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 r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=y1,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-${So}`,So+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),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 r=this.container.querySelector(".ql-selected");e!==r&&(r?.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 r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class sc extends rs{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(r=>{r.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 r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class ic extends rs{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const x1=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class ac{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,x1(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,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>s.right&&(a=s.right-i.right,this.root.style.left=`${t+a}px`),i.left<s.left&&(a=s.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>s.bottom){const l=i.bottom-i.top,c=e.bottom-e.top+l;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const E1=[!1,"center","right","justify"],N1=["#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"],w1=[!1,"serif","monospace"],T1=["1","2","3",!1],A1=["small",!1,"large","huge"];class or extends bn{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(s.target)||i.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")r.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")r.innerHTML=t[i];else{const a=r.value||"";a!=null&&t[i][a]&&(r.innerHTML=t[i][a])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Un(s,E1),typeof t.align=="object"))return new ic(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Un(s,N1,i==="background"?"#ffffff":"#000000"),new sc(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Un(s,w1):s.classList.contains("ql-header")?Un(s,T1):s.classList.contains("ql-size")&&Un(s,A1)),new rs(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(G.events.EDITOR_CHANGE,r)}}or.DEFAULTS=xt({},bn.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 oc extends ac{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 r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),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,G.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,G.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=S1(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,G.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",G.sources.USER),this.quill.setSelection(r+2,G.sources.USER)}break}}this.textbox.value="",this.hide()}}function S1(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 Un(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)})}const C1=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class _1 extends oc{static 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("");constructor(e,t){super(e,t),this.quill.on(G.events.EDITOR_CHANGE,(r,s,i,a)=>{if(r===G.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===G.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const l=this.quill.getLines(s.index,s.length);if(l.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),p=Math.min(c.length()-1,s.index+s.length-u),g=this.quill.getBounds(new Dt(u,p));g!=null&&this.position(g)}}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(G.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),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class lc extends or{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=C1),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new _1(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),tr),this.buildPickers(e.container.querySelectorAll("select"),tr))}}lc.DEFAULTS=xt({},or.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,L.sources.USER)}}}}});const O1=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class R1 extends oc{static 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("");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,G.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(G.events.SELECTION_CHANGE,(e,t,r)=>{if(e!=null){if(e.length===0&&r===G.sources.USER){const[s,i]=this.quill.scroll.descendant(Kr,e.index);if(s!=null){this.linkRange=new Dt(e.index-i,s.length());const a=Kr.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class cc extends or{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=O1),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"),tr),this.buildPickers(e.container.querySelectorAll("select"),tr),this.tooltip=new R1(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}cc.DEFAULTS=xt({},or.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:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,L.sources.USER)}}}}});L.register({"attributors/attribute/direction":Gl,"attributors/class/align":Ul,"attributors/class/background":qg,"attributors/class/color":Ig,"attributors/class/direction":Vl,"attributors/class/font":Yl,"attributors/class/size":Zl,"attributors/style/align":Hl,"attributors/style/background":Hi,"attributors/style/color":Ui,"attributors/style/direction":Wl,"attributors/style/font":Xl,"attributors/style/size":Jl},!0);L.register({"formats/align":Ul,"formats/direction":Vl,"formats/indent":Cm,"formats/background":Hi,"formats/color":Ui,"formats/font":Yl,"formats/size":Zl,"formats/blockquote":_m,"formats/code-block":_e,"formats/header":Om,"formats/list":ar,"formats/bold":Ki,"formats/code":zi,"formats/italic":Rm,"formats/link":Kr,"formats/script":Lm,"formats/strike":km,"formats/underline":jm,"formats/formula":Im,"formats/image":qm,"formats/video":Mm,"modules/syntax":nc,"modules/table":Pm,"modules/toolbar":Xi,"themes/bubble":lc,"themes/snow":cc,"ui/icons":tr,"ui/picker":rs,"ui/icon-picker":ic,"ui/color-picker":sc,"ui/tooltip":ac},!0);class ss extends _.Component{constructor(e){super(e),this.editingAreaRef=_.createRef(),this.containerRef=_.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=(r,s,i,a)=>{r==="text-change"?this.onEditorChangeText?.(this.editor.root.innerHTML,s,a,this.unprivilegedEditor):r==="selection-change"&&this.onEditorChangeSelection?.(s,a,this.unprivilegedEditor)};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(_.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(_.Children.count(e.children)&&_.Children.only(e.children)?.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 r=this.getEditorContents(),s=e.value??"";this.isEqualValue(s,r)||this.setEditorContents(this.editor,s)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(r=>!bt(e[r],this.props[r]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!bt(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 r=this.editor.getContents(),s=this.editor.getSelection();this.regenerationSnapshot={delta:r,selection:s},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){const{delta:r,selection:s}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const i=this.editor;i.setContents(r),_o(()=>this.setEditorSelection(i,s))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);const e=this.props.modules?.toolbar;if(!(typeof e=="object"&&e&&"container"in e&&typeof e.container=="string"||typeof e=="string")){const r=this.containerRef.current?.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 r=new L(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(r,t.tabIndex),this.hookEditor(r),r}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)?bt(e.ops,t.ops):bt(e,t)}setEditorContents(e,t){this.value=t;const r=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),_o(()=>this.setEditorSelection(e,r))}setEditorSelection(e,t){if(this.selection=t,t){const r=e.getLength();t.index=Math.max(0,Math.min(t.index,r-1)),t.length=Math.max(0,Math.min(t.length,r-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){e?.scroll?.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:r}=this.state,s={key:r,ref:this.editingAreaRef};return _.Children.count(e)?_.cloneElement(_.Children.only(e),s):t?_.createElement("pre",{...s}):_.createElement("div",{...s})}render(){return _.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,r,s){if(!this.editor)return;const i=this.isDelta(this.value)?s.getContents():s.getHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=i,this.props.onChange?.(e,t,r,s))}onEditorChangeSelection(e,t,r){if(!this.editor)return;const s=this.getEditorSelection(),i=!s&&e,a=s&&!e;bt(e,s)||(this.selection=e,this.props.onChangeSelection?.(e,t,r),i?this.props.onFocus?.(e,t,r):a&&this.props.onBlur?.(s,t,r))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}ss.displayName="React Quill";ss.Quill=L;ss.defaultProps={theme:"snow",modules:{},readOnly:!1};function _o(n){Promise.resolve().then(n)}const L1=({name:n,label:e,message:t,required:r,value:s,onChange:i,error:a,minimizeToolbar:l=!0})=>{const[c,u]=_.useState(!1),p=_.useRef(null),g=_.useCallback(()=>{const E=p.current?.getEditor();u(y=>{const N=!y;return setTimeout(N?()=>E?.focus():()=>E?.focus(),100),N})},[]);_.useEffect(()=>{const E=y=>{y.key==="Escape"&&c&&g()};return c&&(document.addEventListener("keydown",E),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",E),document.body.style.overflow=""}},[c,g]);const h={toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike"],[{align:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{color:[]},{background:[]}],["link","image"],["clean"]]},m={toolbar:[["bold","italic","underline","strike"],[{align:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],["clean"]]};return d.jsxs(d.Fragment,{children:[d.jsxs("label",{htmlFor:n,children:[e," ",r&&d.jsx("span",{className:"text-danger",children:"*"})]}),d.jsxs("div",{className:`quill-editor-wrapper ${c?"fullscreen":""}`,children:[d.jsx(ss,{ref:p,id:n,theme:"snow",value:s,onChange:i,modules:l?m:h}),d.jsx("button",{type:"button",className:"custom-expand-btn",onClick:g,title:c?"Minimize Editor":"Expand Editor",children:c?d.jsx(Mc,{size:16}):d.jsx(qc,{size:16})})]}),a?d.jsx("small",{className:"form-message text-danger",children:a}):t&&d.jsx("small",{className:"form-message",children:t})]})},k1=({progress:n,visible:e})=>e?d.jsx("div",{className:"loading-bar-container",children:d.jsx("div",{className:"loading-bar",style:{width:`${n}%`,transition:"width 300ms ease-in-out"}})}):null,j1=({className:n="",children:e})=>d.jsx("ul",{className:`block-list ${n}`,children:e}),I1=({children:n})=>d.jsx("li",{children:n}),q1=({children:n,className:e="",view:t="list",gridColumn:r=1})=>d.jsx("div",{className:`divcard-table ${t==="grid"?"grid-mode":""} ${e}`,style:t==="grid"?{gridTemplateColumns:`repeat(${r}, 1fr)`}:{},children:n}),M1=({children:n})=>d.jsx("div",{className:"table-row header",children:n}),D1=({children:n})=>d.jsx(d.Fragment,{children:n}),P1=({children:n,className:e="",isActive:t=!1})=>d.jsx("div",{className:`table-row ${t?"active":""} ${e}`,children:n}),$1=({children:n,className:e="",hideOnGrid:t=!1})=>d.jsx("div",{className:`cell ${t?"hide-ongrid":""} ${e}`,children:n}),B1=({children:n})=>d.jsx("div",{className:"table-row footer",children:n}),F1=({children:n,className:e,...t})=>d.jsx("table",{className:e||void 0,...t,children:n}),U1=({children:n,className:e,...t})=>d.jsx("thead",{className:e||void 0,...t,children:n}),H1=({children:n,className:e,...t})=>d.jsx("tbody",{className:e||void 0,...t,children:n}),z1=({children:n,className:e,...t})=>d.jsx("tfoot",{className:e||void 0,...t,children:n}),G1=({children:n,className:e,...t})=>d.jsx("tr",{className:e||void 0,...t,children:n}),V1=({children:n,header:e=!1,className:t,...r})=>{const s=e?"th":"td";return d.jsx(s,{className:t||void 0,...r,children:n})},W1=({count:n,handleMultipleDelete:e})=>d.jsxs("div",{className:"selected-toolbar",children:[d.jsx(Pe,{className:"btn-icon btn-danger",onClick:e,children:d.jsx($c,{})}),d.jsxs("p",{children:[n," item selected"]})]}),K1=({startIndex:n,endIndex:e,currentPage:t,totalData:r,itemsPerPage:s,setItemsPerPage:i,setCurrentPage:a,totalPages:l,showPerPage:c=!0})=>d.jsxs("div",{className:"pagination-toolbar",children:[c&&d.jsxs("div",{className:"pagination-select",children:[d.jsx("p",{children:"Baris per halaman:"}),d.jsx(Qe,{name:"row_perpage",size:"sm",options:[{value:"10",label:"10"},{value:"20",label:"20"},{value:"30",label:"30"},{value:"50",label:"50"}],value:s.toString(),onChange:u=>{i(Number(u.target.value)),a(1)}})]}),d.jsx("div",{className:"pagination-nav",children:` ${n+1} - ${Math.min(e,r)} dari ${r}`}),d.jsx("div",{className:"pagination-button",children:d.jsxs("div",{className:"btn-group",children:[d.jsx(Pe,{className:"btn-icon btn-info",onClick:()=>a(1),disabled:t<=1,children:d.jsx(Dc,{})}),d.jsx(Pe,{className:"btn-icon btn-info",onClick:()=>a(t-1),disabled:t<=1,children:d.jsx(jc,{})}),d.jsx(Pe,{className:"btn-icon btn-info",onClick:()=>a(Math.min(t+1,l)),disabled:t>=l,children:d.jsx(Ic,{})}),d.jsx(Pe,{className:"btn-icon btn-info",onClick:()=>a(l),disabled:t>=l,children:d.jsx(Pc,{})})]})})]}),Y1=({count:n,selectedItem:e,selectedRows:t})=>d.jsxs("div",{className:"selected-toolbar-block",style:{borderRadius:"0 0 4px 0"},children:[d.jsxs("span",{children:[n," item selected"]}),d.jsxs(Pe,{className:"btn btn-primary",onClick:()=>e(t),children:[d.jsx(hi,{})," Gunakan"]})]});exports.Accordion=su;exports.AccordionSection=iu;exports.AccordionSectionBody=Uo;exports.AccordionSectionFooter=Ho;exports.Alert=Qc;exports.Badge=Nc;exports.Box=wc;exports.Button=Pe;exports.Callout=tu;exports.Card=mc;exports.CardBody=pc;exports.CardFooter=gc;exports.CardHeader=fc;exports.Checkbox=Ri;exports.CircularProgress=au;exports.CircularProgressWithLabel=lu;exports.ClearInput=Au;exports.ConfirmationAlert=eu;exports.DatePicker=Yo;exports.DivTable=q1;exports.DivTableBody=D1;exports.DivTableCell=$1;exports.DivTableFooter=B1;exports.DivTableHeader=M1;exports.DivTableRow=P1;exports.Dropdown=yc;exports.DropdownContent=Ec;exports.DropdownDatePicker=Xo;exports.DropdownMenu=vc;exports.DropdownToggle=xc;exports.FormCheckbox=gu;exports.FormContainer=fu;exports.FormGroup=pu;exports.FormRadio=mu;exports.Input=di;exports.InputDate=Jo;exports.InputFile=el;exports.InputImageSize=Cu;exports.InputTextArea=tl;exports.InputTime=Qo;exports.InputWithAction=Su;exports.LinearProgress=ou;exports.ListItem=I1;exports.ListView=j1;exports.LoadingBar=k1;exports.Modal=Fo;exports.ModalBody=$o;exports.ModalFooter=Bo;exports.ModalHeader=Po;exports.Popover=ru;exports.Radio=nl;exports.RadioButtonGroup=rl;exports.ReactQuillEditor=L1;exports.Select=Qe;exports.SelectMultiple=sl;exports.SelectWithSearch=il;exports.Spinner=bc;exports.Switch=al;exports.Tab=ui;exports.TabGroup=Oo;exports.Table=F1;exports.TableBody=H1;exports.TableCell=V1;exports.TableDeleteSelectedItems=W1;exports.TableFooter=z1;exports.TableHeader=U1;exports.TablePaginating=K1;exports.TablePickSelectedItems=Y1;exports.TableRow=G1;exports.Tabs=Tc;exports.TimePicker=Zo;exports.Tooltip=nu;
70
+ `,{[_e.blotName]:t}),a.insert(l)),i)],new WeakMap)}}nc.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"}]};let ct=class rc extends xe{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Xi()),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===rc.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()}},Pt=class extends Ht{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(t=>{if(t.next==null)return;const r=t.formats(),s=t.next.formats();if(r.table!==s.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}},Et=class extends Ht{static blotName="table-body";static tagName="TBODY"};class Yr extends Ht{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Pt),t=e.reduce((r,s)=>Math.max(s.children.length,r),0);e.forEach(r=>{new Array(t-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=ct.formats(r.children.head.domNode));const i=this.scroll.create(ct.blotName,s);r.appendChild(i),i.optimize()})})}cells(e){return this.rows().map(t=>t.children.at(e))}deleteColumn(e){const[t]=this.descendant(Et);t==null||t.children.head==null||t.children.forEach(r=>{const s=r.children.at(e);s?.remove()})}insertColumn(e){const[t]=this.descendant(Et);t==null||t.children.head==null||t.children.forEach(r=>{const s=r.children.at(e),i=ct.formats(r.children.head.domNode),a=this.scroll.create(ct.blotName,i);r.insertBefore(a,s)})}insertRow(e){const[t]=this.descendant(Et);if(t==null||t.children.head==null)return;const r=Xi(),s=this.scroll.create(Pt.blotName);t.children.head.children.forEach(()=>{const a=this.scroll.create(ct.blotName,r);s.appendChild(a)});const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map(t=>t)}}Yr.allowedChildren=[Et];Et.requiredContainer=Yr;Et.allowedChildren=[Pt];Pt.requiredContainer=Et;Pt.allowedChildren=[ct];ct.requiredContainer=Pt;function Xi(){return`row-${Math.random().toString(36).slice(2,6)}`}let Pm=class extends rt{static register(){k.register(ct),k.register(Pt),k.register(Et),k.register(Yr)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Yr).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(k.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(k.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(k.sources.USER),this.quill.setSelection(t,k.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,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==ct.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=i.cellOffset();r.insertColumn(a+e),this.quill.update(k.sources.USER);let l=s.rowOffset();e===0&&(l+=1),this.quill.setSelection(t.index+l,t.length,k.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=s.rowOffset();r.insertRow(a+e),this.quill.update(k.sources.USER),e>0?this.quill.setSelection(t,k.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,k.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce(i=>{const a=new Array(t).fill(`
71
+ `).join("");return i.insert(a,{table:Xi()})},new V().retain(r.index));this.quill.updateContents(s,k.sources.USER),this.quill.setSelection(r.index,k.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(k.events.SCROLL_OPTIMIZE,e=>{e.some(t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(k.events.TEXT_CHANGE,(r,s,i)=>{i===k.sources.USER&&this.balanceTables()}),!0):!1)})}};const To=ft("quill:toolbar");class Zi extends rt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),$m(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){To.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(r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(k.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find(s=>s.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){To.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const l=e.options[e.selectedIndex];l.hasAttribute("selected")?i=!1:i=l.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof ke){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents(new V().retain(a.index).delete(a.length).insert({[t]:i}),k.sources.USER)}else this.quill.format(t,i,k.sources.USER);this.update(a)}),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,i]=r;if(i.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[s]==null)a=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let l=t[s];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${l}"]`)}a==null?(i.value="",i.selectedIndex=-1):a.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const a=t[s],l=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}})}}Zi.DEFAULTS={};function Ao(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function $m(n,e){Array.isArray(e[0])||(e=[e]),e.forEach(t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach(s=>{if(typeof s=="string")Ao(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Bm(r,i,a):Ao(r,i,a)}}),n.appendChild(r)})}function Bm(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach(s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)}),n.appendChild(r)}Zi.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,W.INLINE)!=null&&this.quill.format(t,!1,k.sources.USER)})}else this.quill.removeFormat(n.index,n.length,k.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",k.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,k.sources.USER),this.quill.format("direction",n,k.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,k.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,k.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,k.sources.USER):this.quill.format("list","unchecked",k.sources.USER):this.quill.format("list",n,k.sources.USER)}}};const Fm='<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>',Um='<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>',Hm='<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>',zm='<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>',Gm='<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>',Vm='<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>',Wm='<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>',Km='<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>',So='<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>',Ym='<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>',Xm='<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>',Zm='<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>',Jm='<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>',Qm='<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>',e1='<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>',t1='<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>',n1='<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>',r1='<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>',s1='<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>',i1='<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>',a1='<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>',o1='<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>',l1='<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>',c1='<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>',u1='<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>',h1='<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>',d1='<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>',f1='<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>',p1='<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>',g1='<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>',m1='<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>',b1='<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>',v1='<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>',nr={align:{"":Fm,center:Um,right:Hm,justify:zm},background:Gm,blockquote:Vm,bold:Wm,clean:Km,code:So,"code-block":So,color:Ym,direction:{"":Xm,rtl:Zm},formula:Jm,header:{1:Qm,2:e1,3:t1,4:n1,5:r1,6:s1},italic:i1,image:a1,indent:{"+1":o1,"-1":l1},link:c1,list:{bullet:u1,check:h1,ordered:d1},script:{sub:f1,super:p1},strike:g1,table:m1,underline:b1,video:v1},y1='<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 Co=0;function _o(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class ss{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"),_o(this.label,"aria-expanded"),_o(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 r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",()=>{this.selectItem(t,!0)}),t.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=y1,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-${Co}`,Co+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)}),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 r=this.container.querySelector(".ql-selected");e!==r&&(r?.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 r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class sc extends ss{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(r=>{r.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 r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class ic extends ss{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=t[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const x1=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};class ac{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,x1(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,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>s.right&&(a=s.right-i.right,this.root.style.left=`${t+a}px`),i.left<s.left&&(a=s.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>s.bottom){const l=i.bottom-i.top,c=e.bottom-e.top+l;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const E1=[!1,"center","right","justify"],w1=["#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"],N1=[!1,"serif","monospace"],T1=["1","2","3",!1],A1=["small",!1,"large","huge"];class or extends vn{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(s.target)||i.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")r.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")r.innerHTML=t[i];else{const a=r.value||"";a!=null&&t[i][a]&&(r.innerHTML=t[i][a])}})})}buildPickers(e,t){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Hn(s,E1),typeof t.align=="object"))return new ic(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Hn(s,w1,i==="background"?"#ffffff":"#000000"),new sc(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Hn(s,N1):s.classList.contains("ql-header")?Hn(s,T1):s.classList.contains("ql-size")&&Hn(s,A1)),new ss(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(G.events.EDITOR_CHANGE,r)}}or.DEFAULTS=xt({},vn.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 oc extends ac{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 r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),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,G.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,G.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=S1(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,G.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",G.sources.USER),this.quill.setSelection(r+2,G.sources.USER)}break}}this.textbox.value="",this.hide()}}function S1(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 Hn(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)})}const C1=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class _1 extends oc{static 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("");constructor(e,t){super(e,t),this.quill.on(G.events.EDITOR_CHANGE,(r,s,i,a)=>{if(r===G.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===G.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const l=this.quill.getLines(s.index,s.length);if(l.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),f=Math.min(c.length()-1,s.index+s.length-u),g=this.quill.getBounds(new Dt(u,f));g!=null&&this.position(g)}}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(G.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),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class lc extends or{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=C1),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new _1(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),nr),this.buildPickers(e.container.querySelectorAll("select"),nr))}}lc.DEFAULTS=xt({},or.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,k.sources.USER)}}}}});const O1=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class R1 extends oc{static 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("");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,G.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()}),this.quill.on(G.events.SELECTION_CHANGE,(e,t,r)=>{if(e!=null){if(e.length===0&&r===G.sources.USER){const[s,i]=this.quill.scroll.descendant(Kr,e.index);if(s!=null){this.linkRange=new Dt(e.index-i,s.length());const a=Kr.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class cc extends or{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=O1),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"),nr),this.buildPickers(e.container.querySelectorAll("select"),nr),this.tooltip=new R1(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(t,r)=>{e.handlers.link.call(e,!r.format.link)}))}}cc.DEFAULTS=xt({},or.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:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,k.sources.USER)}}}}});k.register({"attributors/attribute/direction":Gl,"attributors/class/align":Ul,"attributors/class/background":qg,"attributors/class/color":Ig,"attributors/class/direction":Vl,"attributors/class/font":Yl,"attributors/class/size":Zl,"attributors/style/align":Hl,"attributors/style/background":zi,"attributors/style/color":Hi,"attributors/style/direction":Wl,"attributors/style/font":Xl,"attributors/style/size":Jl},!0);k.register({"formats/align":Ul,"formats/direction":Vl,"formats/indent":Cm,"formats/background":zi,"formats/color":Hi,"formats/font":Yl,"formats/size":Zl,"formats/blockquote":_m,"formats/code-block":_e,"formats/header":Om,"formats/list":ar,"formats/bold":Yi,"formats/code":Gi,"formats/italic":Rm,"formats/link":Kr,"formats/script":Lm,"formats/strike":km,"formats/underline":jm,"formats/formula":Im,"formats/image":qm,"formats/video":Mm,"modules/syntax":nc,"modules/table":Pm,"modules/toolbar":Zi,"themes/bubble":lc,"themes/snow":cc,"ui/icons":nr,"ui/picker":ss,"ui/icon-picker":ic,"ui/color-picker":sc,"ui/tooltip":ac},!0);class is extends _.Component{constructor(e){super(e),this.editingAreaRef=_.createRef(),this.containerRef=_.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=(r,s,i,a)=>{r==="text-change"?this.onEditorChangeText?.(this.editor.root.innerHTML,s,a,this.unprivilegedEditor):r==="selection-change"&&this.onEditorChangeSelection?.(s,a,this.unprivilegedEditor)};const t=this.isControlled()?e.value:e.defaultValue;this.value=t??""}validateProps(e){if(_.Children.count(e.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(_.Children.count(e.children)&&_.Children.only(e.children)?.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 r=this.getEditorContents(),s=e.value??"";this.isEqualValue(s,r)||this.setEditorContents(this.editor,s)}return e.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,e.readOnly),[...this.cleanProps,...this.dirtyProps].some(r=>!bt(e[r],this.props[r]))}shouldComponentRegenerate(e){return this.dirtyProps.some(t=>!bt(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 r=this.editor.getContents(),s=this.editor.getSelection();this.regenerationSnapshot={delta:r,selection:s},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==t.generation){const{delta:r,selection:s}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const i=this.editor;i.setContents(r),Oo(()=>this.setEditorSelection(i,s))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);const e=this.props.modules?.toolbar;if(!(typeof e=="object"&&e&&"container"in e&&typeof e.container=="string"||typeof e=="string")){const r=this.containerRef.current?.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 r=new k(e,t);return t.tabIndex!=null&&this.setEditorTabIndex(r,t.tabIndex),this.hookEditor(r),r}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)?bt(e.ops,t.ops):bt(e,t)}setEditorContents(e,t){this.value=t;const r=this.getEditorSelection();typeof t=="string"?e.setContents(e.clipboard.convert({html:t})):e.setContents(t),Oo(()=>this.setEditorSelection(e,r))}setEditorSelection(e,t){if(this.selection=t,t){const r=e.getLength();t.index=Math.max(0,Math.min(t.index,r-1)),t.length=Math.max(0,Math.min(t.length,r-1-t.index)),e.setSelection(t)}}setEditorTabIndex(e,t){e?.scroll?.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:r}=this.state,s={key:r,ref:this.editingAreaRef};return _.Children.count(e)?_.cloneElement(_.Children.only(e),s):t?_.createElement("pre",{...s}):_.createElement("div",{...s})}render(){return _.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,r,s){if(!this.editor)return;const i=this.isDelta(this.value)?s.getContents():s.getHTML();i!==this.getEditorContents()&&(this.lastDeltaChangeSet=t,this.value=i,this.props.onChange?.(e,t,r,s))}onEditorChangeSelection(e,t,r){if(!this.editor)return;const s=this.getEditorSelection(),i=!s&&e,a=s&&!e;bt(e,s)||(this.selection=e,this.props.onChangeSelection?.(e,t,r),i?this.props.onFocus?.(e,t,r):a&&this.props.onBlur?.(s,t,r))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}is.displayName="React Quill";is.Quill=k;is.defaultProps={theme:"snow",modules:{},readOnly:!1};function Oo(n){Promise.resolve().then(n)}const L1=({name:n,label:e,message:t,required:r,value:s,onChange:i,error:a,minimizeToolbar:l=!0})=>{const[c,u]=_.useState(!1),f=_.useRef(null),g=_.useCallback(()=>{const y=f.current?.getEditor();u(x=>{const w=!x;return setTimeout(w?()=>y?.focus():()=>y?.focus(),100),w})},[]);_.useEffect(()=>{const y=x=>{x.key==="Escape"&&c&&g()};return c&&(document.addEventListener("keydown",y),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",y),document.body.style.overflow=""}},[c,g]);const d={toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike"],[{align:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],[{color:[]},{background:[]}],["link","image"],["clean"]]},m={toolbar:[["bold","italic","underline","strike"],[{align:[]}],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],["clean"]]};return h.jsxs(h.Fragment,{children:[h.jsxs("label",{htmlFor:n,children:[e," ",r&&h.jsx("span",{className:"text-danger",children:"*"})]}),h.jsxs("div",{className:`quill-editor-wrapper ${c?"fullscreen":""}`,children:[h.jsx(is,{ref:f,id:n,theme:"snow",value:s,onChange:i,modules:l?m:d}),h.jsx("button",{type:"button",className:"custom-expand-btn",onClick:g,title:c?"Minimize Editor":"Expand Editor",children:c?h.jsx(Mc,{size:16}):h.jsx(qc,{size:16})})]}),a?h.jsx("small",{className:"form-message text-danger",children:a}):t&&h.jsx("small",{className:"form-message",children:t})]})},k1=({progress:n,visible:e})=>e?h.jsx("div",{className:"loading-bar-container",children:h.jsx("div",{className:"loading-bar",style:{width:`${n}%`,transition:"width 300ms ease-in-out"}})}):null,j1=({className:n="",children:e})=>h.jsx("ul",{className:`block-list ${n}`,children:e}),I1=({children:n})=>h.jsx("li",{children:n}),q1=({children:n,className:e="",view:t="list",gridColumn:r=1})=>h.jsx("div",{className:`divcard-table ${t==="grid"?"grid-mode":""} ${e}`,style:t==="grid"?{gridTemplateColumns:`repeat(${r}, 1fr)`}:{},children:n}),M1=({children:n})=>h.jsx("div",{className:"table-row header",children:n}),D1=({children:n})=>h.jsx(h.Fragment,{children:n}),P1=({children:n,className:e="",isActive:t=!1})=>h.jsx("div",{className:`table-row ${t?"active":""} ${e}`,children:n}),$1=({children:n,className:e="",hideOnGrid:t=!1})=>h.jsx("div",{className:`cell ${t?"hide-ongrid":""} ${e}`,children:n}),B1=({children:n})=>h.jsx("div",{className:"table-row footer",children:n}),F1=({children:n,className:e,...t})=>h.jsx("table",{className:e||void 0,...t,children:n}),U1=({children:n,className:e,...t})=>h.jsx("thead",{className:e||void 0,...t,children:n}),H1=({children:n,className:e,...t})=>h.jsx("tbody",{className:e||void 0,...t,children:n}),z1=({children:n,className:e,...t})=>h.jsx("tfoot",{className:e||void 0,...t,children:n}),G1=({children:n,className:e,...t})=>h.jsx("tr",{className:e||void 0,...t,children:n}),V1=({children:n,header:e=!1,className:t,...r})=>{const s=e?"th":"td";return h.jsx(s,{className:t||void 0,...r,children:n})},W1=({count:n,handleMultipleDelete:e})=>h.jsxs("div",{className:"selected-toolbar",children:[h.jsx(Je,{className:"btn-icon btn-danger",onClick:e,children:h.jsx($c,{})}),h.jsxs("p",{children:[n," item selected"]})]}),K1=({startIndex:n,endIndex:e,currentPage:t,totalData:r,itemsPerPage:s,setItemsPerPage:i,setCurrentPage:a,totalPages:l,showPerPage:c=!0})=>h.jsxs("div",{className:"pagination-toolbar",children:[c&&h.jsxs("div",{className:"pagination-select",children:[h.jsx("p",{children:"Baris per halaman:"}),h.jsx(Qe,{name:"row_perpage",size:"sm",options:[{value:"10",label:"10"},{value:"20",label:"20"},{value:"30",label:"30"},{value:"50",label:"50"}],value:s.toString(),onChange:u=>{i(Number(u.target.value)),a(1)}})]}),h.jsx("div",{className:"pagination-nav",children:` ${n+1} - ${Math.min(e,r)} dari ${r}`}),h.jsx("div",{className:"pagination-button",children:h.jsxs("div",{className:"btn-group",children:[h.jsx(Je,{className:"btn-icon btn-info",onClick:()=>a(1),disabled:t<=1,children:h.jsx(Dc,{})}),h.jsx(Je,{className:"btn-icon btn-info",onClick:()=>a(t-1),disabled:t<=1,children:h.jsx(jc,{})}),h.jsx(Je,{className:"btn-icon btn-info",onClick:()=>a(Math.min(t+1,l)),disabled:t>=l,children:h.jsx(Ic,{})}),h.jsx(Je,{className:"btn-icon btn-info",onClick:()=>a(l),disabled:t>=l,children:h.jsx(Pc,{})})]})})]}),Y1=({count:n,selectedItem:e,selectedRows:t})=>h.jsxs("div",{className:"selected-toolbar-block",style:{borderRadius:"0 0 4px 0"},children:[h.jsxs("span",{children:[n," item selected"]}),h.jsxs(Je,{className:"btn btn-primary",onClick:()=>e(t),children:[h.jsx(di,{})," Gunakan"]})]});exports.Accordion=su;exports.AccordionSection=iu;exports.AccordionSectionBody=Ho;exports.AccordionSectionFooter=zo;exports.Alert=Qc;exports.Badge=wc;exports.Box=Nc;exports.Button=Je;exports.Callout=tu;exports.Card=mc;exports.CardBody=pc;exports.CardFooter=gc;exports.CardHeader=fc;exports.Checkbox=Li;exports.CircularProgress=au;exports.CircularProgressWithLabel=lu;exports.ClearInput=Au;exports.ConfirmationAlert=eu;exports.DatePicker=Yo;exports.DivTable=q1;exports.DivTableBody=D1;exports.DivTableCell=$1;exports.DivTableFooter=B1;exports.DivTableHeader=M1;exports.DivTableRow=P1;exports.Dropdown=yc;exports.DropdownContent=Ec;exports.DropdownDatePicker=Xo;exports.DropdownMenu=vc;exports.DropdownToggle=xc;exports.FormCheckbox=gu;exports.FormContainer=fu;exports.FormGroup=pu;exports.FormRadio=mu;exports.Input=fi;exports.InputDate=Jo;exports.InputFile=el;exports.InputImageSize=Cu;exports.InputTextArea=tl;exports.InputTime=Qo;exports.InputWithAction=Su;exports.LinearProgress=ou;exports.ListItem=I1;exports.ListView=j1;exports.LoadingBar=k1;exports.Modal=Uo;exports.ModalBody=Bo;exports.ModalFooter=Fo;exports.ModalHeader=$o;exports.Popover=ru;exports.Radio=nl;exports.RadioButtonGroup=rl;exports.ReactQuillEditor=L1;exports.Select=Qe;exports.SelectMultiple=sl;exports.SelectWithSearch=il;exports.Spinner=bc;exports.Switch=al;exports.Tab=hi;exports.TabGroup=Ro;exports.Table=F1;exports.TableBody=H1;exports.TableCell=V1;exports.TableDeleteSelectedItems=W1;exports.TableFooter=z1;exports.TableHeader=U1;exports.TablePaginating=K1;exports.TablePickSelectedItems=Y1;exports.TableRow=G1;exports.Tabs=Tc;exports.TimePicker=Zo;exports.Tooltip=nu;