chainlit 0.6.4__py3-none-any.whl → 0.6.401__py3-none-any.whl
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.
Potentially problematic release.
This version of chainlit might be problematic. Click here for more details.
- chainlit/client/local.py +3 -0
- chainlit/config.py +5 -0
- chainlit/frontend/dist/assets/{index-8a4873d1.js → index-69562d52.js} +28 -28
- chainlit/frontend/dist/assets/{index-2dd0d162.js → index-ace9588d.js} +1 -1
- chainlit/frontend/dist/index.html +1 -1
- chainlit/message.py +5 -1
- chainlit/server.py +2 -1
- {chainlit-0.6.4.dist-info → chainlit-0.6.401.dist-info}/METADATA +2 -2
- {chainlit-0.6.4.dist-info → chainlit-0.6.401.dist-info}/RECORD +11 -11
- {chainlit-0.6.4.dist-info → chainlit-0.6.401.dist-info}/WHEEL +0 -0
- {chainlit-0.6.4.dist-info → chainlit-0.6.401.dist-info}/entry_points.txt +0 -0
|
@@ -416,7 +416,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
416
416
|
`))})}function HNe(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=r===void 0?{float:"left",paddingRight:"10px"}:r,o=e.numberStyle,a=o===void 0?{}:o,s=e.startingLineNumber;return gt.createElement("code",{style:Object.assign({},n,i)},VNe({lines:t.replace(/\n$/,"").split(`
|
|
417
417
|
`),style:a,startingLineNumber:s}))}function qNe(e){return"".concat(e.toString().length,".25em")}function Tq(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function Rq(e,t,n){var r={display:"inline-block",minWidth:qNe(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},i=typeof e=="function"?e(t):e,o=Es(Es({},r),i);return o}function Gb(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,a=e.lineProps,s=a===void 0?{}:a,l=e.className,u=l===void 0?[]:l,f=e.showLineNumbers,d=e.wrapLongLines,p=typeof s=="function"?s(n):s;if(p.className=u,n&&o){var g=Rq(r,n,i);t.unshift(Tq(n,g))}return d&f&&(p.style=Es(Es({},p.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:p,children:t}}function Aq(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r<e.length;r++){var i=e[r];if(i.type==="text")n.push(Gb({children:[i],className:LNe(new Set(t))}));else if(i.children){var o=t.concat(i.properties.className);Aq(i.children,o).forEach(function(a){return n.push(a)})}}return n}function GNe(e,t,n,r,i,o,a,s,l){var u,f=Aq(e.value),d=[],p=-1,g=0;function v(R,A){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return Gb({children:R,lineNumber:A,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:i,lineProps:n,className:O,showLineNumbers:r,wrapLongLines:l})}function y(R,A){if(r&&A&&i){var O=Rq(s,A,a);R.unshift(Tq(A,O))}return R}function w(R,A){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||O.length>0?v(R,A,O):y(R,A)}for(var b=function(){var A=f[g],O=A.children[0].value,z=WNe(O);if(z){var V=O.split(`
|
|
418
418
|
`);V.forEach(function(D,W){var ie=r&&d.length+o,se={type:"text",value:"".concat(D,`
|
|
419
|
-
`)};if(W===0){var K=f.slice(p+1,g).concat(Gb({children:[se],className:A.properties.className})),G=w(K,ie);d.push(G)}else if(W===V.length-1){var Q=f[g+1]&&f[g+1].children&&f[g+1].children[0],le={type:"text",value:"".concat(D)};if(Q){var Z=Gb({children:[le],className:A.properties.className});f.splice(g+1,0,Z)}else{var ee=[le],P=w(ee,ie,A.properties.className);d.push(P)}}else{var ge=[se],B=w(ge,ie,A.properties.className);d.push(B)}}),p=g}g++};g<f.length;)b();if(p!==f.length-1){var x=f.slice(p+1,f.length);if(x&&x.length){var C=r&&d.length+o,k=w(x,C);d.push(k)}}return t?d:(u=[]).concat.apply(u,d)}function YNe(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(i,o){return kq({node:i,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(o)})})}function $q(e){return e&&typeof e.highlightAuto<"u"}function XNe(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if($q(t)){var o=zNe(t,n);return n==="text"?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!=="text"?{value:t.highlight(r,n)}:{value:i}}catch{return{value:i}}}function ZNe(e,t){return function(r){var i=r.language,o=r.children,a=r.style,s=a===void 0?t:a,l=r.customStyle,u=l===void 0?{}:l,f=r.codeTagProps,d=f===void 0?{className:i?"language-".concat(i):void 0,style:Es(Es({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:f,p=r.useInlineStyles,g=p===void 0?!0:p,v=r.showLineNumbers,y=v===void 0?!1:v,w=r.showInlineLineNumbers,b=w===void 0?!0:w,x=r.startingLineNumber,C=x===void 0?1:x,k=r.lineNumberContainerStyle,R=r.lineNumberStyle,A=R===void 0?{}:R,O=r.wrapLines,z=r.wrapLongLines,V=z===void 0?!1:z,D=r.lineProps,W=D===void 0?{}:D,ie=r.renderer,se=r.PreTag,K=se===void 0?"pre":se,G=r.CodeTag,Q=G===void 0?"code":G,le=r.code,Z=le===void 0?(Array.isArray(o)?o[0]:o)||"":le,ee=r.astGenerator,P=$Ne(r,UNe);ee=ee||e;var ge=y?gt.createElement(HNe,{containerStyle:k,codeStyle:d.style||{},numberStyle:A,startingLineNumber:C,codeString:Z}):null,B=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},L=$q(ee)?"hljs":"prismjs",ae=g?Object.assign({},P,{style:Object.assign({},B,u)}):Object.assign({},P,{className:P.className?"".concat(L," ").concat(P.className):L,style:Object.assign({},u)});if(V?d.style=Es(Es({},d.style),{},{whiteSpace:"pre-wrap"}):d.style=Es(Es({},d.style),{},{whiteSpace:"pre"}),!ee)return gt.createElement(K,ae,ge,gt.createElement(Q,d,Z));(O===void 0&&ie||V)&&(O=!0),ie=ie||YNe;var ue=[{type:"text",value:Z}],ne=XNe({astGenerator:ee,language:i,code:Z,defaultCodeValue:ue});ne.language===null&&(ne.value=ue);var we=ne.value.length+C,Te=GNe(ne,O,W,y,b,C,we,A,V);return gt.createElement(K,ae,gt.createElement(Q,d,!b&&ge,ie({rows:Te,stylesheet:s,useInlineStyles:g})))}}const JNe="modulepreload",QNe=function(e){return"/"+e},Aj={},eBe=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=QNe(o),o in Aj)return;Aj[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let f=i.length-1;f>=0;f--){const d=i[f];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":JNe,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function $j(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function tBe(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){$j(o,r,i,a,s,"next",l)}function s(l){$j(o,r,i,a,s,"throw",l)}a(void 0)})}}function nBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Eq(r.key),r)}}function rBe(e,t,n){return t&&Oj(e.prototype,t),n&&Oj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H_(e,t)}function oBe(e,t){if(t&&(Yp(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G_(e)}function ix(e){return ix=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ix(e)}var Oq={exports:{}},Iq={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Iq);var aBe=Iq.exports;(function(e){var t=aBe.default;function n(){e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(K,G,Q){K[G]=Q.value},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function d(K,G,Q){return Object.defineProperty(K,G,{value:Q,enumerable:!0,configurable:!0,writable:!0}),K[G]}try{d({},"")}catch{d=function(Q,le,Z){return Q[le]=Z}}function p(K,G,Q,le){var Z=G&&G.prototype instanceof y?G:y,ee=Object.create(Z.prototype),P=new ie(le||[]);return a(ee,"_invoke",{value:z(K,Q,P)}),ee}function g(K,G,Q){try{return{type:"normal",arg:K.call(G,Q)}}catch(le){return{type:"throw",arg:le}}}r.wrap=p;var v={};function y(){}function w(){}function b(){}var x={};d(x,l,function(){return this});var C=Object.getPrototypeOf,k=C&&C(C(se([])));k&&k!==i&&o.call(k,l)&&(x=k);var R=b.prototype=y.prototype=Object.create(x);function A(K){["next","throw","return"].forEach(function(G){d(K,G,function(Q){return this._invoke(G,Q)})})}function O(K,G){function Q(Z,ee,P,ge){var B=g(K[Z],K,ee);if(B.type!=="throw"){var L=B.arg,ae=L.value;return ae&&t(ae)=="object"&&o.call(ae,"__await")?G.resolve(ae.__await).then(function(ue){Q("next",ue,P,ge)},function(ue){Q("throw",ue,P,ge)}):G.resolve(ae).then(function(ue){L.value=ue,P(L)},function(ue){return Q("throw",ue,P,ge)})}ge(B.arg)}var le;a(this,"_invoke",{value:function(ee,P){function ge(){return new G(function(B,L){Q(ee,P,B,L)})}return le=le?le.then(ge,ge):ge()}})}function z(K,G,Q){var le="suspendedStart";return function(Z,ee){if(le==="executing")throw new Error("Generator is already running");if(le==="completed"){if(Z==="throw")throw ee;return{value:void 0,done:!0}}for(Q.method=Z,Q.arg=ee;;){var P=Q.delegate;if(P){var ge=V(P,Q);if(ge){if(ge===v)continue;return ge}}if(Q.method==="next")Q.sent=Q._sent=Q.arg;else if(Q.method==="throw"){if(le==="suspendedStart")throw le="completed",Q.arg;Q.dispatchException(Q.arg)}else Q.method==="return"&&Q.abrupt("return",Q.arg);le="executing";var B=g(K,G,Q);if(B.type==="normal"){if(le=Q.done?"completed":"suspendedYield",B.arg===v)continue;return{value:B.arg,done:Q.done}}B.type==="throw"&&(le="completed",Q.method="throw",Q.arg=B.arg)}}}function V(K,G){var Q=G.method,le=K.iterator[Q];if(le===void 0)return G.delegate=null,Q==="throw"&&K.iterator.return&&(G.method="return",G.arg=void 0,V(K,G),G.method==="throw")||Q!=="return"&&(G.method="throw",G.arg=new TypeError("The iterator does not provide a '"+Q+"' method")),v;var Z=g(le,K.iterator,G.arg);if(Z.type==="throw")return G.method="throw",G.arg=Z.arg,G.delegate=null,v;var ee=Z.arg;return ee?ee.done?(G[K.resultName]=ee.value,G.next=K.nextLoc,G.method!=="return"&&(G.method="next",G.arg=void 0),G.delegate=null,v):ee:(G.method="throw",G.arg=new TypeError("iterator result is not an object"),G.delegate=null,v)}function D(K){var G={tryLoc:K[0]};1 in K&&(G.catchLoc=K[1]),2 in K&&(G.finallyLoc=K[2],G.afterLoc=K[3]),this.tryEntries.push(G)}function W(K){var G=K.completion||{};G.type="normal",delete G.arg,K.completion=G}function ie(K){this.tryEntries=[{tryLoc:"root"}],K.forEach(D,this),this.reset(!0)}function se(K){if(K||K===""){var G=K[l];if(G)return G.call(K);if(typeof K.next=="function")return K;if(!isNaN(K.length)){var Q=-1,le=function Z(){for(;++Q<K.length;)if(o.call(K,Q))return Z.value=K[Q],Z.done=!1,Z;return Z.value=void 0,Z.done=!0,Z};return le.next=le}}throw new TypeError(t(K)+" is not iterable")}return w.prototype=b,a(R,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=d(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(K){var G=typeof K=="function"&&K.constructor;return!!G&&(G===w||(G.displayName||G.name)==="GeneratorFunction")},r.mark=function(K){return Object.setPrototypeOf?Object.setPrototypeOf(K,b):(K.__proto__=b,d(K,f,"GeneratorFunction")),K.prototype=Object.create(R),K},r.awrap=function(K){return{__await:K}},A(O.prototype),d(O.prototype,u,function(){return this}),r.AsyncIterator=O,r.async=function(K,G,Q,le,Z){Z===void 0&&(Z=Promise);var ee=new O(p(K,G,Q,le),Z);return r.isGeneratorFunction(G)?ee:ee.next().then(function(P){return P.done?P.value:ee.next()})},A(R),d(R,f,"Generator"),d(R,l,function(){return this}),d(R,"toString",function(){return"[object Generator]"}),r.keys=function(K){var G=Object(K),Q=[];for(var le in G)Q.push(le);return Q.reverse(),function Z(){for(;Q.length;){var ee=Q.pop();if(ee in G)return Z.value=ee,Z.done=!1,Z}return Z.done=!0,Z}},r.values=se,ie.prototype={constructor:ie,reset:function(G){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(W),!G)for(var Q in this)Q.charAt(0)==="t"&&o.call(this,Q)&&!isNaN(+Q.slice(1))&&(this[Q]=void 0)},stop:function(){this.done=!0;var G=this.tryEntries[0].completion;if(G.type==="throw")throw G.arg;return this.rval},dispatchException:function(G){if(this.done)throw G;var Q=this;function le(L,ae){return P.type="throw",P.arg=G,Q.next=L,ae&&(Q.method="next",Q.arg=void 0),!!ae}for(var Z=this.tryEntries.length-1;Z>=0;--Z){var ee=this.tryEntries[Z],P=ee.completion;if(ee.tryLoc==="root")return le("end");if(ee.tryLoc<=this.prev){var ge=o.call(ee,"catchLoc"),B=o.call(ee,"finallyLoc");if(ge&&B){if(this.prev<ee.catchLoc)return le(ee.catchLoc,!0);if(this.prev<ee.finallyLoc)return le(ee.finallyLoc)}else if(ge){if(this.prev<ee.catchLoc)return le(ee.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<ee.finallyLoc)return le(ee.finallyLoc)}}}},abrupt:function(G,Q){for(var le=this.tryEntries.length-1;le>=0;--le){var Z=this.tryEntries[le];if(Z.tryLoc<=this.prev&&o.call(Z,"finallyLoc")&&this.prev<Z.finallyLoc){var ee=Z;break}}ee&&(G==="break"||G==="continue")&&ee.tryLoc<=Q&&Q<=ee.finallyLoc&&(ee=null);var P=ee?ee.completion:{};return P.type=G,P.arg=Q,ee?(this.method="next",this.next=ee.finallyLoc,v):this.complete(P)},complete:function(G,Q){if(G.type==="throw")throw G.arg;return G.type==="break"||G.type==="continue"?this.next=G.arg:G.type==="return"?(this.rval=this.arg=G.arg,this.method="return",this.next="end"):G.type==="normal"&&Q&&(this.next=Q),v},finish:function(G){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var le=this.tryEntries[Q];if(le.finallyLoc===G)return this.complete(le.completion,le.afterLoc),W(le),v}},catch:function(G){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var le=this.tryEntries[Q];if(le.tryLoc===G){var Z=le.completion;if(Z.type==="throw"){var ee=Z.arg;W(le)}return ee}}throw new Error("illegal catch attempt")},delegateYield:function(G,Q,le){return this.delegate={iterator:se(G),resultName:Q,nextLoc:le},this.method==="next"&&(this.arg=void 0),v}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Oq);var sBe=Oq.exports,Yb=sBe(),lBe=Yb;try{regeneratorRuntime=Yb}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Yb:Function("r","regeneratorRuntime = r")(Yb)}const Ij=_i(lBe);function uBe(e){var t=cBe();return function(){var r=ix(e),i;if(t){var o=ix(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return oBe(this,i)}}function cBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}const fBe=function(e){var t=e.loader,n=e.isLanguageRegistered,r=e.registerLanguage,i=e.languageLoaders,o=e.noAsyncLoadingLanguages,a=function(s){iBe(u,s);var l=uBe(u);function u(){return nBe(this,u),l.apply(this,arguments)}return rBe(u,[{key:"componentDidUpdate",value:function(){!u.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var d=this;u.astGeneratorPromise||u.loadAstGenerator(),u.astGenerator||u.astGeneratorPromise.then(function(){d.forceUpdate()}),!u.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var d=this,p=this.props.language;p!=="text"&&u.loadLanguage(p).then(function(){return d.forceUpdate()}).catch(function(){})}},{key:"normalizeLanguage",value:function(d){return u.isSupportedLanguage(d)?d:"text"}},{key:"render",value:function(){return gt.createElement(u.highlightInstance,M({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:u.astGenerator}))}}],[{key:"preload",value:function(){return u.loadAstGenerator()}},{key:"loadLanguage",value:function(){var f=tBe(Ij.mark(function p(g){var v;return Ij.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(v=i[g],typeof v!="function"){w.next=5;break}return w.abrupt("return",v(u.registerLanguage));case 5:throw new Error("Language ".concat(g," not supported"));case 6:case"end":return w.stop()}},p)}));function d(p){return f.apply(this,arguments)}return d}()},{key:"isSupportedLanguage",value:function(d){return u.isRegistered(d)||typeof i[d]=="function"}},{key:"loadAstGenerator",value:function(){return u.astGeneratorPromise=t().then(function(d){u.astGenerator=d,r&&u.languages.forEach(function(p,g){return r(d,g,p)})}),u.astGeneratorPromise}}]),u}(gt.PureComponent);return yl(a,"astGenerator",null),yl(a,"highlightInstance",ZNe(null,{})),yl(a,"astGeneratorPromise",null),yl(a,"languages",new Map),yl(a,"supportedLanguages",e.supportedLanguages||Object.keys(i||{})),yl(a,"isRegistered",function(s){if(o)return!0;if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");return a.astGenerator?n(a.astGenerator,s):a.languages.has(s)}),yl(a,"registerLanguage",function(s,l){if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");if(a.astGenerator)return r(a.astGenerator,s,l);a.languages.set(s,l)}),a},dBe=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"],pBe=fBe({loader:function(){return eBe(()=>import("./index-2dd0d162.js").then(t=>t.i),[]).then(function(t){return t.default||t})},noAsyncLoadingLanguages:!0,supportedLanguages:dBe}),hBe={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#282a36",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.3em"},':not(pre) > code[class*="language-"]':{background:"#282a36",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},".namespace":{Opacity:".7"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},constant:{color:"#ff79c6"},symbol:{color:"#ff79c6"},deleted:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#50fa7b"},char:{color:"#50fa7b"},builtin:{color:"#50fa7b"},inserted:{color:"#50fa7b"},operator:{color:"#f8f8f2"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#f8f8f2"},".language-css .token.string":{color:"#f8f8f2"},".style .token.string":{color:"#f8f8f2"},variable:{color:"#f8f8f2"},atrule:{color:"#f1fa8c"},"attr-value":{color:"#f1fa8c"},function:{color:"#f1fa8c"},"class-name":{color:"#f1fa8c"},keyword:{color:"#8be9fd"},regex:{color:"#ffb86c"},important:{color:"#ffb86c",fontWeight:"bold"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};function Ty(){return Xn().palette.mode==="dark"}var bI={},gBe=vn;Object.defineProperty(bI,"__esModule",{value:!0});var Dq=bI.default=void 0,mBe=gBe(yn()),vBe=S,yBe=(0,mBe.default)((0,vBe.jsx)("path",{d:"M18 2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H9V4h9v12zM3 15v-2h2v2H3zm0-5.5h2v2H3v-2zM10 20h2v2h-2v-2zm-7-1.5v-2h2v2H3zM5 22c-1.1 0-2-.9-2-2h2v2zm3.5 0h-2v-2h2v2zm5 0v-2h2c0 1.1-.9 2-2 2zM5 6v2H3c0-1.1.9-2 2-2z"}),"CopyAll");Dq=bI.default=yBe;const Pq=({value:e,theme:t})=>{const[n,r]=J2(),i=Ty(),[o,a]=B2e(),s=()=>{if(t){if(t==="dark")return _t[200];if(t==="light")return _t[800]}return i?_t[200]:_t[800]};return S.jsx(yi,{open:n,title:"Copied to clipboard!",onClose:r,sx:{zIndex:2},children:S.jsx(or,{sx:{color:s(),position:"absolute",right:4,top:4},onClick:()=>{a(e).then(()=>r()).catch(l=>console.log("An error occurred while copying: ",l))},children:S.jsx(Dq,{})})})};function _I({inline:e,children:t,...n}){const r=Ty(),i=/language-(\w+)/.exec(n.className||""),o=!e&&i,a=()=>o?S.jsx(pBe,{...n,children:String(t).replace(/\n$/,""),style:hBe,customStyle:{paddingRight:"2.5em"},wrapLongLines:!0,language:i[1],PreTag:"div"}):e?S.jsx("code",{...n,style:{background:r?_t[800]:_t[200],borderRadius:"4px",padding:"0.2em 0.4em",overflowX:"auto"},children:t}):S.jsx(at,{sx:{background:r?_t[800]:_t[200],borderRadius:"4px",padding:s=>s.spacing(1),paddingRight:"2.5em",overflowX:"auto"},children:S.jsx("code",{...n,style:{whiteSpace:"pre-wrap"},children:t})});return S.jsxs("code",{style:{position:"relative"},children:[e?null:S.jsx(Pq,{value:t[0],theme:o?"dark":void 0}),a()]})}function Lq({element:e}){const[t,n]=T.useState(!1),[r,i]=T.useState(!1),[o,a]=T.useState("");T.useEffect(()=>{t||!e.url||(n(!0),fetch(e.url).then(l=>l.text()).then(l=>{a(l),n(!1),i(!1)}).catch(()=>{a(""),i(!0),n(!1)}))},[e]);let s=t?"Loading...":r?"Error":o||e.content;return!t&&!r&&e.language&&(s=`\`\`\`${e.language}
|
|
419
|
+
`)};if(W===0){var K=f.slice(p+1,g).concat(Gb({children:[se],className:A.properties.className})),G=w(K,ie);d.push(G)}else if(W===V.length-1){var Q=f[g+1]&&f[g+1].children&&f[g+1].children[0],le={type:"text",value:"".concat(D)};if(Q){var Z=Gb({children:[le],className:A.properties.className});f.splice(g+1,0,Z)}else{var ee=[le],P=w(ee,ie,A.properties.className);d.push(P)}}else{var ge=[se],B=w(ge,ie,A.properties.className);d.push(B)}}),p=g}g++};g<f.length;)b();if(p!==f.length-1){var x=f.slice(p+1,f.length);if(x&&x.length){var C=r&&d.length+o,k=w(x,C);d.push(k)}}return t?d:(u=[]).concat.apply(u,d)}function YNe(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(i,o){return kq({node:i,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(o)})})}function $q(e){return e&&typeof e.highlightAuto<"u"}function XNe(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if($q(t)){var o=zNe(t,n);return n==="text"?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!=="text"?{value:t.highlight(r,n)}:{value:i}}catch{return{value:i}}}function ZNe(e,t){return function(r){var i=r.language,o=r.children,a=r.style,s=a===void 0?t:a,l=r.customStyle,u=l===void 0?{}:l,f=r.codeTagProps,d=f===void 0?{className:i?"language-".concat(i):void 0,style:Es(Es({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:f,p=r.useInlineStyles,g=p===void 0?!0:p,v=r.showLineNumbers,y=v===void 0?!1:v,w=r.showInlineLineNumbers,b=w===void 0?!0:w,x=r.startingLineNumber,C=x===void 0?1:x,k=r.lineNumberContainerStyle,R=r.lineNumberStyle,A=R===void 0?{}:R,O=r.wrapLines,z=r.wrapLongLines,V=z===void 0?!1:z,D=r.lineProps,W=D===void 0?{}:D,ie=r.renderer,se=r.PreTag,K=se===void 0?"pre":se,G=r.CodeTag,Q=G===void 0?"code":G,le=r.code,Z=le===void 0?(Array.isArray(o)?o[0]:o)||"":le,ee=r.astGenerator,P=$Ne(r,UNe);ee=ee||e;var ge=y?gt.createElement(HNe,{containerStyle:k,codeStyle:d.style||{},numberStyle:A,startingLineNumber:C,codeString:Z}):null,B=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},L=$q(ee)?"hljs":"prismjs",ae=g?Object.assign({},P,{style:Object.assign({},B,u)}):Object.assign({},P,{className:P.className?"".concat(L," ").concat(P.className):L,style:Object.assign({},u)});if(V?d.style=Es(Es({},d.style),{},{whiteSpace:"pre-wrap"}):d.style=Es(Es({},d.style),{},{whiteSpace:"pre"}),!ee)return gt.createElement(K,ae,ge,gt.createElement(Q,d,Z));(O===void 0&&ie||V)&&(O=!0),ie=ie||YNe;var ue=[{type:"text",value:Z}],ne=XNe({astGenerator:ee,language:i,code:Z,defaultCodeValue:ue});ne.language===null&&(ne.value=ue);var we=ne.value.length+C,Te=GNe(ne,O,W,y,b,C,we,A,V);return gt.createElement(K,ae,gt.createElement(Q,d,!b&&ge,ie({rows:Te,stylesheet:s,useInlineStyles:g})))}}const JNe="modulepreload",QNe=function(e){return"/"+e},Aj={},eBe=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=QNe(o),o in Aj)return;Aj[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let f=i.length-1;f>=0;f--){const d=i[f];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":JNe,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function $j(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function tBe(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){$j(o,r,i,a,s,"next",l)}function s(l){$j(o,r,i,a,s,"throw",l)}a(void 0)})}}function nBe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Eq(r.key),r)}}function rBe(e,t,n){return t&&Oj(e.prototype,t),n&&Oj(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iBe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&H_(e,t)}function oBe(e,t){if(t&&(Yp(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G_(e)}function ix(e){return ix=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ix(e)}var Oq={exports:{}},Iq={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Iq);var aBe=Iq.exports;(function(e){var t=aBe.default;function n(){e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(K,G,Q){K[G]=Q.value},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function d(K,G,Q){return Object.defineProperty(K,G,{value:Q,enumerable:!0,configurable:!0,writable:!0}),K[G]}try{d({},"")}catch{d=function(Q,le,Z){return Q[le]=Z}}function p(K,G,Q,le){var Z=G&&G.prototype instanceof y?G:y,ee=Object.create(Z.prototype),P=new ie(le||[]);return a(ee,"_invoke",{value:z(K,Q,P)}),ee}function g(K,G,Q){try{return{type:"normal",arg:K.call(G,Q)}}catch(le){return{type:"throw",arg:le}}}r.wrap=p;var v={};function y(){}function w(){}function b(){}var x={};d(x,l,function(){return this});var C=Object.getPrototypeOf,k=C&&C(C(se([])));k&&k!==i&&o.call(k,l)&&(x=k);var R=b.prototype=y.prototype=Object.create(x);function A(K){["next","throw","return"].forEach(function(G){d(K,G,function(Q){return this._invoke(G,Q)})})}function O(K,G){function Q(Z,ee,P,ge){var B=g(K[Z],K,ee);if(B.type!=="throw"){var L=B.arg,ae=L.value;return ae&&t(ae)=="object"&&o.call(ae,"__await")?G.resolve(ae.__await).then(function(ue){Q("next",ue,P,ge)},function(ue){Q("throw",ue,P,ge)}):G.resolve(ae).then(function(ue){L.value=ue,P(L)},function(ue){return Q("throw",ue,P,ge)})}ge(B.arg)}var le;a(this,"_invoke",{value:function(ee,P){function ge(){return new G(function(B,L){Q(ee,P,B,L)})}return le=le?le.then(ge,ge):ge()}})}function z(K,G,Q){var le="suspendedStart";return function(Z,ee){if(le==="executing")throw new Error("Generator is already running");if(le==="completed"){if(Z==="throw")throw ee;return{value:void 0,done:!0}}for(Q.method=Z,Q.arg=ee;;){var P=Q.delegate;if(P){var ge=V(P,Q);if(ge){if(ge===v)continue;return ge}}if(Q.method==="next")Q.sent=Q._sent=Q.arg;else if(Q.method==="throw"){if(le==="suspendedStart")throw le="completed",Q.arg;Q.dispatchException(Q.arg)}else Q.method==="return"&&Q.abrupt("return",Q.arg);le="executing";var B=g(K,G,Q);if(B.type==="normal"){if(le=Q.done?"completed":"suspendedYield",B.arg===v)continue;return{value:B.arg,done:Q.done}}B.type==="throw"&&(le="completed",Q.method="throw",Q.arg=B.arg)}}}function V(K,G){var Q=G.method,le=K.iterator[Q];if(le===void 0)return G.delegate=null,Q==="throw"&&K.iterator.return&&(G.method="return",G.arg=void 0,V(K,G),G.method==="throw")||Q!=="return"&&(G.method="throw",G.arg=new TypeError("The iterator does not provide a '"+Q+"' method")),v;var Z=g(le,K.iterator,G.arg);if(Z.type==="throw")return G.method="throw",G.arg=Z.arg,G.delegate=null,v;var ee=Z.arg;return ee?ee.done?(G[K.resultName]=ee.value,G.next=K.nextLoc,G.method!=="return"&&(G.method="next",G.arg=void 0),G.delegate=null,v):ee:(G.method="throw",G.arg=new TypeError("iterator result is not an object"),G.delegate=null,v)}function D(K){var G={tryLoc:K[0]};1 in K&&(G.catchLoc=K[1]),2 in K&&(G.finallyLoc=K[2],G.afterLoc=K[3]),this.tryEntries.push(G)}function W(K){var G=K.completion||{};G.type="normal",delete G.arg,K.completion=G}function ie(K){this.tryEntries=[{tryLoc:"root"}],K.forEach(D,this),this.reset(!0)}function se(K){if(K||K===""){var G=K[l];if(G)return G.call(K);if(typeof K.next=="function")return K;if(!isNaN(K.length)){var Q=-1,le=function Z(){for(;++Q<K.length;)if(o.call(K,Q))return Z.value=K[Q],Z.done=!1,Z;return Z.value=void 0,Z.done=!0,Z};return le.next=le}}throw new TypeError(t(K)+" is not iterable")}return w.prototype=b,a(R,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:w,configurable:!0}),w.displayName=d(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(K){var G=typeof K=="function"&&K.constructor;return!!G&&(G===w||(G.displayName||G.name)==="GeneratorFunction")},r.mark=function(K){return Object.setPrototypeOf?Object.setPrototypeOf(K,b):(K.__proto__=b,d(K,f,"GeneratorFunction")),K.prototype=Object.create(R),K},r.awrap=function(K){return{__await:K}},A(O.prototype),d(O.prototype,u,function(){return this}),r.AsyncIterator=O,r.async=function(K,G,Q,le,Z){Z===void 0&&(Z=Promise);var ee=new O(p(K,G,Q,le),Z);return r.isGeneratorFunction(G)?ee:ee.next().then(function(P){return P.done?P.value:ee.next()})},A(R),d(R,f,"Generator"),d(R,l,function(){return this}),d(R,"toString",function(){return"[object Generator]"}),r.keys=function(K){var G=Object(K),Q=[];for(var le in G)Q.push(le);return Q.reverse(),function Z(){for(;Q.length;){var ee=Q.pop();if(ee in G)return Z.value=ee,Z.done=!1,Z}return Z.done=!0,Z}},r.values=se,ie.prototype={constructor:ie,reset:function(G){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(W),!G)for(var Q in this)Q.charAt(0)==="t"&&o.call(this,Q)&&!isNaN(+Q.slice(1))&&(this[Q]=void 0)},stop:function(){this.done=!0;var G=this.tryEntries[0].completion;if(G.type==="throw")throw G.arg;return this.rval},dispatchException:function(G){if(this.done)throw G;var Q=this;function le(L,ae){return P.type="throw",P.arg=G,Q.next=L,ae&&(Q.method="next",Q.arg=void 0),!!ae}for(var Z=this.tryEntries.length-1;Z>=0;--Z){var ee=this.tryEntries[Z],P=ee.completion;if(ee.tryLoc==="root")return le("end");if(ee.tryLoc<=this.prev){var ge=o.call(ee,"catchLoc"),B=o.call(ee,"finallyLoc");if(ge&&B){if(this.prev<ee.catchLoc)return le(ee.catchLoc,!0);if(this.prev<ee.finallyLoc)return le(ee.finallyLoc)}else if(ge){if(this.prev<ee.catchLoc)return le(ee.catchLoc,!0)}else{if(!B)throw new Error("try statement without catch or finally");if(this.prev<ee.finallyLoc)return le(ee.finallyLoc)}}}},abrupt:function(G,Q){for(var le=this.tryEntries.length-1;le>=0;--le){var Z=this.tryEntries[le];if(Z.tryLoc<=this.prev&&o.call(Z,"finallyLoc")&&this.prev<Z.finallyLoc){var ee=Z;break}}ee&&(G==="break"||G==="continue")&&ee.tryLoc<=Q&&Q<=ee.finallyLoc&&(ee=null);var P=ee?ee.completion:{};return P.type=G,P.arg=Q,ee?(this.method="next",this.next=ee.finallyLoc,v):this.complete(P)},complete:function(G,Q){if(G.type==="throw")throw G.arg;return G.type==="break"||G.type==="continue"?this.next=G.arg:G.type==="return"?(this.rval=this.arg=G.arg,this.method="return",this.next="end"):G.type==="normal"&&Q&&(this.next=Q),v},finish:function(G){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var le=this.tryEntries[Q];if(le.finallyLoc===G)return this.complete(le.completion,le.afterLoc),W(le),v}},catch:function(G){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var le=this.tryEntries[Q];if(le.tryLoc===G){var Z=le.completion;if(Z.type==="throw"){var ee=Z.arg;W(le)}return ee}}throw new Error("illegal catch attempt")},delegateYield:function(G,Q,le){return this.delegate={iterator:se(G),resultName:Q,nextLoc:le},this.method==="next"&&(this.arg=void 0),v}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Oq);var sBe=Oq.exports,Yb=sBe(),lBe=Yb;try{regeneratorRuntime=Yb}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Yb:Function("r","regeneratorRuntime = r")(Yb)}const Ij=_i(lBe);function uBe(e){var t=cBe();return function(){var r=ix(e),i;if(t){var o=ix(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return oBe(this,i)}}function cBe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}const fBe=function(e){var t=e.loader,n=e.isLanguageRegistered,r=e.registerLanguage,i=e.languageLoaders,o=e.noAsyncLoadingLanguages,a=function(s){iBe(u,s);var l=uBe(u);function u(){return nBe(this,u),l.apply(this,arguments)}return rBe(u,[{key:"componentDidUpdate",value:function(){!u.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var d=this;u.astGeneratorPromise||u.loadAstGenerator(),u.astGenerator||u.astGeneratorPromise.then(function(){d.forceUpdate()}),!u.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var d=this,p=this.props.language;p!=="text"&&u.loadLanguage(p).then(function(){return d.forceUpdate()}).catch(function(){})}},{key:"normalizeLanguage",value:function(d){return u.isSupportedLanguage(d)?d:"text"}},{key:"render",value:function(){return gt.createElement(u.highlightInstance,M({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:u.astGenerator}))}}],[{key:"preload",value:function(){return u.loadAstGenerator()}},{key:"loadLanguage",value:function(){var f=tBe(Ij.mark(function p(g){var v;return Ij.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(v=i[g],typeof v!="function"){w.next=5;break}return w.abrupt("return",v(u.registerLanguage));case 5:throw new Error("Language ".concat(g," not supported"));case 6:case"end":return w.stop()}},p)}));function d(p){return f.apply(this,arguments)}return d}()},{key:"isSupportedLanguage",value:function(d){return u.isRegistered(d)||typeof i[d]=="function"}},{key:"loadAstGenerator",value:function(){return u.astGeneratorPromise=t().then(function(d){u.astGenerator=d,r&&u.languages.forEach(function(p,g){return r(d,g,p)})}),u.astGeneratorPromise}}]),u}(gt.PureComponent);return yl(a,"astGenerator",null),yl(a,"highlightInstance",ZNe(null,{})),yl(a,"astGeneratorPromise",null),yl(a,"languages",new Map),yl(a,"supportedLanguages",e.supportedLanguages||Object.keys(i||{})),yl(a,"isRegistered",function(s){if(o)return!0;if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");return a.astGenerator?n(a.astGenerator,s):a.languages.has(s)}),yl(a,"registerLanguage",function(s,l){if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");if(a.astGenerator)return r(a.astGenerator,s,l);a.languages.set(s,l)}),a},dBe=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"],pBe=fBe({loader:function(){return eBe(()=>import("./index-ace9588d.js").then(t=>t.i),[]).then(function(t){return t.default||t})},noAsyncLoadingLanguages:!0,supportedLanguages:dBe}),hBe={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#282a36",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.3em"},':not(pre) > code[class*="language-"]':{background:"#282a36",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},".namespace":{Opacity:".7"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},constant:{color:"#ff79c6"},symbol:{color:"#ff79c6"},deleted:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#50fa7b"},char:{color:"#50fa7b"},builtin:{color:"#50fa7b"},inserted:{color:"#50fa7b"},operator:{color:"#f8f8f2"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#f8f8f2"},".language-css .token.string":{color:"#f8f8f2"},".style .token.string":{color:"#f8f8f2"},variable:{color:"#f8f8f2"},atrule:{color:"#f1fa8c"},"attr-value":{color:"#f1fa8c"},function:{color:"#f1fa8c"},"class-name":{color:"#f1fa8c"},keyword:{color:"#8be9fd"},regex:{color:"#ffb86c"},important:{color:"#ffb86c",fontWeight:"bold"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};function Ty(){return Xn().palette.mode==="dark"}var bI={},gBe=vn;Object.defineProperty(bI,"__esModule",{value:!0});var Dq=bI.default=void 0,mBe=gBe(yn()),vBe=S,yBe=(0,mBe.default)((0,vBe.jsx)("path",{d:"M18 2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H9V4h9v12zM3 15v-2h2v2H3zm0-5.5h2v2H3v-2zM10 20h2v2h-2v-2zm-7-1.5v-2h2v2H3zM5 22c-1.1 0-2-.9-2-2h2v2zm3.5 0h-2v-2h2v2zm5 0v-2h2c0 1.1-.9 2-2 2zM5 6v2H3c0-1.1.9-2 2-2z"}),"CopyAll");Dq=bI.default=yBe;const Pq=({value:e,theme:t})=>{const[n,r]=J2(),i=Ty(),[o,a]=B2e(),s=()=>{if(t){if(t==="dark")return _t[200];if(t==="light")return _t[800]}return i?_t[200]:_t[800]};return S.jsx(yi,{open:n,title:"Copied to clipboard!",onClose:r,sx:{zIndex:2},children:S.jsx(or,{sx:{color:s(),position:"absolute",right:4,top:4},onClick:()=>{a(e).then(()=>r()).catch(l=>console.log("An error occurred while copying: ",l))},children:S.jsx(Dq,{})})})};function _I({inline:e,children:t,...n}){const r=Ty(),i=/language-(\w+)/.exec(n.className||""),o=!e&&i,a=()=>o?S.jsx(pBe,{...n,children:String(t).replace(/\n$/,""),style:hBe,customStyle:{paddingRight:"2.5em"},wrapLongLines:!0,language:i[1],PreTag:"div"}):e?S.jsx("code",{...n,style:{background:r?_t[800]:_t[200],borderRadius:"4px",padding:"0.2em 0.4em",overflowX:"auto"},children:t}):S.jsx(at,{sx:{background:r?_t[800]:_t[200],borderRadius:"4px",padding:s=>s.spacing(1),paddingRight:"2.5em",overflowX:"auto"},children:S.jsx("code",{...n,style:{whiteSpace:"pre-wrap"},children:t})});return S.jsxs("code",{style:{position:"relative"},children:[e?null:S.jsx(Pq,{value:t[0],theme:o?"dark":void 0}),a()]})}function Lq({element:e}){const[t,n]=T.useState(!1),[r,i]=T.useState(!1),[o,a]=T.useState("");T.useEffect(()=>{t||!e.url||(n(!0),fetch(e.url).then(l=>l.text()).then(l=>{a(l),n(!1),i(!1)}).catch(()=>{a(""),i(!0),n(!1)}))},[e]);let s=t?"Loading...":r?"Error":o||e.content;return!t&&!r&&e.language&&(s=`\`\`\`${e.language}
|
|
420
420
|
${s}
|
|
421
421
|
\`\`\``),S.jsx(CS,{remarkPlugins:[yI],className:"markdown-body",components:{a:({children:l,...u})=>S.jsx(_y,{...u,target:"_blank",children:l}),code:({...l})=>S.jsx(_I,{...l})},children:s})}function Mq({element:e}){if(!e.url&&!e.content)return null;const t=`${e.display}-video`,n=e.url||URL.createObjectURL(new Blob([e.content],{type:"video/mp4"}));return S.jsx("video",{className:t,width:"100%",controls:!0,src:n})}const Fq=e=>{switch(e.type){case"file":return S.jsx(SH,{element:e});case"image":return S.jsx(CH,{element:e});case"text":return S.jsx(Lq,{element:e});case"pdf":return S.jsx(EH,{element:e});case"audio":return S.jsx(bH,{element:e});case"video":return S.jsx(Mq,{element:e})}},bBe=()=>{const{id:e}=R9(),t=q2e(),n=Ct(mS),[r,i]=T.useState(null),o=t.get("conversation"),{data:a,error:s}=bh(e&&o?`/project/conversation/${o}/element/${e}`:null);if(a)i(a);else if(e&&!o&&!r){const l=n.find(u=>u.id===e);l&&i(l)}return!r||s?null:S.jsxs(at,{display:"flex",flexDirection:"column",flexGrow:1,p:3,gap:2,boxSizing:"border-box",mx:"auto",sx:{width:"100%",maxWidth:"60rem",color:"text.primary"},id:"element-view",children:[S.jsx(Yt,{fontWeight:700,fontSize:"25px",children:r.name}),Fq(r)]})},Jk=400,_Be=T.forwardRef(function({...t},n){return delete t.handleAxis,S.jsx(at,{sx:{width:"4px",height:"24px",position:"absolute",top:"50%",marginTop:"-12px",left:0,cursor:"ew-resize",padding:"10px 5px"},ref:n,...t,children:S.jsx(at,{sx:{width:"100%",height:"100%",backgroundColor:"grey.300",borderRadius:"4px"}})})}),Nq=({children:e})=>{const[t,n]=ir(nI),[r,i]=T.useState(!1),[o,a]=T.useState(Jk),s=(d,p)=>a(p.size.width),{width:l}=z2e(),u=!aS(d=>d.breakpoints.up("sm")),f=T.useMemo(()=>t?Fq(t):null,[t]);return o<Jk&&u&&a(Jk),S.jsxs(S.Fragment,{children:[S.jsx(xBe,{open:!!t,width:o,children:e}),S.jsx(F2e,{width:o,height:0,onResize:s,onResizeStart:()=>i(!0),onResizeStop:()=>i(!1),resizeHandles:["w"],handle:u?S.jsx(S.Fragment,{}):S.jsx(_Be,{}),axis:"x",minConstraints:[100,0],maxConstraints:[l/2,0],children:S.jsxs(wBe,{anchor:"right",isSmallScreen:u,open:!!t,variant:u?"temporary":"persistent",width:o,children:[S.jsxs(Ht,{direction:"row",alignItems:"center",children:[S.jsx(Yt,{noWrap:!0,fontSize:"20px",fontWeight:500,id:"side-view-title",children:t==null?void 0:t.name}),S.jsx(or,{edge:"end",sx:{ml:"auto"},onClick:()=>n(void 0),children:S.jsx(yh,{})})]}),S.jsx(at,{mt:"1.5rem",id:"side-view-content",sx:{height:"100%",pointerEvents:r?"none":"auto"},children:f})]})})]})},xBe=Me(at,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>({width:"100%",display:"flex",flexDirection:"column",boxSizing:"border-box",padding:"0 16px",transition:e.transitions.create("margin",{easing:e.transitions.easing[t?"easeOut":"sharp"],duration:e.transitions.duration[t?"enteringScreen":"leavingScreen"]})})),wBe=Me(lV,{shouldForwardProp:e=>e!=="isSmallScreen"})(({theme:e,open:t,width:n,isSmallScreen:r})=>({width:n,flexShrink:0,display:t?"flex":"none","& .MuiDrawer-paper":{position:"inherit",width:n,maxWidth:r?"80%":"100%",backgroundColor:e.palette.mode==="dark"?e.palette.grey[800]:e.palette.grey[100],borderLeft:`1px solid ${e.palette.mode==="dark"?e.palette.grey[800]:e.palette.grey[200]}`,flexDirection:"column",borderRadius:0,color:e.palette.text.primary,whiteSpace:"nowrap",boxSizing:"border-box",padding:"1.5rem",paddingTop:".5rem",overflowX:"hidden"}})),uc=Yn({key:"Session",dangerouslyAllowMutability:!0,default:void 0}),kS=Yn({key:"Messages",dangerouslyAllowMutability:!0,default:[]}),Bq=Yn({key:"TokenCount",default:0}),Ry=Yn({key:"Loading",default:!1}),jq=Yn({key:"FileSpec",default:void 0}),TS=Yn({key:"AskUser",default:void 0}),zq=Yn({key:"HighlightMessage",default:null}),Ay=Yn({key:"ChatSettings",default:{open:!1,inputs:[]}}),Uq=eW({key:"ChatSettingsValue/Default",get:({get:e})=>e(Ay).inputs.reduce((n,r)=>(n[r.id]=r.initial,n),{})}),xI=Yn({key:"ChatSettingsValue",default:Uq}),SBe="light",Dj=localStorage.getItem("themeVariant"),CBe=Dj||SBe,Hs=Yn({key:"AppSettings",default:{open:!1,expandAll:!1,hideCot:!1,theme:CBe}});var wI={},EBe=vn;Object.defineProperty(wI,"__esModule",{value:!0});var Kq=wI.default=void 0,kBe=EBe(yn()),TBe=S,RBe=(0,kBe.default)((0,TBe.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}),"CloudUploadOutlined");Kq=wI.default=RBe;function ABe(e){return mt("MuiLoadingButton",e)}const $Be=vt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),dl=$Be,OBe=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],IBe=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${ze(n)}`],endIcon:[t&&`endIconLoading${ze(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${ze(n)}`]},o=yt(i,ABe,r);return M({},r,o)},DBe=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",PBe=Me(If,{shouldForwardProp:e=>DBe(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${dl.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${dl.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>M({[`& .${dl.startIconLoadingStart}, & .${dl.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${dl.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${dl.startIconLoadingStart}, & .${dl.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${dl.startIconLoadingStart}, & .${dl.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),LBe=Me("div",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${ze(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>M({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),MBe=T.forwardRef(function(t,n){const r=bt({props:t,name:"MuiLoadingButton"}),{children:i,disabled:o=!1,id:a,loading:s=!1,loadingIndicator:l,loadingPosition:u="center",variant:f="text"}=r,d=Je(r,OBe),p=py(a),g=l??S.jsx(B2,{"aria-labelledby":p,color:"inherit",size:16}),v=M({},r,{disabled:o,loading:s,loadingIndicator:g,loadingPosition:u,variant:f}),y=IBe(v),w=s?S.jsx(LBe,{className:y.loadingIndicator,ownerState:v,children:g}):null;return S.jsxs(PBe,M({disabled:o||s,id:p,ref:n},d,{variant:f,classes:y,ownerState:v,children:[v.loadingPosition==="end"?i:w,v.loadingPosition==="end"?w:i]}))}),RS=MBe;function wh(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{u(r.next(f))}catch(d){a(d)}}function l(f){try{u(r.throw(f))}catch(d){a(d)}}function u(f){f.done?o(f.value):i(f.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function Sh(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Pj(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Lj(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var FBe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function $y(e,t){var n=NBe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function NBe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=FBe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var BBe=[".DS_Store","Thumbs.db"];function jBe(e){return wh(this,void 0,void 0,function(){return Sh(this,function(t){return ox(e)&&zBe(e.dataTransfer)?[2,VBe(e.dataTransfer,e.type)]:UBe(e)?[2,KBe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,WBe(e)]:[2,[]]})})}function zBe(e){return ox(e)}function UBe(e){return ox(e)&&ox(e.target)}function ox(e){return typeof e=="object"&&e!==null}function KBe(e){return UA(e.target.files).map(function(t){return $y(t)})}function WBe(e){return wh(this,void 0,void 0,function(){var t;return Sh(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return $y(r)})]}})})}function VBe(e,t){return wh(this,void 0,void 0,function(){var n,r;return Sh(this,function(i){switch(i.label){case 0:return e.items?(n=UA(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(HBe))]):[3,2];case 1:return r=i.sent(),[2,Mj(Wq(r))];case 2:return[2,Mj(UA(e.files).map(function(o){return $y(o)}))]}})})}function Mj(e){return e.filter(function(t){return BBe.indexOf(t.name)===-1})}function UA(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function HBe(e){if(typeof e.webkitGetAsEntry!="function")return Fj(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Vq(t):Fj(e)}function Wq(e){return e.reduce(function(t,n){return Lj(Lj([],Pj(t),!1),Pj(Array.isArray(n)?Wq(n):[n]),!1)},[])}function Fj(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=$y(t);return Promise.resolve(n)}function qBe(e){return wh(this,void 0,void 0,function(){return Sh(this,function(t){return[2,e.isDirectory?Vq(e):GBe(e)]})})}function Vq(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var a=this;t.readEntries(function(s){return wh(a,void 0,void 0,function(){var l,u,f;return Sh(this,function(d){switch(d.label){case 0:if(s.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=d.sent(),n(l),[3,4];case 3:return u=d.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(s.map(qBe)),i.push(f),o(),d.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function GBe(e){return wh(this,void 0,void 0,function(){return Sh(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=$y(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var YBe=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0};function Nj(e){return JBe(e)||ZBe(e)||qq(e)||XBe()}function XBe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
422
422
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZBe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JBe(e){if(Array.isArray(e))return KA(e)}function Bj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bj(Object(n),!0).forEach(function(r){Hq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hq(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zv(e,t){return t3e(e)||e3e(e,t)||qq(e,t)||QBe()}function QBe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -435,30 +435,30 @@ ${a}
|
|
|
435
435
|
to {
|
|
436
436
|
background-color: transparent;
|
|
437
437
|
}
|
|
438
|
-
`,Fje=({message:e,elements:t,actions:n,indent:r,showAvatar:i,showBorder:o,isRunning:a,isLast:s})=>{const l=Ct(Hs),u=Ct(zq),[f,d]=T.useState(l.expandAll);return T.useEffect(()=>{d(l.expandAll)},[l.expandAll]),l.hideCot&&r?null:S.jsxs(at,{sx:{color:"text.primary",backgroundColor:"transparent"},className:"message",children:[S.jsx(at,{sx:{boxSizing:"border-box",mx:"auto",maxWidth:"60rem",display:"flex",flexDirection:"column",position:"relative"},children:S.jsxs(Ht,{id:`message-${e.id}`,direction:"row",ml:r?`${r*(qA+16)}px`:0,sx:{py:2,borderBottom:p=>o?`1px solid ${p.palette.divider}`:"none",animation:e.id&&u===e.id?`3s ease-in-out 0.1s ${Mje}`:"none"},children:[S.jsx(M3e,{message:e,show:i}),S.jsxs(Ht,{alignItems:"flex-start",width:0,flexGrow:1,spacing:1,minWidth:200,children:[S.jsx(Pje,{authorIsUser:e.authorIsUser,elements:t,id:e.id,content:e.content,language:e.language}),S.jsx(Lje,{message:e,opened:f,onClick:()=>d(!f),loading:a}),!a&&s&&e.waitForAnswer&&S.jsx(O3e,{}),S.jsx(aje,{message:e,actions:n})]})]})}),e.subMessages&&f&&S.jsx(uG,{messages:e.subMessages,actions:n,elements:t,indent:r+1,isRunning:a})]})};function uG({messages:e,elements:t,actions:n,indent:r,isRunning:i}){const o=Ct(Ry);let a="";const s=e.filter((l,u)=>{var v;const f=!!l.content,d=!!((v=l.subMessages)!=null&&v.length),p=u===e.length-1;return f||d||!f&&(i===void 0?o&&p:i&&p)});return S.jsx(S.Fragment,{children:s.map((l,u)=>{const f=u===s.length-1,d=i===void 0?o&&f:i&&f,p=l.author!==a,g=!1;return a=l.author,S.jsx(Fje,{message:l,elements:t,actions:n,showAvatar:p,showBorder:g,indent:r,isRunning:d,isLast:f},u)})})}function Nje(e){const t=[],n={};function r(i,o){if(i){const a=n[i];if(!a)return;a.subMessages||(a.subMessages=[]),a.subMessages.push(o)}else t.push(o)}for(const i of e){const o={...i};i.id&&(n[i.id]=o)}for(const i of e){if(!i.id){t.push({...i});continue}const o=n[i.id];o&&r(i.parentId,o)}return Bje(t)}function Bje(e){const t=[],n=[];for(const r of e){const i={...r},o=r.indent||0;if(o&&!r.authorIsUser&&!r.waitForAnswer){for(;n.length>0&&(n[n.length-1].indent||0)>=o;)n.pop();const a=n[n.length-1];a&&(a.subMessages||(a.subMessages=[]),a.subMessages.push(i))}else t.push(i);n.push(i)}return t}const cG=({messages:e,elements:t,actions:n,autoScroll:r,setAutoScroll:i})=>{const o=T.useRef(),a=Nje(e);T.useEffect(()=>{!o.current||!r||(o.current.scrollTop=o.current.scrollHeight)},[e,r]);const s=()=>{if(!o.current||!i)return;const{scrollTop:l,scrollHeight:u,clientHeight:f}=o.current,d=l+f>=u-10;i(d)};return S.jsx(at,{ref:o,position:"relative",display:"flex",flexDirection:"column",overflow:"auto",flexGrow:1,onScroll:s,children:S.jsx(uG,{indent:0,messages:a,elements:t,actions:n})})};var DI={},jje=vn;Object.defineProperty(DI,"__esModule",{value:!0});var fG=DI.default=void 0,zje=jje(yn()),Uje=S,Kje=(0,zje.default)((0,Uje.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"Restore");fG=DI.default=Kje;class dG extends T.Component{constructor(){super(...arguments);ds(this,"state",{hasError:!1,error:void 0})}static getDerivedStateFromError(n){return{hasError:!0,error:n.message}}componentDidCatch(n,r){console.error("Uncaught error:",n,r)}render(){if(this.state.hasError){const n=this.props.prefix?`${this.props.prefix}: ${this.state.error}`:this.state.error;return S.jsx(at,{flexGrow:1,children:S.jsx(ro,{severity:"error",children:n})})}return this.props.children}}function Wje({children:e}){return S.jsx(Ht,{direction:"row",sx:{backgroundColor:t=>t.palette.background.paper,padding:"16px 24px",alignItems:"center",justifyContent:"flex-end",gap:2},children:e})}var pG={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ni,function(){var n=Array.prototype.slice;function r(m,E){E&&(m.prototype=Object.create(E.prototype)),m.prototype.constructor=m}function i(m){return l(m)?m:Pe(m)}r(o,i);function o(m){return u(m)?m:je(m)}r(a,i);function a(m){return f(m)?m:Fe(m)}r(s,i);function s(m){return l(m)&&!d(m)?m:tt(m)}function l(m){return!!(m&&m[g])}function u(m){return!!(m&&m[v])}function f(m){return!!(m&&m[y])}function d(m){return u(m)||f(m)}function p(m){return!!(m&&m[w])}i.isIterable=l,i.isKeyed=u,i.isIndexed=f,i.isAssociative=d,i.isOrdered=p,i.Keyed=o,i.Indexed=a,i.Set=s;var g="@@__IMMUTABLE_ITERABLE__@@",v="@@__IMMUTABLE_KEYED__@@",y="@@__IMMUTABLE_INDEXED__@@",w="@@__IMMUTABLE_ORDERED__@@",b="delete",x=5,C=1<<x,k=C-1,R={},A={value:!1},O={value:!1};function z(m){return m.value=!1,m}function V(m){m&&(m.value=!0)}function D(){}function W(m,E){E=E||0;for(var I=Math.max(0,m.length-E),F=new Array(I),j=0;j<I;j++)F[j]=m[j+E];return F}function ie(m){return m.size===void 0&&(m.size=m.__iterate(K)),m.size}function se(m,E){if(typeof E!="number"){var I=E>>>0;if(""+I!==E||I===4294967295)return NaN;E=I}return E<0?ie(m)+E:E}function K(){return!0}function G(m,E,I){return(m===0||I!==void 0&&m<=-I)&&(E===void 0||I!==void 0&&E>=I)}function Q(m,E){return Z(m,E,0)}function le(m,E){return Z(m,E,E)}function Z(m,E,I){return m===void 0?I:m<0?Math.max(0,E+m):E===void 0?m:Math.min(E,m)}var ee=0,P=1,ge=2,B=typeof Symbol=="function"&&Symbol.iterator,L="@@iterator",ae=B||L;function ue(m){this.next=m}ue.prototype.toString=function(){return"[Iterator]"},ue.KEYS=ee,ue.VALUES=P,ue.ENTRIES=ge,ue.prototype.inspect=ue.prototype.toSource=function(){return this.toString()},ue.prototype[ae]=function(){return this};function ne(m,E,I,F){var j=m===0?E:m===1?I:[E,I];return F?F.value=j:F={value:j,done:!1},F}function we(){return{value:void 0,done:!0}}function Te(m){return!!Be(m)}function Ee(m){return m&&typeof m.next=="function"}function Le(m){var E=Be(m);return E&&E.call(m)}function Be(m){var E=m&&(B&&m[B]||m[L]);if(typeof E=="function")return E}function Ie(m){return m&&typeof m.length=="number"}r(Pe,i);function Pe(m){return m==null?U():l(m)?m.toSeq():Y(m)}Pe.of=function(){return Pe(arguments)},Pe.prototype.toSeq=function(){return this},Pe.prototype.toString=function(){return this.__toString("Seq {","}")},Pe.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Pe.prototype.__iterate=function(m,E){return oe(this,m,E,!0)},Pe.prototype.__iterator=function(m,E){return xe(this,m,E,!0)},r(je,Pe);function je(m){return m==null?U().toKeyedSeq():l(m)?u(m)?m.toSeq():m.fromEntrySeq():H(m)}je.prototype.toKeyedSeq=function(){return this},r(Fe,Pe);function Fe(m){return m==null?U():l(m)?u(m)?m.entrySeq():m.toIndexedSeq():fe(m)}Fe.of=function(){return Fe(arguments)},Fe.prototype.toIndexedSeq=function(){return this},Fe.prototype.toString=function(){return this.__toString("Seq [","]")},Fe.prototype.__iterate=function(m,E){return oe(this,m,E,!1)},Fe.prototype.__iterator=function(m,E){return xe(this,m,E,!1)},r(tt,Pe);function tt(m){return(m==null?U():l(m)?u(m)?m.entrySeq():m:fe(m)).toSetSeq()}tt.of=function(){return tt(arguments)},tt.prototype.toSetSeq=function(){return this},Pe.isSeq=Re,Pe.Keyed=je,Pe.Set=tt,Pe.Indexed=Fe;var Xe="@@__IMMUTABLE_SEQ__@@";Pe.prototype[Xe]=!0,r(Ye,Fe);function Ye(m){this._array=m,this.size=m.length}Ye.prototype.get=function(m,E){return this.has(m)?this._array[se(this,m)]:E},Ye.prototype.__iterate=function(m,E){for(var I=this._array,F=I.length-1,j=0;j<=F;j++)if(m(I[E?F-j:j],j,this)===!1)return j+1;return j},Ye.prototype.__iterator=function(m,E){var I=this._array,F=I.length-1,j=0;return new ue(function(){return j>F?we():ne(m,j,I[E?F-j++:j++])})},r(st,je);function st(m){var E=Object.keys(m);this._object=m,this._keys=E,this.size=E.length}st.prototype.get=function(m,E){return E!==void 0&&!this.has(m)?E:this._object[m]},st.prototype.has=function(m){return this._object.hasOwnProperty(m)},st.prototype.__iterate=function(m,E){for(var I=this._object,F=this._keys,j=F.length-1,re=0;re<=j;re++){var pe=F[E?j-re:re];if(m(I[pe],pe,this)===!1)return re+1}return re},st.prototype.__iterator=function(m,E){var I=this._object,F=this._keys,j=F.length-1,re=0;return new ue(function(){var pe=F[E?j-re:re];return re++>j?we():ne(m,pe,I[pe])})},st.prototype[w]=!0,r(he,Fe);function he(m){this._iterable=m,this.size=m.length||m.size}he.prototype.__iterateUncached=function(m,E){if(E)return this.cacheResult().__iterate(m,E);var I=this._iterable,F=Le(I),j=0;if(Ee(F))for(var re;!(re=F.next()).done&&m(re.value,j++,this)!==!1;);return j},he.prototype.__iteratorUncached=function(m,E){if(E)return this.cacheResult().__iterator(m,E);var I=this._iterable,F=Le(I);if(!Ee(F))return new ue(we);var j=0;return new ue(function(){var re=F.next();return re.done?re:ne(m,j++,re.value)})},r(Ae,Fe);function Ae(m){this._iterator=m,this._iteratorCache=[]}Ae.prototype.__iterateUncached=function(m,E){if(E)return this.cacheResult().__iterate(m,E);for(var I=this._iterator,F=this._iteratorCache,j=0;j<F.length;)if(m(F[j],j++,this)===!1)return j;for(var re;!(re=I.next()).done;){var pe=re.value;if(F[j]=pe,m(pe,j++,this)===!1)break}return j},Ae.prototype.__iteratorUncached=function(m,E){if(E)return this.cacheResult().__iterator(m,E);var I=this._iterator,F=this._iteratorCache,j=0;return new ue(function(){if(j>=F.length){var re=I.next();if(re.done)return re;F[j]=re.value}return ne(m,j,F[j++])})};function Re(m){return!!(m&&m[Xe])}var Ne;function U(){return Ne||(Ne=new Ye([]))}function H(m){var E=Array.isArray(m)?new Ye(m).fromEntrySeq():Ee(m)?new Ae(m).fromEntrySeq():Te(m)?new he(m).fromEntrySeq():typeof m=="object"?new st(m):void 0;if(!E)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+m);return E}function fe(m){var E=X(m);if(!E)throw new TypeError("Expected Array or iterable object of values: "+m);return E}function Y(m){var E=X(m)||typeof m=="object"&&new st(m);if(!E)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+m);return E}function X(m){return Ie(m)?new Ye(m):Ee(m)?new Ae(m):Te(m)?new he(m):void 0}function oe(m,E,I,F){var j=m._cache;if(j){for(var re=j.length-1,pe=0;pe<=re;pe++){var Se=j[I?re-pe:pe];if(E(Se[1],F?Se[0]:pe,m)===!1)return pe+1}return pe}return m.__iterateUncached(E,I)}function xe(m,E,I,F){var j=m._cache;if(j){var re=j.length-1,pe=0;return new ue(function(){var Se=j[I?re-pe:pe];return pe++>re?we():ne(E,F?Se[0]:pe-1,Se[1])})}return m.__iteratorUncached(E,I)}function Ce(m,E){return E?_e(E,m,"",{"":m}):nt(m)}function _e(m,E,I,F){return Array.isArray(E)?m.call(F,I,Fe(E).map(function(j,re){return _e(m,j,re,E)})):rt(E)?m.call(F,I,je(E).map(function(j,re){return _e(m,j,re,E)})):E}function nt(m){return Array.isArray(m)?Fe(m).map(nt).toList():rt(m)?je(m).map(nt).toMap():m}function rt(m){return m&&(m.constructor===Object||m.constructor===void 0)}function de(m,E){if(m===E||m!==m&&E!==E)return!0;if(!m||!E)return!1;if(typeof m.valueOf=="function"&&typeof E.valueOf=="function"){if(m=m.valueOf(),E=E.valueOf(),m===E||m!==m&&E!==E)return!0;if(!m||!E)return!1}return!!(typeof m.equals=="function"&&typeof E.equals=="function"&&m.equals(E))}function me(m,E){if(m===E)return!0;if(!l(E)||m.size!==void 0&&E.size!==void 0&&m.size!==E.size||m.__hash!==void 0&&E.__hash!==void 0&&m.__hash!==E.__hash||u(m)!==u(E)||f(m)!==f(E)||p(m)!==p(E))return!1;if(m.size===0&&E.size===0)return!0;var I=!d(m);if(p(m)){var F=m.entries();return E.every(function(Oe,De){var te=F.next().value;return te&&de(te[1],Oe)&&(I||de(te[0],De))})&&F.next().done}var j=!1;if(m.size===void 0)if(E.size===void 0)typeof m.cacheResult=="function"&&m.cacheResult();else{j=!0;var re=m;m=E,E=re}var pe=!0,Se=E.__iterate(function(Oe,De){if(I?!m.has(Oe):j?!de(Oe,m.get(De,R)):!de(m.get(De,R),Oe))return pe=!1,!1});return pe&&m.size===Se}r($e,Fe);function $e(m,E){if(!(this instanceof $e))return new $e(m,E);if(this._value=m,this.size=E===void 0?1/0:Math.max(0,E),this.size===0){if(Ve)return Ve;Ve=this}}$e.prototype.toString=function(){return this.size===0?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$e.prototype.get=function(m,E){return this.has(m)?this._value:E},$e.prototype.includes=function(m){return de(this._value,m)},$e.prototype.slice=function(m,E){var I=this.size;return G(m,E,I)?this:new $e(this._value,le(E,I)-Q(m,I))},$e.prototype.reverse=function(){return this},$e.prototype.indexOf=function(m){return de(this._value,m)?0:-1},$e.prototype.lastIndexOf=function(m){return de(this._value,m)?this.size:-1},$e.prototype.__iterate=function(m,E){for(var I=0;I<this.size;I++)if(m(this._value,I,this)===!1)return I+1;return I},$e.prototype.__iterator=function(m,E){var I=this,F=0;return new ue(function(){return F<I.size?ne(m,F++,I._value):we()})},$e.prototype.equals=function(m){return m instanceof $e?de(this._value,m._value):me(m)};var Ve;function He(m,E){if(!m)throw new Error(E)}r(Ze,Fe);function Ze(m,E,I){if(!(this instanceof Ze))return new Ze(m,E,I);if(He(I!==0,"Cannot step a Range by 0"),m=m||0,E===void 0&&(E=1/0),I=I===void 0?1:Math.abs(I),E<m&&(I=-I),this._start=m,this._end=E,this._step=I,this.size=Math.max(0,Math.ceil((E-m)/I-1)+1),this.size===0){if(dt)return dt;dt=this}}Ze.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},Ze.prototype.get=function(m,E){return this.has(m)?this._start+se(this,m)*this._step:E},Ze.prototype.includes=function(m){var E=(m-this._start)/this._step;return E>=0&&E<this.size&&E===Math.floor(E)},Ze.prototype.slice=function(m,E){return G(m,E,this.size)?this:(m=Q(m,this.size),E=le(E,this.size),E<=m?new Ze(0,0):new Ze(this.get(m,this._end),this.get(E,this._end),this._step))},Ze.prototype.indexOf=function(m){var E=m-this._start;if(E%this._step===0){var I=E/this._step;if(I>=0&&I<this.size)return I}return-1},Ze.prototype.lastIndexOf=function(m){return this.indexOf(m)},Ze.prototype.__iterate=function(m,E){for(var I=this.size-1,F=this._step,j=E?this._start+I*F:this._start,re=0;re<=I;re++){if(m(j,re,this)===!1)return re+1;j+=E?-F:F}return re},Ze.prototype.__iterator=function(m,E){var I=this.size-1,F=this._step,j=E?this._start+I*F:this._start,re=0;return new ue(function(){var pe=j;return j+=E?-F:F,re>I?we():ne(m,re++,pe)})},Ze.prototype.equals=function(m){return m instanceof Ze?this._start===m._start&&this._end===m._end&&this._step===m._step:me(this,m)};var dt;r(ct,i);function ct(){throw TypeError("Abstract")}r(ot,ct);function ot(){}r(ht,ct);function ht(){}r(Ot,ct);function Ot(){}ct.Keyed=ot,ct.Indexed=ht,ct.Set=Ot;var rn=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(E,I){E=E|0,I=I|0;var F=E&65535,j=I&65535;return F*j+((E>>>16)*j+F*(I>>>16)<<16>>>0)|0};function Qt(m){return m>>>1&1073741824|m&3221225471}function Xt(m){if(m===!1||m===null||m===void 0||typeof m.valueOf=="function"&&(m=m.valueOf(),m===!1||m===null||m===void 0))return 0;if(m===!0)return 1;var E=typeof m;if(E==="number"){var I=m|0;for(I!==m&&(I^=m*4294967295);m>4294967295;)m/=4294967295,I^=m;return Qt(I)}if(E==="string")return m.length>Hl?br(m):kn(m);if(typeof m.hashCode=="function")return m.hashCode();if(E==="object")return Fr(m);if(typeof m.toString=="function")return kn(m.toString());throw new Error("Value type "+E+" cannot be hashed.")}function br(m){var E=co[m];return E===void 0&&(E=kn(m),On===$n&&(On=0,co={}),On++,co[m]=E),E}function kn(m){for(var E=0,I=0;I<m.length;I++)E=31*E+m.charCodeAt(I)|0;return Qt(E)}function Fr(m){var E;if(xi&&(E=Zs.get(m),E!==void 0)||(E=m[qr],E!==void 0)||!kr&&(E=m.propertyIsEnumerable&&m.propertyIsEnumerable[qr],E!==void 0||(E=Hr(m),E!==void 0)))return E;if(E=++wi,wi&1073741824&&(wi=0),xi)Zs.set(m,E);else{if(_r!==void 0&&_r(m)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(kr)Object.defineProperty(m,qr,{enumerable:!1,configurable:!1,writable:!1,value:E});else if(m.propertyIsEnumerable!==void 0&&m.propertyIsEnumerable===m.constructor.prototype.propertyIsEnumerable)m.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},m.propertyIsEnumerable[qr]=E;else if(m.nodeType!==void 0)m[qr]=E;else throw new Error("Unable to set a non-enumerable property on object.")}return E}var _r=Object.isExtensible,kr=function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}}();function Hr(m){if(m&&m.nodeType>0)switch(m.nodeType){case 1:return m.uniqueID;case 9:return m.documentElement&&m.documentElement.uniqueID}}var xi=typeof WeakMap=="function",Zs;xi&&(Zs=new WeakMap);var wi=0,qr="__immutablehash__";typeof Symbol=="function"&&(qr=Symbol(qr));var Hl=16,$n=255,On=0,co={};function dr(m){He(m!==1/0,"Cannot perform this action with an infinite size.")}r($t,ot);function $t(m){return m==null?No():pc(m)&&!p(m)?m:No().withMutations(function(E){var I=o(m);dr(I.size),I.forEach(function(F,j){return E.set(j,F)})})}$t.prototype.toString=function(){return this.__toString("Map {","}")},$t.prototype.get=function(m,E){return this._root?this._root.get(0,void 0,m,E):E},$t.prototype.set=function(m,E){return t0(this,m,E)},$t.prototype.setIn=function(m,E){return this.updateIn(m,R,function(){return E})},$t.prototype.remove=function(m){return t0(this,m,R)},$t.prototype.deleteIn=function(m){return this.updateIn(m,function(){return R})},$t.prototype.update=function(m,E,I){return arguments.length===1?m(this):this.updateIn([m],E,I)},$t.prototype.updateIn=function(m,E,I){I||(I=E,E=void 0);var F=o0(this,ad(m),E,I);return F===R?void 0:F},$t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):No()},$t.prototype.merge=function(){return td(this,void 0,arguments)},$t.prototype.mergeWith=function(m){var E=n.call(arguments,1);return td(this,m,E)},$t.prototype.mergeIn=function(m){var E=n.call(arguments,1);return this.updateIn(m,No(),function(I){return typeof I.merge=="function"?I.merge.apply(I,E):E[E.length-1]})},$t.prototype.mergeDeep=function(){return td(this,Zh,arguments)},$t.prototype.mergeDeepWith=function(m){var E=n.call(arguments,1);return td(this,gc(m),E)},$t.prototype.mergeDeepIn=function(m){var E=n.call(arguments,1);return this.updateIn(m,No(),function(I){return typeof I.mergeDeep=="function"?I.mergeDeep.apply(I,E):E[E.length-1]})},$t.prototype.sort=function(m){return ar(el(this,m))},$t.prototype.sortBy=function(m,E){return ar(el(this,E,m))},$t.prototype.withMutations=function(m){var E=this.asMutable();return m(E),E.wasAltered()?E.__ensureOwner(this.__ownerID):this},$t.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new D)},$t.prototype.asImmutable=function(){return this.__ensureOwner()},$t.prototype.wasAltered=function(){return this.__altered},$t.prototype.__iterator=function(m,E){return new Vh(this,m,E)},$t.prototype.__iterate=function(m,E){var I=this,F=0;return this._root&&this._root.iterate(function(j){return F++,m(j[1],j[0],I)},E),F},$t.prototype.__ensureOwner=function(m){return m===this.__ownerID?this:m?Qf(this.size,this._root,m,this.__hash):(this.__ownerID=m,this.__altered=!1,this)};function pc(m){return!!(m&&m[Jf])}$t.isMap=pc;var Jf="@@__IMMUTABLE_MAP__@@",lt=$t.prototype;lt[Jf]=!0,lt[b]=lt.remove,lt.removeIn=lt.deleteIn;function xr(m,E){this.ownerID=m,this.entries=E}xr.prototype.get=function(m,E,I,F){for(var j=this.entries,re=0,pe=j.length;re<pe;re++)if(de(I,j[re][0]))return j[re][1];return F},xr.prototype.update=function(m,E,I,F,j,re,pe){for(var Se=j===R,Oe=this.entries,De=0,te=Oe.length;De<te&&!de(F,Oe[De][0]);De++);var be=De<te;if(be?Oe[De][1]===j:Se)return this;if(V(pe),(Se||!be)&&V(re),!(Se&&Oe.length===1)){if(!be&&!Se&&Oe.length>=a0)return r0(m,Oe,F,j);var ye=m&&m===this.ownerID,We=ye?Oe:W(Oe);return be?Se?De===te-1?We.pop():We[De]=We.pop():We[De]=[F,j]:We.push([F,j]),ye?(this.entries=We,this):new xr(m,We)}};function Ea(m,E,I){this.ownerID=m,this.bitmap=E,this.nodes=I}Ea.prototype.get=function(m,E,I,F){E===void 0&&(E=Xt(I));var j=1<<((m===0?E:E>>>m)&k),re=this.bitmap;return re&j?this.nodes[Qh(re&j-1)].get(m+x,E,I,F):F},Ea.prototype.update=function(m,E,I,F,j,re,pe){I===void 0&&(I=Xt(F));var Se=(E===0?I:I>>>E)&k,Oe=1<<Se,De=this.bitmap,te=(De&Oe)!==0;if(!te&&j===R)return this;var be=Qh(De&Oe-1),ye=this.nodes,We=te?ye[be]:void 0,it=Yh(We,m,E+x,I,F,j,re,pe);if(it===We)return this;if(!te&&it&&ye.length>=ng)return Xh(m,ye,De,Se,it);if(te&&!it&&ye.length===2&&n0(ye[be^1]))return ye[be^1];if(te&&it&&ye.length===1&&n0(it))return it;var wt=m&&m===this.ownerID,fn=te?it?De:De^Oe:De|Oe,Vt=te?it?eg(ye,be,it,wt):EC(ye,be,wt):tg(ye,be,it,wt);return wt?(this.bitmap=fn,this.nodes=Vt,this):new Ea(m,fn,Vt)};function hc(m,E,I){this.ownerID=m,this.count=E,this.nodes=I}hc.prototype.get=function(m,E,I,F){E===void 0&&(E=Xt(I));var j=(m===0?E:E>>>m)&k,re=this.nodes[j];return re?re.get(m+x,E,I,F):F},hc.prototype.update=function(m,E,I,F,j,re,pe){I===void 0&&(I=Xt(F));var Se=(E===0?I:I>>>E)&k,Oe=j===R,De=this.nodes,te=De[Se];if(Oe&&!te)return this;var be=Yh(te,m,E+x,I,F,j,re,pe);if(be===te)return this;var ye=this.count;if(!te)ye++;else if(!be&&(ye--,ye<rg))return i0(m,De,ye,Se);var We=m&&m===this.ownerID,it=eg(De,Se,be,We);return We?(this.count=ye,this.nodes=it,this):new hc(m,ye,it)};function ka(m,E,I){this.ownerID=m,this.keyHash=E,this.entries=I}ka.prototype.get=function(m,E,I,F){for(var j=this.entries,re=0,pe=j.length;re<pe;re++)if(de(I,j[re][0]))return j[re][1];return F},ka.prototype.update=function(m,E,I,F,j,re,pe){I===void 0&&(I=Xt(F));var Se=j===R;if(I!==this.keyHash)return Se?this:(V(pe),V(re),ed(this,m,E,I,[F,j]));for(var Oe=this.entries,De=0,te=Oe.length;De<te&&!de(F,Oe[De][0]);De++);var be=De<te;if(be?Oe[De][1]===j:Se)return this;if(V(pe),(Se||!be)&&V(re),Se&&te===2)return new Ta(m,this.keyHash,Oe[De^1]);var ye=m&&m===this.ownerID,We=ye?Oe:W(Oe);return be?Se?De===te-1?We.pop():We[De]=We.pop():We[De]=[F,j]:We.push([F,j]),ye?(this.entries=We,this):new ka(m,this.keyHash,We)};function Ta(m,E,I){this.ownerID=m,this.keyHash=E,this.entry=I}Ta.prototype.get=function(m,E,I,F){return de(I,this.entry[0])?this.entry[1]:F},Ta.prototype.update=function(m,E,I,F,j,re,pe){var Se=j===R,Oe=de(F,this.entry[0]);if(Oe?j===this.entry[1]:Se)return this;if(V(pe),Se){V(re);return}return Oe?m&&m===this.ownerID?(this.entry[1]=j,this):new Ta(m,this.keyHash,[F,j]):(V(re),ed(this,m,E,Xt(F),[F,j]))},xr.prototype.iterate=ka.prototype.iterate=function(m,E){for(var I=this.entries,F=0,j=I.length-1;F<=j;F++)if(m(I[E?j-F:F])===!1)return!1},Ea.prototype.iterate=hc.prototype.iterate=function(m,E){for(var I=this.nodes,F=0,j=I.length-1;F<=j;F++){var re=I[E?j-F:F];if(re&&re.iterate(m,E)===!1)return!1}},Ta.prototype.iterate=function(m,E){return m(this.entry)},r(Vh,ue);function Vh(m,E,I){this._type=E,this._reverse=I,this._stack=m._root&&qh(m._root)}Vh.prototype.next=function(){for(var m=this._type,E=this._stack;E;){var I=E.node,F=E.index++,j;if(I.entry){if(F===0)return Hh(m,I.entry)}else if(I.entries){if(j=I.entries.length-1,F<=j)return Hh(m,I.entries[this._reverse?j-F:F])}else if(j=I.nodes.length-1,F<=j){var re=I.nodes[this._reverse?j-F:F];if(re){if(re.entry)return Hh(m,re.entry);E=this._stack=qh(re,E)}continue}E=this._stack=this._stack.__prev}return we()};function Hh(m,E){return ne(m,E[0],E[1])}function qh(m,E){return{node:m,index:0,__prev:E}}function Qf(m,E,I,F){var j=Object.create(lt);return j.size=m,j._root=E,j.__ownerID=I,j.__hash=F,j.__altered=!1,j}var Gh;function No(){return Gh||(Gh=Qf(0))}function t0(m,E,I){var F,j;if(m._root){var re=z(A),pe=z(O);if(F=Yh(m._root,m.__ownerID,0,void 0,E,I,re,pe),!pe.value)return m;j=m.size+(re.value?I===R?-1:1:0)}else{if(I===R)return m;j=1,F=new xr(m.__ownerID,[[E,I]])}return m.__ownerID?(m.size=j,m._root=F,m.__hash=void 0,m.__altered=!0,m):F?Qf(j,F):No()}function Yh(m,E,I,F,j,re,pe,Se){return m?m.update(E,I,F,j,re,pe,Se):re===R?m:(V(Se),V(pe),new Ta(E,F,[j,re]))}function n0(m){return m.constructor===Ta||m.constructor===ka}function ed(m,E,I,F,j){if(m.keyHash===F)return new ka(E,F,[m.entry,j]);var re=(I===0?m.keyHash:m.keyHash>>>I)&k,pe=(I===0?F:F>>>I)&k,Se,Oe=re===pe?[ed(m,E,I+x,F,j)]:(Se=new Ta(E,F,j),re<pe?[m,Se]:[Se,m]);return new Ea(E,1<<re|1<<pe,Oe)}function r0(m,E,I,F){m||(m=new D);for(var j=new Ta(m,Xt(I),[I,F]),re=0;re<E.length;re++){var pe=E[re];j=j.update(m,0,void 0,pe[0],pe[1])}return j}function i0(m,E,I,F){for(var j=0,re=0,pe=new Array(I),Se=0,Oe=1,De=E.length;Se<De;Se++,Oe<<=1){var te=E[Se];te!==void 0&&Se!==F&&(j|=Oe,pe[re++]=te)}return new Ea(m,j,pe)}function Xh(m,E,I,F,j){for(var re=0,pe=new Array(C),Se=0;I!==0;Se++,I>>>=1)pe[Se]=I&1?E[re++]:void 0;return pe[F]=j,new hc(m,re+1,pe)}function td(m,E,I){for(var F=[],j=0;j<I.length;j++){var re=I[j],pe=o(re);l(re)||(pe=pe.map(function(Se){return Ce(Se)})),F.push(pe)}return Jh(m,E,F)}function Zh(m,E,I){return m&&m.mergeDeep&&l(E)?m.mergeDeep(E):de(m,E)?m:E}function gc(m){return function(E,I,F){if(E&&E.mergeDeepWith&&l(I))return E.mergeDeepWith(m,I);var j=m(E,I,F);return de(E,j)?E:j}}function Jh(m,E,I){return I=I.filter(function(F){return F.size!==0}),I.length===0?m:m.size===0&&!m.__ownerID&&I.length===1?m.constructor(I[0]):m.withMutations(function(F){for(var j=E?function(pe,Se){F.update(Se,R,function(Oe){return Oe===R?pe:E(Oe,pe,Se)})}:function(pe,Se){F.set(Se,pe)},re=0;re<I.length;re++)I[re].forEach(j)})}function o0(m,E,I,F){var j=m===R,re=E.next();if(re.done){var pe=j?I:m,Se=F(pe);return Se===pe?m:Se}He(j||m&&m.set,"invalid keyPath");var Oe=re.value,De=j?R:m.get(Oe,R),te=o0(De,E,I,F);return te===De?m:te===R?m.remove(Oe):(j?No():m).set(Oe,te)}function Qh(m){return m=m-(m>>1&1431655765),m=(m&858993459)+(m>>2&858993459),m=m+(m>>4)&252645135,m=m+(m>>8),m=m+(m>>16),m&127}function eg(m,E,I,F){var j=F?m:W(m);return j[E]=I,j}function tg(m,E,I,F){var j=m.length+1;if(F&&E+1===j)return m[E]=I,m;for(var re=new Array(j),pe=0,Se=0;Se<j;Se++)Se===E?(re[Se]=I,pe=-1):re[Se]=m[Se+pe];return re}function EC(m,E,I){var F=m.length-1;if(I&&E===F)return m.pop(),m;for(var j=new Array(F),re=0,pe=0;pe<F;pe++)pe===E&&(re=1),j[pe]=m[pe+re];return j}var a0=C/4,ng=C/2,rg=C/4;r(sn,ht);function sn(m){var E=sg();if(m==null)return E;if(ig(m))return m;var I=a(m),F=I.size;return F===0?E:(dr(F),F>0&&F<C?Gl(0,F,x,null,new Ra(I.toArray())):E.withMutations(function(j){j.setSize(F),I.forEach(function(re,pe){return j.set(pe,re)})}))}sn.of=function(){return this(arguments)},sn.prototype.toString=function(){return this.__toString("List [","]")},sn.prototype.get=function(m,E){if(m=se(this,m),m>=0&&m<this.size){m+=this._origin;var I=l0(this,m);return I&&I.array[m&k]}return E},sn.prototype.set=function(m,E){return kC(this,m,E)},sn.prototype.remove=function(m){return this.has(m)?m===0?this.shift():m===this.size-1?this.pop():this.splice(m,1):this},sn.prototype.insert=function(m,E){return this.splice(m,0,E)},sn.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=x,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):sg()},sn.prototype.push=function(){var m=arguments,E=this.size;return this.withMutations(function(I){os(I,0,E+m.length);for(var F=0;F<m.length;F++)I.set(E+F,m[F])})},sn.prototype.pop=function(){return os(this,0,-1)},sn.prototype.unshift=function(){var m=arguments;return this.withMutations(function(E){os(E,-m.length);for(var I=0;I<m.length;I++)E.set(I,m[I])})},sn.prototype.shift=function(){return os(this,1)},sn.prototype.merge=function(){return rd(this,void 0,arguments)},sn.prototype.mergeWith=function(m){var E=n.call(arguments,1);return rd(this,m,E)},sn.prototype.mergeDeep=function(){return rd(this,Zh,arguments)},sn.prototype.mergeDeepWith=function(m){var E=n.call(arguments,1);return rd(this,gc(m),E)},sn.prototype.setSize=function(m){return os(this,0,m)},sn.prototype.slice=function(m,E){var I=this.size;return G(m,E,I)?this:os(this,Q(m,I),le(E,I))},sn.prototype.__iterator=function(m,E){var I=0,F=ag(this,E);return new ue(function(){var j=F();return j===ql?we():ne(m,I++,j)})},sn.prototype.__iterate=function(m,E){for(var I=0,F=ag(this,E),j;(j=F())!==ql&&m(j,I++,this)!==!1;);return I},sn.prototype.__ensureOwner=function(m){return m===this.__ownerID?this:m?Gl(this._origin,this._capacity,this._level,this._root,this._tail,m,this.__hash):(this.__ownerID=m,this)};function ig(m){return!!(m&&m[og])}sn.isList=ig;var og="@@__IMMUTABLE_LIST__@@",Gr=sn.prototype;Gr[og]=!0,Gr[b]=Gr.remove,Gr.setIn=lt.setIn,Gr.deleteIn=Gr.removeIn=lt.removeIn,Gr.update=lt.update,Gr.updateIn=lt.updateIn,Gr.mergeIn=lt.mergeIn,Gr.mergeDeepIn=lt.mergeDeepIn,Gr.withMutations=lt.withMutations,Gr.asMutable=lt.asMutable,Gr.asImmutable=lt.asImmutable,Gr.wasAltered=lt.wasAltered;function Ra(m,E){this.array=m,this.ownerID=E}Ra.prototype.removeBefore=function(m,E,I){if(I===E?1<<E:this.array.length===0)return this;var F=I>>>E&k;if(F>=this.array.length)return new Ra([],m);var j=F===0,re;if(E>0){var pe=this.array[F];if(re=pe&&pe.removeBefore(m,E-x,I),re===pe&&j)return this}if(j&&!re)return this;var Se=Yl(this,m);if(!j)for(var Oe=0;Oe<F;Oe++)Se.array[Oe]=void 0;return re&&(Se.array[F]=re),Se},Ra.prototype.removeAfter=function(m,E,I){if(I===(E?1<<E:0)||this.array.length===0)return this;var F=I-1>>>E&k;if(F>=this.array.length)return this;var j;if(E>0){var re=this.array[F];if(j=re&&re.removeAfter(m,E-x,I),j===re&&F===this.array.length-1)return this}var pe=Yl(this,m);return pe.array.splice(F+1),j&&(pe.array[F]=j),pe};var ql={};function ag(m,E){var I=m._origin,F=m._capacity,j=Js(F),re=m._tail;return pe(m._root,m._level,0);function pe(De,te,be){return te===0?Se(De,be):Oe(De,te,be)}function Se(De,te){var be=te===j?re&&re.array:De&&De.array,ye=te>I?0:I-te,We=F-te;return We>C&&(We=C),function(){if(ye===We)return ql;var it=E?--We:ye++;return be&&be[it]}}function Oe(De,te,be){var ye,We=De&&De.array,it=be>I?0:I-be>>te,wt=(F-be>>te)+1;return wt>C&&(wt=C),function(){do{if(ye){var fn=ye();if(fn!==ql)return fn;ye=null}if(it===wt)return ql;var Vt=E?--wt:it++;ye=pe(We&&We[Vt],te-x,be+(Vt<<te))}while(!0)}}}function Gl(m,E,I,F,j,re,pe){var Se=Object.create(Gr);return Se.size=E-m,Se._origin=m,Se._capacity=E,Se._level=I,Se._root=F,Se._tail=j,Se.__ownerID=re,Se.__hash=pe,Se.__altered=!1,Se}var s0;function sg(){return s0||(s0=Gl(0,0,x))}function kC(m,E,I){if(E=se(m,E),E!==E)return m;if(E>=m.size||E<0)return m.withMutations(function(pe){E<0?os(pe,E).set(0,I):os(pe,0,E+1).set(E,I)});E+=m._origin;var F=m._tail,j=m._root,re=z(O);return E>=Js(m._capacity)?F=nd(F,m.__ownerID,0,E,I,re):j=nd(j,m.__ownerID,m._level,E,I,re),re.value?m.__ownerID?(m._root=j,m._tail=F,m.__hash=void 0,m.__altered=!0,m):Gl(m._origin,m._capacity,m._level,j,F):m}function nd(m,E,I,F,j,re){var pe=F>>>I&k,Se=m&&pe<m.array.length;if(!Se&&j===void 0)return m;var Oe;if(I>0){var De=m&&m.array[pe],te=nd(De,E,I-x,F,j,re);return te===De?m:(Oe=Yl(m,E),Oe.array[pe]=te,Oe)}return Se&&m.array[pe]===j?m:(V(re),Oe=Yl(m,E),j===void 0&&pe===Oe.array.length-1?Oe.array.pop():Oe.array[pe]=j,Oe)}function Yl(m,E){return E&&m&&E===m.ownerID?m:new Ra(m?m.array.slice():[],E)}function l0(m,E){if(E>=Js(m._capacity))return m._tail;if(E<1<<m._level+x){for(var I=m._root,F=m._level;I&&F>0;)I=I.array[E>>>F&k],F-=x;return I}}function os(m,E,I){E!==void 0&&(E=E|0),I!==void 0&&(I=I|0);var F=m.__ownerID||new D,j=m._origin,re=m._capacity,pe=j+E,Se=I===void 0?re:I<0?re+I:j+I;if(pe===j&&Se===re)return m;if(pe>=Se)return m.clear();for(var Oe=m._level,De=m._root,te=0;pe+te<0;)De=new Ra(De&&De.array.length?[void 0,De]:[],F),Oe+=x,te+=1<<Oe;te&&(pe+=te,j+=te,Se+=te,re+=te);for(var be=Js(re),ye=Js(Se);ye>=1<<Oe+x;)De=new Ra(De&&De.array.length?[De]:[],F),Oe+=x;var We=m._tail,it=ye<be?l0(m,Se-1):ye>be?new Ra([],F):We;if(We&&ye>be&&pe<re&&We.array.length){De=Yl(De,F);for(var wt=De,fn=Oe;fn>x;fn-=x){var Vt=be>>>fn&k;wt=wt.array[Vt]=Yl(wt.array[Vt],F)}wt.array[be>>>x&k]=We}if(Se<re&&(it=it&&it.removeAfter(F,0,Se)),pe>=ye)pe-=ye,Se-=ye,Oe=x,De=null,it=it&&it.removeBefore(F,0,pe);else if(pe>j||ye<be){for(te=0;De;){var eu=pe>>>Oe&k;if(eu!==ye>>>Oe&k)break;eu&&(te+=(1<<Oe)*eu),Oe-=x,De=De.array[eu]}De&&pe>j&&(De=De.removeBefore(F,Oe,pe-te)),De&&ye<be&&(De=De.removeAfter(F,Oe,ye-te)),te&&(pe-=te,Se-=te)}return m.__ownerID?(m.size=Se-pe,m._origin=pe,m._capacity=Se,m._level=Oe,m._root=De,m._tail=it,m.__hash=void 0,m.__altered=!0,m):Gl(pe,Se,Oe,De,it)}function rd(m,E,I){for(var F=[],j=0,re=0;re<I.length;re++){var pe=I[re],Se=a(pe);Se.size>j&&(j=Se.size),l(pe)||(Se=Se.map(function(Oe){return Ce(Oe)})),F.push(Se)}return j>m.size&&(m=m.setSize(j)),Jh(m,E,F)}function Js(m){return m<C?0:m-1>>>x<<x}r(ar,$t);function ar(m){return m==null?id():u0(m)?m:id().withMutations(function(E){var I=o(m);dr(I.size),I.forEach(function(F,j){return E.set(j,F)})})}ar.of=function(){return this(arguments)},ar.prototype.toString=function(){return this.__toString("OrderedMap {","}")},ar.prototype.get=function(m,E){var I=this._map.get(m);return I!==void 0?this._list.get(I)[1]:E},ar.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):id()},ar.prototype.set=function(m,E){return Tn(this,m,E)},ar.prototype.remove=function(m){return Tn(this,m,R)},ar.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},ar.prototype.__iterate=function(m,E){var I=this;return this._list.__iterate(function(F){return F&&m(F[1],F[0],I)},E)},ar.prototype.__iterator=function(m,E){return this._list.fromEntrySeq().__iterator(m,E)},ar.prototype.__ensureOwner=function(m){if(m===this.__ownerID)return this;var E=this._map.__ensureOwner(m),I=this._list.__ensureOwner(m);return m?lg(E,I,m,this.__hash):(this.__ownerID=m,this._map=E,this._list=I,this)};function u0(m){return pc(m)&&p(m)}ar.isOrderedMap=u0,ar.prototype[w]=!0,ar.prototype[b]=ar.prototype.remove;function lg(m,E,I,F){var j=Object.create(ar.prototype);return j.size=m?m.size:0,j._map=m,j._list=E,j.__ownerID=I,j.__hash=F,j}var c0;function id(){return c0||(c0=lg(No(),sg()))}function Tn(m,E,I){var F=m._map,j=m._list,re=F.get(E),pe=re!==void 0,Se,Oe;if(I===R){if(!pe)return m;j.size>=C&&j.size>=F.size*2?(Oe=j.filter(function(De,te){return De!==void 0&&re!==te}),Se=Oe.toKeyedSeq().map(function(De){return De[0]}).flip().toMap(),m.__ownerID&&(Se.__ownerID=Oe.__ownerID=m.__ownerID)):(Se=F.remove(E),Oe=re===j.size-1?j.pop():j.set(re,void 0))}else if(pe){if(I===j.get(re)[1])return m;Se=F,Oe=j.set(re,[E,I])}else Se=F.set(E,j.size),Oe=j.set(j.size,[E,I]);return m.__ownerID?(m.size=Se.size,m._map=Se,m._list=Oe,m.__hash=void 0,m):lg(Se,Oe)}r(Ut,je);function Ut(m,E){this._iter=m,this._useKeys=E,this.size=m.size}Ut.prototype.get=function(m,E){return this._iter.get(m,E)},Ut.prototype.has=function(m){return this._iter.has(m)},Ut.prototype.valueSeq=function(){return this._iter.valueSeq()},Ut.prototype.reverse=function(){var m=this,E=ug(this,!0);return this._useKeys||(E.valueSeq=function(){return m._iter.toSeq().reverse()}),E},Ut.prototype.map=function(m,E){var I=this,F=d0(this,m,E);return this._useKeys||(F.valueSeq=function(){return I._iter.toSeq().map(m,E)}),F},Ut.prototype.__iterate=function(m,E){var I=this,F;return this._iter.__iterate(this._useKeys?function(j,re){return m(j,re,I)}:(F=E?Ci(this):0,function(j){return m(j,E?--F:F++,I)}),E)},Ut.prototype.__iterator=function(m,E){if(this._useKeys)return this._iter.__iterator(m,E);var I=this._iter.__iterator(P,E),F=E?Ci(this):0;return new ue(function(){var j=I.next();return j.done?j:ne(m,E?--F:F++,j.value,j)})},Ut.prototype[w]=!0,r(Xl,Fe);function Xl(m){this._iter=m,this.size=m.size}Xl.prototype.includes=function(m){return this._iter.includes(m)},Xl.prototype.__iterate=function(m,E){var I=this,F=0;return this._iter.__iterate(function(j){return m(j,F++,I)},E)},Xl.prototype.__iterator=function(m,E){var I=this._iter.__iterator(P,E),F=0;return new ue(function(){var j=I.next();return j.done?j:ne(m,F++,j.value,j)})},r(Zl,tt);function Zl(m){this._iter=m,this.size=m.size}Zl.prototype.has=function(m){return this._iter.includes(m)},Zl.prototype.__iterate=function(m,E){var I=this;return this._iter.__iterate(function(F){return m(F,F,I)},E)},Zl.prototype.__iterator=function(m,E){var I=this._iter.__iterator(P,E);return new ue(function(){var F=I.next();return F.done?F:ne(m,F.value,F.value,F)})},r(Jl,je);function Jl(m){this._iter=m,this.size=m.size}Jl.prototype.entrySeq=function(){return this._iter.toSeq()},Jl.prototype.__iterate=function(m,E){var I=this;return this._iter.__iterate(function(F){if(F){g0(F);var j=l(F);return m(j?F.get(1):F[1],j?F.get(0):F[0],I)}},E)},Jl.prototype.__iterator=function(m,E){var I=this._iter.__iterator(P,E);return new ue(function(){for(;;){var F=I.next();if(F.done)return F;var j=F.value;if(j){g0(j);var re=l(j);return ne(m,re?j.get(0):j[0],re?j.get(1):j[1],F)}}})},Xl.prototype.cacheResult=Ut.prototype.cacheResult=Zl.prototype.cacheResult=Jl.prototype.cacheResult=Bo;function f0(m){var E=fo(m);return E._iter=m,E.size=m.size,E.flip=function(){return m},E.reverse=function(){var I=m.reverse.apply(this);return I.flip=function(){return m.reverse()},I},E.has=function(I){return m.includes(I)},E.includes=function(I){return m.has(I)},E.cacheResult=Bo,E.__iterateUncached=function(I,F){var j=this;return m.__iterate(function(re,pe){return I(pe,re,j)!==!1},F)},E.__iteratorUncached=function(I,F){if(I===ge){var j=m.__iterator(I,F);return new ue(function(){var re=j.next();if(!re.done){var pe=re.value[0];re.value[0]=re.value[1],re.value[1]=pe}return re})}return m.__iterator(I===P?ee:P,F)},E}function d0(m,E,I){var F=fo(m);return F.size=m.size,F.has=function(j){return m.has(j)},F.get=function(j,re){var pe=m.get(j,R);return pe===R?re:E.call(I,pe,j,m)},F.__iterateUncached=function(j,re){var pe=this;return m.__iterate(function(Se,Oe,De){return j(E.call(I,Se,Oe,De),Oe,pe)!==!1},re)},F.__iteratorUncached=function(j,re){var pe=m.__iterator(ge,re);return new ue(function(){var Se=pe.next();if(Se.done)return Se;var Oe=Se.value,De=Oe[0];return ne(j,De,E.call(I,Oe[1],De,m),Se)})},F}function ug(m,E){var I=fo(m);return I._iter=m,I.size=m.size,I.reverse=function(){return m},m.flip&&(I.flip=function(){var F=f0(m);return F.reverse=function(){return m.flip()},F}),I.get=function(F,j){return m.get(E?F:-1-F,j)},I.has=function(F){return m.has(E?F:-1-F)},I.includes=function(F){return m.includes(F)},I.cacheResult=Bo,I.__iterate=function(F,j){var re=this;return m.__iterate(function(pe,Se){return F(pe,Se,re)},!j)},I.__iterator=function(F,j){return m.__iterator(F,!j)},I}function cg(m,E,I,F){var j=fo(m);return F&&(j.has=function(re){var pe=m.get(re,R);return pe!==R&&!!E.call(I,pe,re,m)},j.get=function(re,pe){var Se=m.get(re,R);return Se!==R&&E.call(I,Se,re,m)?Se:pe}),j.__iterateUncached=function(re,pe){var Se=this,Oe=0;return m.__iterate(function(De,te,be){if(E.call(I,De,te,be))return Oe++,re(De,F?te:Oe-1,Se)},pe),Oe},j.__iteratorUncached=function(re,pe){var Se=m.__iterator(ge,pe),Oe=0;return new ue(function(){for(;;){var De=Se.next();if(De.done)return De;var te=De.value,be=te[0],ye=te[1];if(E.call(I,ye,be,m))return ne(re,F?be:Oe++,ye,De)}})},j}function TC(m,E,I){var F=$t().asMutable();return m.__iterate(function(j,re){F.update(E.call(I,j,re,m),0,function(pe){return pe+1})}),F.asImmutable()}function Dr(m,E,I){var F=u(m),j=(p(m)?ar():$t()).asMutable();m.__iterate(function(pe,Se){j.update(E.call(I,pe,Se,m),function(Oe){return Oe=Oe||[],Oe.push(F?[Se,pe]:pe),Oe})});var re=m0(m);return j.map(function(pe){return Lt(m,re(pe))})}function mc(m,E,I,F){var j=m.size;if(E!==void 0&&(E=E|0),I!==void 0&&(I=I|0),G(E,I,j))return m;var re=Q(E,j),pe=le(I,j);if(re!==re||pe!==pe)return mc(m.toSeq().cacheResult(),E,I,F);var Se=pe-re,Oe;Se===Se&&(Oe=Se<0?0:Se);var De=fo(m);return De.size=Oe===0?Oe:m.size&&Oe||void 0,!F&&Re(m)&&Oe>=0&&(De.get=function(te,be){return te=se(this,te),te>=0&&te<Oe?m.get(te+re,be):be}),De.__iterateUncached=function(te,be){var ye=this;if(Oe===0)return 0;if(be)return this.cacheResult().__iterate(te,be);var We=0,it=!0,wt=0;return m.__iterate(function(fn,Vt){if(!(it&&(it=We++<re)))return wt++,te(fn,F?Vt:wt-1,ye)!==!1&&wt!==Oe}),wt},De.__iteratorUncached=function(te,be){if(Oe!==0&&be)return this.cacheResult().__iterator(te,be);var ye=Oe!==0&&m.__iterator(te,be),We=0,it=0;return new ue(function(){for(;We++<re;)ye.next();if(++it>Oe)return we();var wt=ye.next();return F||te===P?wt:te===ee?ne(te,it-1,void 0,wt):ne(te,it-1,wt.value[1],wt)})},De}function Qs(m,E,I){var F=fo(m);return F.__iterateUncached=function(j,re){var pe=this;if(re)return this.cacheResult().__iterate(j,re);var Se=0;return m.__iterate(function(Oe,De,te){return E.call(I,Oe,De,te)&&++Se&&j(Oe,De,pe)}),Se},F.__iteratorUncached=function(j,re){var pe=this;if(re)return this.cacheResult().__iterator(j,re);var Se=m.__iterator(ge,re),Oe=!0;return new ue(function(){if(!Oe)return we();var De=Se.next();if(De.done)return De;var te=De.value,be=te[0],ye=te[1];return E.call(I,ye,be,pe)?j===ge?De:ne(j,be,ye,De):(Oe=!1,we())})},F}function fg(m,E,I,F){var j=fo(m);return j.__iterateUncached=function(re,pe){var Se=this;if(pe)return this.cacheResult().__iterate(re,pe);var Oe=!0,De=0;return m.__iterate(function(te,be,ye){if(!(Oe&&(Oe=E.call(I,te,be,ye))))return De++,re(te,F?be:De-1,Se)}),De},j.__iteratorUncached=function(re,pe){var Se=this;if(pe)return this.cacheResult().__iterator(re,pe);var Oe=m.__iterator(ge,pe),De=!0,te=0;return new ue(function(){var be,ye,We;do{if(be=Oe.next(),be.done)return F||re===P?be:re===ee?ne(re,te++,void 0,be):ne(re,te++,be.value[1],be);var it=be.value;ye=it[0],We=it[1],De&&(De=E.call(I,We,ye,Se))}while(De);return re===ge?be:ne(re,ye,We,be)})},j}function dg(m,E){var I=u(m),F=[m].concat(E).map(function(pe){return l(pe)?I&&(pe=o(pe)):pe=I?H(pe):fe(Array.isArray(pe)?pe:[pe]),pe}).filter(function(pe){return pe.size!==0});if(F.length===0)return m;if(F.length===1){var j=F[0];if(j===m||I&&u(j)||f(m)&&f(j))return j}var re=new Ye(F);return I?re=re.toKeyedSeq():f(m)||(re=re.toSetSeq()),re=re.flatten(!0),re.size=F.reduce(function(pe,Se){if(pe!==void 0){var Oe=Se.size;if(Oe!==void 0)return pe+Oe}},0),re}function Si(m,E,I){var F=fo(m);return F.__iterateUncached=function(j,re){var pe=0,Se=!1;function Oe(De,te){var be=this;De.__iterate(function(ye,We){return(!E||te<E)&&l(ye)?Oe(ye,te+1):j(ye,I?We:pe++,be)===!1&&(Se=!0),!Se},re)}return Oe(m,0),pe},F.__iteratorUncached=function(j,re){var pe=m.__iterator(j,re),Se=[],Oe=0;return new ue(function(){for(;pe;){var De=pe.next();if(De.done!==!1){pe=Se.pop();continue}var te=De.value;if(j===ge&&(te=te[1]),(!E||Se.length<E)&&l(te))Se.push(pe),pe=te.__iterator(j,re);else return I?De:ne(j,Oe++,te,De)}return we()})},F}function p0(m,E,I){var F=m0(m);return m.toSeq().map(function(j,re){return F(E.call(I,j,re,m))}).flatten(!0)}function h0(m,E){var I=fo(m);return I.size=m.size&&m.size*2-1,I.__iterateUncached=function(F,j){var re=this,pe=0;return m.__iterate(function(Se,Oe){return(!pe||F(E,pe++,re)!==!1)&&F(Se,pe++,re)!==!1},j),pe},I.__iteratorUncached=function(F,j){var re=m.__iterator(P,j),pe=0,Se;return new ue(function(){return(!Se||pe%2)&&(Se=re.next(),Se.done)?Se:pe%2?ne(F,pe++,E):ne(F,pe++,Se.value,Se)})},I}function el(m,E,I){E||(E=yc);var F=u(m),j=0,re=m.toSeq().map(function(pe,Se){return[Se,pe,j++,I?I(pe,Se,m):pe]}).toArray();return re.sort(function(pe,Se){return E(pe[3],Se[3])||pe[2]-Se[2]}).forEach(F?function(pe,Se){re[Se].length=2}:function(pe,Se){re[Se]=pe[1]}),F?je(re):f(m)?Fe(re):tt(re)}function vc(m,E,I){if(E||(E=yc),I){var F=m.toSeq().map(function(j,re){return[j,I(j,re,m)]}).reduce(function(j,re){return pg(E,j[1],re[1])?re:j});return F&&F[0]}else return m.reduce(function(j,re){return pg(E,j,re)?re:j})}function pg(m,E,I){var F=m(I,E);return F===0&&I!==E&&(I==null||I!==I)||F>0}function od(m,E,I){var F=fo(m);return F.size=new Ye(I).map(function(j){return j.size}).min(),F.__iterate=function(j,re){for(var pe=this.__iterator(P,re),Se,Oe=0;!(Se=pe.next()).done&&j(Se.value,Oe++,this)!==!1;);return Oe},F.__iteratorUncached=function(j,re){var pe=I.map(function(De){return De=i(De),Le(re?De.reverse():De)}),Se=0,Oe=!1;return new ue(function(){var De;return Oe||(De=pe.map(function(te){return te.next()}),Oe=De.some(function(te){return te.done})),Oe?we():ne(j,Se++,E.apply(null,De.map(function(te){return te.value})))})},F}function Lt(m,E){return Re(m)?E:m.constructor(E)}function g0(m){if(m!==Object(m))throw new TypeError("Expected [K, V] tuple: "+m)}function Ci(m){return dr(m.size),ie(m)}function m0(m){return u(m)?o:f(m)?a:s}function fo(m){return Object.create((u(m)?je:f(m)?Fe:tt).prototype)}function Bo(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Pe.prototype.cacheResult.call(this)}function yc(m,E){return m>E?1:m<E?-1:0}function ad(m){var E=Le(m);if(!E){if(!Ie(m))throw new TypeError("Expected iterable or array-like: "+m);E=Le(i(m))}return E}r(Wt,ot);function Wt(m,E){var I,F=function(pe){if(pe instanceof F)return pe;if(!(this instanceof F))return new F(pe);if(!I){I=!0;var Se=Object.keys(m);hg(j,Se),j.size=Se.length,j._name=E,j._keys=Se,j._defaultValues=m}this._map=$t(pe)},j=F.prototype=Object.create(Ln);return j.constructor=F,F}Wt.prototype.toString=function(){return this.__toString(v0(this)+" {","}")},Wt.prototype.has=function(m){return this._defaultValues.hasOwnProperty(m)},Wt.prototype.get=function(m,E){if(!this.has(m))return E;var I=this._defaultValues[m];return this._map?this._map.get(m,I):I},Wt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var m=this.constructor;return m._empty||(m._empty=Ql(this,No()))},Wt.prototype.set=function(m,E){if(!this.has(m))throw new Error('Cannot set unknown key "'+m+'" on '+v0(this));var I=this._map&&this._map.set(m,E);return this.__ownerID||I===this._map?this:Ql(this,I)},Wt.prototype.remove=function(m){if(!this.has(m))return this;var E=this._map&&this._map.remove(m);return this.__ownerID||E===this._map?this:Ql(this,E)},Wt.prototype.wasAltered=function(){return this._map.wasAltered()},Wt.prototype.__iterator=function(m,E){var I=this;return o(this._defaultValues).map(function(F,j){return I.get(j)}).__iterator(m,E)},Wt.prototype.__iterate=function(m,E){var I=this;return o(this._defaultValues).map(function(F,j){return I.get(j)}).__iterate(m,E)},Wt.prototype.__ensureOwner=function(m){if(m===this.__ownerID)return this;var E=this._map&&this._map.__ensureOwner(m);return m?Ql(this,E,m):(this.__ownerID=m,this._map=E,this)};var Ln=Wt.prototype;Ln[b]=Ln.remove,Ln.deleteIn=Ln.removeIn=lt.removeIn,Ln.merge=lt.merge,Ln.mergeWith=lt.mergeWith,Ln.mergeIn=lt.mergeIn,Ln.mergeDeep=lt.mergeDeep,Ln.mergeDeepWith=lt.mergeDeepWith,Ln.mergeDeepIn=lt.mergeDeepIn,Ln.setIn=lt.setIn,Ln.update=lt.update,Ln.updateIn=lt.updateIn,Ln.withMutations=lt.withMutations,Ln.asMutable=lt.asMutable,Ln.asImmutable=lt.asImmutable;function Ql(m,E,I){var F=Object.create(Object.getPrototypeOf(m));return F._map=E,F.__ownerID=I,F}function v0(m){return m._name||m.constructor.name||"Record"}function hg(m,E){try{E.forEach(RC.bind(void 0,m))}catch{}}function RC(m,E){Object.defineProperty(m,E,{get:function(){return this.get(E)},set:function(I){He(this.__ownerID,"Cannot set on an immutable record."),this.set(E,I)}})}r(Mn,Ot);function Mn(m){return m==null?sd():gg(m)&&!p(m)?m:sd().withMutations(function(E){var I=s(m);dr(I.size),I.forEach(function(F){return E.add(F)})})}Mn.of=function(){return this(arguments)},Mn.fromKeys=function(m){return this(o(m).keySeq())},Mn.prototype.toString=function(){return this.__toString("Set {","}")},Mn.prototype.has=function(m){return this._map.has(m)},Mn.prototype.add=function(m){return as(this,this._map.set(m,!0))},Mn.prototype.remove=function(m){return as(this,this._map.remove(m))},Mn.prototype.clear=function(){return as(this,this._map.clear())},Mn.prototype.union=function(){var m=n.call(arguments,0);return m=m.filter(function(E){return E.size!==0}),m.length===0?this:this.size===0&&!this.__ownerID&&m.length===1?this.constructor(m[0]):this.withMutations(function(E){for(var I=0;I<m.length;I++)s(m[I]).forEach(function(F){return E.add(F)})})},Mn.prototype.intersect=function(){var m=n.call(arguments,0);if(m.length===0)return this;m=m.map(function(I){return s(I)});var E=this;return this.withMutations(function(I){E.forEach(function(F){m.every(function(j){return j.includes(F)})||I.remove(F)})})},Mn.prototype.subtract=function(){var m=n.call(arguments,0);if(m.length===0)return this;m=m.map(function(I){return s(I)});var E=this;return this.withMutations(function(I){E.forEach(function(F){m.some(function(j){return j.includes(F)})&&I.remove(F)})})},Mn.prototype.merge=function(){return this.union.apply(this,arguments)},Mn.prototype.mergeWith=function(m){var E=n.call(arguments,1);return this.union.apply(this,E)},Mn.prototype.sort=function(m){return Fi(el(this,m))},Mn.prototype.sortBy=function(m,E){return Fi(el(this,E,m))},Mn.prototype.wasAltered=function(){return this._map.wasAltered()},Mn.prototype.__iterate=function(m,E){var I=this;return this._map.__iterate(function(F,j){return m(j,j,I)},E)},Mn.prototype.__iterator=function(m,E){return this._map.map(function(I,F){return F}).__iterator(m,E)},Mn.prototype.__ensureOwner=function(m){if(m===this.__ownerID)return this;var E=this._map.__ensureOwner(m);return m?this.__make(E,m):(this.__ownerID=m,this._map=E,this)};function gg(m){return!!(m&&m[mg])}Mn.isSet=gg;var mg="@@__IMMUTABLE_SET__@@",Nr=Mn.prototype;Nr[mg]=!0,Nr[b]=Nr.remove,Nr.mergeDeep=Nr.merge,Nr.mergeDeepWith=Nr.mergeWith,Nr.withMutations=lt.withMutations,Nr.asMutable=lt.asMutable,Nr.asImmutable=lt.asImmutable,Nr.__empty=sd,Nr.__make=y0;function as(m,E){return m.__ownerID?(m.size=E.size,m._map=E,m):E===m._map?m:E.size===0?m.__empty():m.__make(E)}function y0(m,E){var I=Object.create(Nr);return I.size=m?m.size:0,I._map=m,I.__ownerID=E,I}var vg;function sd(){return vg||(vg=y0(No()))}r(Fi,Mn);function Fi(m){return m==null?_c():ld(m)?m:_c().withMutations(function(E){var I=s(m);dr(I.size),I.forEach(function(F){return E.add(F)})})}Fi.of=function(){return this(arguments)},Fi.fromKeys=function(m){return this(o(m).keySeq())},Fi.prototype.toString=function(){return this.__toString("OrderedSet {","}")};function ld(m){return gg(m)&&p(m)}Fi.isOrderedSet=ld;var bc=Fi.prototype;bc[w]=!0,bc.__empty=_c,bc.__make=b0;function b0(m,E){var I=Object.create(bc);return I.size=m?m.size:0,I._map=m,I.__ownerID=E,I}var ud;function _c(){return ud||(ud=b0(id()))}r(pr,ht);function pr(m){return m==null?cd():yg(m)?m:cd().unshiftAll(m)}pr.of=function(){return this(arguments)},pr.prototype.toString=function(){return this.__toString("Stack [","]")},pr.prototype.get=function(m,E){var I=this._head;for(m=se(this,m);I&&m--;)I=I.next;return I?I.value:E},pr.prototype.peek=function(){return this._head&&this._head.value},pr.prototype.push=function(){if(arguments.length===0)return this;for(var m=this.size+arguments.length,E=this._head,I=arguments.length-1;I>=0;I--)E={value:arguments[I],next:E};return this.__ownerID?(this.size=m,this._head=E,this.__hash=void 0,this.__altered=!0,this):Aa(m,E)},pr.prototype.pushAll=function(m){if(m=a(m),m.size===0)return this;dr(m.size);var E=this.size,I=this._head;return m.reverse().forEach(function(F){E++,I={value:F,next:I}}),this.__ownerID?(this.size=E,this._head=I,this.__hash=void 0,this.__altered=!0,this):Aa(E,I)},pr.prototype.pop=function(){return this.slice(1)},pr.prototype.unshift=function(){return this.push.apply(this,arguments)},pr.prototype.unshiftAll=function(m){return this.pushAll(m)},pr.prototype.shift=function(){return this.pop.apply(this,arguments)},pr.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):cd()},pr.prototype.slice=function(m,E){if(G(m,E,this.size))return this;var I=Q(m,this.size),F=le(E,this.size);if(F!==this.size)return ht.prototype.slice.call(this,m,E);for(var j=this.size-I,re=this._head;I--;)re=re.next;return this.__ownerID?(this.size=j,this._head=re,this.__hash=void 0,this.__altered=!0,this):Aa(j,re)},pr.prototype.__ensureOwner=function(m){return m===this.__ownerID?this:m?Aa(this.size,this._head,m,this.__hash):(this.__ownerID=m,this.__altered=!1,this)},pr.prototype.__iterate=function(m,E){if(E)return this.reverse().__iterate(m);for(var I=0,F=this._head;F&&m(F.value,I++,this)!==!1;)F=F.next;return I},pr.prototype.__iterator=function(m,E){if(E)return this.reverse().__iterator(m);var I=0,F=this._head;return new ue(function(){if(F){var j=F.value;return F=F.next,ne(m,I++,j)}return we()})};function yg(m){return!!(m&&m[ai])}pr.isStack=yg;var ai="@@__IMMUTABLE_STACK__@@",ss=pr.prototype;ss[ai]=!0,ss.withMutations=lt.withMutations,ss.asMutable=lt.asMutable,ss.asImmutable=lt.asImmutable,ss.wasAltered=lt.wasAltered;function Aa(m,E,I,F){var j=Object.create(ss);return j.size=m,j._head=E,j.__ownerID=I,j.__hash=F,j.__altered=!1,j}var bg;function cd(){return bg||(bg=Aa(0))}function jo(m,E){var I=function(F){m.prototype[F]=E[F]};return Object.keys(E).forEach(I),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(E).forEach(I),m}i.Iterator=ue,jo(i,{toArray:function(){dr(this.size);var m=new Array(this.size||0);return this.valueSeq().__iterate(function(E,I){m[I]=E}),m},toIndexedSeq:function(){return new Xl(this)},toJS:function(){return this.toSeq().map(function(m){return m&&typeof m.toJS=="function"?m.toJS():m}).__toJS()},toJSON:function(){return this.toSeq().map(function(m){return m&&typeof m.toJSON=="function"?m.toJSON():m}).__toJS()},toKeyedSeq:function(){return new Ut(this,!0)},toMap:function(){return $t(this.toKeyedSeq())},toObject:function(){dr(this.size);var m={};return this.__iterate(function(E,I){m[I]=E}),m},toOrderedMap:function(){return ar(this.toKeyedSeq())},toOrderedSet:function(){return Fi(u(this)?this.valueSeq():this)},toSet:function(){return Mn(u(this)?this.valueSeq():this)},toSetSeq:function(){return new Zl(this)},toSeq:function(){return f(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return pr(u(this)?this.valueSeq():this)},toList:function(){return sn(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(m,E){return this.size===0?m+E:m+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+E},concat:function(){var m=n.call(arguments,0);return Lt(this,dg(this,m))},includes:function(m){return this.some(function(E){return de(E,m)})},entries:function(){return this.__iterator(ge)},every:function(m,E){dr(this.size);var I=!0;return this.__iterate(function(F,j,re){if(!m.call(E,F,j,re))return I=!1,!1}),I},filter:function(m,E){return Lt(this,cg(this,m,E,!0))},find:function(m,E,I){var F=this.findEntry(m,E);return F?F[1]:I},findEntry:function(m,E){var I;return this.__iterate(function(F,j,re){if(m.call(E,F,j,re))return I=[j,F],!1}),I},findLastEntry:function(m,E){return this.toSeq().reverse().findEntry(m,E)},forEach:function(m,E){return dr(this.size),this.__iterate(E?m.bind(E):m)},join:function(m){dr(this.size),m=m!==void 0?""+m:",";var E="",I=!0;return this.__iterate(function(F){I?I=!1:E+=m,E+=F!=null?F.toString():""}),E},keys:function(){return this.__iterator(ee)},map:function(m,E){return Lt(this,d0(this,m,E))},reduce:function(m,E,I){dr(this.size);var F,j;return arguments.length<2?j=!0:F=E,this.__iterate(function(re,pe,Se){j?(j=!1,F=re):F=m.call(I,F,re,pe,Se)}),F},reduceRight:function(m,E,I){var F=this.toKeyedSeq().reverse();return F.reduce.apply(F,arguments)},reverse:function(){return Lt(this,ug(this,!0))},slice:function(m,E){return Lt(this,mc(this,m,E,!0))},some:function(m,E){return!this.every($a(m),E)},sort:function(m){return Lt(this,el(this,m))},values:function(){return this.__iterator(P)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(m,E){return ie(m?this.toSeq().filter(m,E):this)},countBy:function(m,E){return TC(this,m,E)},equals:function(m){return me(this,m)},entrySeq:function(){var m=this;if(m._cache)return new Ye(m._cache);var E=m.toSeq().map($C).toIndexedSeq();return E.fromEntrySeq=function(){return m.toSeq()},E},filterNot:function(m,E){return this.filter($a(m),E)},findLast:function(m,E,I){return this.toKeyedSeq().reverse().find(m,E,I)},first:function(){return this.find(K)},flatMap:function(m,E){return Lt(this,p0(this,m,E))},flatten:function(m){return Lt(this,Si(this,m,!0))},fromEntrySeq:function(){return new Jl(this)},get:function(m,E){return this.find(function(I,F){return de(F,m)},void 0,E)},getIn:function(m,E){for(var I=this,F=ad(m),j;!(j=F.next()).done;){var re=j.value;if(I=I&&I.get?I.get(re,R):R,I===R)return E}return I},groupBy:function(m,E){return Dr(this,m,E)},has:function(m){return this.get(m,R)!==R},hasIn:function(m){return this.getIn(m,R)!==R},isSubset:function(m){return m=typeof m.includes=="function"?m:i(m),this.every(function(E){return m.includes(E)})},isSuperset:function(m){return m=typeof m.isSubset=="function"?m:i(m),m.isSubset(this)},keySeq:function(){return this.toSeq().map(AC).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(m){return vc(this,m)},maxBy:function(m,E){return vc(this,E,m)},min:function(m){return vc(this,m?_0(m):xg)},minBy:function(m,E){return vc(this,E?_0(E):xg,m)},rest:function(){return this.slice(1)},skip:function(m){return this.slice(Math.max(0,m))},skipLast:function(m){return Lt(this,this.toSeq().reverse().skip(m).reverse())},skipWhile:function(m,E){return Lt(this,fg(this,m,E,!0))},skipUntil:function(m,E){return this.skipWhile($a(m),E)},sortBy:function(m,E){return Lt(this,el(this,E,m))},take:function(m){return this.slice(0,Math.max(0,m))},takeLast:function(m){return Lt(this,this.toSeq().reverse().take(m).reverse())},takeWhile:function(m,E){return Lt(this,Qs(this,m,E))},takeUntil:function(m,E){return this.takeWhile($a(m),E)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ls(this))}});var Br=i.prototype;Br[g]=!0,Br[ae]=Br.values,Br.__toJS=Br.toArray,Br.__toStringMapper=x0,Br.inspect=Br.toSource=function(){return this.toString()},Br.chain=Br.flatMap,Br.contains=Br.includes,function(){try{Object.defineProperty(Br,"length",{get:function(){if(!i.noLengthWarning){var m;try{throw new Error}catch(E){m=E.stack}if(m.indexOf("_wrapObject")===-1)return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+m),this.size}}})}catch{}}(),jo(o,{flip:function(){return Lt(this,f0(this))},findKey:function(m,E){var I=this.findEntry(m,E);return I&&I[0]},findLastKey:function(m,E){return this.toSeq().reverse().findKey(m,E)},keyOf:function(m){return this.findKey(function(E){return de(E,m)})},lastKeyOf:function(m){return this.findLastKey(function(E){return de(E,m)})},mapEntries:function(m,E){var I=this,F=0;return Lt(this,this.toSeq().map(function(j,re){return m.call(E,[re,j],F++,I)}).fromEntrySeq())},mapKeys:function(m,E){var I=this;return Lt(this,this.toSeq().flip().map(function(F,j){return m.call(E,F,j,I)}).flip())}});var fd=o.prototype;fd[v]=!0,fd[ae]=Br.entries,fd.__toJS=Br.toObject,fd.__toStringMapper=function(m,E){return JSON.stringify(E)+": "+x0(m)},jo(a,{toKeyedSeq:function(){return new Ut(this,!1)},filter:function(m,E){return Lt(this,cg(this,m,E,!1))},findIndex:function(m,E){var I=this.findEntry(m,E);return I?I[0]:-1},indexOf:function(m){var E=this.toKeyedSeq().keyOf(m);return E===void 0?-1:E},lastIndexOf:function(m){var E=this.toKeyedSeq().reverse().keyOf(m);return E===void 0?-1:E},reverse:function(){return Lt(this,ug(this,!1))},slice:function(m,E){return Lt(this,mc(this,m,E,!1))},splice:function(m,E){var I=arguments.length;if(E=Math.max(E|0,0),I===0||I===2&&!E)return this;m=Q(m,m<0?this.count():this.size);var F=this.slice(0,m);return Lt(this,I===1?F:F.concat(W(arguments,2),this.slice(m+E)))},findLastIndex:function(m,E){var I=this.toKeyedSeq().findLastKey(m,E);return I===void 0?-1:I},first:function(){return this.get(0)},flatten:function(m){return Lt(this,Si(this,m,!1))},get:function(m,E){return m=se(this,m),m<0||this.size===1/0||this.size!==void 0&&m>this.size?E:this.find(function(I,F){return F===m},void 0,E)},has:function(m){return m=se(this,m),m>=0&&(this.size!==void 0?this.size===1/0||m<this.size:this.indexOf(m)!==-1)},interpose:function(m){return Lt(this,h0(this,m))},interleave:function(){var m=[this].concat(W(arguments)),E=od(this.toSeq(),Fe.of,m),I=E.flatten(!0);return E.size&&(I.size=E.size*m.length),Lt(this,I)},last:function(){return this.get(-1)},skipWhile:function(m,E){return Lt(this,fg(this,m,E,!1))},zip:function(){var m=[this].concat(W(arguments));return Lt(this,od(this,_g,m))},zipWith:function(m){var E=W(arguments);return E[0]=this,Lt(this,od(this,m,E))}}),a.prototype[y]=!0,a.prototype[w]=!0,jo(s,{get:function(m,E){return this.has(m)?m:E},includes:function(m){return this.has(m)},keySeq:function(){return this.valueSeq()}}),s.prototype.has=Br.includes,jo(je,o.prototype),jo(Fe,a.prototype),jo(tt,s.prototype),jo(ot,o.prototype),jo(ht,a.prototype),jo(Ot,s.prototype);function AC(m,E){return E}function $C(m,E){return[E,m]}function $a(m){return function(){return!m.apply(this,arguments)}}function _0(m){return function(){return-m.apply(this,arguments)}}function x0(m){return typeof m=="string"?JSON.stringify(m):m}function _g(){return W(arguments)}function xg(m,E){return m<E?1:m>E?-1:0}function ls(m){if(m.size===1/0)return 0;var E=p(m),I=u(m),F=E?1:0,j=m.__iterate(I?E?function(re,pe){F=31*F+w0(Xt(re),Xt(pe))|0}:function(re,pe){F=F+w0(Xt(re),Xt(pe))|0}:E?function(re){F=31*F+Xt(re)|0}:function(re){F=F+Xt(re)|0});return dd(j,F)}function dd(m,E){return E=rn(E,3432918353),E=rn(E<<15|E>>>-15,461845907),E=rn(E<<13|E>>>-13,5),E=(E+3864292196|0)^m,E=rn(E^E>>>16,2246822507),E=rn(E^E>>>13,3266489909),E=Qt(E^E>>>16),E}function w0(m,E){return m^E+2654435769+(m<<6)+(m>>2)|0}var OC={Iterable:i,Seq:Pe,Collection:ct,Map:$t,OrderedMap:ar,List:sn,Stack:pr,Set:Mn,OrderedSet:Fi,Record:Wt,Range:Ze,Repeat:$e,is:de,fromJS:Ce};return OC})})(pG);var cn=pG.exports,Vje=cn,Hje=Vje.OrderedMap,qje={createFromArray:function(t){return Hje(t.map(function(n){return[n.getKey(),n]}))}},Iy=qje;function Gje(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var PI=cn,GA=PI.Map,YA=PI.OrderedSet,Yje=PI.Record,hG=YA(),gG={style:hG,entity:null},Xje=Yje(gG),LI=function(e){Gje(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.getStyle=function(){return this.get("style")},n.getEntity=function(){return this.get("entity")},n.hasStyle=function(i){return this.getStyle().includes(i)},t.applyStyle=function(i,o){var a=i.set("style",i.getStyle().add(o));return t.create(a)},t.removeStyle=function(i,o){var a=i.set("style",i.getStyle().remove(o));return t.create(a)},t.applyEntity=function(i,o){var a=i.getEntity()===o?i:i.set("entity",o);return t.create(a)},t.create=function(i){if(!i)return MI;var o={style:hG,entity:null},a=GA(o).merge(i),s=tT.get(a);if(s)return s;var l=new t(a);return tT=tT.set(a,l),l},t.fromJS=function(i){var o=i.style,a=i.entity;return new t({style:Array.isArray(o)?YA(o):o,entity:Array.isArray(a)?YA(a):a})},t}(Xje),MI=new LI,tT=GA([[GA(gG),MI]]);LI.EMPTY=MI;var xa=LI;function Zje(e,t,n,r){if(e.size){var i=0;e.reduce(function(o,a,s){return t(o,a)||(n(o)&&r(i,s),i=s),a}),n(e.last())&&r(i,e.count())}}var Dy=Zje;function Jje(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Qje=xa,Yj=Dy,Py=cn,mG=Py.List,eze=Py.Map,tze=Py.OrderedSet,nze=Py.Record,rze=Py.Repeat,ize=tze(),oze={key:"",type:"unstyled",text:"",characterList:mG(),depth:0,data:eze()},aze=nze(oze),sze=function(t){if(!t)return t;var n=t.characterList,r=t.text;return r&&!n&&(t.characterList=mG(rze(Qje.EMPTY,r.length))),t},lze=function(e){Jje(t,e);function t(r){return e.call(this,sze(r))||this}var n=t.prototype;return n.getKey=function(){return this.get("key")},n.getType=function(){return this.get("type")},n.getText=function(){return this.get("text")},n.getCharacterList=function(){return this.get("characterList")},n.getLength=function(){return this.getText().length},n.getDepth=function(){return this.get("depth")},n.getData=function(){return this.get("data")},n.getInlineStyleAt=function(i){var o=this.getCharacterList().get(i);return o?o.getStyle():ize},n.getEntityAt=function(i){var o=this.getCharacterList().get(i);return o?o.getEntity():null},n.findStyleRanges=function(i,o){Yj(this.getCharacterList(),uze,i,o)},n.findEntityRanges=function(i,o){Yj(this.getCharacterList(),cze,i,o)},t}(aze);function uze(e,t){return e.getStyle()===t.getStyle()}function cze(e,t){return e.getEntity()===t.getEntity()}var Mf=lze;function fze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var dze=xa,Xj=Dy,Ly=cn,XA=Ly.List,pze=Ly.Map,hze=Ly.OrderedSet,gze=Ly.Record,mze=Ly.Repeat,vze=hze(),Zj={parent:null,characterList:XA(),data:pze(),depth:0,key:"",text:"",type:"unstyled",children:XA(),prevSibling:null,nextSibling:null},yze=function(t,n){return t.getStyle()===n.getStyle()},bze=function(t,n){return t.getEntity()===n.getEntity()},_ze=function(t){if(!t)return t;var n=t.characterList,r=t.text;return r&&!n&&(t.characterList=XA(mze(dze.EMPTY,r.length))),t},xze=function(e){fze(t,e);function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zj;return e.call(this,_ze(r))||this}var n=t.prototype;return n.getKey=function(){return this.get("key")},n.getType=function(){return this.get("type")},n.getText=function(){return this.get("text")},n.getCharacterList=function(){return this.get("characterList")},n.getLength=function(){return this.getText().length},n.getDepth=function(){return this.get("depth")},n.getData=function(){return this.get("data")},n.getInlineStyleAt=function(i){var o=this.getCharacterList().get(i);return o?o.getStyle():vze},n.getEntityAt=function(i){var o=this.getCharacterList().get(i);return o?o.getEntity():null},n.getChildKeys=function(){return this.get("children")},n.getParentKey=function(){return this.get("parent")},n.getPrevSiblingKey=function(){return this.get("prevSibling")},n.getNextSiblingKey=function(){return this.get("nextSibling")},n.findStyleRanges=function(i,o){Xj(this.getCharacterList(),yze,i,o)},n.findEntityRanges=function(i,o){Xj(this.getCharacterList(),bze,i,o)},t}(gze(Zj)),wa=xze,Jj=xa,wze=cn,Sze=wze.Map,Cze={add:function(t,n,r){return Qj(t,n,r,!0)},remove:function(t,n,r){return Qj(t,n,r,!1)}};function Qj(e,t,n,r){var i=e.getBlockMap(),o=t.getStartKey(),a=t.getStartOffset(),s=t.getEndKey(),l=t.getEndOffset(),u=i.skipUntil(function(f,d){return d===o}).takeUntil(function(f,d){return d===s}).concat(Sze([[s,i.get(s)]])).map(function(f,d){var p,g;o===s?(p=a,g=l):(p=d===o?a:0,g=d===s?l:f.getLength());for(var v=f.getCharacterList(),y;p<g;)y=v.get(p),v=v.set(p,r?Jj.applyStyle(y,n):Jj.removeStyle(y,n)),p++;return f.set("characterList",v)});return e.merge({blockMap:i.merge(u),selectionBefore:t,selectionAfter:t})}var Eze=Cze,kze=xa;function Tze(e,t,n,r){for(var i=t,o=e.getCharacterList();i<n;)o=o.set(i,kze.applyEntity(o.get(i),r)),i++;return e.set("characterList",o)}var Rze=Tze,Aze=Rze,$ze=cn;function Oze(e,t,n){var r=e.getBlockMap(),i=t.getStartKey(),o=t.getStartOffset(),a=t.getEndKey(),s=t.getEndOffset(),l=r.skipUntil(function(u,f){return f===i}).takeUntil(function(u,f){return f===a}).toOrderedMap().merge($ze.OrderedMap([[a,r.get(a)]])).map(function(u,f){var d=f===i?o:0,p=f===a?s:u.getLength();return Aze(u,d,p,n)});return e.merge({blockMap:r.merge(l),selectionBefore:t,selectionAfter:t})}var Ize=Oze,Dze={getRemovalRange:function(t,n,r,i,o){var a=r.split(" ");a=a.map(function(w,b){if(o==="forward"){if(b>0)return" "+w}else if(b<a.length-1)return w+" ";return w});for(var s=i,l,u,f=null,d=null,p=0;p<a.length;p++){if(u=a[p],l=s+u.length,t<l&&s<n)f!==null||(f=s),d=l;else if(f!==null)break;s=l}var g=i+r.length,v=f===i,y=d===g;return(!v&&y||v&&!y)&&(o==="forward"?d!==g&&d++:f!==i&&f--),{start:f,end:d}}},Pze=Dze;function Lze(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(t.replace(/%s/g,function(){return String(r[a++])})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var bn=Lze,Mze=bn;function Fze(e,t){var n=[];return e.findEntityRanges(function(r){return r.getEntity()===t},function(r,i){n.push({start:r,end:i})}),n.length||Mze(!1),n}var Nze=Fze,Bze=Pze,jze=Nze,zze=bn;function Uze(e,t,n,r,i){var o=r.getStartOffset(),a=r.getEndOffset(),s=t.getEntityAt(o),l=n.getEntityAt(a-1);if(!s&&!l)return r;var u=r;if(s&&s===l)u=fm(e,t,u,i,s,!0,!0);else if(s&&l){var f=fm(e,t,u,i,s,!1,!0),d=fm(e,n,u,i,l,!1,!1);u=u.merge({anchorOffset:f.getAnchorOffset(),focusOffset:d.getFocusOffset(),isBackward:!1})}else if(s){var p=fm(e,t,u,i,s,!1,!0);u=u.merge({anchorOffset:p.getStartOffset(),isBackward:!1})}else if(l){var g=fm(e,n,u,i,l,!1,!1);u=u.merge({focusOffset:g.getEndOffset(),isBackward:!1})}return u}function fm(e,t,n,r,i,o,a){var s=n.getStartOffset(),l=n.getEndOffset(),u=e.__get(i),f=u.getMutability(),d=a?s:l;if(f==="MUTABLE")return n;var p=jze(t,i).filter(function(y){return d<=y.end&&d>=y.start});p.length!=1&&zze(!1);var g=p[0];if(f==="IMMUTABLE")return n.merge({anchorOffset:g.start,focusOffset:g.end,isBackward:!1});o||(a?l=g.end:s=g.start);var v=Bze.getRemovalRange(s,l,t.getText().slice(g.start,g.end),g.start,r);return n.merge({anchorOffset:v.start,focusOffset:v.end,isBackward:!1})}var Kze=Uze,ez={},Wze=Math.pow(2,24);function Vze(){for(var e;e===void 0||ez.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*Wze).toString(32);return ez[e]=!0,e}var qs=Vze,Hze=wa,vG=qs,qze=cn,yG=qze.OrderedMap,Gze=function(t){var n={},r;return yG(t.withMutations(function(i){i.forEach(function(o,a){var s=o.getKey(),l=o.getNextSiblingKey(),u=o.getPrevSiblingKey(),f=o.getChildKeys(),d=o.getParentKey(),p=vG();if(n[s]=p,l){var g=i.get(l);g?i.setIn([l,"prevSibling"],p):i.setIn([s,"nextSibling"],null)}if(u){var v=i.get(u);v?i.setIn([u,"nextSibling"],p):i.setIn([s,"prevSibling"],null)}if(d&&i.get(d)){var y=i.get(d),w=y.getChildKeys();i.setIn([d,"children"],w.set(w.indexOf(o.getKey()),p))}else i.setIn([s,"parent"],null),r&&(i.setIn([r.getKey(),"nextSibling"],p),i.setIn([s,"prevSibling"],n[r.getKey()])),r=i.get(s);f.forEach(function(b){var x=i.get(b);x?i.setIn([b,"parent"],p):i.setIn([s,"children"],o.getChildKeys().filter(function(C){return C!==b}))})})}).toArray().map(function(i){return[n[i.getKey()],i.set("key",n[i.getKey()])]}))},Yze=function(t){return yG(t.toArray().map(function(n){var r=vG();return[r,n.set("key",r)]}))},Xze=function(t){var n=t.first()instanceof Hze;return n?Gze(t):Yze(t)},bG=Xze,Zze=xa,Jze=Dy,Qze=bn;function e4e(e,t){var n=e.getBlockMap(),r=e.getEntityMap(),i={},o=t.getStartKey(),a=t.getStartOffset(),s=n.get(o),l=tz(r,s,a);l!==s&&(i[o]=l);var u=t.getEndKey(),f=t.getEndOffset(),d=n.get(u);o===u&&(d=l);var p=tz(r,d,f);return p!==d&&(i[u]=p),Object.keys(i).length?e.merge({blockMap:n.merge(i),selectionAfter:t}):e.set("selectionAfter",t)}function t4e(e,t,n){var r;return Jze(e,function(i,o){return i.getEntity()===o.getEntity()},function(i){return i.getEntity()===t},function(i,o){i<=n&&o>=n&&(r={start:i,end:o})}),typeof r!="object"&&Qze(!1),r}function tz(e,t,n){var r=t.getCharacterList(),i=n>0?r.get(n-1):void 0,o=n<r.count()?r.get(n):void 0,a=i?i.getEntity():void 0,s=o?o.getEntity():void 0;if(s&&s===a){var l=e.__get(s);if(l.getMutability()!=="MUTABLE"){for(var u=t4e(r,s,n),f=u.start,d=u.end,p;f<d;)p=r.get(f),r=r.set(f,Zze.applyEntity(p,null)),f++;return t.set("characterList",r)}}return t}var _G=e4e,n4e=bG,r4e=_G,i4e=function(t,n){var r=n.getStartKey(),i=n.getStartOffset(),o=n.getEndKey(),a=n.getEndOffset(),s=r4e(t,n),l=s.getBlockMap(),u=l.keySeq(),f=u.indexOf(r),d=u.indexOf(o)+1;return n4e(l.slice(f,d).map(function(p,g){var v=p.getText(),y=p.getCharacterList();return r===o?p.merge({text:v.slice(i,a),characterList:y.slice(i,a)}):g===r?p.merge({text:v.slice(i),characterList:y.slice(i)}):g===o?p.merge({text:v.slice(0,a),characterList:y.slice(0,a)}):p}))},PS=i4e;function o4e(e,t,n){var r=e;if(n===r.count())t.forEach(function(a){r=r.push(a)});else if(n===0)t.reverse().forEach(function(a){r=r.unshift(a)});else{var i=r.slice(0,n),o=r.slice(n);r=i.concat(t,o).toList()}return r}var xG=o4e,a4e=Iy,wG=wa,s4e=cn,l4e=xG,nz=bn,u4e=bG,c4e=s4e.List,f4e=function(t,n,r,i,o,a){var s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:"REPLACE_WITH_NEW_DATA",l=r.get(o),u=l.getText(),f=l.getCharacterList(),d=o,p=a+i.getText().length,g=null;switch(s){case"MERGE_OLD_DATA_TO_NEW_DATA":g=i.getData().merge(l.getData());break;case"REPLACE_WITH_NEW_DATA":g=i.getData();break}var v=l.getType();u&&v==="unstyled"&&(v=i.getType());var y=l.merge({text:u.slice(0,a)+i.getText()+u.slice(a),characterList:l4e(f,i.getCharacterList(),a),type:v,data:g});return t.merge({blockMap:r.set(o,y),selectionBefore:n,selectionAfter:n.merge({anchorKey:d,anchorOffset:p,focusKey:d,focusOffset:p,isBackward:!1})})},d4e=function(t,n,r){var i=t.getText(),o=t.getCharacterList(),a=i.slice(0,n),s=o.slice(0,n),l=r.first();return t.merge({text:a+l.getText(),characterList:s.concat(l.getCharacterList()),type:a?t.getType():l.getType(),data:l.getData()})},p4e=function(t,n,r){var i=t.getText(),o=t.getCharacterList(),a=i.length,s=i.slice(n,a),l=o.slice(n,a),u=r.last();return u.merge({text:u.getText()+s,characterList:u.getCharacterList().concat(l),data:u.getData()})},h4e=function(t,n){var r=t.getKey(),i=t,o=[];for(n.get(r)&&o.push(r);i&&i.getNextSiblingKey();){var a=i.getNextSiblingKey();if(!a)break;o.push(a),i=n.get(a)}return o},g4e=function(t,n,r,i){return t.withMutations(function(o){var a=r.getKey(),s=i.getKey(),l=r.getNextSiblingKey(),u=r.getParentKey(),f=h4e(i,t),d=f[f.length-1];if(o.get(s)?(o.setIn([a,"nextSibling"],s),o.setIn([s,"prevSibling"],a)):(o.setIn([a,"nextSibling"],i.getNextSiblingKey()),o.setIn([i.getNextSiblingKey(),"prevSibling"],a)),o.setIn([d,"nextSibling"],l),l&&o.setIn([l,"prevSibling"],d),f.forEach(function(b){return o.setIn([b,"parent"],u)}),u){var p=t.get(u),g=p.getChildKeys(),v=g.indexOf(a),y=v+1,w=g.toArray();w.splice.apply(w,[y,0].concat(f)),o.setIn([u,"children"],c4e(w))}})},m4e=function(t,n,r,i,o,a){var s=r.first()instanceof wG,l=[],u=i.size,f=r.get(o),d=i.first(),p=i.last(),g=p.getLength(),v=p.getKey(),y=s&&(!f.getChildKeys().isEmpty()||!d.getChildKeys().isEmpty());r.forEach(function(b,x){if(x!==o){l.push(b);return}y?l.push(b):l.push(d4e(b,a,i)),i.slice(y?0:1,u-1).forEach(function(C){return l.push(C)}),l.push(p4e(b,a,i))});var w=a4e.createFromArray(l);return s&&(w=g4e(w,r,f,d)),t.merge({blockMap:w,selectionBefore:n,selectionAfter:n.merge({anchorKey:v,anchorOffset:g,focusKey:v,focusOffset:g,isBackward:!1})})},v4e=function(t,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"REPLACE_WITH_NEW_DATA";n.isCollapsed()||nz(!1);var o=t.getBlockMap(),a=u4e(r),s=n.getStartKey(),l=n.getStartOffset(),u=o.get(s);return u instanceof wG&&(u.getChildKeys().isEmpty()||nz(!1)),a.size===1?f4e(t,n,o,a.first(),s,l,i):m4e(t,n,o,a,s,l)},y4e=v4e,b4e=cn,_4e=xG,x4e=bn,w4e=b4e.Repeat;function S4e(e,t,n,r){t.isCollapsed()||x4e(!1);var i=null;if(n!=null&&(i=n.length),i==null||i===0)return e;var o=e.getBlockMap(),a=t.getStartKey(),s=t.getStartOffset(),l=o.get(a),u=l.getText(),f=l.merge({text:u.slice(0,s)+n+u.slice(s,l.getLength()),characterList:_4e(l.getCharacterList(),w4e(r,i).toList(),s)}),d=s+i;return e.merge({blockMap:o.set(a,f),selectionAfter:t.merge({anchorOffset:d,focusOffset:d})})}var C4e=S4e,E4e=cn,k4e=E4e.Map;function T4e(e,t,n){var r=t.getStartKey(),i=t.getEndKey(),o=e.getBlockMap(),a=o.toSeq().skipUntil(function(s,l){return l===r}).takeUntil(function(s,l){return l===i}).concat(k4e([[i,o.get(i)]])).map(n);return e.merge({blockMap:o.merge(a),selectionBefore:t,selectionAfter:t})}var SG=T4e,R4e=wa,A4e=function(t,n){var r=t instanceof R4e;if(!r)return null;var i=t.getNextSiblingKey();if(i)return i;var o=t.getParentKey();if(!o)return null;for(var a=n.get(o);a&&!a.getNextSiblingKey();){var s=a.getParentKey();a=s?n.get(s):null}return a?a.getNextSiblingKey():null},CG=A4e,$4e=wa,ZA=CG,EG=cn;EG.List;var rz=EG.Map,Ui=function(t,n,r){if(t){var i=n.get(t);i&&n.set(t,r(i))}},lx=function(t,n){var r=[];if(!t)return r;for(var i=n.get(t);i&&i.getParentKey();){var o=i.getParentKey();o&&r.push(o),i=o?n.get(o):null}return r},O4e=function(t,n){var r=[];if(!t)return r;for(var i=ZA(t,n);i&&n.get(i);){var o=n.get(i);r.push(i),i=o.getParentKey()?ZA(o,n):null}return r},Dd=function(t,n,r){if(!t)return null;for(var i=r.get(t.getKey()).getNextSiblingKey();i&&!n.get(i);)i=r.get(i).getNextSiblingKey()||null;return i},Pd=function(t,n,r){if(!t)return null;for(var i=r.get(t.getKey()).getPrevSiblingKey();i&&!n.get(i);)i=r.get(i).getPrevSiblingKey()||null;return i},I4e=function(t,n,r,i){return t.withMutations(function(o){if(Ui(n.getKey(),o,function(f){return f.merge({nextSibling:Dd(f,o,i),prevSibling:Pd(f,o,i)})}),Ui(r.getKey(),o,function(f){return f.merge({nextSibling:Dd(f,o,i),prevSibling:Pd(f,o,i)})}),lx(n.getKey(),i).forEach(function(f){return Ui(f,o,function(d){return d.merge({children:d.getChildKeys().filter(function(p){return o.get(p)}),nextSibling:Dd(d,o,i),prevSibling:Pd(d,o,i)})})}),Ui(n.getNextSiblingKey(),o,function(f){return f.merge({prevSibling:n.getPrevSiblingKey()})}),Ui(n.getPrevSiblingKey(),o,function(f){return f.merge({nextSibling:Dd(f,o,i)})}),Ui(r.getNextSiblingKey(),o,function(f){return f.merge({prevSibling:Pd(f,o,i)})}),Ui(r.getPrevSiblingKey(),o,function(f){return f.merge({nextSibling:r.getNextSiblingKey()})}),lx(r.getKey(),i).forEach(function(f){Ui(f,o,function(d){return d.merge({children:d.getChildKeys().filter(function(p){return o.get(p)}),nextSibling:Dd(d,o,i),prevSibling:Pd(d,o,i)})})}),O4e(r,i).forEach(function(f){return Ui(f,o,function(d){return d.merge({nextSibling:Dd(d,o,i),prevSibling:Pd(d,o,i)})})}),t.get(n.getKey())==null&&t.get(r.getKey())!=null&&r.getParentKey()===n.getKey()&&r.getPrevSiblingKey()==null){var a=n.getPrevSiblingKey();Ui(r.getKey(),o,function(f){return f.merge({prevSibling:a})}),Ui(a,o,function(f){return f.merge({nextSibling:r.getKey()})});var s=a?t.get(a):null,l=s?s.getParentKey():null;if(n.getChildKeys().forEach(function(f){Ui(f,o,function(d){return d.merge({parent:l})})}),l!=null){var u=t.get(l);Ui(l,o,function(f){return f.merge({children:u.getChildKeys().concat(n.getChildKeys())})})}Ui(n.getChildKeys().find(function(f){var d=t.get(f);return d.getNextSiblingKey()===null}),o,function(f){return f.merge({nextSibling:n.getNextSiblingKey()})})}})},D4e=function(t,n){if(n.isCollapsed())return t;var r=t.getBlockMap(),i=n.getStartKey(),o=n.getStartOffset(),a=n.getEndKey(),s=n.getEndOffset(),l=r.get(i),u=r.get(a),f=l instanceof $4e,d=[];if(f){var p=u.getChildKeys(),g=lx(a,r);u.getNextSiblingKey()&&(d=d.concat(g)),p.isEmpty()||(d=d.concat(g.concat([a]))),d=d.concat(lx(ZA(u,r),r))}var v;l===u?v=P4e(l.getCharacterList(),o,s):v=l.getCharacterList().slice(0,o).concat(u.getCharacterList().slice(s));var y=l.merge({text:l.getText().slice(0,o)+u.getText().slice(s),characterList:v}),w=f&&o===0&&s===0&&u.getParentKey()===i&&u.getPrevSiblingKey()==null,b=w?rz([[i,null]]):r.toSeq().skipUntil(function(C,k){return k===i}).takeUntil(function(C,k){return k===a}).filter(function(C,k){return d.indexOf(k)===-1}).concat(rz([[a,null]])).map(function(C,k){return k===i?y:null}),x=r.merge(b).filter(function(C){return!!C});return f&&l!==u&&(x=I4e(x,l,u,r)),t.merge({blockMap:x,selectionBefore:n,selectionAfter:n.merge({anchorKey:i,anchorOffset:o,focusKey:i,focusOffset:o,isBackward:!1})})},P4e=function(t,n,r){if(n===0)for(;n<r;)t=t.shift(),n++;else if(r===t.count())for(;r>n;)t=t.pop(),r--;else{var i=t.slice(0,n),o=t.slice(r);t=i.concat(o).toList()}return t},L4e=D4e,M4e=wa,F4e=qs,kG=cn,iz=bn,N4e=SG,B4e=kG.List,j4e=kG.Map,Z1=function(t,n,r){if(t){var i=n.get(t);i&&n.set(t,r(i))}},z4e=function(t,n,r){return t.withMutations(function(i){var o=n.getKey(),a=r.getKey();Z1(n.getParentKey(),i,function(s){var l=s.getChildKeys(),u=l.indexOf(o)+1,f=l.toArray();return f.splice(u,0,a),s.merge({children:B4e(f)})}),Z1(n.getNextSiblingKey(),i,function(s){return s.merge({prevSibling:a})}),Z1(o,i,function(s){return s.merge({nextSibling:a})}),Z1(a,i,function(s){return s.merge({prevSibling:o})})})},U4e=function(t,n){n.isCollapsed()||iz(!1);var r=n.getAnchorKey(),i=t.getBlockMap(),o=i.get(r),a=o.getText();if(!a){var s=o.getType();if(s==="unordered-list-item"||s==="ordered-list-item")return N4e(t,n,function(b){return b.merge({type:"unstyled",depth:0})})}var l=n.getAnchorOffset(),u=o.getCharacterList(),f=F4e(),d=o instanceof M4e,p=o.merge({text:a.slice(0,l),characterList:u.slice(0,l)}),g=p.merge({key:f,text:a.slice(l),characterList:u.slice(l),data:j4e()}),v=i.toSeq().takeUntil(function(b){return b===o}),y=i.toSeq().skipUntil(function(b){return b===o}).rest(),w=v.concat([[r,p],[f,g]],y).toOrderedMap();return d&&(o.getChildKeys().isEmpty()||iz(!1),w=z4e(w,p,g)),t.merge({blockMap:w,selectionBefore:n,selectionAfter:n.merge({anchorKey:f,anchorOffset:0,focusKey:f,focusOffset:0,isBackward:!1})})},K4e=U4e,W4e=xa,oz=Eze,V4e=Ize,H4e=Kze,q4e=PS,G4e=cn,Y4e=y4e,X4e=C4e,Z4e=bn,nT=SG,dm=_G,pm=L4e,J4e=K4e,Q4e=G4e.OrderedSet,Xb={replaceText:function(t,n,r,i,o){var a=dm(t,n),s=pm(a,n),l=W4e.create({style:i||Q4e(),entity:o||null});return X4e(s,s.getSelectionAfter(),r,l)},insertText:function(t,n,r,i,o){return n.isCollapsed()||Z4e(!1),Xb.replaceText(t,n,r,i,o)},moveText:function(t,n,r){var i=q4e(t,n),o=Xb.removeRange(t,n,"backward");return Xb.replaceWithFragment(o,r,i)},replaceWithFragment:function(t,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"REPLACE_WITH_NEW_DATA",o=dm(t,n),a=pm(o,n);return Y4e(a,a.getSelectionAfter(),r,i)},removeRange:function(t,n,r){var i,o,a,s;n.getIsBackward()&&(n=n.merge({anchorKey:n.getFocusKey(),anchorOffset:n.getFocusOffset(),focusKey:n.getAnchorKey(),focusOffset:n.getAnchorOffset(),isBackward:!1})),i=n.getAnchorKey(),o=n.getFocusKey(),a=t.getBlockForKey(i),s=t.getBlockForKey(o);var l=n.getStartOffset(),u=n.getEndOffset(),f=a.getEntityAt(l),d=s.getEntityAt(u-1);if(i===o&&f&&f===d){var p=H4e(t.getEntityMap(),a,s,n,r);return pm(t,p)}var g=dm(t,n);return pm(g,n)},splitBlock:function(t,n){var r=dm(t,n),i=pm(r,n);return J4e(i,i.getSelectionAfter())},applyInlineStyle:function(t,n,r){return oz.add(t,n,r)},removeInlineStyle:function(t,n,r){return oz.remove(t,n,r)},setBlockType:function(t,n,r){return nT(t,n,function(i){return i.merge({type:r,depth:0})})},setBlockData:function(t,n,r){return nT(t,n,function(i){return i.merge({data:r})})},mergeBlockData:function(t,n,r){return nT(t,n,function(i){return i.merge({data:i.getData().merge(r)})})},applyEntity:function(t,n,r){var i=dm(t,n);return V4e(i,n,r)}},so=Xb;function e5e(e){return Object.keys(e).map(function(t){return e[t]})}var TG=e5e;function t5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){n5e(e,i,n[i])})}return e}function n5e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r5e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var RG=Dy,i5e=TG,FI=cn,Vd=FI.List,o5e=FI.Repeat,AG=FI.Record,$G=function(){return!0},a5e={start:null,end:null},JA=AG(a5e),s5e={start:null,end:null,decoratorKey:null,leaves:null},rT=AG(s5e),l5e={generate:function(t,n,r){var i=n.getLength();if(!i)return Vd.of(new rT({start:0,end:0,decoratorKey:null,leaves:Vd.of(new JA({start:0,end:0}))}));var o=[],a=r?r.getDecorations(n,t):Vd(o5e(null,i)),s=n.getCharacterList();return RG(a,OG,$G,function(l,u){o.push(new rT({start:l,end:u,decoratorKey:a.get(l),leaves:u5e(s.slice(l,u).toList(),l)}))}),Vd(o)},fromJS:function(t){var n=t.leaves,r=r5e(t,["leaves"]);return new rT(t5e({},r,{leaves:n!=null?Vd(Array.isArray(n)?n:i5e(n)).map(function(i){return JA(i)}):null}))}};function u5e(e,t){var n=[],r=e.map(function(i){return i.getStyle()}).toList();return RG(r,OG,$G,function(i,o){n.push(new JA({start:i+t,end:o+t}))}),Vd(n)}function OG(e,t){return e===t}var c5e=l5e;function f5e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var d5e=cn,p5e=d5e.Record,h5e=p5e({type:"TOKEN",mutability:"IMMUTABLE",data:Object}),g5e=function(e){f5e(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.getType=function(){return this.get("type")},n.getMutability=function(){return this.get("mutability")},n.getData=function(){return this.get("data")},t}(h5e),IG=g5e;function m5e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,n=e=="x"?t:t&3|8;return n.toString(16)})}var v5e=m5e;function y5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){b5e(e,i,n[i])})}return e}function b5e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _5e=IG,x5e=cn,w5e=bn,QA=v5e,S5e=x5e.Map,pl=S5e(),hm=QA();function Ld(e,t){console.warn("WARNING: "+e+` will be deprecated soon!
|
|
439
|
-
Please use "`+t+'" instead.')}var vs={getLastCreatedEntityKey:function(){return Ld("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),vs.__getLastCreatedEntityKey()},create:function(t,n,r){return Ld("DraftEntity.create","contentState.createEntity"),vs.__create(t,n,r)},add:function(t){return Ld("DraftEntity.add","contentState.addEntity"),vs.__add(t)},get:function(t){return Ld("DraftEntity.get","contentState.getEntity"),vs.__get(t)},__getAll:function(){return pl},__loadWithEntities:function(t){pl=t,hm=QA()},mergeData:function(t,n){return Ld("DraftEntity.mergeData","contentState.mergeEntityData"),vs.__mergeData(t,n)},replaceData:function(t,n){return Ld("DraftEntity.replaceData","contentState.replaceEntityData"),vs.__replaceData(t,n)},__getLastCreatedEntityKey:function(){return hm},__create:function(t,n,r){return vs.__add(new
|
|
440
|
-
`)},n.getLastCreatedEntityKey=function(){return gs.__getLastCreatedEntityKey()},n.hasText=function(){var i=this.getBlockMap();return i.size>1||escape(i.first().getText()).replace(/%u200B/g,"").length>0},n.createEntity=function(i,o,a){return gs.__create(i,o,a),this},n.mergeEntityData=function(i,o){return gs.__mergeData(i,o),this},n.replaceEntityData=function(i,o){return gs.__replaceData(i,o),this},n.addEntity=function(i){return gs.__add(i),this},n.getEntity=function(i){return gs.__get(i)},n.getAllEntities=function(){return gs.__getAll()},n.loadWithEntities=function(i){return gs.__loadWithEntities(i)},t.createFromBlockArray=function(i,o){var a=Array.isArray(i)?i:i.contentBlocks,s=P5e.createFromArray(a),l=s.isEmpty()?new J1:J1.createEmpty(s.first().getKey());return new t({blockMap:s,entityMap:o||gs,selectionBefore:l,selectionAfter:l})},t.createFromText=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:/\r\n?|\n/g,a=i.split(o),s=a.map(function(l){return l=j5e(l),new uz({key:F5e(),text:l,type:"unstyled",characterList:lz(U5e(sz.EMPTY,l.length))})});return t.createFromBlockArray(s)},t.fromJS=function(i){return new t(az({},i,{blockMap:W5e(i.blockMap).map(t.createContentBlockFromJS),selectionBefore:new J1(i.selectionBefore),selectionAfter:new J1(i.selectionAfter)}))},t.createContentBlockFromJS=function(i){var o=i.characterList;return new uz(az({},i,{data:K5e(i.data),characterList:o!=null?lz((Array.isArray(o)?o:N5e(o)).map(function(a){return sz.fromJS(a)})):void 0}))},t}(H5e),NI=q5e,ux=bn,G5e="NEUTRAL",FS="LTR",PG="RTL",Zb=null;function cx(e){return e===FS||e===PG}function LG(e){return cx(e)||ux(!1),e===FS?"ltr":"rtl"}function Y5e(e,t){return cx(e)||ux(!1),cx(t)||ux(!1),e===t?null:LG(e)}function MG(e){Zb=e}function X5e(){MG(FS)}function Z5e(){return Zb||this.initGlobalDir(),Zb||ux(!1),Zb}var J5e={NEUTRAL:G5e,LTR:FS,RTL:PG,isStrong:cx,getHTMLDir:LG,getHTMLDirIfDifferent:Y5e,setGlobalDir:MG,initGlobalDir:X5e,getGlobalDir:Z5e},NS=J5e,Rl=NS,Q5e=bn,lv={L:"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",R:"־׀׃׆-א-ת-ׯװ-ײ׳-״-߀-߉ߊ-ߪߴ-ߵߺ-߿ࠀ-ࠕࠚࠤࠨ-࠰-࠾ࡀ-ࡘ-࡞-࢟יִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏ",AL:"؈؋؍؛؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍ܐܒ-ܯ-ݍ-ޥޱ-ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-ﯓ-ﴽ﵀-﵏ﵐ-ﶏ-ﶒ-ﷇ-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴﹶ-ﻼ-"},e6e=new RegExp("["+lv.L+lv.R+lv.AL+"]"),t6e=new RegExp("["+lv.R+lv.AL+"]");function FG(e){var t=e6e.exec(e);return t==null?null:t[0]}function NG(e){var t=FG(e);return t==null?Rl.NEUTRAL:t6e.exec(t)?Rl.RTL:Rl.LTR}function BG(e,t){if(t=t||Rl.NEUTRAL,!e.length)return t;var n=NG(e);return n===Rl.NEUTRAL?t:n}function BI(e,t){return t||(t=Rl.getGlobalDir()),Rl.isStrong(t)||Q5e(!1),BG(e,t)}function n6e(e,t){return BI(e,t)===Rl.LTR}function r6e(e,t){return BI(e,t)===Rl.RTL}var i6e={firstStrongChar:FG,firstStrongCharDir:NG,resolveBlockDir:BG,getDirection:BI,isDirectionLTR:n6e,isDirectionRTL:r6e},jI=i6e;function cz(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o6e=jI,fz=NS,a6e=bn,s6e=function(){function e(n){cz(this,"_defaultDir",void 0),cz(this,"_lastDir",void 0),n?fz.isStrong(n)||a6e(!1):n=fz.getGlobalDir(),this._defaultDir=n,this.reset()}var t=e.prototype;return t.reset=function(){this._lastDir=this._defaultDir},t.getDirection=function(r){return this._lastDir=o6e.getDirection(r,this._lastDir),this._lastDir},e}(),l6e=s6e,u6e=function(t){if(t!=null)return t;throw new Error("Got unexpected null or undefined")},lo=u6e,c6e=l6e,jG=cn,f6e=lo,d6e=jG.OrderedMap,Q1,p6e={getDirectionMap:function(t,n){Q1?Q1.reset():Q1=new c6e;var r=t.getBlockMap(),i=r.valueSeq().map(function(a){return f6e(Q1).getDirection(a.getText())}),o=d6e(r.keySeq().zip(i));return n!=null&&jG.is(n,o)?n:o}},h6e=p6e;function dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){zG(e,i,n[i])})}return e}function zG(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var BS=c5e,gm=NI,eb=h6e,iT=MS,Fy=cn,UG=Fy.OrderedSet,g6e=Fy.Record,Gc=Fy.Stack,pz=Fy.OrderedMap,m6e=Fy.List,v6e={allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:Gc(),selection:null,treeMap:null,undoStack:Gc()},hz=g6e(v6e),KG=function(){t.createEmpty=function(r){return this.createWithText("",r)},t.createWithText=function(r,i){return t.createWithContent(gm.createFromText(r),i)},t.createWithContent=function(r,i){if(r.getBlockMap().count()===0)return t.createEmpty(i);var o=r.getBlockMap().first().getKey();return t.create({currentContent:r,undoStack:Gc(),redoStack:Gc(),decorator:i||null,selection:iT.createEmpty(o)})},t.create=function(r){var i=r.currentContent,o=r.decorator,a=dz({},r,{treeMap:mz(i,o),directionMap:eb.getDirectionMap(i)});return new t(new hz(a))},t.fromJS=function(r){return new t(new hz(dz({},r,{directionMap:r.directionMap!=null?pz(r.directionMap):r.directionMap,inlineStyleOverride:r.inlineStyleOverride!=null?UG(r.inlineStyleOverride):r.inlineStyleOverride,nativelyRenderedContent:r.nativelyRenderedContent!=null?gm.fromJS(r.nativelyRenderedContent):r.nativelyRenderedContent,redoStack:r.redoStack!=null?Gc(r.redoStack.map(function(i){return gm.fromJS(i)})):r.redoStack,selection:r.selection!=null?new iT(r.selection):r.selection,treeMap:r.treeMap!=null?pz(r.treeMap).map(function(i){return m6e(i).map(function(o){return BS.fromJS(o)})}):r.treeMap,undoStack:r.undoStack!=null?Gc(r.undoStack.map(function(i){return gm.fromJS(i)})):r.undoStack,currentContent:gm.fromJS(r.currentContent)})))},t.set=function(r,i){var o=r.getImmutable().withMutations(function(a){var s=a.get("decorator"),l=s;i.decorator===null?l=null:i.decorator&&(l=i.decorator);var u=i.currentContent||r.getCurrentContent();if(l!==s){var f=a.get("treeMap"),d;l&&s?d=b6e(u,u.getBlockMap(),f,l,s):d=mz(u,l),a.merge({decorator:l,treeMap:d,nativelyRenderedContent:null});return}var p=r.getCurrentContent();u!==p&&a.set("treeMap",y6e(r,u.getBlockMap(),u.getEntityMap(),l)),a.merge(i)});return new t(o)};var e=t.prototype;e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.getSelection=function(){return this.getImmutable().get("selection")},e.getDecorator=function(){return this.getImmutable().get("decorator")},e.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},t.setInlineStyleOverride=function(r,i){return t.set(r,{inlineStyleOverride:i})},e.getCurrentInlineStyle=function(){var r=this.getInlineStyleOverride();if(r!=null)return r;var i=this.getCurrentContent(),o=this.getSelection();return o.isCollapsed()?x6e(i,o):w6e(i,o)},e.getBlockTree=function(r){return this.getImmutable().getIn(["treeMap",r])},e.isSelectionAtStartOfContent=function(){var r=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(r,0,0)},e.isSelectionAtEndOfContent=function(){var r=this.getCurrentContent(),i=r.getBlockMap(),o=i.last(),a=o.getLength();return this.getSelection().hasEdgeWithin(o.getKey(),a,a)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},t.acceptSelection=function(r,i){return gz(r,i,!1)},t.forceSelection=function(r,i){return i.getHasFocus()||(i=i.set("hasFocus",!0)),gz(r,i,!0)},t.moveSelectionToEnd=function(r){var i=r.getCurrentContent(),o=i.getLastBlock(),a=o.getKey(),s=o.getLength();return t.acceptSelection(r,new iT({anchorKey:a,anchorOffset:s,focusKey:a,focusOffset:s,isBackward:!1}))},t.moveFocusToEnd=function(r){var i=t.moveSelectionToEnd(r);return t.forceSelection(i,i.getSelection())},t.push=function(r,i,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(r.getCurrentContent()===i)return r;var s=eb.getDirectionMap(i,r.getDirectionMap());if(!r.getAllowUndo())return t.set(r,{currentContent:i,directionMap:s,lastChangeType:o,selection:i.getSelectionAfter(),forceSelection:a,inlineStyleOverride:null});var l=r.getSelection(),u=r.getCurrentContent(),f=r.getUndoStack(),d=i;l!==u.getSelectionAfter()||_6e(r,o)?(f=f.push(u),d=d.set("selectionBefore",l)):(o==="insert-characters"||o==="backspace-character"||o==="delete-character")&&(d=d.set("selectionBefore",u.getSelectionBefore()));var p=r.getInlineStyleOverride(),g=["adjust-depth","change-block-type","split-block"];g.indexOf(o)===-1&&(p=null);var v={currentContent:d,directionMap:s,undoStack:f,redoStack:Gc(),lastChangeType:o,selection:i.getSelectionAfter(),forceSelection:a,inlineStyleOverride:p};return t.set(r,v)},t.undo=function(r){if(!r.getAllowUndo())return r;var i=r.getUndoStack(),o=i.peek();if(!o)return r;var a=r.getCurrentContent(),s=eb.getDirectionMap(o,r.getDirectionMap());return t.set(r,{currentContent:o,directionMap:s,undoStack:i.shift(),redoStack:r.getRedoStack().push(a),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:a.getSelectionBefore()})},t.redo=function(r){if(!r.getAllowUndo())return r;var i=r.getRedoStack(),o=i.peek();if(!o)return r;var a=r.getCurrentContent(),s=eb.getDirectionMap(o,r.getDirectionMap());return t.set(r,{currentContent:o,directionMap:s,undoStack:r.getUndoStack().push(a),redoStack:i.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:o.getSelectionAfter()})};function t(n){zG(this,"_immutable",void 0),this._immutable=n}return e.getImmutable=function(){return this._immutable},t}();function gz(e,t,n){return KG.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function mz(e,t){return e.getBlockMap().map(function(n){return BS.generate(e,n,t)}).toOrderedMap()}function y6e(e,t,n,r){var i=e.getCurrentContent().set("entityMap",n),o=i.getBlockMap(),a=e.getImmutable().get("treeMap");return a.merge(t.toSeq().filter(function(s,l){return s!==o.get(l)}).map(function(s){return BS.generate(i,s,r)}))}function b6e(e,t,n,r,i){return n.merge(t.toSeq().filter(function(o){return r.getDecorations(o,e)!==i.getDecorations(o,e)}).map(function(o){return BS.generate(e,o,r)}))}function _6e(e,t){var n=e.getLastChangeType();return t!==n||t!=="insert-characters"&&t!=="backspace-character"&&t!=="delete-character"}function x6e(e,t){var n=t.getStartKey(),r=t.getStartOffset(),i=e.getBlockForKey(n);return r>0?i.getInlineStyleAt(r-1):i.getLength()?i.getInlineStyleAt(0):WG(e,n)}function w6e(e,t){var n=t.getStartKey(),r=t.getStartOffset(),i=e.getBlockForKey(n);return r<i.getLength()?i.getInlineStyleAt(r):r>0?i.getInlineStyleAt(r-1):WG(e,n)}function WG(e,t){var n=e.getBlockMap().reverse().skipUntil(function(r,i){return i===t}).skip(1).skipUntil(function(r,i){return r.getLength()}).first();return n?n.getInlineStyleAt(n.getLength()-1):UG()}var zn=KG,S6e=wa,C6e=CG,VG=cn,tb=bn,E6e=VG.OrderedMap,k6e=VG.List,Ic=function(t,n,r){if(t){var i=n.get(t);i&&n.set(t,r(i))}},T6e=function(t,n,r,i,o){if(!o)return t;var a=i==="after",s=n.getKey(),l=r.getKey(),u=n.getParentKey(),f=n.getNextSiblingKey(),d=n.getPrevSiblingKey(),p=r.getParentKey(),g=a?r.getNextSiblingKey():l,v=a?l:r.getPrevSiblingKey();return t.withMutations(function(y){Ic(u,y,function(w){var b=w.getChildKeys();return w.merge({children:b.delete(b.indexOf(s))})}),Ic(d,y,function(w){return w.merge({nextSibling:f})}),Ic(f,y,function(w){return w.merge({prevSibling:d})}),Ic(g,y,function(w){return w.merge({prevSibling:s})}),Ic(v,y,function(w){return w.merge({nextSibling:s})}),Ic(p,y,function(w){var b=w.getChildKeys(),x=b.indexOf(l),C=a?x+1:x!==0?x-1:0,k=b.toArray();return k.splice(C,0,s),w.merge({children:k6e(k)})}),Ic(s,y,function(w){return w.merge({nextSibling:g,prevSibling:v,parent:p})})})},R6e=function(t,n,r,i){i==="replace"&&tb(!1);var o=r.getKey(),a=n.getKey();a===o&&tb(!1);var s=t.getBlockMap(),l=n instanceof S6e,u=[n],f=s.delete(a);l&&(u=[],f=s.withMutations(function(b){var x=n.getNextSiblingKey(),C=C6e(n,b);b.toSeq().skipUntil(function(k){return k.getKey()===a}).takeWhile(function(k){var R=k.getKey(),A=R===a,O=x&&R!==x,z=!x&&k.getParentKey()&&(!C||R!==C);return!!(A||O||z)}).forEach(function(k){u.push(k),b.delete(k.getKey())})}));var d=f.toSeq().takeUntil(function(b){return b===r}),p=f.toSeq().skipUntil(function(b){return b===r}).skip(1),g=u.map(function(b){return[b.getKey(),b]}),v=E6e();if(i==="before"){var y=t.getBlockBefore(o);!y||y.getKey()!==n.getKey()||tb(!1),v=d.concat([].concat(g,[[o,r]]),p).toOrderedMap()}else if(i==="after"){var w=t.getBlockAfter(o);!w||w.getKey()!==a||tb(!1),v=d.concat([[o,r]].concat(g),p).toOrderedMap()}return t.merge({blockMap:T6e(v,n,r,i,l),selectionBefore:t.getSelectionAfter(),selectionAfter:t.getSelectionAfter().merge({anchorKey:a,focusKey:a})})},A6e=R6e;function vz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){$6e(e,i,n[i])})}return e}function $6e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var O6e=Iy,I6e=xa,D6e=Mf,P6e=wa,Md=so,yz=zn,bz=qs,L6e=cc,HG=cn,nb=A6e,qG=L6e("draft_tree_data_support"),_z=qG?P6e:D6e,M6e=HG.List,F6e=HG.Repeat,N6e={insertAtomicBlock:function(t,n,r){var i=t.getCurrentContent(),o=t.getSelection(),a=Md.removeRange(i,o,"backward"),s=a.getSelectionAfter(),l=Md.splitBlock(a,s),u=l.getSelectionAfter(),f=Md.setBlockType(l,u,"atomic"),d=I6e.create({entity:n}),p={key:bz(),type:"atomic",text:r,characterList:M6e(F6e(d,r.length))},g={key:bz(),type:"unstyled"};qG&&(p=vz({},p,{nextSibling:g.key}),g=vz({},g,{prevSibling:p.key}));var v=[new _z(p),new _z(g)],y=O6e.createFromArray(v),w=Md.replaceWithFragment(f,u,y),b=w.merge({selectionBefore:o,selectionAfter:w.getSelectionAfter().set("hasFocus",!0)});return yz.push(t,b,"insert-fragment")},moveAtomicBlock:function(t,n,r,i){var o=t.getCurrentContent(),a=t.getSelection(),s;if(i==="before"||i==="after"){var l=o.getBlockForKey(i==="before"?r.getStartKey():r.getEndKey());s=nb(o,n,l,i)}else{var u=Md.removeRange(o,r,"backward"),f=u.getSelectionAfter(),d=u.getBlockForKey(f.getFocusKey());if(f.getStartOffset()===0)s=nb(u,n,d,"before");else if(f.getEndOffset()===d.getLength())s=nb(u,n,d,"after");else{var p=Md.splitBlock(u,f),g=p.getSelectionAfter(),v=p.getBlockForKey(g.getFocusKey());s=nb(p,n,v,"before")}}var y=s.merge({selectionBefore:a,selectionAfter:s.getSelectionAfter().set("hasFocus",!0)});return yz.push(t,y,"move-block")}},B6e=N6e;function j6e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z6e=cn,U6e=z6e.List,oT=".",K6e=function(){function e(n){j6e(this,"_decorators",void 0),this._decorators=n.slice()}var t=e.prototype;return t.getDecorations=function(r,i){var o=Array(r.getText().length).fill(null);return this._decorators.forEach(function(a,s){var l=0,u=a.strategy,f=function(p,g){W6e(o,p,g)&&(V6e(o,p,g,s+oT+l),l++)};u(r,f,i)}),U6e(o)},t.getComponentForKey=function(r){var i=parseInt(r.split(oT)[0],10);return this._decorators[i].component},t.getPropsForKey=function(r){var i=parseInt(r.split(oT)[0],10);return this._decorators[i].props},e}();function W6e(e,t,n){for(var r=t;r<n;r++)if(e[r]!=null)return!1;return!0}function V6e(e,t,n,r){for(var i=t;i<n;i++)e[i]=r}var H6e=K6e;function q6e(e){return typeof e=="object"?Object.keys(e).filter(function(t){return e[t]}).map(xz).join(" "):Array.prototype.map.call(arguments,xz).join(" ")}function xz(e){return e.replace(/\//g,"-")}var Ff=q6e,zI=T,UI=Ff,G6e=cn,Y6e=G6e.Map,X6e=zI.createElement("ul",{className:UI("public/DraftStyleDefault/ul")}),Z6e=zI.createElement("ol",{className:UI("public/DraftStyleDefault/ol")}),J6e=zI.createElement("pre",{className:UI("public/DraftStyleDefault/pre")}),Q6e=Y6e({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:X6e},"ordered-list-item":{element:"li",wrapper:Z6e},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:J6e},unstyled:{element:"div",aliasedElements:["p"]}}),KI=Q6e,GG={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}};/*
|
|
438
|
+
`,Fje=({message:e,elements:t,actions:n,indent:r,showAvatar:i,showBorder:o,isRunning:a,isLast:s})=>{const l=Ct(Hs),u=Ct(zq),[f,d]=T.useState(l.expandAll);return T.useEffect(()=>{d(l.expandAll)},[l.expandAll]),l.hideCot&&r?null:S.jsxs(at,{sx:{color:"text.primary",backgroundColor:"transparent"},className:"message",children:[S.jsx(at,{sx:{boxSizing:"border-box",mx:"auto",maxWidth:"60rem",display:"flex",flexDirection:"column",position:"relative"},children:S.jsxs(Ht,{id:`message-${e.id}`,direction:"row",ml:r?`${r*(qA+16)}px`:0,sx:{py:2,borderBottom:p=>o?`1px solid ${p.palette.divider}`:"none",animation:e.id&&u===e.id?`3s ease-in-out 0.1s ${Mje}`:"none"},children:[S.jsx(M3e,{message:e,show:i}),S.jsxs(Ht,{alignItems:"flex-start",width:0,flexGrow:1,spacing:1,minWidth:200,children:[S.jsx(Pje,{authorIsUser:e.authorIsUser,elements:t,id:e.id,content:e.content,language:e.language}),S.jsx(Lje,{message:e,opened:f,onClick:()=>d(!f),loading:a}),!a&&s&&e.waitForAnswer&&S.jsx(O3e,{}),S.jsx(aje,{message:e,actions:n})]})]})}),e.subMessages&&f&&S.jsx(uG,{messages:e.subMessages,actions:n,elements:t,indent:r+1,isRunning:a})]})};function Nje(e,t){if(e.length-1===t)return!0;for(let n=t+1;n<e.length;n++)if(!e[n].streaming)return!1;return!0}function uG({messages:e,elements:t,actions:n,indent:r,isRunning:i}){const o=Ct(Ry),a=r===0;let s="";const l=e.filter((u,f)=>{var y;const d=!!u.content,p=!!((y=u.subMessages)!=null&&y.length),g=f===e.length-1;return d||p||!d&&(i===void 0?o&&g:i&&g)});return S.jsx(S.Fragment,{children:l.map((u,f)=>{const d=Nje(l,f);let p=i===void 0?o:i;a&&(p=p&&d);const g=u.author!==s,v=!1;return s=u.author,S.jsx(Fje,{message:u,elements:t,actions:n,showAvatar:g,showBorder:v,indent:r,isRunning:p,isLast:d},u.id)})})}function Bje(e){const t=[],n={};function r(i,o){if(i){const a=n[i];if(!a)return;a.subMessages||(a.subMessages=[]),a.subMessages.push(o)}else t.push(o)}for(const i of e){const o={...i};i.id&&(n[i.id]=o)}for(const i of e){if(!i.id){t.push({...i});continue}const o=n[i.id];o&&r(i.parentId,o)}return jje(t)}function jje(e){const t=[],n=[];for(const r of e){const i={...r},o=r.indent||0;if(o&&!r.authorIsUser&&!r.waitForAnswer){for(;n.length>0&&(n[n.length-1].indent||0)>=o;)n.pop();const a=n[n.length-1];a&&(a.subMessages||(a.subMessages=[]),a.subMessages.push(i))}else t.push(i);n.push(i)}return t}const cG=({messages:e,elements:t,actions:n,autoScroll:r,setAutoScroll:i})=>{const o=T.useRef(),a=Bje(e);T.useEffect(()=>{!o.current||!r||(o.current.scrollTop=o.current.scrollHeight)},[e,r]);const s=()=>{if(!o.current||!i)return;const{scrollTop:l,scrollHeight:u,clientHeight:f}=o.current,d=l+f>=u-10;i(d)};return S.jsx(at,{ref:o,position:"relative",display:"flex",flexDirection:"column",overflow:"auto",flexGrow:1,onScroll:s,children:S.jsx(uG,{indent:0,messages:a,elements:t,actions:n})})};var DI={},zje=vn;Object.defineProperty(DI,"__esModule",{value:!0});var fG=DI.default=void 0,Uje=zje(yn()),Kje=S,Wje=(0,Uje.default)((0,Kje.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"Restore");fG=DI.default=Wje;class dG extends T.Component{constructor(){super(...arguments);ds(this,"state",{hasError:!1,error:void 0})}static getDerivedStateFromError(n){return{hasError:!0,error:n.message}}componentDidCatch(n,r){console.error("Uncaught error:",n,r)}render(){if(this.state.hasError){const n=this.props.prefix?`${this.props.prefix}: ${this.state.error}`:this.state.error;return S.jsx(at,{flexGrow:1,children:S.jsx(ro,{severity:"error",children:n})})}return this.props.children}}function Vje({children:e}){return S.jsx(Ht,{direction:"row",sx:{backgroundColor:t=>t.palette.background.paper,padding:"16px 24px",alignItems:"center",justifyContent:"flex-end",gap:2},children:e})}var pG={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ni,function(){var n=Array.prototype.slice;function r(m,E){E&&(m.prototype=Object.create(E.prototype)),m.prototype.constructor=m}function i(m){return l(m)?m:Pe(m)}r(o,i);function o(m){return u(m)?m:je(m)}r(a,i);function a(m){return f(m)?m:Fe(m)}r(s,i);function s(m){return l(m)&&!d(m)?m:tt(m)}function l(m){return!!(m&&m[g])}function u(m){return!!(m&&m[v])}function f(m){return!!(m&&m[y])}function d(m){return u(m)||f(m)}function p(m){return!!(m&&m[w])}i.isIterable=l,i.isKeyed=u,i.isIndexed=f,i.isAssociative=d,i.isOrdered=p,i.Keyed=o,i.Indexed=a,i.Set=s;var g="@@__IMMUTABLE_ITERABLE__@@",v="@@__IMMUTABLE_KEYED__@@",y="@@__IMMUTABLE_INDEXED__@@",w="@@__IMMUTABLE_ORDERED__@@",b="delete",x=5,C=1<<x,k=C-1,R={},A={value:!1},O={value:!1};function z(m){return m.value=!1,m}function V(m){m&&(m.value=!0)}function D(){}function W(m,E){E=E||0;for(var I=Math.max(0,m.length-E),F=new Array(I),j=0;j<I;j++)F[j]=m[j+E];return F}function ie(m){return m.size===void 0&&(m.size=m.__iterate(K)),m.size}function se(m,E){if(typeof E!="number"){var I=E>>>0;if(""+I!==E||I===4294967295)return NaN;E=I}return E<0?ie(m)+E:E}function K(){return!0}function G(m,E,I){return(m===0||I!==void 0&&m<=-I)&&(E===void 0||I!==void 0&&E>=I)}function Q(m,E){return Z(m,E,0)}function le(m,E){return Z(m,E,E)}function Z(m,E,I){return m===void 0?I:m<0?Math.max(0,E+m):E===void 0?m:Math.min(E,m)}var ee=0,P=1,ge=2,B=typeof Symbol=="function"&&Symbol.iterator,L="@@iterator",ae=B||L;function ue(m){this.next=m}ue.prototype.toString=function(){return"[Iterator]"},ue.KEYS=ee,ue.VALUES=P,ue.ENTRIES=ge,ue.prototype.inspect=ue.prototype.toSource=function(){return this.toString()},ue.prototype[ae]=function(){return this};function ne(m,E,I,F){var j=m===0?E:m===1?I:[E,I];return F?F.value=j:F={value:j,done:!1},F}function we(){return{value:void 0,done:!0}}function Te(m){return!!Be(m)}function Ee(m){return m&&typeof m.next=="function"}function Le(m){var E=Be(m);return E&&E.call(m)}function Be(m){var E=m&&(B&&m[B]||m[L]);if(typeof E=="function")return E}function Ie(m){return m&&typeof m.length=="number"}r(Pe,i);function Pe(m){return m==null?U():l(m)?m.toSeq():Y(m)}Pe.of=function(){return Pe(arguments)},Pe.prototype.toSeq=function(){return this},Pe.prototype.toString=function(){return this.__toString("Seq {","}")},Pe.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},Pe.prototype.__iterate=function(m,E){return oe(this,m,E,!0)},Pe.prototype.__iterator=function(m,E){return xe(this,m,E,!0)},r(je,Pe);function je(m){return m==null?U().toKeyedSeq():l(m)?u(m)?m.toSeq():m.fromEntrySeq():H(m)}je.prototype.toKeyedSeq=function(){return this},r(Fe,Pe);function Fe(m){return m==null?U():l(m)?u(m)?m.entrySeq():m.toIndexedSeq():fe(m)}Fe.of=function(){return Fe(arguments)},Fe.prototype.toIndexedSeq=function(){return this},Fe.prototype.toString=function(){return this.__toString("Seq [","]")},Fe.prototype.__iterate=function(m,E){return oe(this,m,E,!1)},Fe.prototype.__iterator=function(m,E){return xe(this,m,E,!1)},r(tt,Pe);function tt(m){return(m==null?U():l(m)?u(m)?m.entrySeq():m:fe(m)).toSetSeq()}tt.of=function(){return tt(arguments)},tt.prototype.toSetSeq=function(){return this},Pe.isSeq=Re,Pe.Keyed=je,Pe.Set=tt,Pe.Indexed=Fe;var Xe="@@__IMMUTABLE_SEQ__@@";Pe.prototype[Xe]=!0,r(Ye,Fe);function Ye(m){this._array=m,this.size=m.length}Ye.prototype.get=function(m,E){return this.has(m)?this._array[se(this,m)]:E},Ye.prototype.__iterate=function(m,E){for(var I=this._array,F=I.length-1,j=0;j<=F;j++)if(m(I[E?F-j:j],j,this)===!1)return j+1;return j},Ye.prototype.__iterator=function(m,E){var I=this._array,F=I.length-1,j=0;return new ue(function(){return j>F?we():ne(m,j,I[E?F-j++:j++])})},r(st,je);function st(m){var E=Object.keys(m);this._object=m,this._keys=E,this.size=E.length}st.prototype.get=function(m,E){return E!==void 0&&!this.has(m)?E:this._object[m]},st.prototype.has=function(m){return this._object.hasOwnProperty(m)},st.prototype.__iterate=function(m,E){for(var I=this._object,F=this._keys,j=F.length-1,re=0;re<=j;re++){var pe=F[E?j-re:re];if(m(I[pe],pe,this)===!1)return re+1}return re},st.prototype.__iterator=function(m,E){var I=this._object,F=this._keys,j=F.length-1,re=0;return new ue(function(){var pe=F[E?j-re:re];return re++>j?we():ne(m,pe,I[pe])})},st.prototype[w]=!0,r(he,Fe);function he(m){this._iterable=m,this.size=m.length||m.size}he.prototype.__iterateUncached=function(m,E){if(E)return this.cacheResult().__iterate(m,E);var I=this._iterable,F=Le(I),j=0;if(Ee(F))for(var re;!(re=F.next()).done&&m(re.value,j++,this)!==!1;);return j},he.prototype.__iteratorUncached=function(m,E){if(E)return this.cacheResult().__iterator(m,E);var I=this._iterable,F=Le(I);if(!Ee(F))return new ue(we);var j=0;return new ue(function(){var re=F.next();return re.done?re:ne(m,j++,re.value)})},r(Ae,Fe);function Ae(m){this._iterator=m,this._iteratorCache=[]}Ae.prototype.__iterateUncached=function(m,E){if(E)return this.cacheResult().__iterate(m,E);for(var I=this._iterator,F=this._iteratorCache,j=0;j<F.length;)if(m(F[j],j++,this)===!1)return j;for(var re;!(re=I.next()).done;){var pe=re.value;if(F[j]=pe,m(pe,j++,this)===!1)break}return j},Ae.prototype.__iteratorUncached=function(m,E){if(E)return this.cacheResult().__iterator(m,E);var I=this._iterator,F=this._iteratorCache,j=0;return new ue(function(){if(j>=F.length){var re=I.next();if(re.done)return re;F[j]=re.value}return ne(m,j,F[j++])})};function Re(m){return!!(m&&m[Xe])}var Ne;function U(){return Ne||(Ne=new Ye([]))}function H(m){var E=Array.isArray(m)?new Ye(m).fromEntrySeq():Ee(m)?new Ae(m).fromEntrySeq():Te(m)?new he(m).fromEntrySeq():typeof m=="object"?new st(m):void 0;if(!E)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+m);return E}function fe(m){var E=X(m);if(!E)throw new TypeError("Expected Array or iterable object of values: "+m);return E}function Y(m){var E=X(m)||typeof m=="object"&&new st(m);if(!E)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+m);return E}function X(m){return Ie(m)?new Ye(m):Ee(m)?new Ae(m):Te(m)?new he(m):void 0}function oe(m,E,I,F){var j=m._cache;if(j){for(var re=j.length-1,pe=0;pe<=re;pe++){var Se=j[I?re-pe:pe];if(E(Se[1],F?Se[0]:pe,m)===!1)return pe+1}return pe}return m.__iterateUncached(E,I)}function xe(m,E,I,F){var j=m._cache;if(j){var re=j.length-1,pe=0;return new ue(function(){var Se=j[I?re-pe:pe];return pe++>re?we():ne(E,F?Se[0]:pe-1,Se[1])})}return m.__iteratorUncached(E,I)}function Ce(m,E){return E?_e(E,m,"",{"":m}):nt(m)}function _e(m,E,I,F){return Array.isArray(E)?m.call(F,I,Fe(E).map(function(j,re){return _e(m,j,re,E)})):rt(E)?m.call(F,I,je(E).map(function(j,re){return _e(m,j,re,E)})):E}function nt(m){return Array.isArray(m)?Fe(m).map(nt).toList():rt(m)?je(m).map(nt).toMap():m}function rt(m){return m&&(m.constructor===Object||m.constructor===void 0)}function de(m,E){if(m===E||m!==m&&E!==E)return!0;if(!m||!E)return!1;if(typeof m.valueOf=="function"&&typeof E.valueOf=="function"){if(m=m.valueOf(),E=E.valueOf(),m===E||m!==m&&E!==E)return!0;if(!m||!E)return!1}return!!(typeof m.equals=="function"&&typeof E.equals=="function"&&m.equals(E))}function me(m,E){if(m===E)return!0;if(!l(E)||m.size!==void 0&&E.size!==void 0&&m.size!==E.size||m.__hash!==void 0&&E.__hash!==void 0&&m.__hash!==E.__hash||u(m)!==u(E)||f(m)!==f(E)||p(m)!==p(E))return!1;if(m.size===0&&E.size===0)return!0;var I=!d(m);if(p(m)){var F=m.entries();return E.every(function(Oe,De){var te=F.next().value;return te&&de(te[1],Oe)&&(I||de(te[0],De))})&&F.next().done}var j=!1;if(m.size===void 0)if(E.size===void 0)typeof m.cacheResult=="function"&&m.cacheResult();else{j=!0;var re=m;m=E,E=re}var pe=!0,Se=E.__iterate(function(Oe,De){if(I?!m.has(Oe):j?!de(Oe,m.get(De,R)):!de(m.get(De,R),Oe))return pe=!1,!1});return pe&&m.size===Se}r($e,Fe);function $e(m,E){if(!(this instanceof $e))return new $e(m,E);if(this._value=m,this.size=E===void 0?1/0:Math.max(0,E),this.size===0){if(Ve)return Ve;Ve=this}}$e.prototype.toString=function(){return this.size===0?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$e.prototype.get=function(m,E){return this.has(m)?this._value:E},$e.prototype.includes=function(m){return de(this._value,m)},$e.prototype.slice=function(m,E){var I=this.size;return G(m,E,I)?this:new $e(this._value,le(E,I)-Q(m,I))},$e.prototype.reverse=function(){return this},$e.prototype.indexOf=function(m){return de(this._value,m)?0:-1},$e.prototype.lastIndexOf=function(m){return de(this._value,m)?this.size:-1},$e.prototype.__iterate=function(m,E){for(var I=0;I<this.size;I++)if(m(this._value,I,this)===!1)return I+1;return I},$e.prototype.__iterator=function(m,E){var I=this,F=0;return new ue(function(){return F<I.size?ne(m,F++,I._value):we()})},$e.prototype.equals=function(m){return m instanceof $e?de(this._value,m._value):me(m)};var Ve;function He(m,E){if(!m)throw new Error(E)}r(Ze,Fe);function Ze(m,E,I){if(!(this instanceof Ze))return new Ze(m,E,I);if(He(I!==0,"Cannot step a Range by 0"),m=m||0,E===void 0&&(E=1/0),I=I===void 0?1:Math.abs(I),E<m&&(I=-I),this._start=m,this._end=E,this._step=I,this.size=Math.max(0,Math.ceil((E-m)/I-1)+1),this.size===0){if(dt)return dt;dt=this}}Ze.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},Ze.prototype.get=function(m,E){return this.has(m)?this._start+se(this,m)*this._step:E},Ze.prototype.includes=function(m){var E=(m-this._start)/this._step;return E>=0&&E<this.size&&E===Math.floor(E)},Ze.prototype.slice=function(m,E){return G(m,E,this.size)?this:(m=Q(m,this.size),E=le(E,this.size),E<=m?new Ze(0,0):new Ze(this.get(m,this._end),this.get(E,this._end),this._step))},Ze.prototype.indexOf=function(m){var E=m-this._start;if(E%this._step===0){var I=E/this._step;if(I>=0&&I<this.size)return I}return-1},Ze.prototype.lastIndexOf=function(m){return this.indexOf(m)},Ze.prototype.__iterate=function(m,E){for(var I=this.size-1,F=this._step,j=E?this._start+I*F:this._start,re=0;re<=I;re++){if(m(j,re,this)===!1)return re+1;j+=E?-F:F}return re},Ze.prototype.__iterator=function(m,E){var I=this.size-1,F=this._step,j=E?this._start+I*F:this._start,re=0;return new ue(function(){var pe=j;return j+=E?-F:F,re>I?we():ne(m,re++,pe)})},Ze.prototype.equals=function(m){return m instanceof Ze?this._start===m._start&&this._end===m._end&&this._step===m._step:me(this,m)};var dt;r(ct,i);function ct(){throw TypeError("Abstract")}r(ot,ct);function ot(){}r(ht,ct);function ht(){}r(Ot,ct);function Ot(){}ct.Keyed=ot,ct.Indexed=ht,ct.Set=Ot;var rn=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(E,I){E=E|0,I=I|0;var F=E&65535,j=I&65535;return F*j+((E>>>16)*j+F*(I>>>16)<<16>>>0)|0};function Qt(m){return m>>>1&1073741824|m&3221225471}function Xt(m){if(m===!1||m===null||m===void 0||typeof m.valueOf=="function"&&(m=m.valueOf(),m===!1||m===null||m===void 0))return 0;if(m===!0)return 1;var E=typeof m;if(E==="number"){var I=m|0;for(I!==m&&(I^=m*4294967295);m>4294967295;)m/=4294967295,I^=m;return Qt(I)}if(E==="string")return m.length>Hl?br(m):kn(m);if(typeof m.hashCode=="function")return m.hashCode();if(E==="object")return Fr(m);if(typeof m.toString=="function")return kn(m.toString());throw new Error("Value type "+E+" cannot be hashed.")}function br(m){var E=co[m];return E===void 0&&(E=kn(m),On===$n&&(On=0,co={}),On++,co[m]=E),E}function kn(m){for(var E=0,I=0;I<m.length;I++)E=31*E+m.charCodeAt(I)|0;return Qt(E)}function Fr(m){var E;if(xi&&(E=Zs.get(m),E!==void 0)||(E=m[qr],E!==void 0)||!kr&&(E=m.propertyIsEnumerable&&m.propertyIsEnumerable[qr],E!==void 0||(E=Hr(m),E!==void 0)))return E;if(E=++wi,wi&1073741824&&(wi=0),xi)Zs.set(m,E);else{if(_r!==void 0&&_r(m)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(kr)Object.defineProperty(m,qr,{enumerable:!1,configurable:!1,writable:!1,value:E});else if(m.propertyIsEnumerable!==void 0&&m.propertyIsEnumerable===m.constructor.prototype.propertyIsEnumerable)m.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},m.propertyIsEnumerable[qr]=E;else if(m.nodeType!==void 0)m[qr]=E;else throw new Error("Unable to set a non-enumerable property on object.")}return E}var _r=Object.isExtensible,kr=function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}}();function Hr(m){if(m&&m.nodeType>0)switch(m.nodeType){case 1:return m.uniqueID;case 9:return m.documentElement&&m.documentElement.uniqueID}}var xi=typeof WeakMap=="function",Zs;xi&&(Zs=new WeakMap);var wi=0,qr="__immutablehash__";typeof Symbol=="function"&&(qr=Symbol(qr));var Hl=16,$n=255,On=0,co={};function dr(m){He(m!==1/0,"Cannot perform this action with an infinite size.")}r($t,ot);function $t(m){return m==null?No():pc(m)&&!p(m)?m:No().withMutations(function(E){var I=o(m);dr(I.size),I.forEach(function(F,j){return E.set(j,F)})})}$t.prototype.toString=function(){return this.__toString("Map {","}")},$t.prototype.get=function(m,E){return this._root?this._root.get(0,void 0,m,E):E},$t.prototype.set=function(m,E){return t0(this,m,E)},$t.prototype.setIn=function(m,E){return this.updateIn(m,R,function(){return E})},$t.prototype.remove=function(m){return t0(this,m,R)},$t.prototype.deleteIn=function(m){return this.updateIn(m,function(){return R})},$t.prototype.update=function(m,E,I){return arguments.length===1?m(this):this.updateIn([m],E,I)},$t.prototype.updateIn=function(m,E,I){I||(I=E,E=void 0);var F=o0(this,ad(m),E,I);return F===R?void 0:F},$t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):No()},$t.prototype.merge=function(){return td(this,void 0,arguments)},$t.prototype.mergeWith=function(m){var E=n.call(arguments,1);return td(this,m,E)},$t.prototype.mergeIn=function(m){var E=n.call(arguments,1);return this.updateIn(m,No(),function(I){return typeof I.merge=="function"?I.merge.apply(I,E):E[E.length-1]})},$t.prototype.mergeDeep=function(){return td(this,Zh,arguments)},$t.prototype.mergeDeepWith=function(m){var E=n.call(arguments,1);return td(this,gc(m),E)},$t.prototype.mergeDeepIn=function(m){var E=n.call(arguments,1);return this.updateIn(m,No(),function(I){return typeof I.mergeDeep=="function"?I.mergeDeep.apply(I,E):E[E.length-1]})},$t.prototype.sort=function(m){return ar(el(this,m))},$t.prototype.sortBy=function(m,E){return ar(el(this,E,m))},$t.prototype.withMutations=function(m){var E=this.asMutable();return m(E),E.wasAltered()?E.__ensureOwner(this.__ownerID):this},$t.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new D)},$t.prototype.asImmutable=function(){return this.__ensureOwner()},$t.prototype.wasAltered=function(){return this.__altered},$t.prototype.__iterator=function(m,E){return new Vh(this,m,E)},$t.prototype.__iterate=function(m,E){var I=this,F=0;return this._root&&this._root.iterate(function(j){return F++,m(j[1],j[0],I)},E),F},$t.prototype.__ensureOwner=function(m){return m===this.__ownerID?this:m?Qf(this.size,this._root,m,this.__hash):(this.__ownerID=m,this.__altered=!1,this)};function pc(m){return!!(m&&m[Jf])}$t.isMap=pc;var Jf="@@__IMMUTABLE_MAP__@@",lt=$t.prototype;lt[Jf]=!0,lt[b]=lt.remove,lt.removeIn=lt.deleteIn;function xr(m,E){this.ownerID=m,this.entries=E}xr.prototype.get=function(m,E,I,F){for(var j=this.entries,re=0,pe=j.length;re<pe;re++)if(de(I,j[re][0]))return j[re][1];return F},xr.prototype.update=function(m,E,I,F,j,re,pe){for(var Se=j===R,Oe=this.entries,De=0,te=Oe.length;De<te&&!de(F,Oe[De][0]);De++);var be=De<te;if(be?Oe[De][1]===j:Se)return this;if(V(pe),(Se||!be)&&V(re),!(Se&&Oe.length===1)){if(!be&&!Se&&Oe.length>=a0)return r0(m,Oe,F,j);var ye=m&&m===this.ownerID,We=ye?Oe:W(Oe);return be?Se?De===te-1?We.pop():We[De]=We.pop():We[De]=[F,j]:We.push([F,j]),ye?(this.entries=We,this):new xr(m,We)}};function Ea(m,E,I){this.ownerID=m,this.bitmap=E,this.nodes=I}Ea.prototype.get=function(m,E,I,F){E===void 0&&(E=Xt(I));var j=1<<((m===0?E:E>>>m)&k),re=this.bitmap;return re&j?this.nodes[Qh(re&j-1)].get(m+x,E,I,F):F},Ea.prototype.update=function(m,E,I,F,j,re,pe){I===void 0&&(I=Xt(F));var Se=(E===0?I:I>>>E)&k,Oe=1<<Se,De=this.bitmap,te=(De&Oe)!==0;if(!te&&j===R)return this;var be=Qh(De&Oe-1),ye=this.nodes,We=te?ye[be]:void 0,it=Yh(We,m,E+x,I,F,j,re,pe);if(it===We)return this;if(!te&&it&&ye.length>=ng)return Xh(m,ye,De,Se,it);if(te&&!it&&ye.length===2&&n0(ye[be^1]))return ye[be^1];if(te&&it&&ye.length===1&&n0(it))return it;var wt=m&&m===this.ownerID,fn=te?it?De:De^Oe:De|Oe,Vt=te?it?eg(ye,be,it,wt):EC(ye,be,wt):tg(ye,be,it,wt);return wt?(this.bitmap=fn,this.nodes=Vt,this):new Ea(m,fn,Vt)};function hc(m,E,I){this.ownerID=m,this.count=E,this.nodes=I}hc.prototype.get=function(m,E,I,F){E===void 0&&(E=Xt(I));var j=(m===0?E:E>>>m)&k,re=this.nodes[j];return re?re.get(m+x,E,I,F):F},hc.prototype.update=function(m,E,I,F,j,re,pe){I===void 0&&(I=Xt(F));var Se=(E===0?I:I>>>E)&k,Oe=j===R,De=this.nodes,te=De[Se];if(Oe&&!te)return this;var be=Yh(te,m,E+x,I,F,j,re,pe);if(be===te)return this;var ye=this.count;if(!te)ye++;else if(!be&&(ye--,ye<rg))return i0(m,De,ye,Se);var We=m&&m===this.ownerID,it=eg(De,Se,be,We);return We?(this.count=ye,this.nodes=it,this):new hc(m,ye,it)};function ka(m,E,I){this.ownerID=m,this.keyHash=E,this.entries=I}ka.prototype.get=function(m,E,I,F){for(var j=this.entries,re=0,pe=j.length;re<pe;re++)if(de(I,j[re][0]))return j[re][1];return F},ka.prototype.update=function(m,E,I,F,j,re,pe){I===void 0&&(I=Xt(F));var Se=j===R;if(I!==this.keyHash)return Se?this:(V(pe),V(re),ed(this,m,E,I,[F,j]));for(var Oe=this.entries,De=0,te=Oe.length;De<te&&!de(F,Oe[De][0]);De++);var be=De<te;if(be?Oe[De][1]===j:Se)return this;if(V(pe),(Se||!be)&&V(re),Se&&te===2)return new Ta(m,this.keyHash,Oe[De^1]);var ye=m&&m===this.ownerID,We=ye?Oe:W(Oe);return be?Se?De===te-1?We.pop():We[De]=We.pop():We[De]=[F,j]:We.push([F,j]),ye?(this.entries=We,this):new ka(m,this.keyHash,We)};function Ta(m,E,I){this.ownerID=m,this.keyHash=E,this.entry=I}Ta.prototype.get=function(m,E,I,F){return de(I,this.entry[0])?this.entry[1]:F},Ta.prototype.update=function(m,E,I,F,j,re,pe){var Se=j===R,Oe=de(F,this.entry[0]);if(Oe?j===this.entry[1]:Se)return this;if(V(pe),Se){V(re);return}return Oe?m&&m===this.ownerID?(this.entry[1]=j,this):new Ta(m,this.keyHash,[F,j]):(V(re),ed(this,m,E,Xt(F),[F,j]))},xr.prototype.iterate=ka.prototype.iterate=function(m,E){for(var I=this.entries,F=0,j=I.length-1;F<=j;F++)if(m(I[E?j-F:F])===!1)return!1},Ea.prototype.iterate=hc.prototype.iterate=function(m,E){for(var I=this.nodes,F=0,j=I.length-1;F<=j;F++){var re=I[E?j-F:F];if(re&&re.iterate(m,E)===!1)return!1}},Ta.prototype.iterate=function(m,E){return m(this.entry)},r(Vh,ue);function Vh(m,E,I){this._type=E,this._reverse=I,this._stack=m._root&&qh(m._root)}Vh.prototype.next=function(){for(var m=this._type,E=this._stack;E;){var I=E.node,F=E.index++,j;if(I.entry){if(F===0)return Hh(m,I.entry)}else if(I.entries){if(j=I.entries.length-1,F<=j)return Hh(m,I.entries[this._reverse?j-F:F])}else if(j=I.nodes.length-1,F<=j){var re=I.nodes[this._reverse?j-F:F];if(re){if(re.entry)return Hh(m,re.entry);E=this._stack=qh(re,E)}continue}E=this._stack=this._stack.__prev}return we()};function Hh(m,E){return ne(m,E[0],E[1])}function qh(m,E){return{node:m,index:0,__prev:E}}function Qf(m,E,I,F){var j=Object.create(lt);return j.size=m,j._root=E,j.__ownerID=I,j.__hash=F,j.__altered=!1,j}var Gh;function No(){return Gh||(Gh=Qf(0))}function t0(m,E,I){var F,j;if(m._root){var re=z(A),pe=z(O);if(F=Yh(m._root,m.__ownerID,0,void 0,E,I,re,pe),!pe.value)return m;j=m.size+(re.value?I===R?-1:1:0)}else{if(I===R)return m;j=1,F=new xr(m.__ownerID,[[E,I]])}return m.__ownerID?(m.size=j,m._root=F,m.__hash=void 0,m.__altered=!0,m):F?Qf(j,F):No()}function Yh(m,E,I,F,j,re,pe,Se){return m?m.update(E,I,F,j,re,pe,Se):re===R?m:(V(Se),V(pe),new Ta(E,F,[j,re]))}function n0(m){return m.constructor===Ta||m.constructor===ka}function ed(m,E,I,F,j){if(m.keyHash===F)return new ka(E,F,[m.entry,j]);var re=(I===0?m.keyHash:m.keyHash>>>I)&k,pe=(I===0?F:F>>>I)&k,Se,Oe=re===pe?[ed(m,E,I+x,F,j)]:(Se=new Ta(E,F,j),re<pe?[m,Se]:[Se,m]);return new Ea(E,1<<re|1<<pe,Oe)}function r0(m,E,I,F){m||(m=new D);for(var j=new Ta(m,Xt(I),[I,F]),re=0;re<E.length;re++){var pe=E[re];j=j.update(m,0,void 0,pe[0],pe[1])}return j}function i0(m,E,I,F){for(var j=0,re=0,pe=new Array(I),Se=0,Oe=1,De=E.length;Se<De;Se++,Oe<<=1){var te=E[Se];te!==void 0&&Se!==F&&(j|=Oe,pe[re++]=te)}return new Ea(m,j,pe)}function Xh(m,E,I,F,j){for(var re=0,pe=new Array(C),Se=0;I!==0;Se++,I>>>=1)pe[Se]=I&1?E[re++]:void 0;return pe[F]=j,new hc(m,re+1,pe)}function td(m,E,I){for(var F=[],j=0;j<I.length;j++){var re=I[j],pe=o(re);l(re)||(pe=pe.map(function(Se){return Ce(Se)})),F.push(pe)}return Jh(m,E,F)}function Zh(m,E,I){return m&&m.mergeDeep&&l(E)?m.mergeDeep(E):de(m,E)?m:E}function gc(m){return function(E,I,F){if(E&&E.mergeDeepWith&&l(I))return E.mergeDeepWith(m,I);var j=m(E,I,F);return de(E,j)?E:j}}function Jh(m,E,I){return I=I.filter(function(F){return F.size!==0}),I.length===0?m:m.size===0&&!m.__ownerID&&I.length===1?m.constructor(I[0]):m.withMutations(function(F){for(var j=E?function(pe,Se){F.update(Se,R,function(Oe){return Oe===R?pe:E(Oe,pe,Se)})}:function(pe,Se){F.set(Se,pe)},re=0;re<I.length;re++)I[re].forEach(j)})}function o0(m,E,I,F){var j=m===R,re=E.next();if(re.done){var pe=j?I:m,Se=F(pe);return Se===pe?m:Se}He(j||m&&m.set,"invalid keyPath");var Oe=re.value,De=j?R:m.get(Oe,R),te=o0(De,E,I,F);return te===De?m:te===R?m.remove(Oe):(j?No():m).set(Oe,te)}function Qh(m){return m=m-(m>>1&1431655765),m=(m&858993459)+(m>>2&858993459),m=m+(m>>4)&252645135,m=m+(m>>8),m=m+(m>>16),m&127}function eg(m,E,I,F){var j=F?m:W(m);return j[E]=I,j}function tg(m,E,I,F){var j=m.length+1;if(F&&E+1===j)return m[E]=I,m;for(var re=new Array(j),pe=0,Se=0;Se<j;Se++)Se===E?(re[Se]=I,pe=-1):re[Se]=m[Se+pe];return re}function EC(m,E,I){var F=m.length-1;if(I&&E===F)return m.pop(),m;for(var j=new Array(F),re=0,pe=0;pe<F;pe++)pe===E&&(re=1),j[pe]=m[pe+re];return j}var a0=C/4,ng=C/2,rg=C/4;r(sn,ht);function sn(m){var E=sg();if(m==null)return E;if(ig(m))return m;var I=a(m),F=I.size;return F===0?E:(dr(F),F>0&&F<C?Gl(0,F,x,null,new Ra(I.toArray())):E.withMutations(function(j){j.setSize(F),I.forEach(function(re,pe){return j.set(pe,re)})}))}sn.of=function(){return this(arguments)},sn.prototype.toString=function(){return this.__toString("List [","]")},sn.prototype.get=function(m,E){if(m=se(this,m),m>=0&&m<this.size){m+=this._origin;var I=l0(this,m);return I&&I.array[m&k]}return E},sn.prototype.set=function(m,E){return kC(this,m,E)},sn.prototype.remove=function(m){return this.has(m)?m===0?this.shift():m===this.size-1?this.pop():this.splice(m,1):this},sn.prototype.insert=function(m,E){return this.splice(m,0,E)},sn.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=x,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):sg()},sn.prototype.push=function(){var m=arguments,E=this.size;return this.withMutations(function(I){os(I,0,E+m.length);for(var F=0;F<m.length;F++)I.set(E+F,m[F])})},sn.prototype.pop=function(){return os(this,0,-1)},sn.prototype.unshift=function(){var m=arguments;return this.withMutations(function(E){os(E,-m.length);for(var I=0;I<m.length;I++)E.set(I,m[I])})},sn.prototype.shift=function(){return os(this,1)},sn.prototype.merge=function(){return rd(this,void 0,arguments)},sn.prototype.mergeWith=function(m){var E=n.call(arguments,1);return rd(this,m,E)},sn.prototype.mergeDeep=function(){return rd(this,Zh,arguments)},sn.prototype.mergeDeepWith=function(m){var E=n.call(arguments,1);return rd(this,gc(m),E)},sn.prototype.setSize=function(m){return os(this,0,m)},sn.prototype.slice=function(m,E){var I=this.size;return G(m,E,I)?this:os(this,Q(m,I),le(E,I))},sn.prototype.__iterator=function(m,E){var I=0,F=ag(this,E);return new ue(function(){var j=F();return j===ql?we():ne(m,I++,j)})},sn.prototype.__iterate=function(m,E){for(var I=0,F=ag(this,E),j;(j=F())!==ql&&m(j,I++,this)!==!1;);return I},sn.prototype.__ensureOwner=function(m){return m===this.__ownerID?this:m?Gl(this._origin,this._capacity,this._level,this._root,this._tail,m,this.__hash):(this.__ownerID=m,this)};function ig(m){return!!(m&&m[og])}sn.isList=ig;var og="@@__IMMUTABLE_LIST__@@",Gr=sn.prototype;Gr[og]=!0,Gr[b]=Gr.remove,Gr.setIn=lt.setIn,Gr.deleteIn=Gr.removeIn=lt.removeIn,Gr.update=lt.update,Gr.updateIn=lt.updateIn,Gr.mergeIn=lt.mergeIn,Gr.mergeDeepIn=lt.mergeDeepIn,Gr.withMutations=lt.withMutations,Gr.asMutable=lt.asMutable,Gr.asImmutable=lt.asImmutable,Gr.wasAltered=lt.wasAltered;function Ra(m,E){this.array=m,this.ownerID=E}Ra.prototype.removeBefore=function(m,E,I){if(I===E?1<<E:this.array.length===0)return this;var F=I>>>E&k;if(F>=this.array.length)return new Ra([],m);var j=F===0,re;if(E>0){var pe=this.array[F];if(re=pe&&pe.removeBefore(m,E-x,I),re===pe&&j)return this}if(j&&!re)return this;var Se=Yl(this,m);if(!j)for(var Oe=0;Oe<F;Oe++)Se.array[Oe]=void 0;return re&&(Se.array[F]=re),Se},Ra.prototype.removeAfter=function(m,E,I){if(I===(E?1<<E:0)||this.array.length===0)return this;var F=I-1>>>E&k;if(F>=this.array.length)return this;var j;if(E>0){var re=this.array[F];if(j=re&&re.removeAfter(m,E-x,I),j===re&&F===this.array.length-1)return this}var pe=Yl(this,m);return pe.array.splice(F+1),j&&(pe.array[F]=j),pe};var ql={};function ag(m,E){var I=m._origin,F=m._capacity,j=Js(F),re=m._tail;return pe(m._root,m._level,0);function pe(De,te,be){return te===0?Se(De,be):Oe(De,te,be)}function Se(De,te){var be=te===j?re&&re.array:De&&De.array,ye=te>I?0:I-te,We=F-te;return We>C&&(We=C),function(){if(ye===We)return ql;var it=E?--We:ye++;return be&&be[it]}}function Oe(De,te,be){var ye,We=De&&De.array,it=be>I?0:I-be>>te,wt=(F-be>>te)+1;return wt>C&&(wt=C),function(){do{if(ye){var fn=ye();if(fn!==ql)return fn;ye=null}if(it===wt)return ql;var Vt=E?--wt:it++;ye=pe(We&&We[Vt],te-x,be+(Vt<<te))}while(!0)}}}function Gl(m,E,I,F,j,re,pe){var Se=Object.create(Gr);return Se.size=E-m,Se._origin=m,Se._capacity=E,Se._level=I,Se._root=F,Se._tail=j,Se.__ownerID=re,Se.__hash=pe,Se.__altered=!1,Se}var s0;function sg(){return s0||(s0=Gl(0,0,x))}function kC(m,E,I){if(E=se(m,E),E!==E)return m;if(E>=m.size||E<0)return m.withMutations(function(pe){E<0?os(pe,E).set(0,I):os(pe,0,E+1).set(E,I)});E+=m._origin;var F=m._tail,j=m._root,re=z(O);return E>=Js(m._capacity)?F=nd(F,m.__ownerID,0,E,I,re):j=nd(j,m.__ownerID,m._level,E,I,re),re.value?m.__ownerID?(m._root=j,m._tail=F,m.__hash=void 0,m.__altered=!0,m):Gl(m._origin,m._capacity,m._level,j,F):m}function nd(m,E,I,F,j,re){var pe=F>>>I&k,Se=m&&pe<m.array.length;if(!Se&&j===void 0)return m;var Oe;if(I>0){var De=m&&m.array[pe],te=nd(De,E,I-x,F,j,re);return te===De?m:(Oe=Yl(m,E),Oe.array[pe]=te,Oe)}return Se&&m.array[pe]===j?m:(V(re),Oe=Yl(m,E),j===void 0&&pe===Oe.array.length-1?Oe.array.pop():Oe.array[pe]=j,Oe)}function Yl(m,E){return E&&m&&E===m.ownerID?m:new Ra(m?m.array.slice():[],E)}function l0(m,E){if(E>=Js(m._capacity))return m._tail;if(E<1<<m._level+x){for(var I=m._root,F=m._level;I&&F>0;)I=I.array[E>>>F&k],F-=x;return I}}function os(m,E,I){E!==void 0&&(E=E|0),I!==void 0&&(I=I|0);var F=m.__ownerID||new D,j=m._origin,re=m._capacity,pe=j+E,Se=I===void 0?re:I<0?re+I:j+I;if(pe===j&&Se===re)return m;if(pe>=Se)return m.clear();for(var Oe=m._level,De=m._root,te=0;pe+te<0;)De=new Ra(De&&De.array.length?[void 0,De]:[],F),Oe+=x,te+=1<<Oe;te&&(pe+=te,j+=te,Se+=te,re+=te);for(var be=Js(re),ye=Js(Se);ye>=1<<Oe+x;)De=new Ra(De&&De.array.length?[De]:[],F),Oe+=x;var We=m._tail,it=ye<be?l0(m,Se-1):ye>be?new Ra([],F):We;if(We&&ye>be&&pe<re&&We.array.length){De=Yl(De,F);for(var wt=De,fn=Oe;fn>x;fn-=x){var Vt=be>>>fn&k;wt=wt.array[Vt]=Yl(wt.array[Vt],F)}wt.array[be>>>x&k]=We}if(Se<re&&(it=it&&it.removeAfter(F,0,Se)),pe>=ye)pe-=ye,Se-=ye,Oe=x,De=null,it=it&&it.removeBefore(F,0,pe);else if(pe>j||ye<be){for(te=0;De;){var eu=pe>>>Oe&k;if(eu!==ye>>>Oe&k)break;eu&&(te+=(1<<Oe)*eu),Oe-=x,De=De.array[eu]}De&&pe>j&&(De=De.removeBefore(F,Oe,pe-te)),De&&ye<be&&(De=De.removeAfter(F,Oe,ye-te)),te&&(pe-=te,Se-=te)}return m.__ownerID?(m.size=Se-pe,m._origin=pe,m._capacity=Se,m._level=Oe,m._root=De,m._tail=it,m.__hash=void 0,m.__altered=!0,m):Gl(pe,Se,Oe,De,it)}function rd(m,E,I){for(var F=[],j=0,re=0;re<I.length;re++){var pe=I[re],Se=a(pe);Se.size>j&&(j=Se.size),l(pe)||(Se=Se.map(function(Oe){return Ce(Oe)})),F.push(Se)}return j>m.size&&(m=m.setSize(j)),Jh(m,E,F)}function Js(m){return m<C?0:m-1>>>x<<x}r(ar,$t);function ar(m){return m==null?id():u0(m)?m:id().withMutations(function(E){var I=o(m);dr(I.size),I.forEach(function(F,j){return E.set(j,F)})})}ar.of=function(){return this(arguments)},ar.prototype.toString=function(){return this.__toString("OrderedMap {","}")},ar.prototype.get=function(m,E){var I=this._map.get(m);return I!==void 0?this._list.get(I)[1]:E},ar.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):id()},ar.prototype.set=function(m,E){return Tn(this,m,E)},ar.prototype.remove=function(m){return Tn(this,m,R)},ar.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},ar.prototype.__iterate=function(m,E){var I=this;return this._list.__iterate(function(F){return F&&m(F[1],F[0],I)},E)},ar.prototype.__iterator=function(m,E){return this._list.fromEntrySeq().__iterator(m,E)},ar.prototype.__ensureOwner=function(m){if(m===this.__ownerID)return this;var E=this._map.__ensureOwner(m),I=this._list.__ensureOwner(m);return m?lg(E,I,m,this.__hash):(this.__ownerID=m,this._map=E,this._list=I,this)};function u0(m){return pc(m)&&p(m)}ar.isOrderedMap=u0,ar.prototype[w]=!0,ar.prototype[b]=ar.prototype.remove;function lg(m,E,I,F){var j=Object.create(ar.prototype);return j.size=m?m.size:0,j._map=m,j._list=E,j.__ownerID=I,j.__hash=F,j}var c0;function id(){return c0||(c0=lg(No(),sg()))}function Tn(m,E,I){var F=m._map,j=m._list,re=F.get(E),pe=re!==void 0,Se,Oe;if(I===R){if(!pe)return m;j.size>=C&&j.size>=F.size*2?(Oe=j.filter(function(De,te){return De!==void 0&&re!==te}),Se=Oe.toKeyedSeq().map(function(De){return De[0]}).flip().toMap(),m.__ownerID&&(Se.__ownerID=Oe.__ownerID=m.__ownerID)):(Se=F.remove(E),Oe=re===j.size-1?j.pop():j.set(re,void 0))}else if(pe){if(I===j.get(re)[1])return m;Se=F,Oe=j.set(re,[E,I])}else Se=F.set(E,j.size),Oe=j.set(j.size,[E,I]);return m.__ownerID?(m.size=Se.size,m._map=Se,m._list=Oe,m.__hash=void 0,m):lg(Se,Oe)}r(Ut,je);function Ut(m,E){this._iter=m,this._useKeys=E,this.size=m.size}Ut.prototype.get=function(m,E){return this._iter.get(m,E)},Ut.prototype.has=function(m){return this._iter.has(m)},Ut.prototype.valueSeq=function(){return this._iter.valueSeq()},Ut.prototype.reverse=function(){var m=this,E=ug(this,!0);return this._useKeys||(E.valueSeq=function(){return m._iter.toSeq().reverse()}),E},Ut.prototype.map=function(m,E){var I=this,F=d0(this,m,E);return this._useKeys||(F.valueSeq=function(){return I._iter.toSeq().map(m,E)}),F},Ut.prototype.__iterate=function(m,E){var I=this,F;return this._iter.__iterate(this._useKeys?function(j,re){return m(j,re,I)}:(F=E?Ci(this):0,function(j){return m(j,E?--F:F++,I)}),E)},Ut.prototype.__iterator=function(m,E){if(this._useKeys)return this._iter.__iterator(m,E);var I=this._iter.__iterator(P,E),F=E?Ci(this):0;return new ue(function(){var j=I.next();return j.done?j:ne(m,E?--F:F++,j.value,j)})},Ut.prototype[w]=!0,r(Xl,Fe);function Xl(m){this._iter=m,this.size=m.size}Xl.prototype.includes=function(m){return this._iter.includes(m)},Xl.prototype.__iterate=function(m,E){var I=this,F=0;return this._iter.__iterate(function(j){return m(j,F++,I)},E)},Xl.prototype.__iterator=function(m,E){var I=this._iter.__iterator(P,E),F=0;return new ue(function(){var j=I.next();return j.done?j:ne(m,F++,j.value,j)})},r(Zl,tt);function Zl(m){this._iter=m,this.size=m.size}Zl.prototype.has=function(m){return this._iter.includes(m)},Zl.prototype.__iterate=function(m,E){var I=this;return this._iter.__iterate(function(F){return m(F,F,I)},E)},Zl.prototype.__iterator=function(m,E){var I=this._iter.__iterator(P,E);return new ue(function(){var F=I.next();return F.done?F:ne(m,F.value,F.value,F)})},r(Jl,je);function Jl(m){this._iter=m,this.size=m.size}Jl.prototype.entrySeq=function(){return this._iter.toSeq()},Jl.prototype.__iterate=function(m,E){var I=this;return this._iter.__iterate(function(F){if(F){g0(F);var j=l(F);return m(j?F.get(1):F[1],j?F.get(0):F[0],I)}},E)},Jl.prototype.__iterator=function(m,E){var I=this._iter.__iterator(P,E);return new ue(function(){for(;;){var F=I.next();if(F.done)return F;var j=F.value;if(j){g0(j);var re=l(j);return ne(m,re?j.get(0):j[0],re?j.get(1):j[1],F)}}})},Xl.prototype.cacheResult=Ut.prototype.cacheResult=Zl.prototype.cacheResult=Jl.prototype.cacheResult=Bo;function f0(m){var E=fo(m);return E._iter=m,E.size=m.size,E.flip=function(){return m},E.reverse=function(){var I=m.reverse.apply(this);return I.flip=function(){return m.reverse()},I},E.has=function(I){return m.includes(I)},E.includes=function(I){return m.has(I)},E.cacheResult=Bo,E.__iterateUncached=function(I,F){var j=this;return m.__iterate(function(re,pe){return I(pe,re,j)!==!1},F)},E.__iteratorUncached=function(I,F){if(I===ge){var j=m.__iterator(I,F);return new ue(function(){var re=j.next();if(!re.done){var pe=re.value[0];re.value[0]=re.value[1],re.value[1]=pe}return re})}return m.__iterator(I===P?ee:P,F)},E}function d0(m,E,I){var F=fo(m);return F.size=m.size,F.has=function(j){return m.has(j)},F.get=function(j,re){var pe=m.get(j,R);return pe===R?re:E.call(I,pe,j,m)},F.__iterateUncached=function(j,re){var pe=this;return m.__iterate(function(Se,Oe,De){return j(E.call(I,Se,Oe,De),Oe,pe)!==!1},re)},F.__iteratorUncached=function(j,re){var pe=m.__iterator(ge,re);return new ue(function(){var Se=pe.next();if(Se.done)return Se;var Oe=Se.value,De=Oe[0];return ne(j,De,E.call(I,Oe[1],De,m),Se)})},F}function ug(m,E){var I=fo(m);return I._iter=m,I.size=m.size,I.reverse=function(){return m},m.flip&&(I.flip=function(){var F=f0(m);return F.reverse=function(){return m.flip()},F}),I.get=function(F,j){return m.get(E?F:-1-F,j)},I.has=function(F){return m.has(E?F:-1-F)},I.includes=function(F){return m.includes(F)},I.cacheResult=Bo,I.__iterate=function(F,j){var re=this;return m.__iterate(function(pe,Se){return F(pe,Se,re)},!j)},I.__iterator=function(F,j){return m.__iterator(F,!j)},I}function cg(m,E,I,F){var j=fo(m);return F&&(j.has=function(re){var pe=m.get(re,R);return pe!==R&&!!E.call(I,pe,re,m)},j.get=function(re,pe){var Se=m.get(re,R);return Se!==R&&E.call(I,Se,re,m)?Se:pe}),j.__iterateUncached=function(re,pe){var Se=this,Oe=0;return m.__iterate(function(De,te,be){if(E.call(I,De,te,be))return Oe++,re(De,F?te:Oe-1,Se)},pe),Oe},j.__iteratorUncached=function(re,pe){var Se=m.__iterator(ge,pe),Oe=0;return new ue(function(){for(;;){var De=Se.next();if(De.done)return De;var te=De.value,be=te[0],ye=te[1];if(E.call(I,ye,be,m))return ne(re,F?be:Oe++,ye,De)}})},j}function TC(m,E,I){var F=$t().asMutable();return m.__iterate(function(j,re){F.update(E.call(I,j,re,m),0,function(pe){return pe+1})}),F.asImmutable()}function Dr(m,E,I){var F=u(m),j=(p(m)?ar():$t()).asMutable();m.__iterate(function(pe,Se){j.update(E.call(I,pe,Se,m),function(Oe){return Oe=Oe||[],Oe.push(F?[Se,pe]:pe),Oe})});var re=m0(m);return j.map(function(pe){return Lt(m,re(pe))})}function mc(m,E,I,F){var j=m.size;if(E!==void 0&&(E=E|0),I!==void 0&&(I=I|0),G(E,I,j))return m;var re=Q(E,j),pe=le(I,j);if(re!==re||pe!==pe)return mc(m.toSeq().cacheResult(),E,I,F);var Se=pe-re,Oe;Se===Se&&(Oe=Se<0?0:Se);var De=fo(m);return De.size=Oe===0?Oe:m.size&&Oe||void 0,!F&&Re(m)&&Oe>=0&&(De.get=function(te,be){return te=se(this,te),te>=0&&te<Oe?m.get(te+re,be):be}),De.__iterateUncached=function(te,be){var ye=this;if(Oe===0)return 0;if(be)return this.cacheResult().__iterate(te,be);var We=0,it=!0,wt=0;return m.__iterate(function(fn,Vt){if(!(it&&(it=We++<re)))return wt++,te(fn,F?Vt:wt-1,ye)!==!1&&wt!==Oe}),wt},De.__iteratorUncached=function(te,be){if(Oe!==0&&be)return this.cacheResult().__iterator(te,be);var ye=Oe!==0&&m.__iterator(te,be),We=0,it=0;return new ue(function(){for(;We++<re;)ye.next();if(++it>Oe)return we();var wt=ye.next();return F||te===P?wt:te===ee?ne(te,it-1,void 0,wt):ne(te,it-1,wt.value[1],wt)})},De}function Qs(m,E,I){var F=fo(m);return F.__iterateUncached=function(j,re){var pe=this;if(re)return this.cacheResult().__iterate(j,re);var Se=0;return m.__iterate(function(Oe,De,te){return E.call(I,Oe,De,te)&&++Se&&j(Oe,De,pe)}),Se},F.__iteratorUncached=function(j,re){var pe=this;if(re)return this.cacheResult().__iterator(j,re);var Se=m.__iterator(ge,re),Oe=!0;return new ue(function(){if(!Oe)return we();var De=Se.next();if(De.done)return De;var te=De.value,be=te[0],ye=te[1];return E.call(I,ye,be,pe)?j===ge?De:ne(j,be,ye,De):(Oe=!1,we())})},F}function fg(m,E,I,F){var j=fo(m);return j.__iterateUncached=function(re,pe){var Se=this;if(pe)return this.cacheResult().__iterate(re,pe);var Oe=!0,De=0;return m.__iterate(function(te,be,ye){if(!(Oe&&(Oe=E.call(I,te,be,ye))))return De++,re(te,F?be:De-1,Se)}),De},j.__iteratorUncached=function(re,pe){var Se=this;if(pe)return this.cacheResult().__iterator(re,pe);var Oe=m.__iterator(ge,pe),De=!0,te=0;return new ue(function(){var be,ye,We;do{if(be=Oe.next(),be.done)return F||re===P?be:re===ee?ne(re,te++,void 0,be):ne(re,te++,be.value[1],be);var it=be.value;ye=it[0],We=it[1],De&&(De=E.call(I,We,ye,Se))}while(De);return re===ge?be:ne(re,ye,We,be)})},j}function dg(m,E){var I=u(m),F=[m].concat(E).map(function(pe){return l(pe)?I&&(pe=o(pe)):pe=I?H(pe):fe(Array.isArray(pe)?pe:[pe]),pe}).filter(function(pe){return pe.size!==0});if(F.length===0)return m;if(F.length===1){var j=F[0];if(j===m||I&&u(j)||f(m)&&f(j))return j}var re=new Ye(F);return I?re=re.toKeyedSeq():f(m)||(re=re.toSetSeq()),re=re.flatten(!0),re.size=F.reduce(function(pe,Se){if(pe!==void 0){var Oe=Se.size;if(Oe!==void 0)return pe+Oe}},0),re}function Si(m,E,I){var F=fo(m);return F.__iterateUncached=function(j,re){var pe=0,Se=!1;function Oe(De,te){var be=this;De.__iterate(function(ye,We){return(!E||te<E)&&l(ye)?Oe(ye,te+1):j(ye,I?We:pe++,be)===!1&&(Se=!0),!Se},re)}return Oe(m,0),pe},F.__iteratorUncached=function(j,re){var pe=m.__iterator(j,re),Se=[],Oe=0;return new ue(function(){for(;pe;){var De=pe.next();if(De.done!==!1){pe=Se.pop();continue}var te=De.value;if(j===ge&&(te=te[1]),(!E||Se.length<E)&&l(te))Se.push(pe),pe=te.__iterator(j,re);else return I?De:ne(j,Oe++,te,De)}return we()})},F}function p0(m,E,I){var F=m0(m);return m.toSeq().map(function(j,re){return F(E.call(I,j,re,m))}).flatten(!0)}function h0(m,E){var I=fo(m);return I.size=m.size&&m.size*2-1,I.__iterateUncached=function(F,j){var re=this,pe=0;return m.__iterate(function(Se,Oe){return(!pe||F(E,pe++,re)!==!1)&&F(Se,pe++,re)!==!1},j),pe},I.__iteratorUncached=function(F,j){var re=m.__iterator(P,j),pe=0,Se;return new ue(function(){return(!Se||pe%2)&&(Se=re.next(),Se.done)?Se:pe%2?ne(F,pe++,E):ne(F,pe++,Se.value,Se)})},I}function el(m,E,I){E||(E=yc);var F=u(m),j=0,re=m.toSeq().map(function(pe,Se){return[Se,pe,j++,I?I(pe,Se,m):pe]}).toArray();return re.sort(function(pe,Se){return E(pe[3],Se[3])||pe[2]-Se[2]}).forEach(F?function(pe,Se){re[Se].length=2}:function(pe,Se){re[Se]=pe[1]}),F?je(re):f(m)?Fe(re):tt(re)}function vc(m,E,I){if(E||(E=yc),I){var F=m.toSeq().map(function(j,re){return[j,I(j,re,m)]}).reduce(function(j,re){return pg(E,j[1],re[1])?re:j});return F&&F[0]}else return m.reduce(function(j,re){return pg(E,j,re)?re:j})}function pg(m,E,I){var F=m(I,E);return F===0&&I!==E&&(I==null||I!==I)||F>0}function od(m,E,I){var F=fo(m);return F.size=new Ye(I).map(function(j){return j.size}).min(),F.__iterate=function(j,re){for(var pe=this.__iterator(P,re),Se,Oe=0;!(Se=pe.next()).done&&j(Se.value,Oe++,this)!==!1;);return Oe},F.__iteratorUncached=function(j,re){var pe=I.map(function(De){return De=i(De),Le(re?De.reverse():De)}),Se=0,Oe=!1;return new ue(function(){var De;return Oe||(De=pe.map(function(te){return te.next()}),Oe=De.some(function(te){return te.done})),Oe?we():ne(j,Se++,E.apply(null,De.map(function(te){return te.value})))})},F}function Lt(m,E){return Re(m)?E:m.constructor(E)}function g0(m){if(m!==Object(m))throw new TypeError("Expected [K, V] tuple: "+m)}function Ci(m){return dr(m.size),ie(m)}function m0(m){return u(m)?o:f(m)?a:s}function fo(m){return Object.create((u(m)?je:f(m)?Fe:tt).prototype)}function Bo(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Pe.prototype.cacheResult.call(this)}function yc(m,E){return m>E?1:m<E?-1:0}function ad(m){var E=Le(m);if(!E){if(!Ie(m))throw new TypeError("Expected iterable or array-like: "+m);E=Le(i(m))}return E}r(Wt,ot);function Wt(m,E){var I,F=function(pe){if(pe instanceof F)return pe;if(!(this instanceof F))return new F(pe);if(!I){I=!0;var Se=Object.keys(m);hg(j,Se),j.size=Se.length,j._name=E,j._keys=Se,j._defaultValues=m}this._map=$t(pe)},j=F.prototype=Object.create(Ln);return j.constructor=F,F}Wt.prototype.toString=function(){return this.__toString(v0(this)+" {","}")},Wt.prototype.has=function(m){return this._defaultValues.hasOwnProperty(m)},Wt.prototype.get=function(m,E){if(!this.has(m))return E;var I=this._defaultValues[m];return this._map?this._map.get(m,I):I},Wt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var m=this.constructor;return m._empty||(m._empty=Ql(this,No()))},Wt.prototype.set=function(m,E){if(!this.has(m))throw new Error('Cannot set unknown key "'+m+'" on '+v0(this));var I=this._map&&this._map.set(m,E);return this.__ownerID||I===this._map?this:Ql(this,I)},Wt.prototype.remove=function(m){if(!this.has(m))return this;var E=this._map&&this._map.remove(m);return this.__ownerID||E===this._map?this:Ql(this,E)},Wt.prototype.wasAltered=function(){return this._map.wasAltered()},Wt.prototype.__iterator=function(m,E){var I=this;return o(this._defaultValues).map(function(F,j){return I.get(j)}).__iterator(m,E)},Wt.prototype.__iterate=function(m,E){var I=this;return o(this._defaultValues).map(function(F,j){return I.get(j)}).__iterate(m,E)},Wt.prototype.__ensureOwner=function(m){if(m===this.__ownerID)return this;var E=this._map&&this._map.__ensureOwner(m);return m?Ql(this,E,m):(this.__ownerID=m,this._map=E,this)};var Ln=Wt.prototype;Ln[b]=Ln.remove,Ln.deleteIn=Ln.removeIn=lt.removeIn,Ln.merge=lt.merge,Ln.mergeWith=lt.mergeWith,Ln.mergeIn=lt.mergeIn,Ln.mergeDeep=lt.mergeDeep,Ln.mergeDeepWith=lt.mergeDeepWith,Ln.mergeDeepIn=lt.mergeDeepIn,Ln.setIn=lt.setIn,Ln.update=lt.update,Ln.updateIn=lt.updateIn,Ln.withMutations=lt.withMutations,Ln.asMutable=lt.asMutable,Ln.asImmutable=lt.asImmutable;function Ql(m,E,I){var F=Object.create(Object.getPrototypeOf(m));return F._map=E,F.__ownerID=I,F}function v0(m){return m._name||m.constructor.name||"Record"}function hg(m,E){try{E.forEach(RC.bind(void 0,m))}catch{}}function RC(m,E){Object.defineProperty(m,E,{get:function(){return this.get(E)},set:function(I){He(this.__ownerID,"Cannot set on an immutable record."),this.set(E,I)}})}r(Mn,Ot);function Mn(m){return m==null?sd():gg(m)&&!p(m)?m:sd().withMutations(function(E){var I=s(m);dr(I.size),I.forEach(function(F){return E.add(F)})})}Mn.of=function(){return this(arguments)},Mn.fromKeys=function(m){return this(o(m).keySeq())},Mn.prototype.toString=function(){return this.__toString("Set {","}")},Mn.prototype.has=function(m){return this._map.has(m)},Mn.prototype.add=function(m){return as(this,this._map.set(m,!0))},Mn.prototype.remove=function(m){return as(this,this._map.remove(m))},Mn.prototype.clear=function(){return as(this,this._map.clear())},Mn.prototype.union=function(){var m=n.call(arguments,0);return m=m.filter(function(E){return E.size!==0}),m.length===0?this:this.size===0&&!this.__ownerID&&m.length===1?this.constructor(m[0]):this.withMutations(function(E){for(var I=0;I<m.length;I++)s(m[I]).forEach(function(F){return E.add(F)})})},Mn.prototype.intersect=function(){var m=n.call(arguments,0);if(m.length===0)return this;m=m.map(function(I){return s(I)});var E=this;return this.withMutations(function(I){E.forEach(function(F){m.every(function(j){return j.includes(F)})||I.remove(F)})})},Mn.prototype.subtract=function(){var m=n.call(arguments,0);if(m.length===0)return this;m=m.map(function(I){return s(I)});var E=this;return this.withMutations(function(I){E.forEach(function(F){m.some(function(j){return j.includes(F)})&&I.remove(F)})})},Mn.prototype.merge=function(){return this.union.apply(this,arguments)},Mn.prototype.mergeWith=function(m){var E=n.call(arguments,1);return this.union.apply(this,E)},Mn.prototype.sort=function(m){return Fi(el(this,m))},Mn.prototype.sortBy=function(m,E){return Fi(el(this,E,m))},Mn.prototype.wasAltered=function(){return this._map.wasAltered()},Mn.prototype.__iterate=function(m,E){var I=this;return this._map.__iterate(function(F,j){return m(j,j,I)},E)},Mn.prototype.__iterator=function(m,E){return this._map.map(function(I,F){return F}).__iterator(m,E)},Mn.prototype.__ensureOwner=function(m){if(m===this.__ownerID)return this;var E=this._map.__ensureOwner(m);return m?this.__make(E,m):(this.__ownerID=m,this._map=E,this)};function gg(m){return!!(m&&m[mg])}Mn.isSet=gg;var mg="@@__IMMUTABLE_SET__@@",Nr=Mn.prototype;Nr[mg]=!0,Nr[b]=Nr.remove,Nr.mergeDeep=Nr.merge,Nr.mergeDeepWith=Nr.mergeWith,Nr.withMutations=lt.withMutations,Nr.asMutable=lt.asMutable,Nr.asImmutable=lt.asImmutable,Nr.__empty=sd,Nr.__make=y0;function as(m,E){return m.__ownerID?(m.size=E.size,m._map=E,m):E===m._map?m:E.size===0?m.__empty():m.__make(E)}function y0(m,E){var I=Object.create(Nr);return I.size=m?m.size:0,I._map=m,I.__ownerID=E,I}var vg;function sd(){return vg||(vg=y0(No()))}r(Fi,Mn);function Fi(m){return m==null?_c():ld(m)?m:_c().withMutations(function(E){var I=s(m);dr(I.size),I.forEach(function(F){return E.add(F)})})}Fi.of=function(){return this(arguments)},Fi.fromKeys=function(m){return this(o(m).keySeq())},Fi.prototype.toString=function(){return this.__toString("OrderedSet {","}")};function ld(m){return gg(m)&&p(m)}Fi.isOrderedSet=ld;var bc=Fi.prototype;bc[w]=!0,bc.__empty=_c,bc.__make=b0;function b0(m,E){var I=Object.create(bc);return I.size=m?m.size:0,I._map=m,I.__ownerID=E,I}var ud;function _c(){return ud||(ud=b0(id()))}r(pr,ht);function pr(m){return m==null?cd():yg(m)?m:cd().unshiftAll(m)}pr.of=function(){return this(arguments)},pr.prototype.toString=function(){return this.__toString("Stack [","]")},pr.prototype.get=function(m,E){var I=this._head;for(m=se(this,m);I&&m--;)I=I.next;return I?I.value:E},pr.prototype.peek=function(){return this._head&&this._head.value},pr.prototype.push=function(){if(arguments.length===0)return this;for(var m=this.size+arguments.length,E=this._head,I=arguments.length-1;I>=0;I--)E={value:arguments[I],next:E};return this.__ownerID?(this.size=m,this._head=E,this.__hash=void 0,this.__altered=!0,this):Aa(m,E)},pr.prototype.pushAll=function(m){if(m=a(m),m.size===0)return this;dr(m.size);var E=this.size,I=this._head;return m.reverse().forEach(function(F){E++,I={value:F,next:I}}),this.__ownerID?(this.size=E,this._head=I,this.__hash=void 0,this.__altered=!0,this):Aa(E,I)},pr.prototype.pop=function(){return this.slice(1)},pr.prototype.unshift=function(){return this.push.apply(this,arguments)},pr.prototype.unshiftAll=function(m){return this.pushAll(m)},pr.prototype.shift=function(){return this.pop.apply(this,arguments)},pr.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):cd()},pr.prototype.slice=function(m,E){if(G(m,E,this.size))return this;var I=Q(m,this.size),F=le(E,this.size);if(F!==this.size)return ht.prototype.slice.call(this,m,E);for(var j=this.size-I,re=this._head;I--;)re=re.next;return this.__ownerID?(this.size=j,this._head=re,this.__hash=void 0,this.__altered=!0,this):Aa(j,re)},pr.prototype.__ensureOwner=function(m){return m===this.__ownerID?this:m?Aa(this.size,this._head,m,this.__hash):(this.__ownerID=m,this.__altered=!1,this)},pr.prototype.__iterate=function(m,E){if(E)return this.reverse().__iterate(m);for(var I=0,F=this._head;F&&m(F.value,I++,this)!==!1;)F=F.next;return I},pr.prototype.__iterator=function(m,E){if(E)return this.reverse().__iterator(m);var I=0,F=this._head;return new ue(function(){if(F){var j=F.value;return F=F.next,ne(m,I++,j)}return we()})};function yg(m){return!!(m&&m[ai])}pr.isStack=yg;var ai="@@__IMMUTABLE_STACK__@@",ss=pr.prototype;ss[ai]=!0,ss.withMutations=lt.withMutations,ss.asMutable=lt.asMutable,ss.asImmutable=lt.asImmutable,ss.wasAltered=lt.wasAltered;function Aa(m,E,I,F){var j=Object.create(ss);return j.size=m,j._head=E,j.__ownerID=I,j.__hash=F,j.__altered=!1,j}var bg;function cd(){return bg||(bg=Aa(0))}function jo(m,E){var I=function(F){m.prototype[F]=E[F]};return Object.keys(E).forEach(I),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(E).forEach(I),m}i.Iterator=ue,jo(i,{toArray:function(){dr(this.size);var m=new Array(this.size||0);return this.valueSeq().__iterate(function(E,I){m[I]=E}),m},toIndexedSeq:function(){return new Xl(this)},toJS:function(){return this.toSeq().map(function(m){return m&&typeof m.toJS=="function"?m.toJS():m}).__toJS()},toJSON:function(){return this.toSeq().map(function(m){return m&&typeof m.toJSON=="function"?m.toJSON():m}).__toJS()},toKeyedSeq:function(){return new Ut(this,!0)},toMap:function(){return $t(this.toKeyedSeq())},toObject:function(){dr(this.size);var m={};return this.__iterate(function(E,I){m[I]=E}),m},toOrderedMap:function(){return ar(this.toKeyedSeq())},toOrderedSet:function(){return Fi(u(this)?this.valueSeq():this)},toSet:function(){return Mn(u(this)?this.valueSeq():this)},toSetSeq:function(){return new Zl(this)},toSeq:function(){return f(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return pr(u(this)?this.valueSeq():this)},toList:function(){return sn(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(m,E){return this.size===0?m+E:m+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+E},concat:function(){var m=n.call(arguments,0);return Lt(this,dg(this,m))},includes:function(m){return this.some(function(E){return de(E,m)})},entries:function(){return this.__iterator(ge)},every:function(m,E){dr(this.size);var I=!0;return this.__iterate(function(F,j,re){if(!m.call(E,F,j,re))return I=!1,!1}),I},filter:function(m,E){return Lt(this,cg(this,m,E,!0))},find:function(m,E,I){var F=this.findEntry(m,E);return F?F[1]:I},findEntry:function(m,E){var I;return this.__iterate(function(F,j,re){if(m.call(E,F,j,re))return I=[j,F],!1}),I},findLastEntry:function(m,E){return this.toSeq().reverse().findEntry(m,E)},forEach:function(m,E){return dr(this.size),this.__iterate(E?m.bind(E):m)},join:function(m){dr(this.size),m=m!==void 0?""+m:",";var E="",I=!0;return this.__iterate(function(F){I?I=!1:E+=m,E+=F!=null?F.toString():""}),E},keys:function(){return this.__iterator(ee)},map:function(m,E){return Lt(this,d0(this,m,E))},reduce:function(m,E,I){dr(this.size);var F,j;return arguments.length<2?j=!0:F=E,this.__iterate(function(re,pe,Se){j?(j=!1,F=re):F=m.call(I,F,re,pe,Se)}),F},reduceRight:function(m,E,I){var F=this.toKeyedSeq().reverse();return F.reduce.apply(F,arguments)},reverse:function(){return Lt(this,ug(this,!0))},slice:function(m,E){return Lt(this,mc(this,m,E,!0))},some:function(m,E){return!this.every($a(m),E)},sort:function(m){return Lt(this,el(this,m))},values:function(){return this.__iterator(P)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(m,E){return ie(m?this.toSeq().filter(m,E):this)},countBy:function(m,E){return TC(this,m,E)},equals:function(m){return me(this,m)},entrySeq:function(){var m=this;if(m._cache)return new Ye(m._cache);var E=m.toSeq().map($C).toIndexedSeq();return E.fromEntrySeq=function(){return m.toSeq()},E},filterNot:function(m,E){return this.filter($a(m),E)},findLast:function(m,E,I){return this.toKeyedSeq().reverse().find(m,E,I)},first:function(){return this.find(K)},flatMap:function(m,E){return Lt(this,p0(this,m,E))},flatten:function(m){return Lt(this,Si(this,m,!0))},fromEntrySeq:function(){return new Jl(this)},get:function(m,E){return this.find(function(I,F){return de(F,m)},void 0,E)},getIn:function(m,E){for(var I=this,F=ad(m),j;!(j=F.next()).done;){var re=j.value;if(I=I&&I.get?I.get(re,R):R,I===R)return E}return I},groupBy:function(m,E){return Dr(this,m,E)},has:function(m){return this.get(m,R)!==R},hasIn:function(m){return this.getIn(m,R)!==R},isSubset:function(m){return m=typeof m.includes=="function"?m:i(m),this.every(function(E){return m.includes(E)})},isSuperset:function(m){return m=typeof m.isSubset=="function"?m:i(m),m.isSubset(this)},keySeq:function(){return this.toSeq().map(AC).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(m){return vc(this,m)},maxBy:function(m,E){return vc(this,E,m)},min:function(m){return vc(this,m?_0(m):xg)},minBy:function(m,E){return vc(this,E?_0(E):xg,m)},rest:function(){return this.slice(1)},skip:function(m){return this.slice(Math.max(0,m))},skipLast:function(m){return Lt(this,this.toSeq().reverse().skip(m).reverse())},skipWhile:function(m,E){return Lt(this,fg(this,m,E,!0))},skipUntil:function(m,E){return this.skipWhile($a(m),E)},sortBy:function(m,E){return Lt(this,el(this,E,m))},take:function(m){return this.slice(0,Math.max(0,m))},takeLast:function(m){return Lt(this,this.toSeq().reverse().take(m).reverse())},takeWhile:function(m,E){return Lt(this,Qs(this,m,E))},takeUntil:function(m,E){return this.takeWhile($a(m),E)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ls(this))}});var Br=i.prototype;Br[g]=!0,Br[ae]=Br.values,Br.__toJS=Br.toArray,Br.__toStringMapper=x0,Br.inspect=Br.toSource=function(){return this.toString()},Br.chain=Br.flatMap,Br.contains=Br.includes,function(){try{Object.defineProperty(Br,"length",{get:function(){if(!i.noLengthWarning){var m;try{throw new Error}catch(E){m=E.stack}if(m.indexOf("_wrapObject")===-1)return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+m),this.size}}})}catch{}}(),jo(o,{flip:function(){return Lt(this,f0(this))},findKey:function(m,E){var I=this.findEntry(m,E);return I&&I[0]},findLastKey:function(m,E){return this.toSeq().reverse().findKey(m,E)},keyOf:function(m){return this.findKey(function(E){return de(E,m)})},lastKeyOf:function(m){return this.findLastKey(function(E){return de(E,m)})},mapEntries:function(m,E){var I=this,F=0;return Lt(this,this.toSeq().map(function(j,re){return m.call(E,[re,j],F++,I)}).fromEntrySeq())},mapKeys:function(m,E){var I=this;return Lt(this,this.toSeq().flip().map(function(F,j){return m.call(E,F,j,I)}).flip())}});var fd=o.prototype;fd[v]=!0,fd[ae]=Br.entries,fd.__toJS=Br.toObject,fd.__toStringMapper=function(m,E){return JSON.stringify(E)+": "+x0(m)},jo(a,{toKeyedSeq:function(){return new Ut(this,!1)},filter:function(m,E){return Lt(this,cg(this,m,E,!1))},findIndex:function(m,E){var I=this.findEntry(m,E);return I?I[0]:-1},indexOf:function(m){var E=this.toKeyedSeq().keyOf(m);return E===void 0?-1:E},lastIndexOf:function(m){var E=this.toKeyedSeq().reverse().keyOf(m);return E===void 0?-1:E},reverse:function(){return Lt(this,ug(this,!1))},slice:function(m,E){return Lt(this,mc(this,m,E,!1))},splice:function(m,E){var I=arguments.length;if(E=Math.max(E|0,0),I===0||I===2&&!E)return this;m=Q(m,m<0?this.count():this.size);var F=this.slice(0,m);return Lt(this,I===1?F:F.concat(W(arguments,2),this.slice(m+E)))},findLastIndex:function(m,E){var I=this.toKeyedSeq().findLastKey(m,E);return I===void 0?-1:I},first:function(){return this.get(0)},flatten:function(m){return Lt(this,Si(this,m,!1))},get:function(m,E){return m=se(this,m),m<0||this.size===1/0||this.size!==void 0&&m>this.size?E:this.find(function(I,F){return F===m},void 0,E)},has:function(m){return m=se(this,m),m>=0&&(this.size!==void 0?this.size===1/0||m<this.size:this.indexOf(m)!==-1)},interpose:function(m){return Lt(this,h0(this,m))},interleave:function(){var m=[this].concat(W(arguments)),E=od(this.toSeq(),Fe.of,m),I=E.flatten(!0);return E.size&&(I.size=E.size*m.length),Lt(this,I)},last:function(){return this.get(-1)},skipWhile:function(m,E){return Lt(this,fg(this,m,E,!1))},zip:function(){var m=[this].concat(W(arguments));return Lt(this,od(this,_g,m))},zipWith:function(m){var E=W(arguments);return E[0]=this,Lt(this,od(this,m,E))}}),a.prototype[y]=!0,a.prototype[w]=!0,jo(s,{get:function(m,E){return this.has(m)?m:E},includes:function(m){return this.has(m)},keySeq:function(){return this.valueSeq()}}),s.prototype.has=Br.includes,jo(je,o.prototype),jo(Fe,a.prototype),jo(tt,s.prototype),jo(ot,o.prototype),jo(ht,a.prototype),jo(Ot,s.prototype);function AC(m,E){return E}function $C(m,E){return[E,m]}function $a(m){return function(){return!m.apply(this,arguments)}}function _0(m){return function(){return-m.apply(this,arguments)}}function x0(m){return typeof m=="string"?JSON.stringify(m):m}function _g(){return W(arguments)}function xg(m,E){return m<E?1:m>E?-1:0}function ls(m){if(m.size===1/0)return 0;var E=p(m),I=u(m),F=E?1:0,j=m.__iterate(I?E?function(re,pe){F=31*F+w0(Xt(re),Xt(pe))|0}:function(re,pe){F=F+w0(Xt(re),Xt(pe))|0}:E?function(re){F=31*F+Xt(re)|0}:function(re){F=F+Xt(re)|0});return dd(j,F)}function dd(m,E){return E=rn(E,3432918353),E=rn(E<<15|E>>>-15,461845907),E=rn(E<<13|E>>>-13,5),E=(E+3864292196|0)^m,E=rn(E^E>>>16,2246822507),E=rn(E^E>>>13,3266489909),E=Qt(E^E>>>16),E}function w0(m,E){return m^E+2654435769+(m<<6)+(m>>2)|0}var OC={Iterable:i,Seq:Pe,Collection:ct,Map:$t,OrderedMap:ar,List:sn,Stack:pr,Set:Mn,OrderedSet:Fi,Record:Wt,Range:Ze,Repeat:$e,is:de,fromJS:Ce};return OC})})(pG);var cn=pG.exports,Hje=cn,qje=Hje.OrderedMap,Gje={createFromArray:function(t){return qje(t.map(function(n){return[n.getKey(),n]}))}},Iy=Gje;function Yje(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var PI=cn,GA=PI.Map,YA=PI.OrderedSet,Xje=PI.Record,hG=YA(),gG={style:hG,entity:null},Zje=Xje(gG),LI=function(e){Yje(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.getStyle=function(){return this.get("style")},n.getEntity=function(){return this.get("entity")},n.hasStyle=function(i){return this.getStyle().includes(i)},t.applyStyle=function(i,o){var a=i.set("style",i.getStyle().add(o));return t.create(a)},t.removeStyle=function(i,o){var a=i.set("style",i.getStyle().remove(o));return t.create(a)},t.applyEntity=function(i,o){var a=i.getEntity()===o?i:i.set("entity",o);return t.create(a)},t.create=function(i){if(!i)return MI;var o={style:hG,entity:null},a=GA(o).merge(i),s=tT.get(a);if(s)return s;var l=new t(a);return tT=tT.set(a,l),l},t.fromJS=function(i){var o=i.style,a=i.entity;return new t({style:Array.isArray(o)?YA(o):o,entity:Array.isArray(a)?YA(a):a})},t}(Zje),MI=new LI,tT=GA([[GA(gG),MI]]);LI.EMPTY=MI;var xa=LI;function Jje(e,t,n,r){if(e.size){var i=0;e.reduce(function(o,a,s){return t(o,a)||(n(o)&&r(i,s),i=s),a}),n(e.last())&&r(i,e.count())}}var Dy=Jje;function Qje(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var eze=xa,Yj=Dy,Py=cn,mG=Py.List,tze=Py.Map,nze=Py.OrderedSet,rze=Py.Record,ize=Py.Repeat,oze=nze(),aze={key:"",type:"unstyled",text:"",characterList:mG(),depth:0,data:tze()},sze=rze(aze),lze=function(t){if(!t)return t;var n=t.characterList,r=t.text;return r&&!n&&(t.characterList=mG(ize(eze.EMPTY,r.length))),t},uze=function(e){Qje(t,e);function t(r){return e.call(this,lze(r))||this}var n=t.prototype;return n.getKey=function(){return this.get("key")},n.getType=function(){return this.get("type")},n.getText=function(){return this.get("text")},n.getCharacterList=function(){return this.get("characterList")},n.getLength=function(){return this.getText().length},n.getDepth=function(){return this.get("depth")},n.getData=function(){return this.get("data")},n.getInlineStyleAt=function(i){var o=this.getCharacterList().get(i);return o?o.getStyle():oze},n.getEntityAt=function(i){var o=this.getCharacterList().get(i);return o?o.getEntity():null},n.findStyleRanges=function(i,o){Yj(this.getCharacterList(),cze,i,o)},n.findEntityRanges=function(i,o){Yj(this.getCharacterList(),fze,i,o)},t}(sze);function cze(e,t){return e.getStyle()===t.getStyle()}function fze(e,t){return e.getEntity()===t.getEntity()}var Mf=uze;function dze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var pze=xa,Xj=Dy,Ly=cn,XA=Ly.List,hze=Ly.Map,gze=Ly.OrderedSet,mze=Ly.Record,vze=Ly.Repeat,yze=gze(),Zj={parent:null,characterList:XA(),data:hze(),depth:0,key:"",text:"",type:"unstyled",children:XA(),prevSibling:null,nextSibling:null},bze=function(t,n){return t.getStyle()===n.getStyle()},_ze=function(t,n){return t.getEntity()===n.getEntity()},xze=function(t){if(!t)return t;var n=t.characterList,r=t.text;return r&&!n&&(t.characterList=XA(vze(pze.EMPTY,r.length))),t},wze=function(e){dze(t,e);function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zj;return e.call(this,xze(r))||this}var n=t.prototype;return n.getKey=function(){return this.get("key")},n.getType=function(){return this.get("type")},n.getText=function(){return this.get("text")},n.getCharacterList=function(){return this.get("characterList")},n.getLength=function(){return this.getText().length},n.getDepth=function(){return this.get("depth")},n.getData=function(){return this.get("data")},n.getInlineStyleAt=function(i){var o=this.getCharacterList().get(i);return o?o.getStyle():yze},n.getEntityAt=function(i){var o=this.getCharacterList().get(i);return o?o.getEntity():null},n.getChildKeys=function(){return this.get("children")},n.getParentKey=function(){return this.get("parent")},n.getPrevSiblingKey=function(){return this.get("prevSibling")},n.getNextSiblingKey=function(){return this.get("nextSibling")},n.findStyleRanges=function(i,o){Xj(this.getCharacterList(),bze,i,o)},n.findEntityRanges=function(i,o){Xj(this.getCharacterList(),_ze,i,o)},t}(mze(Zj)),wa=wze,Jj=xa,Sze=cn,Cze=Sze.Map,Eze={add:function(t,n,r){return Qj(t,n,r,!0)},remove:function(t,n,r){return Qj(t,n,r,!1)}};function Qj(e,t,n,r){var i=e.getBlockMap(),o=t.getStartKey(),a=t.getStartOffset(),s=t.getEndKey(),l=t.getEndOffset(),u=i.skipUntil(function(f,d){return d===o}).takeUntil(function(f,d){return d===s}).concat(Cze([[s,i.get(s)]])).map(function(f,d){var p,g;o===s?(p=a,g=l):(p=d===o?a:0,g=d===s?l:f.getLength());for(var v=f.getCharacterList(),y;p<g;)y=v.get(p),v=v.set(p,r?Jj.applyStyle(y,n):Jj.removeStyle(y,n)),p++;return f.set("characterList",v)});return e.merge({blockMap:i.merge(u),selectionBefore:t,selectionAfter:t})}var kze=Eze,Tze=xa;function Rze(e,t,n,r){for(var i=t,o=e.getCharacterList();i<n;)o=o.set(i,Tze.applyEntity(o.get(i),r)),i++;return e.set("characterList",o)}var Aze=Rze,$ze=Aze,Oze=cn;function Ize(e,t,n){var r=e.getBlockMap(),i=t.getStartKey(),o=t.getStartOffset(),a=t.getEndKey(),s=t.getEndOffset(),l=r.skipUntil(function(u,f){return f===i}).takeUntil(function(u,f){return f===a}).toOrderedMap().merge(Oze.OrderedMap([[a,r.get(a)]])).map(function(u,f){var d=f===i?o:0,p=f===a?s:u.getLength();return $ze(u,d,p,n)});return e.merge({blockMap:r.merge(l),selectionBefore:t,selectionAfter:t})}var Dze=Ize,Pze={getRemovalRange:function(t,n,r,i,o){var a=r.split(" ");a=a.map(function(w,b){if(o==="forward"){if(b>0)return" "+w}else if(b<a.length-1)return w+" ";return w});for(var s=i,l,u,f=null,d=null,p=0;p<a.length;p++){if(u=a[p],l=s+u.length,t<l&&s<n)f!==null||(f=s),d=l;else if(f!==null)break;s=l}var g=i+r.length,v=f===i,y=d===g;return(!v&&y||v&&!y)&&(o==="forward"?d!==g&&d++:f!==i&&f--),{start:f,end:d}}},Lze=Pze;function Mze(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(t.replace(/%s/g,function(){return String(r[a++])})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var bn=Mze,Fze=bn;function Nze(e,t){var n=[];return e.findEntityRanges(function(r){return r.getEntity()===t},function(r,i){n.push({start:r,end:i})}),n.length||Fze(!1),n}var Bze=Nze,jze=Lze,zze=Bze,Uze=bn;function Kze(e,t,n,r,i){var o=r.getStartOffset(),a=r.getEndOffset(),s=t.getEntityAt(o),l=n.getEntityAt(a-1);if(!s&&!l)return r;var u=r;if(s&&s===l)u=fm(e,t,u,i,s,!0,!0);else if(s&&l){var f=fm(e,t,u,i,s,!1,!0),d=fm(e,n,u,i,l,!1,!1);u=u.merge({anchorOffset:f.getAnchorOffset(),focusOffset:d.getFocusOffset(),isBackward:!1})}else if(s){var p=fm(e,t,u,i,s,!1,!0);u=u.merge({anchorOffset:p.getStartOffset(),isBackward:!1})}else if(l){var g=fm(e,n,u,i,l,!1,!1);u=u.merge({focusOffset:g.getEndOffset(),isBackward:!1})}return u}function fm(e,t,n,r,i,o,a){var s=n.getStartOffset(),l=n.getEndOffset(),u=e.__get(i),f=u.getMutability(),d=a?s:l;if(f==="MUTABLE")return n;var p=zze(t,i).filter(function(y){return d<=y.end&&d>=y.start});p.length!=1&&Uze(!1);var g=p[0];if(f==="IMMUTABLE")return n.merge({anchorOffset:g.start,focusOffset:g.end,isBackward:!1});o||(a?l=g.end:s=g.start);var v=jze.getRemovalRange(s,l,t.getText().slice(g.start,g.end),g.start,r);return n.merge({anchorOffset:v.start,focusOffset:v.end,isBackward:!1})}var Wze=Kze,ez={},Vze=Math.pow(2,24);function Hze(){for(var e;e===void 0||ez.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*Vze).toString(32);return ez[e]=!0,e}var qs=Hze,qze=wa,vG=qs,Gze=cn,yG=Gze.OrderedMap,Yze=function(t){var n={},r;return yG(t.withMutations(function(i){i.forEach(function(o,a){var s=o.getKey(),l=o.getNextSiblingKey(),u=o.getPrevSiblingKey(),f=o.getChildKeys(),d=o.getParentKey(),p=vG();if(n[s]=p,l){var g=i.get(l);g?i.setIn([l,"prevSibling"],p):i.setIn([s,"nextSibling"],null)}if(u){var v=i.get(u);v?i.setIn([u,"nextSibling"],p):i.setIn([s,"prevSibling"],null)}if(d&&i.get(d)){var y=i.get(d),w=y.getChildKeys();i.setIn([d,"children"],w.set(w.indexOf(o.getKey()),p))}else i.setIn([s,"parent"],null),r&&(i.setIn([r.getKey(),"nextSibling"],p),i.setIn([s,"prevSibling"],n[r.getKey()])),r=i.get(s);f.forEach(function(b){var x=i.get(b);x?i.setIn([b,"parent"],p):i.setIn([s,"children"],o.getChildKeys().filter(function(C){return C!==b}))})})}).toArray().map(function(i){return[n[i.getKey()],i.set("key",n[i.getKey()])]}))},Xze=function(t){return yG(t.toArray().map(function(n){var r=vG();return[r,n.set("key",r)]}))},Zze=function(t){var n=t.first()instanceof qze;return n?Yze(t):Xze(t)},bG=Zze,Jze=xa,Qze=Dy,e4e=bn;function t4e(e,t){var n=e.getBlockMap(),r=e.getEntityMap(),i={},o=t.getStartKey(),a=t.getStartOffset(),s=n.get(o),l=tz(r,s,a);l!==s&&(i[o]=l);var u=t.getEndKey(),f=t.getEndOffset(),d=n.get(u);o===u&&(d=l);var p=tz(r,d,f);return p!==d&&(i[u]=p),Object.keys(i).length?e.merge({blockMap:n.merge(i),selectionAfter:t}):e.set("selectionAfter",t)}function n4e(e,t,n){var r;return Qze(e,function(i,o){return i.getEntity()===o.getEntity()},function(i){return i.getEntity()===t},function(i,o){i<=n&&o>=n&&(r={start:i,end:o})}),typeof r!="object"&&e4e(!1),r}function tz(e,t,n){var r=t.getCharacterList(),i=n>0?r.get(n-1):void 0,o=n<r.count()?r.get(n):void 0,a=i?i.getEntity():void 0,s=o?o.getEntity():void 0;if(s&&s===a){var l=e.__get(s);if(l.getMutability()!=="MUTABLE"){for(var u=n4e(r,s,n),f=u.start,d=u.end,p;f<d;)p=r.get(f),r=r.set(f,Jze.applyEntity(p,null)),f++;return t.set("characterList",r)}}return t}var _G=t4e,r4e=bG,i4e=_G,o4e=function(t,n){var r=n.getStartKey(),i=n.getStartOffset(),o=n.getEndKey(),a=n.getEndOffset(),s=i4e(t,n),l=s.getBlockMap(),u=l.keySeq(),f=u.indexOf(r),d=u.indexOf(o)+1;return r4e(l.slice(f,d).map(function(p,g){var v=p.getText(),y=p.getCharacterList();return r===o?p.merge({text:v.slice(i,a),characterList:y.slice(i,a)}):g===r?p.merge({text:v.slice(i),characterList:y.slice(i)}):g===o?p.merge({text:v.slice(0,a),characterList:y.slice(0,a)}):p}))},PS=o4e;function a4e(e,t,n){var r=e;if(n===r.count())t.forEach(function(a){r=r.push(a)});else if(n===0)t.reverse().forEach(function(a){r=r.unshift(a)});else{var i=r.slice(0,n),o=r.slice(n);r=i.concat(t,o).toList()}return r}var xG=a4e,s4e=Iy,wG=wa,l4e=cn,u4e=xG,nz=bn,c4e=bG,f4e=l4e.List,d4e=function(t,n,r,i,o,a){var s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:"REPLACE_WITH_NEW_DATA",l=r.get(o),u=l.getText(),f=l.getCharacterList(),d=o,p=a+i.getText().length,g=null;switch(s){case"MERGE_OLD_DATA_TO_NEW_DATA":g=i.getData().merge(l.getData());break;case"REPLACE_WITH_NEW_DATA":g=i.getData();break}var v=l.getType();u&&v==="unstyled"&&(v=i.getType());var y=l.merge({text:u.slice(0,a)+i.getText()+u.slice(a),characterList:u4e(f,i.getCharacterList(),a),type:v,data:g});return t.merge({blockMap:r.set(o,y),selectionBefore:n,selectionAfter:n.merge({anchorKey:d,anchorOffset:p,focusKey:d,focusOffset:p,isBackward:!1})})},p4e=function(t,n,r){var i=t.getText(),o=t.getCharacterList(),a=i.slice(0,n),s=o.slice(0,n),l=r.first();return t.merge({text:a+l.getText(),characterList:s.concat(l.getCharacterList()),type:a?t.getType():l.getType(),data:l.getData()})},h4e=function(t,n,r){var i=t.getText(),o=t.getCharacterList(),a=i.length,s=i.slice(n,a),l=o.slice(n,a),u=r.last();return u.merge({text:u.getText()+s,characterList:u.getCharacterList().concat(l),data:u.getData()})},g4e=function(t,n){var r=t.getKey(),i=t,o=[];for(n.get(r)&&o.push(r);i&&i.getNextSiblingKey();){var a=i.getNextSiblingKey();if(!a)break;o.push(a),i=n.get(a)}return o},m4e=function(t,n,r,i){return t.withMutations(function(o){var a=r.getKey(),s=i.getKey(),l=r.getNextSiblingKey(),u=r.getParentKey(),f=g4e(i,t),d=f[f.length-1];if(o.get(s)?(o.setIn([a,"nextSibling"],s),o.setIn([s,"prevSibling"],a)):(o.setIn([a,"nextSibling"],i.getNextSiblingKey()),o.setIn([i.getNextSiblingKey(),"prevSibling"],a)),o.setIn([d,"nextSibling"],l),l&&o.setIn([l,"prevSibling"],d),f.forEach(function(b){return o.setIn([b,"parent"],u)}),u){var p=t.get(u),g=p.getChildKeys(),v=g.indexOf(a),y=v+1,w=g.toArray();w.splice.apply(w,[y,0].concat(f)),o.setIn([u,"children"],f4e(w))}})},v4e=function(t,n,r,i,o,a){var s=r.first()instanceof wG,l=[],u=i.size,f=r.get(o),d=i.first(),p=i.last(),g=p.getLength(),v=p.getKey(),y=s&&(!f.getChildKeys().isEmpty()||!d.getChildKeys().isEmpty());r.forEach(function(b,x){if(x!==o){l.push(b);return}y?l.push(b):l.push(p4e(b,a,i)),i.slice(y?0:1,u-1).forEach(function(C){return l.push(C)}),l.push(h4e(b,a,i))});var w=s4e.createFromArray(l);return s&&(w=m4e(w,r,f,d)),t.merge({blockMap:w,selectionBefore:n,selectionAfter:n.merge({anchorKey:v,anchorOffset:g,focusKey:v,focusOffset:g,isBackward:!1})})},y4e=function(t,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"REPLACE_WITH_NEW_DATA";n.isCollapsed()||nz(!1);var o=t.getBlockMap(),a=c4e(r),s=n.getStartKey(),l=n.getStartOffset(),u=o.get(s);return u instanceof wG&&(u.getChildKeys().isEmpty()||nz(!1)),a.size===1?d4e(t,n,o,a.first(),s,l,i):v4e(t,n,o,a,s,l)},b4e=y4e,_4e=cn,x4e=xG,w4e=bn,S4e=_4e.Repeat;function C4e(e,t,n,r){t.isCollapsed()||w4e(!1);var i=null;if(n!=null&&(i=n.length),i==null||i===0)return e;var o=e.getBlockMap(),a=t.getStartKey(),s=t.getStartOffset(),l=o.get(a),u=l.getText(),f=l.merge({text:u.slice(0,s)+n+u.slice(s,l.getLength()),characterList:x4e(l.getCharacterList(),S4e(r,i).toList(),s)}),d=s+i;return e.merge({blockMap:o.set(a,f),selectionAfter:t.merge({anchorOffset:d,focusOffset:d})})}var E4e=C4e,k4e=cn,T4e=k4e.Map;function R4e(e,t,n){var r=t.getStartKey(),i=t.getEndKey(),o=e.getBlockMap(),a=o.toSeq().skipUntil(function(s,l){return l===r}).takeUntil(function(s,l){return l===i}).concat(T4e([[i,o.get(i)]])).map(n);return e.merge({blockMap:o.merge(a),selectionBefore:t,selectionAfter:t})}var SG=R4e,A4e=wa,$4e=function(t,n){var r=t instanceof A4e;if(!r)return null;var i=t.getNextSiblingKey();if(i)return i;var o=t.getParentKey();if(!o)return null;for(var a=n.get(o);a&&!a.getNextSiblingKey();){var s=a.getParentKey();a=s?n.get(s):null}return a?a.getNextSiblingKey():null},CG=$4e,O4e=wa,ZA=CG,EG=cn;EG.List;var rz=EG.Map,Ui=function(t,n,r){if(t){var i=n.get(t);i&&n.set(t,r(i))}},lx=function(t,n){var r=[];if(!t)return r;for(var i=n.get(t);i&&i.getParentKey();){var o=i.getParentKey();o&&r.push(o),i=o?n.get(o):null}return r},I4e=function(t,n){var r=[];if(!t)return r;for(var i=ZA(t,n);i&&n.get(i);){var o=n.get(i);r.push(i),i=o.getParentKey()?ZA(o,n):null}return r},Dd=function(t,n,r){if(!t)return null;for(var i=r.get(t.getKey()).getNextSiblingKey();i&&!n.get(i);)i=r.get(i).getNextSiblingKey()||null;return i},Pd=function(t,n,r){if(!t)return null;for(var i=r.get(t.getKey()).getPrevSiblingKey();i&&!n.get(i);)i=r.get(i).getPrevSiblingKey()||null;return i},D4e=function(t,n,r,i){return t.withMutations(function(o){if(Ui(n.getKey(),o,function(f){return f.merge({nextSibling:Dd(f,o,i),prevSibling:Pd(f,o,i)})}),Ui(r.getKey(),o,function(f){return f.merge({nextSibling:Dd(f,o,i),prevSibling:Pd(f,o,i)})}),lx(n.getKey(),i).forEach(function(f){return Ui(f,o,function(d){return d.merge({children:d.getChildKeys().filter(function(p){return o.get(p)}),nextSibling:Dd(d,o,i),prevSibling:Pd(d,o,i)})})}),Ui(n.getNextSiblingKey(),o,function(f){return f.merge({prevSibling:n.getPrevSiblingKey()})}),Ui(n.getPrevSiblingKey(),o,function(f){return f.merge({nextSibling:Dd(f,o,i)})}),Ui(r.getNextSiblingKey(),o,function(f){return f.merge({prevSibling:Pd(f,o,i)})}),Ui(r.getPrevSiblingKey(),o,function(f){return f.merge({nextSibling:r.getNextSiblingKey()})}),lx(r.getKey(),i).forEach(function(f){Ui(f,o,function(d){return d.merge({children:d.getChildKeys().filter(function(p){return o.get(p)}),nextSibling:Dd(d,o,i),prevSibling:Pd(d,o,i)})})}),I4e(r,i).forEach(function(f){return Ui(f,o,function(d){return d.merge({nextSibling:Dd(d,o,i),prevSibling:Pd(d,o,i)})})}),t.get(n.getKey())==null&&t.get(r.getKey())!=null&&r.getParentKey()===n.getKey()&&r.getPrevSiblingKey()==null){var a=n.getPrevSiblingKey();Ui(r.getKey(),o,function(f){return f.merge({prevSibling:a})}),Ui(a,o,function(f){return f.merge({nextSibling:r.getKey()})});var s=a?t.get(a):null,l=s?s.getParentKey():null;if(n.getChildKeys().forEach(function(f){Ui(f,o,function(d){return d.merge({parent:l})})}),l!=null){var u=t.get(l);Ui(l,o,function(f){return f.merge({children:u.getChildKeys().concat(n.getChildKeys())})})}Ui(n.getChildKeys().find(function(f){var d=t.get(f);return d.getNextSiblingKey()===null}),o,function(f){return f.merge({nextSibling:n.getNextSiblingKey()})})}})},P4e=function(t,n){if(n.isCollapsed())return t;var r=t.getBlockMap(),i=n.getStartKey(),o=n.getStartOffset(),a=n.getEndKey(),s=n.getEndOffset(),l=r.get(i),u=r.get(a),f=l instanceof O4e,d=[];if(f){var p=u.getChildKeys(),g=lx(a,r);u.getNextSiblingKey()&&(d=d.concat(g)),p.isEmpty()||(d=d.concat(g.concat([a]))),d=d.concat(lx(ZA(u,r),r))}var v;l===u?v=L4e(l.getCharacterList(),o,s):v=l.getCharacterList().slice(0,o).concat(u.getCharacterList().slice(s));var y=l.merge({text:l.getText().slice(0,o)+u.getText().slice(s),characterList:v}),w=f&&o===0&&s===0&&u.getParentKey()===i&&u.getPrevSiblingKey()==null,b=w?rz([[i,null]]):r.toSeq().skipUntil(function(C,k){return k===i}).takeUntil(function(C,k){return k===a}).filter(function(C,k){return d.indexOf(k)===-1}).concat(rz([[a,null]])).map(function(C,k){return k===i?y:null}),x=r.merge(b).filter(function(C){return!!C});return f&&l!==u&&(x=D4e(x,l,u,r)),t.merge({blockMap:x,selectionBefore:n,selectionAfter:n.merge({anchorKey:i,anchorOffset:o,focusKey:i,focusOffset:o,isBackward:!1})})},L4e=function(t,n,r){if(n===0)for(;n<r;)t=t.shift(),n++;else if(r===t.count())for(;r>n;)t=t.pop(),r--;else{var i=t.slice(0,n),o=t.slice(r);t=i.concat(o).toList()}return t},M4e=P4e,F4e=wa,N4e=qs,kG=cn,iz=bn,B4e=SG,j4e=kG.List,z4e=kG.Map,Z1=function(t,n,r){if(t){var i=n.get(t);i&&n.set(t,r(i))}},U4e=function(t,n,r){return t.withMutations(function(i){var o=n.getKey(),a=r.getKey();Z1(n.getParentKey(),i,function(s){var l=s.getChildKeys(),u=l.indexOf(o)+1,f=l.toArray();return f.splice(u,0,a),s.merge({children:j4e(f)})}),Z1(n.getNextSiblingKey(),i,function(s){return s.merge({prevSibling:a})}),Z1(o,i,function(s){return s.merge({nextSibling:a})}),Z1(a,i,function(s){return s.merge({prevSibling:o})})})},K4e=function(t,n){n.isCollapsed()||iz(!1);var r=n.getAnchorKey(),i=t.getBlockMap(),o=i.get(r),a=o.getText();if(!a){var s=o.getType();if(s==="unordered-list-item"||s==="ordered-list-item")return B4e(t,n,function(b){return b.merge({type:"unstyled",depth:0})})}var l=n.getAnchorOffset(),u=o.getCharacterList(),f=N4e(),d=o instanceof F4e,p=o.merge({text:a.slice(0,l),characterList:u.slice(0,l)}),g=p.merge({key:f,text:a.slice(l),characterList:u.slice(l),data:z4e()}),v=i.toSeq().takeUntil(function(b){return b===o}),y=i.toSeq().skipUntil(function(b){return b===o}).rest(),w=v.concat([[r,p],[f,g]],y).toOrderedMap();return d&&(o.getChildKeys().isEmpty()||iz(!1),w=U4e(w,p,g)),t.merge({blockMap:w,selectionBefore:n,selectionAfter:n.merge({anchorKey:f,anchorOffset:0,focusKey:f,focusOffset:0,isBackward:!1})})},W4e=K4e,V4e=xa,oz=kze,H4e=Dze,q4e=Wze,G4e=PS,Y4e=cn,X4e=b4e,Z4e=E4e,J4e=bn,nT=SG,dm=_G,pm=M4e,Q4e=W4e,e5e=Y4e.OrderedSet,Xb={replaceText:function(t,n,r,i,o){var a=dm(t,n),s=pm(a,n),l=V4e.create({style:i||e5e(),entity:o||null});return Z4e(s,s.getSelectionAfter(),r,l)},insertText:function(t,n,r,i,o){return n.isCollapsed()||J4e(!1),Xb.replaceText(t,n,r,i,o)},moveText:function(t,n,r){var i=G4e(t,n),o=Xb.removeRange(t,n,"backward");return Xb.replaceWithFragment(o,r,i)},replaceWithFragment:function(t,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"REPLACE_WITH_NEW_DATA",o=dm(t,n),a=pm(o,n);return X4e(a,a.getSelectionAfter(),r,i)},removeRange:function(t,n,r){var i,o,a,s;n.getIsBackward()&&(n=n.merge({anchorKey:n.getFocusKey(),anchorOffset:n.getFocusOffset(),focusKey:n.getAnchorKey(),focusOffset:n.getAnchorOffset(),isBackward:!1})),i=n.getAnchorKey(),o=n.getFocusKey(),a=t.getBlockForKey(i),s=t.getBlockForKey(o);var l=n.getStartOffset(),u=n.getEndOffset(),f=a.getEntityAt(l),d=s.getEntityAt(u-1);if(i===o&&f&&f===d){var p=q4e(t.getEntityMap(),a,s,n,r);return pm(t,p)}var g=dm(t,n);return pm(g,n)},splitBlock:function(t,n){var r=dm(t,n),i=pm(r,n);return Q4e(i,i.getSelectionAfter())},applyInlineStyle:function(t,n,r){return oz.add(t,n,r)},removeInlineStyle:function(t,n,r){return oz.remove(t,n,r)},setBlockType:function(t,n,r){return nT(t,n,function(i){return i.merge({type:r,depth:0})})},setBlockData:function(t,n,r){return nT(t,n,function(i){return i.merge({data:r})})},mergeBlockData:function(t,n,r){return nT(t,n,function(i){return i.merge({data:i.getData().merge(r)})})},applyEntity:function(t,n,r){var i=dm(t,n);return H4e(i,n,r)}},so=Xb;function t5e(e){return Object.keys(e).map(function(t){return e[t]})}var TG=t5e;function n5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){r5e(e,i,n[i])})}return e}function r5e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i5e(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var RG=Dy,o5e=TG,FI=cn,Vd=FI.List,a5e=FI.Repeat,AG=FI.Record,$G=function(){return!0},s5e={start:null,end:null},JA=AG(s5e),l5e={start:null,end:null,decoratorKey:null,leaves:null},rT=AG(l5e),u5e={generate:function(t,n,r){var i=n.getLength();if(!i)return Vd.of(new rT({start:0,end:0,decoratorKey:null,leaves:Vd.of(new JA({start:0,end:0}))}));var o=[],a=r?r.getDecorations(n,t):Vd(a5e(null,i)),s=n.getCharacterList();return RG(a,OG,$G,function(l,u){o.push(new rT({start:l,end:u,decoratorKey:a.get(l),leaves:c5e(s.slice(l,u).toList(),l)}))}),Vd(o)},fromJS:function(t){var n=t.leaves,r=i5e(t,["leaves"]);return new rT(n5e({},r,{leaves:n!=null?Vd(Array.isArray(n)?n:o5e(n)).map(function(i){return JA(i)}):null}))}};function c5e(e,t){var n=[],r=e.map(function(i){return i.getStyle()}).toList();return RG(r,OG,$G,function(i,o){n.push(new JA({start:i+t,end:o+t}))}),Vd(n)}function OG(e,t){return e===t}var f5e=u5e;function d5e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var p5e=cn,h5e=p5e.Record,g5e=h5e({type:"TOKEN",mutability:"IMMUTABLE",data:Object}),m5e=function(e){d5e(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.getType=function(){return this.get("type")},n.getMutability=function(){return this.get("mutability")},n.getData=function(){return this.get("data")},t}(g5e),IG=m5e;function v5e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,n=e=="x"?t:t&3|8;return n.toString(16)})}var y5e=v5e;function b5e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){_5e(e,i,n[i])})}return e}function _5e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var x5e=IG,w5e=cn,S5e=bn,QA=y5e,C5e=w5e.Map,pl=C5e(),hm=QA();function Ld(e,t){console.warn("WARNING: "+e+` will be deprecated soon!
|
|
439
|
+
Please use "`+t+'" instead.')}var vs={getLastCreatedEntityKey:function(){return Ld("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),vs.__getLastCreatedEntityKey()},create:function(t,n,r){return Ld("DraftEntity.create","contentState.createEntity"),vs.__create(t,n,r)},add:function(t){return Ld("DraftEntity.add","contentState.addEntity"),vs.__add(t)},get:function(t){return Ld("DraftEntity.get","contentState.getEntity"),vs.__get(t)},__getAll:function(){return pl},__loadWithEntities:function(t){pl=t,hm=QA()},mergeData:function(t,n){return Ld("DraftEntity.mergeData","contentState.mergeEntityData"),vs.__mergeData(t,n)},replaceData:function(t,n){return Ld("DraftEntity.replaceData","contentState.replaceEntityData"),vs.__replaceData(t,n)},__getLastCreatedEntityKey:function(){return hm},__create:function(t,n,r){return vs.__add(new x5e({type:t,mutability:n,data:r||{}}))},__add:function(t){return hm=QA(),pl=pl.set(hm,t),hm},__get:function(t){var n=pl.get(t);return n||S5e(!1),n},__mergeData:function(t,n){var r=vs.__get(t),i=b5e({},r.getData(),n),o=r.set("data",i);return pl=pl.set(t,o),o},__replaceData:function(t,n){var r=vs.__get(t),i=r.set("data",n);return pl=pl.set(t,i),i}},LS=vs;function E5e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var k5e=cn,T5e=k5e.Record,R5e={anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1},A5e=T5e(R5e),$5e=function(e){E5e(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},n.getAnchorKey=function(){return this.get("anchorKey")},n.getAnchorOffset=function(){return this.get("anchorOffset")},n.getFocusKey=function(){return this.get("focusKey")},n.getFocusOffset=function(){return this.get("focusOffset")},n.getIsBackward=function(){return this.get("isBackward")},n.getHasFocus=function(){return this.get("hasFocus")},n.hasEdgeWithin=function(i,o,a){var s=this.getAnchorKey(),l=this.getFocusKey();if(s===l&&s===i){var u=this.getStartOffset(),f=this.getEndOffset();return o<=u&&u<=a||o<=f&&f<=a}if(i!==s&&i!==l)return!1;var d=i===s?this.getAnchorOffset():this.getFocusOffset();return o<=d&&a>=d},n.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},n.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},n.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},n.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},n.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},t.createEmpty=function(i){return new t({anchorKey:i,anchorOffset:0,focusKey:i,focusOffset:0,isBackward:!1,hasFocus:!1})},t}(A5e),MS=$5e,cc=function(e){return typeof window<"u"&&window.__DRAFT_GKX?!!window.__DRAFT_GKX[e]:!1},O5e=new RegExp("\r","g");function I5e(e){return e.replace(O5e,"")}var DG=I5e;function az(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){D5e(e,i,n[i])})}return e}function D5e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P5e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var L5e=Iy,sz=xa,M5e=Mf,F5e=wa,gs=LS,J1=MS,N5e=qs,B5e=TG,j5e=cc,My=cn,z5e=DG,lz=My.List,U5e=My.Record,K5e=My.Repeat,W5e=My.Map,V5e=My.OrderedMap,H5e={entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null},q5e=U5e(H5e),uz=j5e("draft_tree_data_support")?F5e:M5e,G5e=function(e){P5e(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.getEntityMap=function(){return gs},n.getBlockMap=function(){return this.get("blockMap")},n.getSelectionBefore=function(){return this.get("selectionBefore")},n.getSelectionAfter=function(){return this.get("selectionAfter")},n.getBlockForKey=function(i){var o=this.getBlockMap().get(i);return o},n.getKeyBefore=function(i){return this.getBlockMap().reverse().keySeq().skipUntil(function(o){return o===i}).skip(1).first()},n.getKeyAfter=function(i){return this.getBlockMap().keySeq().skipUntil(function(o){return o===i}).skip(1).first()},n.getBlockAfter=function(i){return this.getBlockMap().skipUntil(function(o,a){return a===i}).skip(1).first()},n.getBlockBefore=function(i){return this.getBlockMap().reverse().skipUntil(function(o,a){return a===i}).skip(1).first()},n.getBlocksAsArray=function(){return this.getBlockMap().toArray()},n.getFirstBlock=function(){return this.getBlockMap().first()},n.getLastBlock=function(){return this.getBlockMap().last()},n.getPlainText=function(i){return this.getBlockMap().map(function(o){return o?o.getText():""}).join(i||`
|
|
440
|
+
`)},n.getLastCreatedEntityKey=function(){return gs.__getLastCreatedEntityKey()},n.hasText=function(){var i=this.getBlockMap();return i.size>1||escape(i.first().getText()).replace(/%u200B/g,"").length>0},n.createEntity=function(i,o,a){return gs.__create(i,o,a),this},n.mergeEntityData=function(i,o){return gs.__mergeData(i,o),this},n.replaceEntityData=function(i,o){return gs.__replaceData(i,o),this},n.addEntity=function(i){return gs.__add(i),this},n.getEntity=function(i){return gs.__get(i)},n.getAllEntities=function(){return gs.__getAll()},n.loadWithEntities=function(i){return gs.__loadWithEntities(i)},t.createFromBlockArray=function(i,o){var a=Array.isArray(i)?i:i.contentBlocks,s=L5e.createFromArray(a),l=s.isEmpty()?new J1:J1.createEmpty(s.first().getKey());return new t({blockMap:s,entityMap:o||gs,selectionBefore:l,selectionAfter:l})},t.createFromText=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:/\r\n?|\n/g,a=i.split(o),s=a.map(function(l){return l=z5e(l),new uz({key:N5e(),text:l,type:"unstyled",characterList:lz(K5e(sz.EMPTY,l.length))})});return t.createFromBlockArray(s)},t.fromJS=function(i){return new t(az({},i,{blockMap:V5e(i.blockMap).map(t.createContentBlockFromJS),selectionBefore:new J1(i.selectionBefore),selectionAfter:new J1(i.selectionAfter)}))},t.createContentBlockFromJS=function(i){var o=i.characterList;return new uz(az({},i,{data:W5e(i.data),characterList:o!=null?lz((Array.isArray(o)?o:B5e(o)).map(function(a){return sz.fromJS(a)})):void 0}))},t}(q5e),NI=G5e,ux=bn,Y5e="NEUTRAL",FS="LTR",PG="RTL",Zb=null;function cx(e){return e===FS||e===PG}function LG(e){return cx(e)||ux(!1),e===FS?"ltr":"rtl"}function X5e(e,t){return cx(e)||ux(!1),cx(t)||ux(!1),e===t?null:LG(e)}function MG(e){Zb=e}function Z5e(){MG(FS)}function J5e(){return Zb||this.initGlobalDir(),Zb||ux(!1),Zb}var Q5e={NEUTRAL:Y5e,LTR:FS,RTL:PG,isStrong:cx,getHTMLDir:LG,getHTMLDirIfDifferent:X5e,setGlobalDir:MG,initGlobalDir:Z5e,getGlobalDir:J5e},NS=Q5e,Rl=NS,e6e=bn,lv={L:"A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ff-stﬓ-ﬗA-Za-zヲ-ッーア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",R:"־׀׃׆-א-ת-ׯװ-ײ׳-״-߀-߉ߊ-ߪߴ-ߵߺ-߿ࠀ-ࠕࠚࠤࠨ-࠰-࠾ࡀ-ࡘ-࡞-࢟יִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏ",AL:"؈؋؍؛؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍ܐܒ-ܯ-ݍ-ޥޱ-ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-ﯓ-ﴽ﵀-﵏ﵐ-ﶏ-ﶒ-ﷇ-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴﹶ-ﻼ-"},t6e=new RegExp("["+lv.L+lv.R+lv.AL+"]"),n6e=new RegExp("["+lv.R+lv.AL+"]");function FG(e){var t=t6e.exec(e);return t==null?null:t[0]}function NG(e){var t=FG(e);return t==null?Rl.NEUTRAL:n6e.exec(t)?Rl.RTL:Rl.LTR}function BG(e,t){if(t=t||Rl.NEUTRAL,!e.length)return t;var n=NG(e);return n===Rl.NEUTRAL?t:n}function BI(e,t){return t||(t=Rl.getGlobalDir()),Rl.isStrong(t)||e6e(!1),BG(e,t)}function r6e(e,t){return BI(e,t)===Rl.LTR}function i6e(e,t){return BI(e,t)===Rl.RTL}var o6e={firstStrongChar:FG,firstStrongCharDir:NG,resolveBlockDir:BG,getDirection:BI,isDirectionLTR:r6e,isDirectionRTL:i6e},jI=o6e;function cz(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a6e=jI,fz=NS,s6e=bn,l6e=function(){function e(n){cz(this,"_defaultDir",void 0),cz(this,"_lastDir",void 0),n?fz.isStrong(n)||s6e(!1):n=fz.getGlobalDir(),this._defaultDir=n,this.reset()}var t=e.prototype;return t.reset=function(){this._lastDir=this._defaultDir},t.getDirection=function(r){return this._lastDir=a6e.getDirection(r,this._lastDir),this._lastDir},e}(),u6e=l6e,c6e=function(t){if(t!=null)return t;throw new Error("Got unexpected null or undefined")},lo=c6e,f6e=u6e,jG=cn,d6e=lo,p6e=jG.OrderedMap,Q1,h6e={getDirectionMap:function(t,n){Q1?Q1.reset():Q1=new f6e;var r=t.getBlockMap(),i=r.valueSeq().map(function(a){return d6e(Q1).getDirection(a.getText())}),o=p6e(r.keySeq().zip(i));return n!=null&&jG.is(n,o)?n:o}},g6e=h6e;function dz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){zG(e,i,n[i])})}return e}function zG(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var BS=f5e,gm=NI,eb=g6e,iT=MS,Fy=cn,UG=Fy.OrderedSet,m6e=Fy.Record,Gc=Fy.Stack,pz=Fy.OrderedMap,v6e=Fy.List,y6e={allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:Gc(),selection:null,treeMap:null,undoStack:Gc()},hz=m6e(y6e),KG=function(){t.createEmpty=function(r){return this.createWithText("",r)},t.createWithText=function(r,i){return t.createWithContent(gm.createFromText(r),i)},t.createWithContent=function(r,i){if(r.getBlockMap().count()===0)return t.createEmpty(i);var o=r.getBlockMap().first().getKey();return t.create({currentContent:r,undoStack:Gc(),redoStack:Gc(),decorator:i||null,selection:iT.createEmpty(o)})},t.create=function(r){var i=r.currentContent,o=r.decorator,a=dz({},r,{treeMap:mz(i,o),directionMap:eb.getDirectionMap(i)});return new t(new hz(a))},t.fromJS=function(r){return new t(new hz(dz({},r,{directionMap:r.directionMap!=null?pz(r.directionMap):r.directionMap,inlineStyleOverride:r.inlineStyleOverride!=null?UG(r.inlineStyleOverride):r.inlineStyleOverride,nativelyRenderedContent:r.nativelyRenderedContent!=null?gm.fromJS(r.nativelyRenderedContent):r.nativelyRenderedContent,redoStack:r.redoStack!=null?Gc(r.redoStack.map(function(i){return gm.fromJS(i)})):r.redoStack,selection:r.selection!=null?new iT(r.selection):r.selection,treeMap:r.treeMap!=null?pz(r.treeMap).map(function(i){return v6e(i).map(function(o){return BS.fromJS(o)})}):r.treeMap,undoStack:r.undoStack!=null?Gc(r.undoStack.map(function(i){return gm.fromJS(i)})):r.undoStack,currentContent:gm.fromJS(r.currentContent)})))},t.set=function(r,i){var o=r.getImmutable().withMutations(function(a){var s=a.get("decorator"),l=s;i.decorator===null?l=null:i.decorator&&(l=i.decorator);var u=i.currentContent||r.getCurrentContent();if(l!==s){var f=a.get("treeMap"),d;l&&s?d=_6e(u,u.getBlockMap(),f,l,s):d=mz(u,l),a.merge({decorator:l,treeMap:d,nativelyRenderedContent:null});return}var p=r.getCurrentContent();u!==p&&a.set("treeMap",b6e(r,u.getBlockMap(),u.getEntityMap(),l)),a.merge(i)});return new t(o)};var e=t.prototype;e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.getSelection=function(){return this.getImmutable().get("selection")},e.getDecorator=function(){return this.getImmutable().get("decorator")},e.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},t.setInlineStyleOverride=function(r,i){return t.set(r,{inlineStyleOverride:i})},e.getCurrentInlineStyle=function(){var r=this.getInlineStyleOverride();if(r!=null)return r;var i=this.getCurrentContent(),o=this.getSelection();return o.isCollapsed()?w6e(i,o):S6e(i,o)},e.getBlockTree=function(r){return this.getImmutable().getIn(["treeMap",r])},e.isSelectionAtStartOfContent=function(){var r=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(r,0,0)},e.isSelectionAtEndOfContent=function(){var r=this.getCurrentContent(),i=r.getBlockMap(),o=i.last(),a=o.getLength();return this.getSelection().hasEdgeWithin(o.getKey(),a,a)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},t.acceptSelection=function(r,i){return gz(r,i,!1)},t.forceSelection=function(r,i){return i.getHasFocus()||(i=i.set("hasFocus",!0)),gz(r,i,!0)},t.moveSelectionToEnd=function(r){var i=r.getCurrentContent(),o=i.getLastBlock(),a=o.getKey(),s=o.getLength();return t.acceptSelection(r,new iT({anchorKey:a,anchorOffset:s,focusKey:a,focusOffset:s,isBackward:!1}))},t.moveFocusToEnd=function(r){var i=t.moveSelectionToEnd(r);return t.forceSelection(i,i.getSelection())},t.push=function(r,i,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;if(r.getCurrentContent()===i)return r;var s=eb.getDirectionMap(i,r.getDirectionMap());if(!r.getAllowUndo())return t.set(r,{currentContent:i,directionMap:s,lastChangeType:o,selection:i.getSelectionAfter(),forceSelection:a,inlineStyleOverride:null});var l=r.getSelection(),u=r.getCurrentContent(),f=r.getUndoStack(),d=i;l!==u.getSelectionAfter()||x6e(r,o)?(f=f.push(u),d=d.set("selectionBefore",l)):(o==="insert-characters"||o==="backspace-character"||o==="delete-character")&&(d=d.set("selectionBefore",u.getSelectionBefore()));var p=r.getInlineStyleOverride(),g=["adjust-depth","change-block-type","split-block"];g.indexOf(o)===-1&&(p=null);var v={currentContent:d,directionMap:s,undoStack:f,redoStack:Gc(),lastChangeType:o,selection:i.getSelectionAfter(),forceSelection:a,inlineStyleOverride:p};return t.set(r,v)},t.undo=function(r){if(!r.getAllowUndo())return r;var i=r.getUndoStack(),o=i.peek();if(!o)return r;var a=r.getCurrentContent(),s=eb.getDirectionMap(o,r.getDirectionMap());return t.set(r,{currentContent:o,directionMap:s,undoStack:i.shift(),redoStack:r.getRedoStack().push(a),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:a.getSelectionBefore()})},t.redo=function(r){if(!r.getAllowUndo())return r;var i=r.getRedoStack(),o=i.peek();if(!o)return r;var a=r.getCurrentContent(),s=eb.getDirectionMap(o,r.getDirectionMap());return t.set(r,{currentContent:o,directionMap:s,undoStack:r.getUndoStack().push(a),redoStack:i.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:o.getSelectionAfter()})};function t(n){zG(this,"_immutable",void 0),this._immutable=n}return e.getImmutable=function(){return this._immutable},t}();function gz(e,t,n){return KG.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function mz(e,t){return e.getBlockMap().map(function(n){return BS.generate(e,n,t)}).toOrderedMap()}function b6e(e,t,n,r){var i=e.getCurrentContent().set("entityMap",n),o=i.getBlockMap(),a=e.getImmutable().get("treeMap");return a.merge(t.toSeq().filter(function(s,l){return s!==o.get(l)}).map(function(s){return BS.generate(i,s,r)}))}function _6e(e,t,n,r,i){return n.merge(t.toSeq().filter(function(o){return r.getDecorations(o,e)!==i.getDecorations(o,e)}).map(function(o){return BS.generate(e,o,r)}))}function x6e(e,t){var n=e.getLastChangeType();return t!==n||t!=="insert-characters"&&t!=="backspace-character"&&t!=="delete-character"}function w6e(e,t){var n=t.getStartKey(),r=t.getStartOffset(),i=e.getBlockForKey(n);return r>0?i.getInlineStyleAt(r-1):i.getLength()?i.getInlineStyleAt(0):WG(e,n)}function S6e(e,t){var n=t.getStartKey(),r=t.getStartOffset(),i=e.getBlockForKey(n);return r<i.getLength()?i.getInlineStyleAt(r):r>0?i.getInlineStyleAt(r-1):WG(e,n)}function WG(e,t){var n=e.getBlockMap().reverse().skipUntil(function(r,i){return i===t}).skip(1).skipUntil(function(r,i){return r.getLength()}).first();return n?n.getInlineStyleAt(n.getLength()-1):UG()}var zn=KG,C6e=wa,E6e=CG,VG=cn,tb=bn,k6e=VG.OrderedMap,T6e=VG.List,Ic=function(t,n,r){if(t){var i=n.get(t);i&&n.set(t,r(i))}},R6e=function(t,n,r,i,o){if(!o)return t;var a=i==="after",s=n.getKey(),l=r.getKey(),u=n.getParentKey(),f=n.getNextSiblingKey(),d=n.getPrevSiblingKey(),p=r.getParentKey(),g=a?r.getNextSiblingKey():l,v=a?l:r.getPrevSiblingKey();return t.withMutations(function(y){Ic(u,y,function(w){var b=w.getChildKeys();return w.merge({children:b.delete(b.indexOf(s))})}),Ic(d,y,function(w){return w.merge({nextSibling:f})}),Ic(f,y,function(w){return w.merge({prevSibling:d})}),Ic(g,y,function(w){return w.merge({prevSibling:s})}),Ic(v,y,function(w){return w.merge({nextSibling:s})}),Ic(p,y,function(w){var b=w.getChildKeys(),x=b.indexOf(l),C=a?x+1:x!==0?x-1:0,k=b.toArray();return k.splice(C,0,s),w.merge({children:T6e(k)})}),Ic(s,y,function(w){return w.merge({nextSibling:g,prevSibling:v,parent:p})})})},A6e=function(t,n,r,i){i==="replace"&&tb(!1);var o=r.getKey(),a=n.getKey();a===o&&tb(!1);var s=t.getBlockMap(),l=n instanceof C6e,u=[n],f=s.delete(a);l&&(u=[],f=s.withMutations(function(b){var x=n.getNextSiblingKey(),C=E6e(n,b);b.toSeq().skipUntil(function(k){return k.getKey()===a}).takeWhile(function(k){var R=k.getKey(),A=R===a,O=x&&R!==x,z=!x&&k.getParentKey()&&(!C||R!==C);return!!(A||O||z)}).forEach(function(k){u.push(k),b.delete(k.getKey())})}));var d=f.toSeq().takeUntil(function(b){return b===r}),p=f.toSeq().skipUntil(function(b){return b===r}).skip(1),g=u.map(function(b){return[b.getKey(),b]}),v=k6e();if(i==="before"){var y=t.getBlockBefore(o);!y||y.getKey()!==n.getKey()||tb(!1),v=d.concat([].concat(g,[[o,r]]),p).toOrderedMap()}else if(i==="after"){var w=t.getBlockAfter(o);!w||w.getKey()!==a||tb(!1),v=d.concat([[o,r]].concat(g),p).toOrderedMap()}return t.merge({blockMap:R6e(v,n,r,i,l),selectionBefore:t.getSelectionAfter(),selectionAfter:t.getSelectionAfter().merge({anchorKey:a,focusKey:a})})},$6e=A6e;function vz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){O6e(e,i,n[i])})}return e}function O6e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var I6e=Iy,D6e=xa,P6e=Mf,L6e=wa,Md=so,yz=zn,bz=qs,M6e=cc,HG=cn,nb=$6e,qG=M6e("draft_tree_data_support"),_z=qG?L6e:P6e,F6e=HG.List,N6e=HG.Repeat,B6e={insertAtomicBlock:function(t,n,r){var i=t.getCurrentContent(),o=t.getSelection(),a=Md.removeRange(i,o,"backward"),s=a.getSelectionAfter(),l=Md.splitBlock(a,s),u=l.getSelectionAfter(),f=Md.setBlockType(l,u,"atomic"),d=D6e.create({entity:n}),p={key:bz(),type:"atomic",text:r,characterList:F6e(N6e(d,r.length))},g={key:bz(),type:"unstyled"};qG&&(p=vz({},p,{nextSibling:g.key}),g=vz({},g,{prevSibling:p.key}));var v=[new _z(p),new _z(g)],y=I6e.createFromArray(v),w=Md.replaceWithFragment(f,u,y),b=w.merge({selectionBefore:o,selectionAfter:w.getSelectionAfter().set("hasFocus",!0)});return yz.push(t,b,"insert-fragment")},moveAtomicBlock:function(t,n,r,i){var o=t.getCurrentContent(),a=t.getSelection(),s;if(i==="before"||i==="after"){var l=o.getBlockForKey(i==="before"?r.getStartKey():r.getEndKey());s=nb(o,n,l,i)}else{var u=Md.removeRange(o,r,"backward"),f=u.getSelectionAfter(),d=u.getBlockForKey(f.getFocusKey());if(f.getStartOffset()===0)s=nb(u,n,d,"before");else if(f.getEndOffset()===d.getLength())s=nb(u,n,d,"after");else{var p=Md.splitBlock(u,f),g=p.getSelectionAfter(),v=p.getBlockForKey(g.getFocusKey());s=nb(p,n,v,"before")}}var y=s.merge({selectionBefore:a,selectionAfter:s.getSelectionAfter().set("hasFocus",!0)});return yz.push(t,y,"move-block")}},j6e=B6e;function z6e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var U6e=cn,K6e=U6e.List,oT=".",W6e=function(){function e(n){z6e(this,"_decorators",void 0),this._decorators=n.slice()}var t=e.prototype;return t.getDecorations=function(r,i){var o=Array(r.getText().length).fill(null);return this._decorators.forEach(function(a,s){var l=0,u=a.strategy,f=function(p,g){V6e(o,p,g)&&(H6e(o,p,g,s+oT+l),l++)};u(r,f,i)}),K6e(o)},t.getComponentForKey=function(r){var i=parseInt(r.split(oT)[0],10);return this._decorators[i].component},t.getPropsForKey=function(r){var i=parseInt(r.split(oT)[0],10);return this._decorators[i].props},e}();function V6e(e,t,n){for(var r=t;r<n;r++)if(e[r]!=null)return!1;return!0}function H6e(e,t,n,r){for(var i=t;i<n;i++)e[i]=r}var q6e=W6e;function G6e(e){return typeof e=="object"?Object.keys(e).filter(function(t){return e[t]}).map(xz).join(" "):Array.prototype.map.call(arguments,xz).join(" ")}function xz(e){return e.replace(/\//g,"-")}var Ff=G6e,zI=T,UI=Ff,Y6e=cn,X6e=Y6e.Map,Z6e=zI.createElement("ul",{className:UI("public/DraftStyleDefault/ul")}),J6e=zI.createElement("ol",{className:UI("public/DraftStyleDefault/ol")}),Q6e=zI.createElement("pre",{className:UI("public/DraftStyleDefault/pre")}),eUe=X6e({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:Z6e},"ordered-list-item":{element:"li",wrapper:J6e},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:Q6e},unstyled:{element:"div",aliasedElements:["p"]}}),KI=eUe,GG={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}};/*
|
|
441
441
|
object-assign
|
|
442
442
|
(c) Sindre Sorhus
|
|
443
443
|
@license MIT
|
|
444
|
-
*/var wz=Object.getOwnPropertySymbols,eUe=Object.prototype.hasOwnProperty,tUe=Object.prototype.propertyIsEnumerable;function nUe(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function rUe(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Nf=rUe()?Object.assign:function(e,t){for(var n,r=nUe(e),i,o=1;o<arguments.length;o++){n=Object(arguments[o]);for(var a in n)eUe.call(n,a)&&(r[a]=n[a]);if(wz){i=wz(n);for(var s=0;s<i.length;s++)tUe.call(n,i[s])&&(r[i[s]]=n[i[s]])}}return r},e$={exports:{}};(function(e,t){(function(n,r){var i="0.7.35",o="",a="?",s="function",l="undefined",u="object",f="string",d="major",p="model",g="name",v="type",y="vendor",w="version",b="architecture",x="console",C="mobile",k="tablet",R="smarttv",A="wearable",O="embedded",z=350,V="Amazon",D="Apple",W="ASUS",ie="BlackBerry",se="Browser",K="Chrome",G="Edge",Q="Firefox",le="Google",Z="Huawei",ee="LG",P="Microsoft",ge="Motorola",B="Opera",L="Samsung",ae="Sharp",ue="Sony",ne="Xiaomi",we="Zebra",Te="Facebook",Ee="Chromium OS",Le="Mac OS",Be=function(H,fe){var Y={};for(var X in H)fe[X]&&fe[X].length%2===0?Y[X]=fe[X].concat(H[X]):Y[X]=H[X];return Y},Ie=function(H){for(var fe={},Y=0;Y<H.length;Y++)fe[H[Y].toUpperCase()]=H[Y];return fe},Pe=function(H,fe){return typeof H===f?je(fe).indexOf(je(H))!==-1:!1},je=function(H){return H.toLowerCase()},Fe=function(H){return typeof H===f?H.replace(/[^\d\.]/g,o).split(".")[0]:r},tt=function(H,fe){if(typeof H===f)return H=H.replace(/^\s\s*/,o),typeof fe===l?H:H.substring(0,z)},Xe=function(H,fe){for(var Y=0,X,oe,xe,Ce,_e,nt;Y<fe.length&&!_e;){var rt=fe[Y],de=fe[Y+1];for(X=oe=0;X<rt.length&&!_e&&rt[X];)if(_e=rt[X++].exec(H),_e)for(xe=0;xe<de.length;xe++)nt=_e[++oe],Ce=de[xe],typeof Ce===u&&Ce.length>0?Ce.length===2?typeof Ce[1]==s?this[Ce[0]]=Ce[1].call(this,nt):this[Ce[0]]=Ce[1]:Ce.length===3?typeof Ce[1]===s&&!(Ce[1].exec&&Ce[1].test)?this[Ce[0]]=nt?Ce[1].call(this,nt,Ce[2]):r:this[Ce[0]]=nt?nt.replace(Ce[1],Ce[2]):r:Ce.length===4&&(this[Ce[0]]=nt?Ce[3].call(this,nt.replace(Ce[1],Ce[2])):r):this[Ce]=nt||r;Y+=2}},Ye=function(H,fe){for(var Y in fe)if(typeof fe[Y]===u&&fe[Y].length>0){for(var X=0;X<fe[Y].length;X++)if(Pe(fe[Y][X],H))return Y===a?r:Y}else if(Pe(fe[Y],H))return Y===a?r:Y;return H},st={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},he={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ae={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[w,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[w,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,w],[/opios[\/ ]+([\w\.]+)/i],[w,[g,B+" Mini"]],[/\bopr\/([\w\.]+)/i],[w,[g,B]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[g,w],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[w,[g,"UC"+se]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[w,[g,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[w,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[w,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[w,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[w,[g,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+se],w],[/\bfocus\/([\w\.]+)/i],[w,[g,Q+" Focus"]],[/\bopt\/([\w\.]+)/i],[w,[g,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[w,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[w,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[w,[g,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[w,[g,"MIUI "+se]],[/fxios\/([-\w\.]+)/i],[w,[g,Q]],[/\bqihu|(qi?ho?o?|360)browser/i],[[g,"360 "+se]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1 "+se],w],[/(comodo_dragon)\/([\w\.]+)/i],[[g,/_/g," "],w],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[g,w],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,Te],w],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[g,w],[/\bgsa\/([\w\.]+) .*safari\//i],[w,[g,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[w,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[w,[g,K+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,K+" WebView"],w],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[w,[g,"Android "+se]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,w],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[w,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[w,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[w,Ye,st]],[/(webkit|khtml)\/([\w\.]+)/i],[g,w],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],w],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[w,[g,Q+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[g,w],[/(cobalt)\/([\w\.]+)/i],[g,[w,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,je]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows (ce|mobile); ppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[b,/ower/,o,je]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,je]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[y,L],[v,k]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[y,L],[v,C]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[y,D],[v,C]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[y,D],[v,k]],[/(macintosh);/i],[p,[y,D]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[y,ae],[v,C]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[y,Z],[v,k]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[y,Z],[v,C]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[y,ne],[v,C]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[y,ne],[v,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[y,"OPPO"],[v,C]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[y,"Vivo"],[v,C]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[p,[y,"Realme"],[v,C]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[y,ge],[v,C]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[y,ge],[v,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[y,ee],[v,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[y,ee],[v,C]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[y,"Lenovo"],[v,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[y,"Nokia"],[v,C]],[/(pixel c)\b/i],[p,[y,le],[v,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[y,le],[v,C]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[y,ue],[v,C]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[y,ue],[v,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[y,"OnePlus"],[v,C]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[y,V],[v,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[y,V],[v,C]],[/(playbook);[-\w\),; ]+(rim)/i],[p,y,[v,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[y,ie],[v,C]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[y,W],[v,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[y,W],[v,C]],[/(nexus 9)/i],[p,[y,"HTC"],[v,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[p,/_/g," "],[v,C]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[y,"Acer"],[v,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[y,"Meizu"],[v,C]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,p,[v,C]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,p,[v,k]],[/(surface duo)/i],[p,[y,P],[v,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[y,"Fairphone"],[v,C]],[/(u304aa)/i],[p,[y,"AT&T"],[v,C]],[/\bsie-(\w*)/i],[p,[y,"Siemens"],[v,C]],[/\b(rct\w+) b/i],[p,[y,"RCA"],[v,k]],[/\b(venue[\d ]{2,7}) b/i],[p,[y,"Dell"],[v,k]],[/\b(q(?:mv|ta)\w+) b/i],[p,[y,"Verizon"],[v,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[y,"Barnes & Noble"],[v,k]],[/\b(tm\d{3}\w+) b/i],[p,[y,"NuVision"],[v,k]],[/\b(k88) b/i],[p,[y,"ZTE"],[v,k]],[/\b(nx\d{3}j) b/i],[p,[y,"ZTE"],[v,C]],[/\b(gen\d{3}) b.+49h/i],[p,[y,"Swiss"],[v,C]],[/\b(zur\d{3}) b/i],[p,[y,"Swiss"],[v,k]],[/\b((zeki)?tb.*\b) b/i],[p,[y,"Zeki"],[v,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],p,[v,k]],[/\b(ns-?\w{0,9}) b/i],[p,[y,"Insignia"],[v,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[y,"NextBook"],[v,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],p,[v,C]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],p,[v,C]],[/\b(ph-1) /i],[p,[y,"Essential"],[v,C]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[y,"Envizen"],[v,k]],[/\b(trio[-\w\. ]+) b/i],[p,[y,"MachSpeed"],[v,k]],[/\btu_(1491) b/i],[p,[y,"Rotor"],[v,k]],[/(shield[\w ]+) b/i],[p,[y,"Nvidia"],[v,k]],[/(sprint) (\w+)/i],[y,p,[v,C]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[y,P],[v,C]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[y,we],[v,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[y,we],[v,C]],[/smart-tv.+(samsung)/i],[y,[v,R]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[y,L],[v,R]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,ee],[v,R]],[/(apple) ?tv/i],[y,[p,D+" TV"],[v,R]],[/crkey/i],[[p,K+"cast"],[y,le],[v,R]],[/droid.+aft(\w)( bui|\))/i],[p,[y,V],[v,R]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[y,ae],[v,R]],[/(bravia[\w ]+)( bui|\))/i],[p,[y,ue],[v,R]],[/(mitv-\w{5}) bui/i],[p,[y,ne],[v,R]],[/Hbbtv.*(technisat) (.*);/i],[y,p,[v,R]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,tt],[p,tt],[v,R]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,R]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,p,[v,x]],[/droid.+; (shield) bui/i],[p,[y,"Nvidia"],[v,x]],[/(playstation [345portablevi]+)/i],[p,[y,ue],[v,x]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[y,P],[v,x]],[/((pebble))app/i],[y,p,[v,A]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[y,D],[v,A]],[/droid.+; (glass) \d/i],[p,[y,le],[v,A]],[/droid.+; (wt63?0{2,3})\)/i],[p,[y,we],[v,A]],[/(quest( 2| pro)?)/i],[p,[y,Te],[v,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[v,O]],[/(aeobc)\b/i],[p,[y,V],[v,O]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[p,[v,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[v,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,C]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[w,[g,G+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[w,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,w],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[w,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,w],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[g,[w,Ye,he]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,"Windows"],[w,Ye,he]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[w,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Le],[w,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[w,g],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[g,w],[/\(bb(10);/i],[w,[g,ie]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[w,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[w,[g,Q+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[w,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[w,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[w,[g,K+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,Ee],w],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[g,w],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],w],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,w]]},Re=function(H,fe){if(typeof H===u&&(fe=H,H=r),!(this instanceof Re))return new Re(H,fe).getResult();var Y=typeof n!==l&&n.navigator?n.navigator:r,X=H||(Y&&Y.userAgent?Y.userAgent:o),oe=Y&&Y.userAgentData?Y.userAgentData:r,xe=fe?Be(Ae,fe):Ae,Ce=Y&&Y.userAgent==X;return this.getBrowser=function(){var _e={};return _e[g]=r,_e[w]=r,Xe.call(_e,X,xe.browser),_e[d]=Fe(_e[w]),Ce&&Y&&Y.brave&&typeof Y.brave.isBrave==s&&(_e[g]="Brave"),_e},this.getCPU=function(){var _e={};return _e[b]=r,Xe.call(_e,X,xe.cpu),_e},this.getDevice=function(){var _e={};return _e[y]=r,_e[p]=r,_e[v]=r,Xe.call(_e,X,xe.device),Ce&&!_e[v]&&oe&&oe.mobile&&(_e[v]=C),Ce&&_e[p]=="Macintosh"&&Y&&typeof Y.standalone!==l&&Y.maxTouchPoints&&Y.maxTouchPoints>2&&(_e[p]="iPad",_e[v]=k),_e},this.getEngine=function(){var _e={};return _e[g]=r,_e[w]=r,Xe.call(_e,X,xe.engine),_e},this.getOS=function(){var _e={};return _e[g]=r,_e[w]=r,Xe.call(_e,X,xe.os),Ce&&!_e[g]&&oe&&oe.platform!="Unknown"&&(_e[g]=oe.platform.replace(/chrome os/i,Ee).replace(/macos/i,Le)),_e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return X},this.setUA=function(_e){return X=typeof _e===f&&_e.length>z?tt(_e,z):_e,this},this.setUA(X),this};Re.VERSION=i,Re.BROWSER=Ie([g,w,d]),Re.CPU=Ie([b]),Re.DEVICE=Ie([p,y,v,x,C,R,k,A,O]),Re.ENGINE=Re.OS=Ie([g,w]),e.exports&&(t=e.exports=Re),t.UAParser=Re;var Ne=typeof n!==l&&(n.jQuery||n.Zepto);if(Ne&&!Ne.ua){var U=new Re;Ne.ua=U.getResult(),Ne.ua.get=function(){return U.getUA()},Ne.ua.set=function(H){U.setUA(H);var fe=U.getResult();for(var Y in fe)Ne.ua[Y]=fe[Y]}}})(typeof window=="object"?window:ni)})(e$,e$.exports);var iUe=e$.exports,oUe=iUe,qo="Unknown",aUe={"Mac OS":"Mac OS X"};function sUe(e){return aUe[e]||e}function lUe(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}var uUe=new oUe,Yo=uUe.getResult(),cUe=lUe(Yo.browser.version),fUe={browserArchitecture:Yo.cpu.architecture||qo,browserFullVersion:Yo.browser.version||qo,browserMinorVersion:cUe.minor||qo,browserName:Yo.browser.name||qo,browserVersion:Yo.browser.major||qo,deviceName:Yo.device.model||qo,engineName:Yo.engine.name||qo,engineVersion:Yo.engine.version||qo,platformArchitecture:Yo.cpu.architecture||qo,platformName:sUe(Yo.os.name)||qo,platformVersion:Yo.os.version||qo,platformFullVersion:Yo.os.version||qo},dUe=fUe,fx=bn,YG=/\./,pUe=/\|\|/,hUe=/\s+\-\s+/,gUe=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,Sz=/^(\d*)(.*)/;function mUe(e,t){var n=e.split(pUe);return n.length>1?n.some(function(r){return QG.contains(r,t)}):(e=n[0].trim(),vUe(e,t))}function vUe(e,t){var n=e.split(hUe);if(n.length>0&&n.length<=2||fx(!1),n.length===1)return aT(n[0],t);var r=n[0],i=n[1];return Cz(r)&&Cz(i)||fx(!1),aT(">="+r,t)&&aT("<="+i,t)}function aT(e,t){if(e=e.trim(),e==="")return!0;var n=t.split(YG),r=JG(e),i=r.modifier,o=r.rangeComponents;switch(i){case"<":return XG(n,o);case"<=":return yUe(n,o);case">=":return ZG(n,o);case">":return _Ue(n,o);case"~":case"~>":return xUe(n,o);default:return bUe(n,o)}}function XG(e,t){return Ny(e,t)===-1}function yUe(e,t){var n=Ny(e,t);return n===-1||n===0}function bUe(e,t){return Ny(e,t)===0}function ZG(e,t){var n=Ny(e,t);return n===1||n===0}function _Ue(e,t){return Ny(e,t)===1}function xUe(e,t){var n=t.slice(),r=t.slice();r.length>1&&r.pop();var i=r.length-1,o=parseInt(r[i],10);return t$(o)&&(r[i]=o+1+""),ZG(e,n)&&XG(e,r)}function JG(e){var t=e.split(YG),n=t[0].match(gUe);return n||fx(!1),{modifier:n[1],rangeComponents:[n[2]].concat(t.slice(1))}}function t$(e){return!isNaN(e)&&isFinite(e)}function Cz(e){return!JG(e).modifier}function Ez(e,t){for(var n=e.length;n<t;n++)e[n]="0"}function wUe(e,t){e=e.slice(),t=t.slice(),Ez(e,t.length);for(var n=0;n<t.length;n++){var r=t[n].match(/^[x*]$/i);if(r&&(t[n]=e[n]="0",r[0]==="*"&&n===t.length-1))for(var i=n;i<e.length;i++)e[i]="0"}return Ez(t,e.length),[e,t]}function SUe(e,t){var n=e.match(Sz)[1],r=t.match(Sz)[1],i=parseInt(n,10),o=parseInt(r,10);return t$(i)&&t$(o)&&i!==o?kz(i,o):kz(e,t)}function kz(e,t){return typeof e!=typeof t&&fx(!1),e>t?1:e<t?-1:0}function Ny(e,t){for(var n=wUe(e,t),r=n[0],i=n[1],o=0;o<i.length;o++){var a=SUe(r[o],i[o]);if(a)return a}return 0}var QG={contains:function(t,n){return mUe(t.trim(),n.trim())}},CUe=QG,EUe=Object.prototype.hasOwnProperty;function kUe(e,t,n){if(!e)return null;var r={};for(var i in e)EUe.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}var TUe=kUe;function RUe(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}var AUe=RUe,ys=dUe,$Ue=CUe,OUe=TUe,IUe=AUe;function Fd(e,t,n,r){if(e===n)return!0;if(!n.startsWith(e))return!1;var i=n.slice(e.length);return t?(i=r?r(i):i,$Ue.contains(i,t)):!1}function DUe(e){return ys.platformName==="Windows"?e.replace(/^\s*NT/,""):e}var PUe={isBrowser:function(t){return Fd(ys.browserName,ys.browserFullVersion,t)},isBrowserArchitecture:function(t){return Fd(ys.browserArchitecture,null,t)},isDevice:function(t){return Fd(ys.deviceName,null,t)},isEngine:function(t){return Fd(ys.engineName,ys.engineVersion,t)},isPlatform:function(t){return Fd(ys.platformName,ys.platformFullVersion,t,DUe)},isPlatformArchitecture:function(t){return Fd(ys.platformArchitecture,null,t)}},uo=OUe(PUe,IUe);function LUe(e){return!e||!e.ownerDocument?document:e.ownerDocument}var jS=LUe;function MUe(e){return!e||!e.ownerDocument?!1:e.nodeType===Node.ELEMENT_NODE}var Bf=MUe,FUe=Bf;function eY(e){if(FUe(e)){var t=e,n=t.getAttribute("data-offset-key");if(n)return n;for(var r=0;r<t.childNodes.length;r++){var i=eY(t.childNodes[r]);if(i)return i}}return null}var tY=eY,NUe=jS,BUe=tY;function jUe(e){for(var t=e;t&&t!==NUe(e).documentElement;){var n=BUe(t);if(n!=null)return n;t=t.parentNode}return null}var zS=jUe;function zUe(e){return!e||!e.ownerDocument||!e.ownerDocument.defaultView?window:e.ownerDocument.defaultView}var nY=zUe;function rb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var UUe=uo,KUe=zS,WUe=nY,VUe=cn,HUe=bn,qUe=lo,Tz=VUe.Map,GUe={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},Rz=UUe.isBrowser("IE <= 11"),YUe=function(){function e(n){var r=this;rb(this,"observer",void 0),rb(this,"container",void 0),rb(this,"mutations",void 0),rb(this,"onCharData",void 0),this.container=n,this.mutations=Tz();var i=WUe(n);i.MutationObserver&&!Rz?this.observer=new i.MutationObserver(function(o){return r.registerMutations(o)}):this.onCharData=function(o){o.target instanceof Node||HUe(!1),r.registerMutation({type:"characterData",target:o.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,GUe):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},t.stopAndFlushMutations=function(){var r=this.observer;r?(this.registerMutations(r.takeRecords()),r.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var i=this.mutations;return this.mutations=Tz(),i},t.registerMutations=function(r){for(var i=0;i<r.length;i++)this.registerMutation(r[i])},t.getMutationTextContent=function(r){var i=r.type,o=r.target,a=r.removedNodes;if(i==="characterData"){if(o.textContent!=="")return Rz?o.textContent.replace(`
|
|
445
|
-
`,""):o.textContent}else if(i==="childList"){if(a&&a.length)return"";if(o.textContent!=="")return o.textContent}return null},t.registerMutation=function(r){var i=this.getMutationTextContent(r);if(i!=null){var o=
|
|
446
|
-
`?0:t.length}var aY=
|
|
447
|
-
`:e.tagName==="BR"}var
|
|
448
|
-
`):Xp.createElement("br",{key:"A","data-text":"true",ref:t})},
|
|
449
|
-
`):Xp.createElement("br",{key:"B","data-text":"true",ref:t})},
|
|
444
|
+
*/var wz=Object.getOwnPropertySymbols,tUe=Object.prototype.hasOwnProperty,nUe=Object.prototype.propertyIsEnumerable;function rUe(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function iUe(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Nf=iUe()?Object.assign:function(e,t){for(var n,r=rUe(e),i,o=1;o<arguments.length;o++){n=Object(arguments[o]);for(var a in n)tUe.call(n,a)&&(r[a]=n[a]);if(wz){i=wz(n);for(var s=0;s<i.length;s++)nUe.call(n,i[s])&&(r[i[s]]=n[i[s]])}}return r},e$={exports:{}};(function(e,t){(function(n,r){var i="0.7.35",o="",a="?",s="function",l="undefined",u="object",f="string",d="major",p="model",g="name",v="type",y="vendor",w="version",b="architecture",x="console",C="mobile",k="tablet",R="smarttv",A="wearable",O="embedded",z=350,V="Amazon",D="Apple",W="ASUS",ie="BlackBerry",se="Browser",K="Chrome",G="Edge",Q="Firefox",le="Google",Z="Huawei",ee="LG",P="Microsoft",ge="Motorola",B="Opera",L="Samsung",ae="Sharp",ue="Sony",ne="Xiaomi",we="Zebra",Te="Facebook",Ee="Chromium OS",Le="Mac OS",Be=function(H,fe){var Y={};for(var X in H)fe[X]&&fe[X].length%2===0?Y[X]=fe[X].concat(H[X]):Y[X]=H[X];return Y},Ie=function(H){for(var fe={},Y=0;Y<H.length;Y++)fe[H[Y].toUpperCase()]=H[Y];return fe},Pe=function(H,fe){return typeof H===f?je(fe).indexOf(je(H))!==-1:!1},je=function(H){return H.toLowerCase()},Fe=function(H){return typeof H===f?H.replace(/[^\d\.]/g,o).split(".")[0]:r},tt=function(H,fe){if(typeof H===f)return H=H.replace(/^\s\s*/,o),typeof fe===l?H:H.substring(0,z)},Xe=function(H,fe){for(var Y=0,X,oe,xe,Ce,_e,nt;Y<fe.length&&!_e;){var rt=fe[Y],de=fe[Y+1];for(X=oe=0;X<rt.length&&!_e&&rt[X];)if(_e=rt[X++].exec(H),_e)for(xe=0;xe<de.length;xe++)nt=_e[++oe],Ce=de[xe],typeof Ce===u&&Ce.length>0?Ce.length===2?typeof Ce[1]==s?this[Ce[0]]=Ce[1].call(this,nt):this[Ce[0]]=Ce[1]:Ce.length===3?typeof Ce[1]===s&&!(Ce[1].exec&&Ce[1].test)?this[Ce[0]]=nt?Ce[1].call(this,nt,Ce[2]):r:this[Ce[0]]=nt?nt.replace(Ce[1],Ce[2]):r:Ce.length===4&&(this[Ce[0]]=nt?Ce[3].call(this,nt.replace(Ce[1],Ce[2])):r):this[Ce]=nt||r;Y+=2}},Ye=function(H,fe){for(var Y in fe)if(typeof fe[Y]===u&&fe[Y].length>0){for(var X=0;X<fe[Y].length;X++)if(Pe(fe[Y][X],H))return Y===a?r:Y}else if(Pe(fe[Y],H))return Y===a?r:Y;return H},st={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},he={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ae={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[w,[g,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[w,[g,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[g,w],[/opios[\/ ]+([\w\.]+)/i],[w,[g,B+" Mini"]],[/\bopr\/([\w\.]+)/i],[w,[g,B]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[g,w],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[w,[g,"UC"+se]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[w,[g,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[w,[g,"WeChat"]],[/konqueror\/([\w\.]+)/i],[w,[g,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[w,[g,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[w,[g,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[g,/(.+)/,"$1 Secure "+se],w],[/\bfocus\/([\w\.]+)/i],[w,[g,Q+" Focus"]],[/\bopt\/([\w\.]+)/i],[w,[g,B+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[w,[g,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[w,[g,"Dolphin"]],[/coast\/([\w\.]+)/i],[w,[g,B+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[w,[g,"MIUI "+se]],[/fxios\/([-\w\.]+)/i],[w,[g,Q]],[/\bqihu|(qi?ho?o?|360)browser/i],[[g,"360 "+se]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[g,/(.+)/,"$1 "+se],w],[/(comodo_dragon)\/([\w\.]+)/i],[[g,/_/g," "],w],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[g,w],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[g],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[g,Te],w],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[g,w],[/\bgsa\/([\w\.]+) .*safari\//i],[w,[g,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[w,[g,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[w,[g,K+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[g,K+" WebView"],w],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[w,[g,"Android "+se]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[g,w],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[w,[g,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[w,g],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[g,[w,Ye,st]],[/(webkit|khtml)\/([\w\.]+)/i],[g,w],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[g,"Netscape"],w],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[w,[g,Q+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[g,w],[/(cobalt)\/([\w\.]+)/i],[g,[w,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,je]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows (ce|mobile); ppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[b,/ower/,o,je]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,je]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[y,L],[v,k]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[y,L],[v,C]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[y,D],[v,C]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[y,D],[v,k]],[/(macintosh);/i],[p,[y,D]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[y,ae],[v,C]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[y,Z],[v,k]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[y,Z],[v,C]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[y,ne],[v,C]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[y,ne],[v,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[y,"OPPO"],[v,C]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[y,"Vivo"],[v,C]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[p,[y,"Realme"],[v,C]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[y,ge],[v,C]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[y,ge],[v,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[y,ee],[v,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[y,ee],[v,C]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[y,"Lenovo"],[v,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[y,"Nokia"],[v,C]],[/(pixel c)\b/i],[p,[y,le],[v,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[y,le],[v,C]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[y,ue],[v,C]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[y,ue],[v,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[y,"OnePlus"],[v,C]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[y,V],[v,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[y,V],[v,C]],[/(playbook);[-\w\),; ]+(rim)/i],[p,y,[v,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[y,ie],[v,C]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[y,W],[v,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[y,W],[v,C]],[/(nexus 9)/i],[p,[y,"HTC"],[v,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[p,/_/g," "],[v,C]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[y,"Acer"],[v,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[y,"Meizu"],[v,C]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,p,[v,C]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,p,[v,k]],[/(surface duo)/i],[p,[y,P],[v,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[y,"Fairphone"],[v,C]],[/(u304aa)/i],[p,[y,"AT&T"],[v,C]],[/\bsie-(\w*)/i],[p,[y,"Siemens"],[v,C]],[/\b(rct\w+) b/i],[p,[y,"RCA"],[v,k]],[/\b(venue[\d ]{2,7}) b/i],[p,[y,"Dell"],[v,k]],[/\b(q(?:mv|ta)\w+) b/i],[p,[y,"Verizon"],[v,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[y,"Barnes & Noble"],[v,k]],[/\b(tm\d{3}\w+) b/i],[p,[y,"NuVision"],[v,k]],[/\b(k88) b/i],[p,[y,"ZTE"],[v,k]],[/\b(nx\d{3}j) b/i],[p,[y,"ZTE"],[v,C]],[/\b(gen\d{3}) b.+49h/i],[p,[y,"Swiss"],[v,C]],[/\b(zur\d{3}) b/i],[p,[y,"Swiss"],[v,k]],[/\b((zeki)?tb.*\b) b/i],[p,[y,"Zeki"],[v,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],p,[v,k]],[/\b(ns-?\w{0,9}) b/i],[p,[y,"Insignia"],[v,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[y,"NextBook"],[v,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],p,[v,C]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],p,[v,C]],[/\b(ph-1) /i],[p,[y,"Essential"],[v,C]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[y,"Envizen"],[v,k]],[/\b(trio[-\w\. ]+) b/i],[p,[y,"MachSpeed"],[v,k]],[/\btu_(1491) b/i],[p,[y,"Rotor"],[v,k]],[/(shield[\w ]+) b/i],[p,[y,"Nvidia"],[v,k]],[/(sprint) (\w+)/i],[y,p,[v,C]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[y,P],[v,C]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[y,we],[v,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[y,we],[v,C]],[/smart-tv.+(samsung)/i],[y,[v,R]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[y,L],[v,R]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,ee],[v,R]],[/(apple) ?tv/i],[y,[p,D+" TV"],[v,R]],[/crkey/i],[[p,K+"cast"],[y,le],[v,R]],[/droid.+aft(\w)( bui|\))/i],[p,[y,V],[v,R]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[y,ae],[v,R]],[/(bravia[\w ]+)( bui|\))/i],[p,[y,ue],[v,R]],[/(mitv-\w{5}) bui/i],[p,[y,ne],[v,R]],[/Hbbtv.*(technisat) (.*);/i],[y,p,[v,R]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,tt],[p,tt],[v,R]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,R]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,p,[v,x]],[/droid.+; (shield) bui/i],[p,[y,"Nvidia"],[v,x]],[/(playstation [345portablevi]+)/i],[p,[y,ue],[v,x]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[y,P],[v,x]],[/((pebble))app/i],[y,p,[v,A]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[y,D],[v,A]],[/droid.+; (glass) \d/i],[p,[y,le],[v,A]],[/droid.+; (wt63?0{2,3})\)/i],[p,[y,we],[v,A]],[/(quest( 2| pro)?)/i],[p,[y,Te],[v,A]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[v,O]],[/(aeobc)\b/i],[p,[y,V],[v,O]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[p,[v,C]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[v,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,C]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[w,[g,G+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[w,[g,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[g,w],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[w,g]],os:[[/microsoft (windows) (vista|xp)/i],[g,w],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[g,[w,Ye,he]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,"Windows"],[w,Ye,he]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[w,/_/g,"."],[g,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[g,Le],[w,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[w,g],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[g,w],[/\(bb(10);/i],[w,[g,ie]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[w,[g,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[w,[g,Q+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[w,[g,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[w,[g,"watchOS"]],[/crkey\/([\d\.]+)/i],[w,[g,K+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[g,Ee],w],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[g,w],[/(sunos) ?([\w\.\d]*)/i],[[g,"Solaris"],w],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[g,w]]},Re=function(H,fe){if(typeof H===u&&(fe=H,H=r),!(this instanceof Re))return new Re(H,fe).getResult();var Y=typeof n!==l&&n.navigator?n.navigator:r,X=H||(Y&&Y.userAgent?Y.userAgent:o),oe=Y&&Y.userAgentData?Y.userAgentData:r,xe=fe?Be(Ae,fe):Ae,Ce=Y&&Y.userAgent==X;return this.getBrowser=function(){var _e={};return _e[g]=r,_e[w]=r,Xe.call(_e,X,xe.browser),_e[d]=Fe(_e[w]),Ce&&Y&&Y.brave&&typeof Y.brave.isBrave==s&&(_e[g]="Brave"),_e},this.getCPU=function(){var _e={};return _e[b]=r,Xe.call(_e,X,xe.cpu),_e},this.getDevice=function(){var _e={};return _e[y]=r,_e[p]=r,_e[v]=r,Xe.call(_e,X,xe.device),Ce&&!_e[v]&&oe&&oe.mobile&&(_e[v]=C),Ce&&_e[p]=="Macintosh"&&Y&&typeof Y.standalone!==l&&Y.maxTouchPoints&&Y.maxTouchPoints>2&&(_e[p]="iPad",_e[v]=k),_e},this.getEngine=function(){var _e={};return _e[g]=r,_e[w]=r,Xe.call(_e,X,xe.engine),_e},this.getOS=function(){var _e={};return _e[g]=r,_e[w]=r,Xe.call(_e,X,xe.os),Ce&&!_e[g]&&oe&&oe.platform!="Unknown"&&(_e[g]=oe.platform.replace(/chrome os/i,Ee).replace(/macos/i,Le)),_e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return X},this.setUA=function(_e){return X=typeof _e===f&&_e.length>z?tt(_e,z):_e,this},this.setUA(X),this};Re.VERSION=i,Re.BROWSER=Ie([g,w,d]),Re.CPU=Ie([b]),Re.DEVICE=Ie([p,y,v,x,C,R,k,A,O]),Re.ENGINE=Re.OS=Ie([g,w]),e.exports&&(t=e.exports=Re),t.UAParser=Re;var Ne=typeof n!==l&&(n.jQuery||n.Zepto);if(Ne&&!Ne.ua){var U=new Re;Ne.ua=U.getResult(),Ne.ua.get=function(){return U.getUA()},Ne.ua.set=function(H){U.setUA(H);var fe=U.getResult();for(var Y in fe)Ne.ua[Y]=fe[Y]}}})(typeof window=="object"?window:ni)})(e$,e$.exports);var oUe=e$.exports,aUe=oUe,qo="Unknown",sUe={"Mac OS":"Mac OS X"};function lUe(e){return sUe[e]||e}function uUe(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}var cUe=new aUe,Yo=cUe.getResult(),fUe=uUe(Yo.browser.version),dUe={browserArchitecture:Yo.cpu.architecture||qo,browserFullVersion:Yo.browser.version||qo,browserMinorVersion:fUe.minor||qo,browserName:Yo.browser.name||qo,browserVersion:Yo.browser.major||qo,deviceName:Yo.device.model||qo,engineName:Yo.engine.name||qo,engineVersion:Yo.engine.version||qo,platformArchitecture:Yo.cpu.architecture||qo,platformName:lUe(Yo.os.name)||qo,platformVersion:Yo.os.version||qo,platformFullVersion:Yo.os.version||qo},pUe=dUe,fx=bn,YG=/\./,hUe=/\|\|/,gUe=/\s+\-\s+/,mUe=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,Sz=/^(\d*)(.*)/;function vUe(e,t){var n=e.split(hUe);return n.length>1?n.some(function(r){return QG.contains(r,t)}):(e=n[0].trim(),yUe(e,t))}function yUe(e,t){var n=e.split(gUe);if(n.length>0&&n.length<=2||fx(!1),n.length===1)return aT(n[0],t);var r=n[0],i=n[1];return Cz(r)&&Cz(i)||fx(!1),aT(">="+r,t)&&aT("<="+i,t)}function aT(e,t){if(e=e.trim(),e==="")return!0;var n=t.split(YG),r=JG(e),i=r.modifier,o=r.rangeComponents;switch(i){case"<":return XG(n,o);case"<=":return bUe(n,o);case">=":return ZG(n,o);case">":return xUe(n,o);case"~":case"~>":return wUe(n,o);default:return _Ue(n,o)}}function XG(e,t){return Ny(e,t)===-1}function bUe(e,t){var n=Ny(e,t);return n===-1||n===0}function _Ue(e,t){return Ny(e,t)===0}function ZG(e,t){var n=Ny(e,t);return n===1||n===0}function xUe(e,t){return Ny(e,t)===1}function wUe(e,t){var n=t.slice(),r=t.slice();r.length>1&&r.pop();var i=r.length-1,o=parseInt(r[i],10);return t$(o)&&(r[i]=o+1+""),ZG(e,n)&&XG(e,r)}function JG(e){var t=e.split(YG),n=t[0].match(mUe);return n||fx(!1),{modifier:n[1],rangeComponents:[n[2]].concat(t.slice(1))}}function t$(e){return!isNaN(e)&&isFinite(e)}function Cz(e){return!JG(e).modifier}function Ez(e,t){for(var n=e.length;n<t;n++)e[n]="0"}function SUe(e,t){e=e.slice(),t=t.slice(),Ez(e,t.length);for(var n=0;n<t.length;n++){var r=t[n].match(/^[x*]$/i);if(r&&(t[n]=e[n]="0",r[0]==="*"&&n===t.length-1))for(var i=n;i<e.length;i++)e[i]="0"}return Ez(t,e.length),[e,t]}function CUe(e,t){var n=e.match(Sz)[1],r=t.match(Sz)[1],i=parseInt(n,10),o=parseInt(r,10);return t$(i)&&t$(o)&&i!==o?kz(i,o):kz(e,t)}function kz(e,t){return typeof e!=typeof t&&fx(!1),e>t?1:e<t?-1:0}function Ny(e,t){for(var n=SUe(e,t),r=n[0],i=n[1],o=0;o<i.length;o++){var a=CUe(r[o],i[o]);if(a)return a}return 0}var QG={contains:function(t,n){return vUe(t.trim(),n.trim())}},EUe=QG,kUe=Object.prototype.hasOwnProperty;function TUe(e,t,n){if(!e)return null;var r={};for(var i in e)kUe.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}var RUe=TUe;function AUe(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}var $Ue=AUe,ys=pUe,OUe=EUe,IUe=RUe,DUe=$Ue;function Fd(e,t,n,r){if(e===n)return!0;if(!n.startsWith(e))return!1;var i=n.slice(e.length);return t?(i=r?r(i):i,OUe.contains(i,t)):!1}function PUe(e){return ys.platformName==="Windows"?e.replace(/^\s*NT/,""):e}var LUe={isBrowser:function(t){return Fd(ys.browserName,ys.browserFullVersion,t)},isBrowserArchitecture:function(t){return Fd(ys.browserArchitecture,null,t)},isDevice:function(t){return Fd(ys.deviceName,null,t)},isEngine:function(t){return Fd(ys.engineName,ys.engineVersion,t)},isPlatform:function(t){return Fd(ys.platformName,ys.platformFullVersion,t,PUe)},isPlatformArchitecture:function(t){return Fd(ys.platformArchitecture,null,t)}},uo=IUe(LUe,DUe);function MUe(e){return!e||!e.ownerDocument?document:e.ownerDocument}var jS=MUe;function FUe(e){return!e||!e.ownerDocument?!1:e.nodeType===Node.ELEMENT_NODE}var Bf=FUe,NUe=Bf;function eY(e){if(NUe(e)){var t=e,n=t.getAttribute("data-offset-key");if(n)return n;for(var r=0;r<t.childNodes.length;r++){var i=eY(t.childNodes[r]);if(i)return i}}return null}var tY=eY,BUe=jS,jUe=tY;function zUe(e){for(var t=e;t&&t!==BUe(e).documentElement;){var n=jUe(t);if(n!=null)return n;t=t.parentNode}return null}var zS=zUe;function UUe(e){return!e||!e.ownerDocument||!e.ownerDocument.defaultView?window:e.ownerDocument.defaultView}var nY=UUe;function rb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var KUe=uo,WUe=zS,VUe=nY,HUe=cn,qUe=bn,GUe=lo,Tz=HUe.Map,YUe={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},Rz=KUe.isBrowser("IE <= 11"),XUe=function(){function e(n){var r=this;rb(this,"observer",void 0),rb(this,"container",void 0),rb(this,"mutations",void 0),rb(this,"onCharData",void 0),this.container=n,this.mutations=Tz();var i=VUe(n);i.MutationObserver&&!Rz?this.observer=new i.MutationObserver(function(o){return r.registerMutations(o)}):this.onCharData=function(o){o.target instanceof Node||qUe(!1),r.registerMutation({type:"characterData",target:o.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,YUe):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},t.stopAndFlushMutations=function(){var r=this.observer;r?(this.registerMutations(r.takeRecords()),r.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var i=this.mutations;return this.mutations=Tz(),i},t.registerMutations=function(r){for(var i=0;i<r.length;i++)this.registerMutation(r[i])},t.getMutationTextContent=function(r){var i=r.type,o=r.target,a=r.removedNodes;if(i==="characterData"){if(o.textContent!=="")return Rz?o.textContent.replace(`
|
|
445
|
+
`,""):o.textContent}else if(i==="childList"){if(a&&a.length)return"";if(o.textContent!=="")return o.textContent}return null},t.registerMutation=function(r){var i=this.getMutationTextContent(r);if(i!=null){var o=GUe(WUe(r.target));this.mutations=this.mutations.set(o,i)}},e}(),ZUe=XUe,ib="-",JUe={encode:function(t,n,r){return t+ib+n+ib+r},decode:function(t){var n=t.split(ib).reverse(),r=n[0],i=n[1],o=n.slice(2);return{blockKey:o.reverse().join(ib),decoratorKey:parseInt(i,10),leafKey:parseInt(r,10)}}},Kl=JUe,US={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105},rY={logBlockedSelectionEvent:function(){return null},logSelectionStateFailure:function(){return null}};function QUe(e){return!e||!e.ownerDocument?!1:e.ownerDocument.defaultView?e instanceof e.ownerDocument.defaultView.HTMLElement:e instanceof HTMLElement}var By=QUe,Az=bn,e9e=By;function t9e(e){var t=e.editorContainer;t||Az(!1),e9e(t.firstChild)||Az(!1);var n=t.firstChild;return n}var iY=t9e,$z=Kl,n9e=lo;function r9e(e,t,n,r,i){var o=n9e(e.getSelection());if(!t||!r)return o;var a=$z.decode(t),s=a.blockKey,l=e.getBlockTree(s),u=l&&l.getIn([a.decoratorKey,"leaves",a.leafKey]),f=$z.decode(r),d=f.blockKey,p=e.getBlockTree(d),g=p&&p.getIn([f.decoratorKey,"leaves",f.leafKey]);if(!u||!g)return o;var v=u.get("start"),y=g.get("start"),w=u?v+n:null,b=g?y+i:null,x=o.getAnchorKey()===s&&o.getAnchorOffset()===w&&o.getFocusKey()===d&&o.getFocusOffset()===b;if(x)return o;var C=!1;if(s===d){var k=u.get("end"),R=g.get("end");y===v&&R===k?C=i<n:C=y<v}else{var A=e.getCurrentContent().getBlockMap().keySeq().skipUntil(function(O){return O===s||O===d}).first();C=A===d}return o.merge({anchorKey:s,anchorOffset:w,focusKey:d,focusOffset:b,isBackward:C})}var oY=r9e,Dm=zS,uv=tY,Oz=oY,sT=bn,WI=Bf,nf=lo;function i9e(e,t,n,r,i,o){var a=n.nodeType===Node.TEXT_NODE,s=i.nodeType===Node.TEXT_NODE;if(a&&s)return{selectionState:Oz(e,nf(Dm(n)),r,nf(Dm(i)),o),needsRecovery:!1};var l=null,u=null,f=!0;return a?(l={key:nf(Dm(n)),offset:r},u=ob(t,i,o)):s?(u={key:nf(Dm(i)),offset:o},l=ob(t,n,r)):(l=ob(t,n,r),u=ob(t,i,o),n===i&&r===o&&(f=!!n.firstChild&&n.firstChild.nodeName!=="BR")),{selectionState:Oz(e,l.key,l.offset,u.key,u.offset),needsRecovery:f}}function o9e(e){for(;e.firstChild&&(WI(e.firstChild)&&e.firstChild.getAttribute("data-blocks")==="true"||uv(e.firstChild));)e=e.firstChild;return e}function a9e(e){for(;e.lastChild&&(WI(e.lastChild)&&e.lastChild.getAttribute("data-blocks")==="true"||uv(e.lastChild));)e=e.lastChild;return e}function ob(e,t,n){var r=t,i=Dm(r);if(i!=null||e&&(e===r||e.firstChild===r)||sT(!1),e===r){r=r.firstChild,WI(r)||sT(!1);var o=r;r=o,r.getAttribute("data-contents")!=="true"&&sT(!1),n>0&&(n=r.childNodes.length)}if(n===0){var a=null;if(i!=null)a=i;else{var s=o9e(r);a=nf(uv(s))}return{key:a,offset:0}}var l=r.childNodes[n-1],u=null,f=null;if(!uv(l))u=nf(i),f=Iz(l);else{var d=a9e(l);u=nf(uv(d)),f=Iz(d)}return{key:u,offset:f}}function Iz(e){var t=e.textContent;return t===`
|
|
446
|
+
`?0:t.length}var aY=i9e,s9e=aY;function l9e(e,t){var n=t.ownerDocument.defaultView.getSelection(),r=n.anchorNode,i=n.anchorOffset,o=n.focusNode,a=n.focusOffset,s=n.rangeCount;return s===0||r==null||o==null?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:s9e(e,t,r,i,o,a)}var sY=l9e,u9e=rY,Dz=zn,c9e=iY,f9e=sY;function d9e(e){if(e._blockSelectEvents||e._latestEditorState!==e.props.editorState){if(e._blockSelectEvents){var t=e.props.editorState,n=t.getSelection();u9e.logBlockedSelectionEvent({anonymizedDom:"N/A",extraParams:JSON.stringify({stacktrace:new Error().stack}),selectionState:JSON.stringify(n.toJS())})}return}var r=e.props.editorState,i=f9e(r,c9e(e)),o=i.selectionState;o!==r.getSelection()&&(i.needsRecovery?r=Dz.forceSelection(r,o):r=Dz.acceptSelection(r,o),e.update(r))}var lY=d9e;function p9e(e){return e!=null&&e!=""}var uY={notEmptyKey:p9e},h9e=uY,g9e=h9e.notEmptyKey;function m9e(e,t){var n;if(t.isCollapsed()){var r=t.getAnchorKey(),i=t.getAnchorOffset();return i>0?(n=e.getBlockForKey(r).getEntityAt(i-1),n!==e.getBlockForKey(r).getEntityAt(i)?null:Pz(e.getEntityMap(),n)):null}var o=t.getStartKey(),a=t.getStartOffset(),s=e.getBlockForKey(o);return n=a===s.getLength()?null:s.getEntityAt(a),Pz(e.getEntityMap(),n)}function Pz(e,t){if(g9e(t)){var n=e.__get(t);return n.getMutability()==="MUTABLE"?t:null}return null}var VI=m9e,v9e=ZUe,y9e=so,b9e=Kl,mm=zn,lT=US,_9e=uo,x9e=lY,cY=iY,w9e=sY,S9e=VI,C9e=lo,E9e=_9e.isBrowser("IE"),k9e=20,uT=!1,ab=!1,cv=null;function T9e(e){cv||(cv=new v9e(cY(e)),cv.start())}var n$={onCompositionStart:function(t){ab=!0,T9e(t)},onCompositionEnd:function(t){uT=!1,ab=!1,setTimeout(function(){uT||n$.resolveComposition(t)},k9e)},onSelect:x9e,onKeyDown:function(t,n){if(!ab){n$.resolveComposition(t),t._onKeyDown(n);return}(n.which===lT.RIGHT||n.which===lT.LEFT)&&n.preventDefault()},onKeyPress:function(t,n){n.which===lT.RETURN&&n.preventDefault()},resolveComposition:function(t){if(!ab){var n=C9e(cv).stopAndFlushMutations();cv=null,uT=!0;var r=mm.set(t._latestEditorState,{inCompositionMode:!1});if(t.exitCurrentMode(),!n.size){t.update(r);return}var i=r.getCurrentContent();n.forEach(function(l,u){var f=b9e.decode(u),d=f.blockKey,p=f.decoratorKey,g=f.leafKey,v=r.getBlockTree(d).getIn([p,"leaves",g]),y=v.start,w=v.end,b=r.getSelection().merge({anchorKey:d,focusKey:d,anchorOffset:y,focusOffset:w,isBackward:!1}),x=S9e(i,b),C=i.getBlockForKey(d).getInlineStyleAt(y);i=y9e.replaceText(i,b,l,C,x),r=mm.set(r,{currentContent:i})});var o=w9e(r,cY(t)),a=o.selectionState;t.restoreEditorDOM();var s=E9e?mm.forceSelection(r,a):mm.acceptSelection(r,a);t.update(mm.push(s,i,"insert-characters"))}}},R9e=n$,cT,Lz;function A9e(){if(Lz)return cT;Lz=1;var e=Nf;function t(){return t=e||function(l){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d])}return l},t.apply(this,arguments)}function n(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,l.__proto__=u}var r=Kl,i=T,o=jI,a=NS,s=function(l){n(u,l);function u(){return l.apply(this,arguments)||this}var f=u.prototype;return f.render=function(){var p=this.props,g=p.block,v=p.children,y=p.contentState,w=p.decorator,b=p.decoratorKey,x=p.direction,C=p.leafSet,k=p.text,R=g.getKey(),A=C.get("leaves"),O=w.getComponentForKey(b),z=w.getPropsForKey(b),V=r.encode(R,parseInt(b,10),0),D=k.slice(A.first().get("start"),A.last().get("end")),W=a.getHTMLDirIfDifferent(o.getDirection(D),x);return i.createElement(O,t({},z,{contentState:y,decoratedText:D,dir:W,key:V,entityKey:g.getEntityAt(C.get("start")),offsetKey:V}),v)},u}(i.Component);return cT=s,cT}function Mz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $9e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Fz(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xp=T,O9e=uo,I9e=bn,D9e=Bf,HI=O9e.isBrowser("IE <= 11");function P9e(e){return HI?e.textContent===`
|
|
447
|
+
`:e.tagName==="BR"}var L9e=function(t){return HI?Xp.createElement("span",{key:"A","data-text":"true",ref:t},`
|
|
448
|
+
`):Xp.createElement("br",{key:"A","data-text":"true",ref:t})},M9e=function(t){return HI?Xp.createElement("span",{key:"B","data-text":"true",ref:t},`
|
|
449
|
+
`):Xp.createElement("br",{key:"B","data-text":"true",ref:t})},F9e=function(e){$9e(t,e);function t(r){var i;return i=e.call(this,r)||this,Fz(Mz(i),"_forceFlag",void 0),Fz(Mz(i),"_node",void 0),i._forceFlag=!1,i}var n=t.prototype;return n.shouldComponentUpdate=function(i){var o=this._node,a=i.children==="";D9e(o)||I9e(!1);var s=o;return a?!P9e(s):s.textContent!==i.children},n.componentDidMount=function(){this._forceFlag=!this._forceFlag},n.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},n.render=function(){var i=this;return this.props.children===""?this._forceFlag?L9e(function(o){return i._node=o}):M9e(function(o){return i._node=o}):Xp.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true",ref:function(a){return i._node=a}},this.props.children)},t}(Xp.Component),N9e=F9e,B9e=Bf;function j9e(e){return!e||!e.ownerDocument?!1:B9e(e)&&e.nodeName==="BR"}var fY=j9e,dY={initODS:function(){},handleExtensionCausedError:function(){}};function z9e(e){var t=e?e.ownerDocument||e:document,n=t.defaultView||window;return!!(e&&(typeof n.Node=="function"?e instanceof n.Node:typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"))}var U9e=z9e,K9e=U9e;function W9e(e){return K9e(e)&&e.nodeType==3}var V9e=W9e,Nz=V9e;function pY(e,t){return!e||!t?!1:e===t?!0:Nz(e)?!1:Nz(t)?pY(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1}var qI=pY;function H9e(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var hY=H9e,q9e=dY,r$=rY,G9e=uo,gY=qI,Y9e=hY,GI=jS,X9e=bn,mY=Bf,Z9e=G9e.isBrowser("IE");function J9e(e,t){if(!e)return"[empty]";var n=vY(e,t);if(n.nodeType===Node.TEXT_NODE)return n.textContent;mY(n)||X9e(!1);var r=n;return r.outerHTML}function vY(e,t){var n=t!==void 0?t(e):[];if(e.nodeType===Node.TEXT_NODE){var r=e.textContent.length;return GI(e).createTextNode("[text "+r+(n.length?" | "+n.join(", "):"")+"]")}var i=e.cloneNode();i.nodeType===1&&n.length&&i.setAttribute("data-labels",n.join(", "));for(var o=e.childNodes,a=0;a<o.length;a++)i.appendChild(vY(o[a],t));return i}function i$(e,t){for(var n=e,r=n;n;){if(mY(n)&&r.hasAttribute("contenteditable"))return J9e(n,t);n=n.parentNode,r=n}return"Could not find contentEditable parent of node"}function yY(e){return e.nodeValue===null?e.childNodes.length:e.nodeValue.length}function Q9e(e,t,n,r,i){var o=GI(t);if(gY(o.documentElement,t)){var a=o.defaultView.getSelection(),s=e.getAnchorKey(),l=e.getAnchorOffset(),u=e.getFocusKey(),f=e.getFocusOffset(),d=e.getIsBackward();if(!a.extend&&d){var p=s,g=l;s=u,l=f,u=p,f=g,d=!1}var v=s===n&&r<=l&&i>=l,y=u===n&&r<=f&&i>=f;if(v&&y){a.removeAllRanges(),sb(a,t,l-r,e),Jb(a,t,f-r,e);return}if(!d)v&&(a.removeAllRanges(),sb(a,t,l-r,e)),y&&Jb(a,t,f-r,e);else if(y&&(a.removeAllRanges(),sb(a,t,f-r,e)),v){var w=a.focusNode,b=a.focusOffset;a.removeAllRanges(),sb(a,t,l-r,e),Jb(a,w,b,e)}}}function Jb(e,t,n,r){var i=Y9e(),o=e.extend;if(o&&t!=null&&gY(i,t)){n>yY(t)&&r$.logSelectionStateFailure({anonymizedDom:i$(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())});var a=t===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(t,n)}catch(l){throw r$.logSelectionStateFailure({anonymizedDom:i$(t,function(u){var f=[];return u===i&&f.push("active element"),u===e.anchorNode&&f.push("selection anchor node"),u===e.focusNode&&f.push("selection focus node"),f}),extraParams:JSON.stringify({activeElementName:i?i.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:a,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:l?""+l:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),l}}else if(t&&e.rangeCount>0){var s=e.getRangeAt(0);s.setEnd(t,n),e.addRange(s.cloneRange())}}function sb(e,t,n,r){var i=GI(t).createRange();if(n>yY(t)&&(r$.logSelectionStateFailure({anonymizedDom:i$(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())}),q9e.handleExtensionCausedError()),i.setStart(t,n),Z9e)try{e.addRange(i)}catch{}else e.addRange(i)}var e8e={setDraftEditorSelection:Q9e,addFocusToSelection:Jb},Bz=Nf;function t8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n8e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function r8e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i8e=N9e,fT=T,lb=bn,o8e=fY,a8e=e8e.setDraftEditorSelection,s8e=function(e){n8e(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o))||this,r8e(t8e(r),"leaf",void 0),r}var n=t.prototype;return n._setSelection=function(){var i=this.props.selection;if(!(i==null||!i.getHasFocus())){var o=this.props,a=o.block,s=o.start,l=o.text,u=a.getKey(),f=s+l.length;if(i.hasEdgeWithin(u,s,f)){var d=this.leaf;d||lb(!1);var p=d.firstChild;p||lb(!1);var g;p.nodeType===Node.TEXT_NODE?g=p:o8e(p)?g=d:(g=p.firstChild,g||lb(!1)),a8e(i,g,u,s,f)}}},n.shouldComponentUpdate=function(i){var o=this.leaf;o||lb(!1);var a=o.textContent!==i.text||i.styleSet!==this.props.styleSet||i.forceSelection;return a},n.componentDidUpdate=function(){this._setSelection()},n.componentDidMount=function(){this._setSelection()},n.render=function(){var i=this,o=this.props.block,a=this.props.text;a.endsWith(`
|
|
450
450
|
`)&&this.props.isLast&&(a+=`
|
|
451
|
-
`);var s=this.props,l=s.customStyleMap,u=s.customStyleFn,f=s.offsetKey,d=s.styleSet,p=d.reduce(function(v,y){var w={},b=l[y];return b!==void 0&&v.textDecoration!==b.textDecoration&&(w.textDecoration=[v.textDecoration,b.textDecoration].join(" ").trim()),Bz(v,b,w)},{});if(u){var g=u(d,o);p=Bz(p,g)}return fT.createElement("span",{"data-offset-key":f,ref:function(y){return i.leaf=y},style:p},fT.createElement(r8e,null,a))},t}(fT.Component),bY=a8e,dT,jz;function s8e(){if(jz)return dT;jz=1;function e(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,l.__proto__=u}var t=R9e(),n=bY,r=Kl,i=cn,o=T,a=Ff;i.List;var s=function(l){e(u,l);function u(){return l.apply(this,arguments)||this}var f=u.prototype;return f.render=function(){var p=this.props,g=p.block,v=p.contentState,y=p.customStyleFn,w=p.customStyleMap,b=p.decorator,x=p.direction,C=p.forceSelection,k=p.hasSelection,R=p.selection,A=p.tree,O=g.getKey(),z=g.getText(),V=A.size-1,D=this.props.children||A.map(function(W,ie){var se=W.get("decoratorKey"),K=W.get("leaves"),G=K.size-1,Q=K.map(function(le,Z){var ee=r.encode(O,ie,Z),P=le.get("start"),ge=le.get("end");return o.createElement(n,{key:ee,offsetKey:ee,block:g,start:P,selection:k?R:null,forceSelection:C,text:z.slice(P,ge),styleSet:g.getInlineStyleAt(P),customStyleMap:w,customStyleFn:y,isLast:se===V&&Z===G})}).toArray();return!se||!b?Q:o.createElement(t,{block:g,children:Q,contentState:v,decorator:b,decoratorKey:se,direction:x,leafSet:W,text:z,key:ie})}).toArray();return o.createElement("div",{"data-offset-key":r.encode(O,0,0),className:a({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":x==="LTR","public/DraftStyleDefault/rtl":x==="RTL"})},D)},u}(o.Component);return dT=s,dT}function ub(e,t){return!!t&&(e===t.documentElement||e===t.body)}var l8e={getTop:function(t){var n=t.ownerDocument;return ub(t,n)?n.body.scrollTop||n.documentElement.scrollTop:t.scrollTop},setTop:function(t,n){var r=t.ownerDocument;ub(t,r)?r.body.scrollTop=r.documentElement.scrollTop=n:t.scrollTop=n},getLeft:function(t){var n=t.ownerDocument;return ub(t,n)?n.body.scrollLeft||n.documentElement.scrollLeft:t.scrollLeft},setLeft:function(t,n){var r=t.ownerDocument;ub(t,r)?r.body.scrollLeft=r.documentElement.scrollLeft=n:t.scrollLeft=n}},YI=l8e,u8e=/-(.)/g;function c8e(e){return e.replace(u8e,function(t,n){return n.toUpperCase()})}var f8e=c8e,d8e=/([A-Z])/g;function p8e(e){return e.replace(d8e,"-$1").toLowerCase()}var h8e=p8e,zz=f8e,Uz=h8e;function vm(e){return e==null?e:String(e)}function g8e(e,t){var n;if(window.getComputedStyle&&(n=window.getComputedStyle(e,null),n))return vm(n.getPropertyValue(Uz(t)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(e,null),n)return vm(n.getPropertyValue(Uz(t)));if(t==="display")return"none"}return e.currentStyle?vm(t==="float"?e.currentStyle.cssFloat||e.currentStyle.styleFloat:e.currentStyle[zz(t)]):vm(e.style&&e.style[zz(t)])}var m8e=g8e,v8e=m8e;function pT(e,t){var n=_Y.get(e,t);return n==="auto"||n==="scroll"}var _Y={get:v8e,getScrollParent:function(t){if(!t)return null;for(var n=t.ownerDocument;t&&t!==n.body;){if(pT(t,"overflow")||pT(t,"overflowY")||pT(t,"overflowX"))return t;t=t.parentNode}return n.defaultView||n.parentWindow}},KS=_Y,y8e=qI;function b8e(e){var t=e.ownerDocument.documentElement;if(!("getBoundingClientRect"in e)||!y8e(t,e))return{left:0,right:0,top:0,bottom:0};var n=e.getBoundingClientRect();return{left:Math.round(n.left)-t.clientLeft,right:Math.round(n.right)-t.clientLeft,top:Math.round(n.top)-t.clientTop,bottom:Math.round(n.bottom)-t.clientTop}}var _8e=b8e,x8e=_8e;function w8e(e){var t=x8e(e);return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}var xY=w8e,S8e=typeof navigator<"u"&&navigator.userAgent.indexOf("AppleWebKit")>-1;function C8e(e){return e=e||document,e.scrollingElement?e.scrollingElement:!S8e&&e.compatMode==="CSS1Compat"?e.documentElement:e.body}var E8e=C8e;function k8e(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}var T8e=k8e,R8e=E8e,A8e=T8e;function $8e(e){var t=R8e(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var n=A8e(e),r=e===t?e.ownerDocument.documentElement:e,i=e.scrollWidth-r.clientWidth,o=e.scrollHeight-r.clientHeight;return n.x=Math.max(0,Math.min(n.x,i)),n.y=Math.max(0,Math.min(n.y,o)),n}var WS=$8e;function wY(){var e;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function SY(){var e;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function CY(){return{width:window.innerWidth||wY(),height:window.innerHeight||SY()}}CY.withoutScrollbars=function(){return{width:wY(),height:SY()}};var EY=CY,hT,Kz;function O8e(){if(Kz)return hT;Kz=1;var e=Nf;function t(){return t=e||function(V){for(var D=1;D<arguments.length;D++){var W=arguments[D];for(var ie in W)Object.prototype.hasOwnProperty.call(W,ie)&&(V[ie]=W[ie])}return V},t.apply(this,arguments)}function n(V){if(V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function r(V,D){V.prototype=Object.create(D.prototype),V.prototype.constructor=V,V.__proto__=D}function i(V){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{},ie=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(ie=ie.concat(Object.getOwnPropertySymbols(W).filter(function(se){return Object.getOwnPropertyDescriptor(W,se).enumerable}))),ie.forEach(function(se){o(V,se,W[se])})}return V}function o(V,D,W){return D in V?Object.defineProperty(V,D,{value:W,enumerable:!0,configurable:!0,writable:!0}):V[D]=W,V}var a=s8e(),s=Kl,l=T,u=YI,f=KS,d=xY,p=WS,g=EY,v=cn,y=bn,w=By,b=10;v.List;var x=function(D,W){return D.getAnchorKey()===W||D.getFocusKey()===W},C=function(D,W){var ie=D.getNextSiblingKey();return ie?W.getBlockForKey(ie).getType()===D.getType():!1},k=function(D,W,ie){var se=[],K=!0,G=!1,Q=void 0;try{for(var le=ie.reverse()[Symbol.iterator](),Z;!(K=(Z=le.next()).done);K=!0){var ee=Z.value;if(ee.type!==W)break;se.push(ee)}}catch(B){G=!0,Q=B}finally{try{!K&&le.return!=null&&le.return()}finally{if(G)throw Q}}ie.splice(ie.indexOf(se[0]),se.length+1);var P=se.reverse(),ge=P[0].key;return ie.push(l.cloneElement(D,{key:"".concat(ge,"-wrap"),"data-offset-key":s.encode(ge,0,0)},P)),ie},R=function(D,W){var ie=W.get(D.getType())||W.get("unstyled"),se=ie.wrapper,K=ie.element||W.get("unstyled").element;return{Element:K,wrapperTemplate:se}},A=function(D,W){var ie=W(D);if(!ie)return{};var se=ie.component,K=ie.props,G=ie.editable;return{CustomComponent:se,customProps:K,customEditable:G}},O=function(D,W,ie,se,K,G){var Q={"data-block":!0,"data-editor":W,"data-offset-key":ie,key:D.getKey(),ref:G},le=se(D);return le&&(Q.className=le),K.customEditable!==void 0&&(Q=i({},Q,{contentEditable:K.customEditable,suppressContentEditableWarning:!0})),Q},z=function(V){r(D,V);function D(){for(var ie,se=arguments.length,K=new Array(se),G=0;G<se;G++)K[G]=arguments[G];return ie=V.call.apply(V,[this].concat(K))||this,o(n(ie),"wrapperRef",l.createRef()),ie}var W=D.prototype;return W.shouldComponentUpdate=function(se){var K=this.props,G=K.block,Q=K.direction,le=K.tree,Z=!G.getChildKeys().isEmpty(),ee=G!==se.block||le!==se.tree||Q!==se.direction||x(se.selection,se.block.getKey())&&se.forceSelection;return Z||ee},W.componentDidMount=function(){var se=this.props.selection,K=se.getEndKey();if(!(!se.getHasFocus()||K!==this.props.block.getKey())){var G=this.wrapperRef.current;if(G){var Q=f.getScrollParent(G),le=p(Q),Z;if(Q===window){var ee=d(G),P=ee.y+ee.height,ge=g().height;Z=P-ge,Z>0&&window.scrollTo(le.x,le.y+Z+b)}else{w(G)||y(!1);var B=G,L=B.offsetHeight+B.offsetTop,ae=Q.offsetHeight+le.y;Z=L-ae,Z>0&&u.setTop(Q,u.getTop(Q)+Z+b)}}}},W.render=function(){var se=this,K=this.props,G=K.block,Q=K.blockRenderMap,le=K.blockRendererFn,Z=K.blockStyleFn,ee=K.contentState,P=K.decorator,ge=K.editorKey,B=K.editorState,L=K.customStyleFn,ae=K.customStyleMap,ue=K.direction,ne=K.forceSelection,we=K.selection,Te=K.tree,Ee=null;G.children.size&&(Ee=G.children.reduce(function(Ye,st){var he=s.encode(st,0,0),Ae=ee.getBlockForKey(st),Re=A(Ae,le),Ne=Re.CustomComponent||D,U=R(Ae,Q),H=U.Element,fe=U.wrapperTemplate,Y=O(Ae,ge,he,Z,Re,null),X=i({},se.props,{tree:B.getBlockTree(st),blockProps:Re.customProps,offsetKey:he,block:Ae});return Ye.push(l.createElement(H,Y,l.createElement(Ne,X))),!fe||C(Ae,ee)||k(fe,H,Ye),Ye},[]));var Le=G.getKey(),Be=s.encode(Le,0,0),Ie=A(G,le),Pe=Ie.CustomComponent,je=Pe!=null?l.createElement(Pe,t({},this.props,{tree:B.getBlockTree(Le),blockProps:Ie.customProps,offsetKey:Be,block:G})):l.createElement(a,{block:G,children:Ee,contentState:ee,customStyleFn:L,customStyleMap:ae,decorator:P,direction:ue,forceSelection:ne,hasSelection:x(we,Le),selection:we,tree:Te});if(G.getParentKey())return je;var Fe=R(G,Q),tt=Fe.Element,Xe=O(G,ge,Be,Z,Ie,this.wrapperRef);return l.createElement(tt,Xe,je)},D}(l.Component);return hT=z,hT}var gT,Wz;function I8e(){if(Wz)return gT;Wz=1;var e=Nf;function t(){return t=e||function(l){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d])}return l},t.apply(this,arguments)}function n(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,l.__proto__=u}var r=O8e(),i=Kl,o=T,a=lo,s=function(l){n(u,l);function u(){return l.apply(this,arguments)||this}var f=u.prototype;return f.shouldComponentUpdate=function(p){var g=this.props.editorState,v=p.editorState,y=g.getDirectionMap(),w=v.getDirectionMap();if(y!==w)return!0;var b=g.getSelection().getHasFocus(),x=v.getSelection().getHasFocus();if(b!==x)return!0;var C=v.getNativelyRenderedContent(),k=g.isInCompositionMode(),R=v.isInCompositionMode();if(g===v||C!==null&&v.getCurrentContent()===C||k&&R)return!1;var A=g.getCurrentContent(),O=v.getCurrentContent(),z=g.getDecorator(),V=v.getDecorator();return k!==R||A!==O||z!==V||v.mustForceSelection()},f.render=function(){for(var p=this.props,g=p.blockRenderMap,v=p.blockRendererFn,y=p.blockStyleFn,w=p.customStyleMap,b=p.customStyleFn,x=p.editorState,C=p.editorKey,k=p.textDirectionality,R=x.getCurrentContent(),A=x.getSelection(),O=x.mustForceSelection(),z=x.getDecorator(),V=a(x.getDirectionMap()),D=R.getBlocksAsArray(),W=D[0],ie=[],se=W;se;){var K=se.getKey(),G={blockRenderMap:g,blockRendererFn:v,blockStyleFn:y,contentState:R,customStyleFn:b,customStyleMap:w,decorator:z,editorKey:C,editorState:x,forceSelection:O,selection:A,block:se,direction:k||V.get(K),tree:x.getBlockTree(K)},Q=g.get(se.getType())||g.get("unstyled"),le=Q.wrapper;ie.push({block:o.createElement(r,t({key:K},G)),wrapperTemplate:le,key:K,offsetKey:i.encode(K,0,0)});var Z=se.getNextSiblingKey();se=Z?R.getBlockForKey(Z):null}for(var ee=[],P=0;P<ie.length;){var ge=ie[P];if(ge.wrapperTemplate){var B=[];do B.push(ie[P].block),P++;while(P<ie.length&&ie[P].wrapperTemplate===ge.wrapperTemplate);var L=o.cloneElement(ge.wrapperTemplate,{key:ge.key+"-wrap","data-offset-key":ge.offsetKey},B);ee.push(L)}else ee.push(ge.block),P++}return o.createElement("div",{"data-contents":"true"},ee)},u}(o.Component);return gT=s,gT}var D8e=Nf;function o$(){return o$=D8e||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o$.apply(this,arguments)}function P8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L8e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function M8e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F8e=bY,Vz=Kl,cb=T,Hz=YI,N8e=KS,B8e=jI,j8e=NS,z8e=Ff,U8e=xY,K8e=WS,W8e=EY,V8e=bn,H8e=By,q8e=lo,qz=10,Gz=function(t,n){return t.getAnchorKey()===n||t.getFocusKey()===n},G8e=function(e){L8e(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o))||this,M8e(P8e(r),"_node",void 0),r}var n=t.prototype;return n.shouldComponentUpdate=function(i){return this.props.block!==i.block||this.props.tree!==i.tree||this.props.direction!==i.direction||Gz(i.selection,i.block.getKey())&&i.forceSelection},n.componentDidMount=function(){if(!this.props.preventScroll){var i=this.props.selection,o=i.getEndKey();if(!(!i.getHasFocus()||o!==this.props.block.getKey())){var a=this._node;if(a!=null){var s=N8e.getScrollParent(a),l=K8e(s),u;if(s===window){var f=U8e(a),d=f.y+f.height,p=W8e().height;u=d-p,u>0&&window.scrollTo(l.x,l.y+u+qz)}else{H8e(a)||V8e(!1);var g=a.offsetHeight+a.offsetTop,v=s.offsetTop+s.offsetHeight,y=v+l.y;u=g-y,u>0&&Hz.setTop(s,Hz.getTop(s)+u+qz)}}}}},n._renderChildren=function(){var i=this,o=this.props.block,a=o.getKey(),s=o.getText(),l=this.props.tree.size-1,u=Gz(this.props.selection,a);return this.props.tree.map(function(f,d){var p=f.get("leaves");if(p.size===0)return null;var g=p.size-1,v=p.map(function(D,W){var ie=Vz.encode(a,d,W),se=D.get("start"),K=D.get("end");return cb.createElement(F8e,{key:ie,offsetKey:ie,block:o,start:se,selection:u?i.props.selection:null,forceSelection:i.props.forceSelection,text:s.slice(se,K),styleSet:o.getInlineStyleAt(se),customStyleMap:i.props.customStyleMap,customStyleFn:i.props.customStyleFn,isLast:d===l&&W===g})}).toArray(),y=f.get("decoratorKey");if(y==null||!i.props.decorator)return v;var w=q8e(i.props.decorator),b=w.getComponentForKey(y);if(!b)return v;var x=w.getPropsForKey(y),C=Vz.encode(a,d,0),k=p.first().get("start"),R=p.last().get("end"),A=s.slice(k,R),O=o.getEntityAt(f.get("start")),z=j8e.getHTMLDirIfDifferent(B8e.getDirection(A),i.props.direction),V={contentState:i.props.contentState,decoratedText:A,dir:z,start:k,end:R,blockKey:a,entityKey:O,offsetKey:C};return cb.createElement(b,o$({},x,V,{key:C}),v)}).toArray()},n.render=function(){var i=this,o=this.props,a=o.direction,s=o.offsetKey,l=z8e({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":a==="LTR","public/DraftStyleDefault/rtl":a==="RTL"});return cb.createElement("div",{"data-offset-key":s,className:l,ref:function(f){return i._node=f}},this._renderChildren())},t}(cb.Component),kY=G8e,mT,Yz;function Y8e(){if(Yz)return mT;Yz=1;function e(t){var n=t||"",r=arguments.length;if(r>1)for(var i=1;i<r;i++){var o=arguments[i];o&&(n=(n?n+" ":"")+o)}return n}return mT=e,mT}var vT,Xz;function X8e(){if(Xz)return vT;Xz=1;var e=Nf;function t(){return t=e||function(g){for(var v=1;v<arguments.length;v++){var y=arguments[v];for(var w in y)Object.prototype.hasOwnProperty.call(y,w)&&(g[w]=y[w])}return g},t.apply(this,arguments)}function n(g){for(var v=1;v<arguments.length;v++){var y=arguments[v]!=null?arguments[v]:{},w=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(w=w.concat(Object.getOwnPropertySymbols(y).filter(function(b){return Object.getOwnPropertyDescriptor(y,b).enumerable}))),w.forEach(function(b){r(g,b,y[b])})}return g}function r(g,v,y){return v in g?Object.defineProperty(g,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[v]=y,g}function i(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var o=kY,a=Kl,s=T,l=Ff,u=Y8e(),f=lo,d=function(v,y,w,b){return l({"public/DraftStyleDefault/unorderedListItem":v==="unordered-list-item","public/DraftStyleDefault/orderedListItem":v==="ordered-list-item","public/DraftStyleDefault/reset":w,"public/DraftStyleDefault/depth0":y===0,"public/DraftStyleDefault/depth1":y===1,"public/DraftStyleDefault/depth2":y===2,"public/DraftStyleDefault/depth3":y===3,"public/DraftStyleDefault/depth4":y>=4,"public/DraftStyleDefault/listLTR":b==="LTR","public/DraftStyleDefault/listRTL":b==="RTL"})},p=function(g){i(v,g);function v(){return g.apply(this,arguments)||this}var y=v.prototype;return y.shouldComponentUpdate=function(b){var x=this.props.editorState,C=b.editorState,k=x.getDirectionMap(),R=C.getDirectionMap();if(k!==R)return!0;var A=x.getSelection().getHasFocus(),O=C.getSelection().getHasFocus();if(A!==O)return!0;var z=C.getNativelyRenderedContent(),V=x.isInCompositionMode(),D=C.isInCompositionMode();if(x===C||z!==null&&C.getCurrentContent()===z||V&&D)return!1;var W=x.getCurrentContent(),ie=C.getCurrentContent(),se=x.getDecorator(),K=C.getDecorator();return V!==D||W!==ie||se!==K||C.mustForceSelection()},y.render=function(){for(var b=this.props,x=b.blockRenderMap,C=b.blockRendererFn,k=b.blockStyleFn,R=b.customStyleMap,A=b.customStyleFn,O=b.editorState,z=b.editorKey,V=b.preventScroll,D=b.textDirectionality,W=O.getCurrentContent(),ie=O.getSelection(),se=O.mustForceSelection(),K=O.getDecorator(),G=f(O.getDirectionMap()),Q=W.getBlocksAsArray(),le=[],Z=null,ee=null,P=0;P<Q.length;P++){var ge=Q[P],B=ge.getKey(),L=ge.getType(),ae=C(ge),ue=void 0,ne=void 0,we=void 0;ae&&(ue=ae.component,ne=ae.props,we=ae.editable);var Te=D||G.get(B),Ee=a.encode(B,0,0),Le={contentState:W,block:ge,blockProps:ne,blockStyleFn:k,customStyleMap:R,customStyleFn:A,decorator:K,direction:Te,forceSelection:se,offsetKey:Ee,preventScroll:V,selection:ie,tree:O.getBlockTree(B)},Be=x.get(L)||x.get("unstyled"),Ie=Be.wrapper,Pe=Be.element||x.get("unstyled").element,je=ge.getDepth(),Fe="";if(k&&(Fe=k(ge)),Pe==="li"){var tt=ee!==Ie||Z===null||je>Z;Fe=u(Fe,d(L,je,tt,Te))}var Xe=ue||o,Ye={className:Fe,"data-block":!0,"data-editor":z,"data-offset-key":Ee,key:B};we!==void 0&&(Ye=n({},Ye,{contentEditable:we,suppressContentEditableWarning:!0}));var st=s.createElement(Pe,Ye,s.createElement(Xe,t({},Le,{key:B})));le.push({block:st,wrapperTemplate:Ie,key:B,offsetKey:Ee}),Ie?Z=ge.getDepth():Z=null,ee=Ie}for(var he=[],Ae=0;Ae<le.length;){var Re=le[Ae];if(Re.wrapperTemplate){var Ne=[];do Ne.push(le[Ae].block),Ae++;while(Ae<le.length&&le[Ae].wrapperTemplate===Re.wrapperTemplate);var U=s.cloneElement(Re.wrapperTemplate,{key:Re.key+"-wrap","data-offset-key":Re.offsetKey},Ne);he.push(U)}else he.push(Re.block),Ae++}return s.createElement("div",{"data-contents":"true"},he)},v}(s.Component);return vT=p,vT}var Z8e=cc,J8e=Z8e("draft_tree_data_support"),Q8e=J8e?I8e():X8e(),TY={isImage:function(t){return Zz(t)[0]==="image"},isJpeg:function(t){var n=Zz(t);return TY.isImage(t)&&(n[1]==="jpeg"||n[1]==="pjpeg")}};function Zz(e){return e.split("/")}var e7e=TY,fb=bn;function t7e(e){var t=e.length;if(!Array.isArray(e)&&(typeof e=="object"||typeof e=="function")||fb(!1),typeof t!="number"&&fb(!1),t===0||t-1 in e||fb(!1),typeof e.callee=="function"&&fb(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch{}for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}function n7e(e){return!!e&&(typeof e=="object"||typeof e=="function")&&"length"in e&&!("setInterval"in e)&&typeof e.nodeType!="number"&&(Array.isArray(e)||"callee"in e||"item"in e)}function r7e(e){return n7e(e)?Array.isArray(e)?e.slice():t7e(e):[e]}var i7e=r7e;function VS(e){return function(){return e}}var jf=function(){};jf.thatReturns=VS;jf.thatReturnsFalse=VS(!1);jf.thatReturnsTrue=VS(!0);jf.thatReturnsNull=VS(null);jf.thatReturnsThis=function(){return this};jf.thatReturnsArgument=function(e){return e};var o7e=jf,a7e=e7e,s7e=i7e,l7e=o7e,u7e=new RegExp(`\r
|
|
452
|
-
`,"g"),
|
|
453
|
-
`,
|
|
454
|
-
`);return r[0]}return this.types.indexOf("text/uri-list")!=-1?this.data.getData("text/uri-list"):this.data.getData("url")}return null},t.isImage=function(){var r=this.types.some(function(s){return s.indexOf("application/x-moz-file")!=-1});if(r)return!0;for(var i=this.getFiles(),o=0;o<i.length;o++){var a=i[o].type;if(!a7e.isImage(a))return!1}return!0},t.getCount=function(){return this.data.hasOwnProperty("items")?this.data.items.length:this.data.hasOwnProperty("mozItemCount")?this.data.mozItemCount:this.data.files?this.data.files.length:null},t.getFiles=function(){return this.data.items?Array.prototype.slice.call(this.data.items).map(d7e).filter(l7e.thatReturnsArgument):this.data.files?Array.prototype.slice.call(this.data.files):[]},t.hasFiles=function(){return this.getFiles().length>0},e}(),RY=p7e,h7e=bn,Jz=/\.textClipping$/,g7e={"text/plain":!0,"text/html":!0,"text/rtf":!0},m7e=5e3;function v7e(e,t){var n=0,r=[];e.forEach(function(i){y7e(i,function(o){n++,o&&r.push(o.slice(0,m7e)),n==e.length&&t(r.join("\r"))})})}function y7e(e,t){if(!ni.FileReader||e.type&&!(e.type in g7e)){t("");return}if(e.type===""){var n="";Jz.test(e.name)&&(n=e.name.replace(Jz,"")),t(n);return}var r=new FileReader;r.onload=function(){var i=r.result;typeof i!="string"&&h7e(!1),t(i)},r.onerror=function(){t("")},r.readAsText(e)}var AY=v7e;function b7e(e){return e==="handled"||e===!0}var HS=b7e,_7e=RY,$Y=so,OY=zn,x7e=zS,w7e=jS,S7e=AY,C7e=oY,E7e=nY,Qz=HS,yT=lo;function k7e(e,t){var n=null,r=null,i=w7e(e.currentTarget);if(typeof i.caretRangeFromPoint=="function"){var o=i.caretRangeFromPoint(e.x,e.y);n=o.startContainer,r=o.startOffset}else if(e.rangeParent)n=e.rangeParent,r=e.rangeOffset;else return null;n=yT(n),r=yT(r);var a=yT(x7e(n));return C7e(t,a,r,a,r)}var T7e={onDragEnd:function(t){t.exitCurrentMode(),e4(t)},onDrop:function(t,n){var r=new _7e(n.nativeEvent.dataTransfer),i=t._latestEditorState,o=k7e(n.nativeEvent,i);if(n.preventDefault(),t._dragCount=0,t.exitCurrentMode(),o!=null){var a=r.getFiles();if(a.length>0){if(t.props.handleDroppedFiles&&Qz(t.props.handleDroppedFiles(o,a)))return;S7e(a,function(l){l&&t.update(t4(i,o,l))});return}var s=t._internalDrag?"internal":"external";t.props.handleDrop&&Qz(t.props.handleDrop(o,r,s))||(t._internalDrag?t.update(R7e(i,o)):t.update(t4(i,o,r.getText()))),e4(t)}}};function e4(e){e._internalDrag=!1;var t=e.editorContainer;if(t){var n=new MouseEvent("mouseup",{view:E7e(t),bubbles:!0,cancelable:!0});t.dispatchEvent(n)}}function R7e(e,t){var n=$Y.moveText(e.getCurrentContent(),e.getSelection(),t);return OY.push(e,n,"insert-fragment")}function t4(e,t,n){var r=$Y.insertText(e.getCurrentContent(),t,n,e.getCurrentInlineStyle());return OY.push(e,r,"insert-fragment")}var A7e=T7e;function $7e(e){var t=e.getSelection(),n=t.getAnchorKey(),r=e.getBlockTree(n),i=t.getStartOffset(),o=!1;return r.some(function(a){return i===a.get("start")?(o=!0,!0):i<a.get("end")?a.get("leaves").some(function(s){var l=s.get("start");return i===l?(o=!0,!0):!1}):!1}),o}var O7e=$7e;(function(e,t){if(e.setImmediate)return;var n=1,r={},i=!1,o=e.document,a;function s(x){typeof x!="function"&&(x=new Function(""+x));for(var C=new Array(arguments.length-1),k=0;k<C.length;k++)C[k]=arguments[k+1];var R={callback:x,args:C};return r[n]=R,a(n),n++}function l(x){delete r[x]}function u(x){var C=x.callback,k=x.args;switch(k.length){case 0:C();break;case 1:C(k[0]);break;case 2:C(k[0],k[1]);break;case 3:C(k[0],k[1],k[2]);break;default:C.apply(t,k);break}}function f(x){if(i)setTimeout(f,0,x);else{var C=r[x];if(C){i=!0;try{u(C)}finally{l(x),i=!1}}}}function d(){a=function(x){process.nextTick(function(){f(x)})}}function p(){if(e.postMessage&&!e.importScripts){var x=!0,C=e.onmessage;return e.onmessage=function(){x=!1},e.postMessage("","*"),e.onmessage=C,x}}function g(){var x="setImmediate$"+Math.random()+"$",C=function(k){k.source===e&&typeof k.data=="string"&&k.data.indexOf(x)===0&&f(+k.data.slice(x.length))};e.addEventListener?e.addEventListener("message",C,!1):e.attachEvent("onmessage",C),a=function(k){e.postMessage(x+k,"*")}}function v(){var x=new MessageChannel;x.port1.onmessage=function(C){var k=C.data;f(k)},a=function(C){x.port2.postMessage(C)}}function y(){var x=o.documentElement;a=function(C){var k=o.createElement("script");k.onreadystatechange=function(){f(C),k.onreadystatechange=null,x.removeChild(k),k=null},x.appendChild(k)}}function w(){a=function(x){setTimeout(f,0,x)}}var b=Object.getPrototypeOf&&Object.getPrototypeOf(e);b=b&&b.setTimeout?b:e,{}.toString.call(e.process)==="[object process]"?d():p()?g():e.MessageChannel?v():o&&"onreadystatechange"in o.createElement("script")?y():w(),b.setImmediate=s,b.clearImmediate=l})(typeof self>"u"?ni:self);var I7e=ni.setImmediate,D7e=so,a$=zn,P7e=uo,n4=VI,L7e=HS,M7e=O7e,r4=lo,F7e=I7e,N7e="'",B7e="/",j7e=P7e.isBrowser("Firefox");function z7e(e){return j7e&&(e==N7e||e==B7e)}function i4(e,t,n,r,i){var o=D7e.replaceText(e.getCurrentContent(),e.getSelection(),t,n,r);return a$.push(e,o,"insert-characters",i)}function U7e(e,t){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e._latestEditorState,r=t.data;if(r){if(e.props.handleBeforeInput&&L7e(e.props.handleBeforeInput(r,n,t.timeStamp))){t.preventDefault();return}var i=n.getSelection(),o=i.getStartOffset(),a=i.getAnchorKey();if(!i.isCollapsed()){t.preventDefault(),e.update(i4(n,r,n.getCurrentInlineStyle(),n4(n.getCurrentContent(),n.getSelection()),!0));return}var s=i4(n,r,n.getCurrentInlineStyle(),n4(n.getCurrentContent(),n.getSelection()),!1),l=!1;if(l||(l=M7e(e._latestCommittedEditorState)),!l){var u=n.getBlockTree(a),f=s.getBlockTree(a);l=u.size!==f.size||u.zip(f).some(function(d){var p=d[0],g=d[1],v=p.get("start"),y=v+(v>=o?r.length:0),w=p.get("end"),b=w+(w>=o?r.length:0),x=g.get("start"),C=g.get("end"),k=g.get("decoratorKey");return p.get("decoratorKey")!==k||p.get("leaves").size!==g.get("leaves").size||y!==x||b!==C||k!=null&&C-x!==w-v})}if(l||(l=z7e(r)),l||(l=r4(s.getDirectionMap()).get(a)!==r4(n.getDirectionMap()).get(a)),l){t.preventDefault(),s=a$.set(s,{forceSelection:!0}),e.update(s);return}s=a$.set(s,{nativelyRenderedContent:s.getCurrentContent()}),e._pendingStateFromBeforeInput=s,F7e(function(){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)})}}var K7e=U7e,W7e=zn,o4=qI,V7e=hY;function H7e(e,t){var n=t.currentTarget.ownerDocument;if(!e.props.preserveSelectionOnBlur&&V7e(n)===n.body){var r=n.defaultView.getSelection(),i=e.editor;r.rangeCount===1&&o4(i,r.anchorNode)&&o4(i,r.focusNode)&&r.removeAllRanges()}var o=e._latestEditorState,a=o.getSelection();if(a.getHasFocus()){var s=a.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(t),e.update(W7e.acceptSelection(o,s))}}var q7e=H7e,G7e=zn;function Y7e(e,t){e.setMode("composite"),e.update(G7e.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(t)}var X7e=Y7e,Z7e=PS;function J7e(e){var t=e.getSelection();return t.isCollapsed()?null:Z7e(e.getCurrentContent(),t)}var IY=J7e,Q7e=IY;function eKe(e,t){var n=e._latestEditorState,r=n.getSelection();if(r.isCollapsed()){t.preventDefault();return}e.setClipboard(Q7e(e._latestEditorState))}var tKe=eKe;function nKe(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){var t=e;if(!t.ownerDocument.defaultView)return t instanceof Node;if(t instanceof t.ownerDocument.defaultView.Node)return!0}return!1}var rKe=nKe,iKe=so,oKe=zn,aKe=KS,sKe=IY,lKe=WS,uKe=rKe;function cKe(e,t){var n=e._latestEditorState,r=n.getSelection(),i=t.target,o;if(r.isCollapsed()){t.preventDefault();return}if(uKe(i)){var a=i;o=lKe(aKe.getScrollParent(a))}var s=sKe(n);e.setClipboard(s),e.setMode("cut"),setTimeout(function(){e.restoreEditorDOM(o),e.exitCurrentMode(),e.update(fKe(n))},0)}function fKe(e){var t=iKe.removeRange(e.getCurrentContent(),e.getSelection(),"forward");return oKe.push(e,t,"remove-range")}var dKe=cKe;function pKe(e,t){e.setMode("drag"),t.preventDefault()}var hKe=pKe;function gKe(e){e._internalDrag=!0,e.setMode("drag")}var mKe=gKe,a4=zn,vKe=uo;function yKe(e,t){var n=e._latestEditorState,r=n.getSelection();if(!r.getHasFocus()){var i=r.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(t),vKe.isBrowser("Chrome < 60.0.3081.0")?e.update(a4.forceSelection(n,i)):e.update(a4.acceptSelection(n,i))}}var bKe=yKe,_Ke=bn,DY=55296,xKe=56319,wKe=56320,PY=57343,SKe=/[\uD800-\uDFFF]/;function LY(e){return DY<=e&&e<=PY}function CKe(e,t){if(0<=t&&t<e.length||_Ke(!1),t+1===e.length)return!1;var n=e.charCodeAt(t),r=e.charCodeAt(t+1);return DY<=n&&n<=xKe&&wKe<=r&&r<=PY}function XI(e){return SKe.test(e)}function Sp(e,t){return 1+LY(e.charCodeAt(t))}function EKe(e){if(!XI(e))return e.length;for(var t=0,n=0;n<e.length;n+=Sp(e,n))t++;return t}function MY(e,t,n){if(t=t||0,n=n===void 0?1/0:n||0,!XI(e))return e.substr(t,n);var r=e.length;if(r<=0||t>r||n<=0)return"";var i=0;if(t>0){for(;t>0&&i<r;t--)i+=Sp(e,i);if(i>=r)return""}else if(t<0){for(i=r;t<0&&0<i;t++)i-=Sp(e,i-1);i<0&&(i=0)}var o=r;if(n<r)for(o=i;n>0&&o<r;n--)o+=Sp(e,o);return e.substring(i,o)}function kKe(e,t,n){t=t||0,n=n===void 0?1/0:n||0,t<0&&(t=0),n<0&&(n=0);var r=Math.abs(n-t);return t=t<n?t:n,MY(e,t,r)}function TKe(e){for(var t=[],n=0;n<e.length;n+=Sp(e,n))t.push(e.codePointAt(n));return t}var RKe={getCodePoints:TKe,getUTF16Length:Sp,hasSurrogateUnit:XI,isCodeUnitInSurrogateRange:LY,isSurrogatePair:CKe,strlen:EKe,substring:kKe,substr:MY},zf=RKe;function AKe(e,t){var n=e.getSelection(),r=e.getCurrentContent(),i=n.getStartKey(),o=n.getStartOffset(),a=i,s=0;if(t>o){var l=r.getKeyBefore(i);if(l==null)a=i;else{a=l;var u=r.getBlockForKey(l);s=u.getText().length}}else s=o-t;return n.merge({focusKey:a,focusOffset:s,isBackward:!0})}var ZI=AKe,$Ke=so,OKe=cc,s4=OKe("draft_tree_data_support");function IKe(e,t,n){var r=e.getSelection(),i=e.getCurrentContent(),o=r,a=r.getAnchorKey(),s=r.getFocusKey(),l=i.getBlockForKey(a);if(s4&&n==="forward"&&a!==s)return i;if(r.isCollapsed()){if(n==="forward"){if(e.isSelectionAtEndOfContent())return i;if(s4){var u=r.getAnchorOffset()===i.getBlockForKey(a).getLength();if(u){var f=i.getBlockForKey(l.nextSibling);if(!f||f.getLength()===0)return i}}}else if(e.isSelectionAtStartOfContent())return i;if(o=t(e),o===r)return i}return $Ke.removeRange(i,o,n)}var jy=IKe,DKe=zn,PKe=zf,LKe=ZI,MKe=jy;function FKe(e){var t=MKe(e,function(r){var i=r.getSelection(),o=r.getCurrentContent(),a=i.getAnchorKey(),s=i.getAnchorOffset(),l=o.getBlockForKey(a).getText()[s-1];return LKe(r,l?PKe.getUTF16Length(l,0):1)},"backward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return DKe.push(e,t.set("selectionBefore",n),n.isCollapsed()?"backspace-character":"remove-range")}var FY=FKe,NKe=so,BKe=Kl,jKe=zn,zKe=uo,UKe=uY,KKe=UKe.notEmptyKey,WKe=zS,VKe=FY,HKe=lo,qKe=zKe.isEngine("Gecko"),GKe=`
|
|
451
|
+
`);var s=this.props,l=s.customStyleMap,u=s.customStyleFn,f=s.offsetKey,d=s.styleSet,p=d.reduce(function(v,y){var w={},b=l[y];return b!==void 0&&v.textDecoration!==b.textDecoration&&(w.textDecoration=[v.textDecoration,b.textDecoration].join(" ").trim()),Bz(v,b,w)},{});if(u){var g=u(d,o);p=Bz(p,g)}return fT.createElement("span",{"data-offset-key":f,ref:function(y){return i.leaf=y},style:p},fT.createElement(i8e,null,a))},t}(fT.Component),bY=s8e,dT,jz;function l8e(){if(jz)return dT;jz=1;function e(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,l.__proto__=u}var t=A9e(),n=bY,r=Kl,i=cn,o=T,a=Ff;i.List;var s=function(l){e(u,l);function u(){return l.apply(this,arguments)||this}var f=u.prototype;return f.render=function(){var p=this.props,g=p.block,v=p.contentState,y=p.customStyleFn,w=p.customStyleMap,b=p.decorator,x=p.direction,C=p.forceSelection,k=p.hasSelection,R=p.selection,A=p.tree,O=g.getKey(),z=g.getText(),V=A.size-1,D=this.props.children||A.map(function(W,ie){var se=W.get("decoratorKey"),K=W.get("leaves"),G=K.size-1,Q=K.map(function(le,Z){var ee=r.encode(O,ie,Z),P=le.get("start"),ge=le.get("end");return o.createElement(n,{key:ee,offsetKey:ee,block:g,start:P,selection:k?R:null,forceSelection:C,text:z.slice(P,ge),styleSet:g.getInlineStyleAt(P),customStyleMap:w,customStyleFn:y,isLast:se===V&&Z===G})}).toArray();return!se||!b?Q:o.createElement(t,{block:g,children:Q,contentState:v,decorator:b,decoratorKey:se,direction:x,leafSet:W,text:z,key:ie})}).toArray();return o.createElement("div",{"data-offset-key":r.encode(O,0,0),className:a({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":x==="LTR","public/DraftStyleDefault/rtl":x==="RTL"})},D)},u}(o.Component);return dT=s,dT}function ub(e,t){return!!t&&(e===t.documentElement||e===t.body)}var u8e={getTop:function(t){var n=t.ownerDocument;return ub(t,n)?n.body.scrollTop||n.documentElement.scrollTop:t.scrollTop},setTop:function(t,n){var r=t.ownerDocument;ub(t,r)?r.body.scrollTop=r.documentElement.scrollTop=n:t.scrollTop=n},getLeft:function(t){var n=t.ownerDocument;return ub(t,n)?n.body.scrollLeft||n.documentElement.scrollLeft:t.scrollLeft},setLeft:function(t,n){var r=t.ownerDocument;ub(t,r)?r.body.scrollLeft=r.documentElement.scrollLeft=n:t.scrollLeft=n}},YI=u8e,c8e=/-(.)/g;function f8e(e){return e.replace(c8e,function(t,n){return n.toUpperCase()})}var d8e=f8e,p8e=/([A-Z])/g;function h8e(e){return e.replace(p8e,"-$1").toLowerCase()}var g8e=h8e,zz=d8e,Uz=g8e;function vm(e){return e==null?e:String(e)}function m8e(e,t){var n;if(window.getComputedStyle&&(n=window.getComputedStyle(e,null),n))return vm(n.getPropertyValue(Uz(t)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(e,null),n)return vm(n.getPropertyValue(Uz(t)));if(t==="display")return"none"}return e.currentStyle?vm(t==="float"?e.currentStyle.cssFloat||e.currentStyle.styleFloat:e.currentStyle[zz(t)]):vm(e.style&&e.style[zz(t)])}var v8e=m8e,y8e=v8e;function pT(e,t){var n=_Y.get(e,t);return n==="auto"||n==="scroll"}var _Y={get:y8e,getScrollParent:function(t){if(!t)return null;for(var n=t.ownerDocument;t&&t!==n.body;){if(pT(t,"overflow")||pT(t,"overflowY")||pT(t,"overflowX"))return t;t=t.parentNode}return n.defaultView||n.parentWindow}},KS=_Y,b8e=qI;function _8e(e){var t=e.ownerDocument.documentElement;if(!("getBoundingClientRect"in e)||!b8e(t,e))return{left:0,right:0,top:0,bottom:0};var n=e.getBoundingClientRect();return{left:Math.round(n.left)-t.clientLeft,right:Math.round(n.right)-t.clientLeft,top:Math.round(n.top)-t.clientTop,bottom:Math.round(n.bottom)-t.clientTop}}var x8e=_8e,w8e=x8e;function S8e(e){var t=w8e(e);return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}var xY=S8e,C8e=typeof navigator<"u"&&navigator.userAgent.indexOf("AppleWebKit")>-1;function E8e(e){return e=e||document,e.scrollingElement?e.scrollingElement:!C8e&&e.compatMode==="CSS1Compat"?e.documentElement:e.body}var k8e=E8e;function T8e(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}var R8e=T8e,A8e=k8e,$8e=R8e;function O8e(e){var t=A8e(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var n=$8e(e),r=e===t?e.ownerDocument.documentElement:e,i=e.scrollWidth-r.clientWidth,o=e.scrollHeight-r.clientHeight;return n.x=Math.max(0,Math.min(n.x,i)),n.y=Math.max(0,Math.min(n.y,o)),n}var WS=O8e;function wY(){var e;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function SY(){var e;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function CY(){return{width:window.innerWidth||wY(),height:window.innerHeight||SY()}}CY.withoutScrollbars=function(){return{width:wY(),height:SY()}};var EY=CY,hT,Kz;function I8e(){if(Kz)return hT;Kz=1;var e=Nf;function t(){return t=e||function(V){for(var D=1;D<arguments.length;D++){var W=arguments[D];for(var ie in W)Object.prototype.hasOwnProperty.call(W,ie)&&(V[ie]=W[ie])}return V},t.apply(this,arguments)}function n(V){if(V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function r(V,D){V.prototype=Object.create(D.prototype),V.prototype.constructor=V,V.__proto__=D}function i(V){for(var D=1;D<arguments.length;D++){var W=arguments[D]!=null?arguments[D]:{},ie=Object.keys(W);typeof Object.getOwnPropertySymbols=="function"&&(ie=ie.concat(Object.getOwnPropertySymbols(W).filter(function(se){return Object.getOwnPropertyDescriptor(W,se).enumerable}))),ie.forEach(function(se){o(V,se,W[se])})}return V}function o(V,D,W){return D in V?Object.defineProperty(V,D,{value:W,enumerable:!0,configurable:!0,writable:!0}):V[D]=W,V}var a=l8e(),s=Kl,l=T,u=YI,f=KS,d=xY,p=WS,g=EY,v=cn,y=bn,w=By,b=10;v.List;var x=function(D,W){return D.getAnchorKey()===W||D.getFocusKey()===W},C=function(D,W){var ie=D.getNextSiblingKey();return ie?W.getBlockForKey(ie).getType()===D.getType():!1},k=function(D,W,ie){var se=[],K=!0,G=!1,Q=void 0;try{for(var le=ie.reverse()[Symbol.iterator](),Z;!(K=(Z=le.next()).done);K=!0){var ee=Z.value;if(ee.type!==W)break;se.push(ee)}}catch(B){G=!0,Q=B}finally{try{!K&&le.return!=null&&le.return()}finally{if(G)throw Q}}ie.splice(ie.indexOf(se[0]),se.length+1);var P=se.reverse(),ge=P[0].key;return ie.push(l.cloneElement(D,{key:"".concat(ge,"-wrap"),"data-offset-key":s.encode(ge,0,0)},P)),ie},R=function(D,W){var ie=W.get(D.getType())||W.get("unstyled"),se=ie.wrapper,K=ie.element||W.get("unstyled").element;return{Element:K,wrapperTemplate:se}},A=function(D,W){var ie=W(D);if(!ie)return{};var se=ie.component,K=ie.props,G=ie.editable;return{CustomComponent:se,customProps:K,customEditable:G}},O=function(D,W,ie,se,K,G){var Q={"data-block":!0,"data-editor":W,"data-offset-key":ie,key:D.getKey(),ref:G},le=se(D);return le&&(Q.className=le),K.customEditable!==void 0&&(Q=i({},Q,{contentEditable:K.customEditable,suppressContentEditableWarning:!0})),Q},z=function(V){r(D,V);function D(){for(var ie,se=arguments.length,K=new Array(se),G=0;G<se;G++)K[G]=arguments[G];return ie=V.call.apply(V,[this].concat(K))||this,o(n(ie),"wrapperRef",l.createRef()),ie}var W=D.prototype;return W.shouldComponentUpdate=function(se){var K=this.props,G=K.block,Q=K.direction,le=K.tree,Z=!G.getChildKeys().isEmpty(),ee=G!==se.block||le!==se.tree||Q!==se.direction||x(se.selection,se.block.getKey())&&se.forceSelection;return Z||ee},W.componentDidMount=function(){var se=this.props.selection,K=se.getEndKey();if(!(!se.getHasFocus()||K!==this.props.block.getKey())){var G=this.wrapperRef.current;if(G){var Q=f.getScrollParent(G),le=p(Q),Z;if(Q===window){var ee=d(G),P=ee.y+ee.height,ge=g().height;Z=P-ge,Z>0&&window.scrollTo(le.x,le.y+Z+b)}else{w(G)||y(!1);var B=G,L=B.offsetHeight+B.offsetTop,ae=Q.offsetHeight+le.y;Z=L-ae,Z>0&&u.setTop(Q,u.getTop(Q)+Z+b)}}}},W.render=function(){var se=this,K=this.props,G=K.block,Q=K.blockRenderMap,le=K.blockRendererFn,Z=K.blockStyleFn,ee=K.contentState,P=K.decorator,ge=K.editorKey,B=K.editorState,L=K.customStyleFn,ae=K.customStyleMap,ue=K.direction,ne=K.forceSelection,we=K.selection,Te=K.tree,Ee=null;G.children.size&&(Ee=G.children.reduce(function(Ye,st){var he=s.encode(st,0,0),Ae=ee.getBlockForKey(st),Re=A(Ae,le),Ne=Re.CustomComponent||D,U=R(Ae,Q),H=U.Element,fe=U.wrapperTemplate,Y=O(Ae,ge,he,Z,Re,null),X=i({},se.props,{tree:B.getBlockTree(st),blockProps:Re.customProps,offsetKey:he,block:Ae});return Ye.push(l.createElement(H,Y,l.createElement(Ne,X))),!fe||C(Ae,ee)||k(fe,H,Ye),Ye},[]));var Le=G.getKey(),Be=s.encode(Le,0,0),Ie=A(G,le),Pe=Ie.CustomComponent,je=Pe!=null?l.createElement(Pe,t({},this.props,{tree:B.getBlockTree(Le),blockProps:Ie.customProps,offsetKey:Be,block:G})):l.createElement(a,{block:G,children:Ee,contentState:ee,customStyleFn:L,customStyleMap:ae,decorator:P,direction:ue,forceSelection:ne,hasSelection:x(we,Le),selection:we,tree:Te});if(G.getParentKey())return je;var Fe=R(G,Q),tt=Fe.Element,Xe=O(G,ge,Be,Z,Ie,this.wrapperRef);return l.createElement(tt,Xe,je)},D}(l.Component);return hT=z,hT}var gT,Wz;function D8e(){if(Wz)return gT;Wz=1;var e=Nf;function t(){return t=e||function(l){for(var u=1;u<arguments.length;u++){var f=arguments[u];for(var d in f)Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d])}return l},t.apply(this,arguments)}function n(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,l.__proto__=u}var r=I8e(),i=Kl,o=T,a=lo,s=function(l){n(u,l);function u(){return l.apply(this,arguments)||this}var f=u.prototype;return f.shouldComponentUpdate=function(p){var g=this.props.editorState,v=p.editorState,y=g.getDirectionMap(),w=v.getDirectionMap();if(y!==w)return!0;var b=g.getSelection().getHasFocus(),x=v.getSelection().getHasFocus();if(b!==x)return!0;var C=v.getNativelyRenderedContent(),k=g.isInCompositionMode(),R=v.isInCompositionMode();if(g===v||C!==null&&v.getCurrentContent()===C||k&&R)return!1;var A=g.getCurrentContent(),O=v.getCurrentContent(),z=g.getDecorator(),V=v.getDecorator();return k!==R||A!==O||z!==V||v.mustForceSelection()},f.render=function(){for(var p=this.props,g=p.blockRenderMap,v=p.blockRendererFn,y=p.blockStyleFn,w=p.customStyleMap,b=p.customStyleFn,x=p.editorState,C=p.editorKey,k=p.textDirectionality,R=x.getCurrentContent(),A=x.getSelection(),O=x.mustForceSelection(),z=x.getDecorator(),V=a(x.getDirectionMap()),D=R.getBlocksAsArray(),W=D[0],ie=[],se=W;se;){var K=se.getKey(),G={blockRenderMap:g,blockRendererFn:v,blockStyleFn:y,contentState:R,customStyleFn:b,customStyleMap:w,decorator:z,editorKey:C,editorState:x,forceSelection:O,selection:A,block:se,direction:k||V.get(K),tree:x.getBlockTree(K)},Q=g.get(se.getType())||g.get("unstyled"),le=Q.wrapper;ie.push({block:o.createElement(r,t({key:K},G)),wrapperTemplate:le,key:K,offsetKey:i.encode(K,0,0)});var Z=se.getNextSiblingKey();se=Z?R.getBlockForKey(Z):null}for(var ee=[],P=0;P<ie.length;){var ge=ie[P];if(ge.wrapperTemplate){var B=[];do B.push(ie[P].block),P++;while(P<ie.length&&ie[P].wrapperTemplate===ge.wrapperTemplate);var L=o.cloneElement(ge.wrapperTemplate,{key:ge.key+"-wrap","data-offset-key":ge.offsetKey},B);ee.push(L)}else ee.push(ge.block),P++}return o.createElement("div",{"data-contents":"true"},ee)},u}(o.Component);return gT=s,gT}var P8e=Nf;function o$(){return o$=P8e||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o$.apply(this,arguments)}function L8e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M8e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function F8e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N8e=bY,Vz=Kl,cb=T,Hz=YI,B8e=KS,j8e=jI,z8e=NS,U8e=Ff,K8e=xY,W8e=WS,V8e=EY,H8e=bn,q8e=By,G8e=lo,qz=10,Gz=function(t,n){return t.getAnchorKey()===n||t.getFocusKey()===n},Y8e=function(e){M8e(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o))||this,F8e(L8e(r),"_node",void 0),r}var n=t.prototype;return n.shouldComponentUpdate=function(i){return this.props.block!==i.block||this.props.tree!==i.tree||this.props.direction!==i.direction||Gz(i.selection,i.block.getKey())&&i.forceSelection},n.componentDidMount=function(){if(!this.props.preventScroll){var i=this.props.selection,o=i.getEndKey();if(!(!i.getHasFocus()||o!==this.props.block.getKey())){var a=this._node;if(a!=null){var s=B8e.getScrollParent(a),l=W8e(s),u;if(s===window){var f=K8e(a),d=f.y+f.height,p=V8e().height;u=d-p,u>0&&window.scrollTo(l.x,l.y+u+qz)}else{q8e(a)||H8e(!1);var g=a.offsetHeight+a.offsetTop,v=s.offsetTop+s.offsetHeight,y=v+l.y;u=g-y,u>0&&Hz.setTop(s,Hz.getTop(s)+u+qz)}}}}},n._renderChildren=function(){var i=this,o=this.props.block,a=o.getKey(),s=o.getText(),l=this.props.tree.size-1,u=Gz(this.props.selection,a);return this.props.tree.map(function(f,d){var p=f.get("leaves");if(p.size===0)return null;var g=p.size-1,v=p.map(function(D,W){var ie=Vz.encode(a,d,W),se=D.get("start"),K=D.get("end");return cb.createElement(N8e,{key:ie,offsetKey:ie,block:o,start:se,selection:u?i.props.selection:null,forceSelection:i.props.forceSelection,text:s.slice(se,K),styleSet:o.getInlineStyleAt(se),customStyleMap:i.props.customStyleMap,customStyleFn:i.props.customStyleFn,isLast:d===l&&W===g})}).toArray(),y=f.get("decoratorKey");if(y==null||!i.props.decorator)return v;var w=G8e(i.props.decorator),b=w.getComponentForKey(y);if(!b)return v;var x=w.getPropsForKey(y),C=Vz.encode(a,d,0),k=p.first().get("start"),R=p.last().get("end"),A=s.slice(k,R),O=o.getEntityAt(f.get("start")),z=z8e.getHTMLDirIfDifferent(j8e.getDirection(A),i.props.direction),V={contentState:i.props.contentState,decoratedText:A,dir:z,start:k,end:R,blockKey:a,entityKey:O,offsetKey:C};return cb.createElement(b,o$({},x,V,{key:C}),v)}).toArray()},n.render=function(){var i=this,o=this.props,a=o.direction,s=o.offsetKey,l=U8e({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":a==="LTR","public/DraftStyleDefault/rtl":a==="RTL"});return cb.createElement("div",{"data-offset-key":s,className:l,ref:function(f){return i._node=f}},this._renderChildren())},t}(cb.Component),kY=Y8e,mT,Yz;function X8e(){if(Yz)return mT;Yz=1;function e(t){var n=t||"",r=arguments.length;if(r>1)for(var i=1;i<r;i++){var o=arguments[i];o&&(n=(n?n+" ":"")+o)}return n}return mT=e,mT}var vT,Xz;function Z8e(){if(Xz)return vT;Xz=1;var e=Nf;function t(){return t=e||function(g){for(var v=1;v<arguments.length;v++){var y=arguments[v];for(var w in y)Object.prototype.hasOwnProperty.call(y,w)&&(g[w]=y[w])}return g},t.apply(this,arguments)}function n(g){for(var v=1;v<arguments.length;v++){var y=arguments[v]!=null?arguments[v]:{},w=Object.keys(y);typeof Object.getOwnPropertySymbols=="function"&&(w=w.concat(Object.getOwnPropertySymbols(y).filter(function(b){return Object.getOwnPropertyDescriptor(y,b).enumerable}))),w.forEach(function(b){r(g,b,y[b])})}return g}function r(g,v,y){return v in g?Object.defineProperty(g,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[v]=y,g}function i(g,v){g.prototype=Object.create(v.prototype),g.prototype.constructor=g,g.__proto__=v}var o=kY,a=Kl,s=T,l=Ff,u=X8e(),f=lo,d=function(v,y,w,b){return l({"public/DraftStyleDefault/unorderedListItem":v==="unordered-list-item","public/DraftStyleDefault/orderedListItem":v==="ordered-list-item","public/DraftStyleDefault/reset":w,"public/DraftStyleDefault/depth0":y===0,"public/DraftStyleDefault/depth1":y===1,"public/DraftStyleDefault/depth2":y===2,"public/DraftStyleDefault/depth3":y===3,"public/DraftStyleDefault/depth4":y>=4,"public/DraftStyleDefault/listLTR":b==="LTR","public/DraftStyleDefault/listRTL":b==="RTL"})},p=function(g){i(v,g);function v(){return g.apply(this,arguments)||this}var y=v.prototype;return y.shouldComponentUpdate=function(b){var x=this.props.editorState,C=b.editorState,k=x.getDirectionMap(),R=C.getDirectionMap();if(k!==R)return!0;var A=x.getSelection().getHasFocus(),O=C.getSelection().getHasFocus();if(A!==O)return!0;var z=C.getNativelyRenderedContent(),V=x.isInCompositionMode(),D=C.isInCompositionMode();if(x===C||z!==null&&C.getCurrentContent()===z||V&&D)return!1;var W=x.getCurrentContent(),ie=C.getCurrentContent(),se=x.getDecorator(),K=C.getDecorator();return V!==D||W!==ie||se!==K||C.mustForceSelection()},y.render=function(){for(var b=this.props,x=b.blockRenderMap,C=b.blockRendererFn,k=b.blockStyleFn,R=b.customStyleMap,A=b.customStyleFn,O=b.editorState,z=b.editorKey,V=b.preventScroll,D=b.textDirectionality,W=O.getCurrentContent(),ie=O.getSelection(),se=O.mustForceSelection(),K=O.getDecorator(),G=f(O.getDirectionMap()),Q=W.getBlocksAsArray(),le=[],Z=null,ee=null,P=0;P<Q.length;P++){var ge=Q[P],B=ge.getKey(),L=ge.getType(),ae=C(ge),ue=void 0,ne=void 0,we=void 0;ae&&(ue=ae.component,ne=ae.props,we=ae.editable);var Te=D||G.get(B),Ee=a.encode(B,0,0),Le={contentState:W,block:ge,blockProps:ne,blockStyleFn:k,customStyleMap:R,customStyleFn:A,decorator:K,direction:Te,forceSelection:se,offsetKey:Ee,preventScroll:V,selection:ie,tree:O.getBlockTree(B)},Be=x.get(L)||x.get("unstyled"),Ie=Be.wrapper,Pe=Be.element||x.get("unstyled").element,je=ge.getDepth(),Fe="";if(k&&(Fe=k(ge)),Pe==="li"){var tt=ee!==Ie||Z===null||je>Z;Fe=u(Fe,d(L,je,tt,Te))}var Xe=ue||o,Ye={className:Fe,"data-block":!0,"data-editor":z,"data-offset-key":Ee,key:B};we!==void 0&&(Ye=n({},Ye,{contentEditable:we,suppressContentEditableWarning:!0}));var st=s.createElement(Pe,Ye,s.createElement(Xe,t({},Le,{key:B})));le.push({block:st,wrapperTemplate:Ie,key:B,offsetKey:Ee}),Ie?Z=ge.getDepth():Z=null,ee=Ie}for(var he=[],Ae=0;Ae<le.length;){var Re=le[Ae];if(Re.wrapperTemplate){var Ne=[];do Ne.push(le[Ae].block),Ae++;while(Ae<le.length&&le[Ae].wrapperTemplate===Re.wrapperTemplate);var U=s.cloneElement(Re.wrapperTemplate,{key:Re.key+"-wrap","data-offset-key":Re.offsetKey},Ne);he.push(U)}else he.push(Re.block),Ae++}return s.createElement("div",{"data-contents":"true"},he)},v}(s.Component);return vT=p,vT}var J8e=cc,Q8e=J8e("draft_tree_data_support"),e7e=Q8e?D8e():Z8e(),TY={isImage:function(t){return Zz(t)[0]==="image"},isJpeg:function(t){var n=Zz(t);return TY.isImage(t)&&(n[1]==="jpeg"||n[1]==="pjpeg")}};function Zz(e){return e.split("/")}var t7e=TY,fb=bn;function n7e(e){var t=e.length;if(!Array.isArray(e)&&(typeof e=="object"||typeof e=="function")||fb(!1),typeof t!="number"&&fb(!1),t===0||t-1 in e||fb(!1),typeof e.callee=="function"&&fb(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch{}for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}function r7e(e){return!!e&&(typeof e=="object"||typeof e=="function")&&"length"in e&&!("setInterval"in e)&&typeof e.nodeType!="number"&&(Array.isArray(e)||"callee"in e||"item"in e)}function i7e(e){return r7e(e)?Array.isArray(e)?e.slice():n7e(e):[e]}var o7e=i7e;function VS(e){return function(){return e}}var jf=function(){};jf.thatReturns=VS;jf.thatReturnsFalse=VS(!1);jf.thatReturnsTrue=VS(!0);jf.thatReturnsNull=VS(null);jf.thatReturnsThis=function(){return this};jf.thatReturnsArgument=function(e){return e};var a7e=jf,s7e=t7e,l7e=o7e,u7e=a7e,c7e=new RegExp(`\r
|
|
452
|
+
`,"g"),f7e=`
|
|
453
|
+
`,d7e={"text/rtf":1,"text/html":1};function p7e(e){if(e.kind=="file")return e.getAsFile()}var h7e=function(){function e(n){this.data=n,this.types=n.types?l7e(n.types):[]}var t=e.prototype;return t.isRichText=function(){return this.getHTML()&&this.getText()?!0:this.isImage()?!1:this.types.some(function(r){return d7e[r]})},t.getText=function(){var r;return this.data.getData&&(this.types.length?this.types.indexOf("text/plain")!=-1&&(r=this.data.getData("text/plain")):r=this.data.getData("Text")),r?r.replace(c7e,f7e):null},t.getHTML=function(){if(this.data.getData)if(this.types.length){if(this.types.indexOf("text/html")!=-1)return this.data.getData("text/html")}else return this.data.getData("Text")},t.isLink=function(){return this.types.some(function(r){return r.indexOf("Url")!=-1||r.indexOf("text/uri-list")!=-1||r.indexOf("text/x-moz-url")})},t.getLink=function(){if(this.data.getData){if(this.types.indexOf("text/x-moz-url")!=-1){var r=this.data.getData("text/x-moz-url").split(`
|
|
454
|
+
`);return r[0]}return this.types.indexOf("text/uri-list")!=-1?this.data.getData("text/uri-list"):this.data.getData("url")}return null},t.isImage=function(){var r=this.types.some(function(s){return s.indexOf("application/x-moz-file")!=-1});if(r)return!0;for(var i=this.getFiles(),o=0;o<i.length;o++){var a=i[o].type;if(!s7e.isImage(a))return!1}return!0},t.getCount=function(){return this.data.hasOwnProperty("items")?this.data.items.length:this.data.hasOwnProperty("mozItemCount")?this.data.mozItemCount:this.data.files?this.data.files.length:null},t.getFiles=function(){return this.data.items?Array.prototype.slice.call(this.data.items).map(p7e).filter(u7e.thatReturnsArgument):this.data.files?Array.prototype.slice.call(this.data.files):[]},t.hasFiles=function(){return this.getFiles().length>0},e}(),RY=h7e,g7e=bn,Jz=/\.textClipping$/,m7e={"text/plain":!0,"text/html":!0,"text/rtf":!0},v7e=5e3;function y7e(e,t){var n=0,r=[];e.forEach(function(i){b7e(i,function(o){n++,o&&r.push(o.slice(0,v7e)),n==e.length&&t(r.join("\r"))})})}function b7e(e,t){if(!ni.FileReader||e.type&&!(e.type in m7e)){t("");return}if(e.type===""){var n="";Jz.test(e.name)&&(n=e.name.replace(Jz,"")),t(n);return}var r=new FileReader;r.onload=function(){var i=r.result;typeof i!="string"&&g7e(!1),t(i)},r.onerror=function(){t("")},r.readAsText(e)}var AY=y7e;function _7e(e){return e==="handled"||e===!0}var HS=_7e,x7e=RY,$Y=so,OY=zn,w7e=zS,S7e=jS,C7e=AY,E7e=oY,k7e=nY,Qz=HS,yT=lo;function T7e(e,t){var n=null,r=null,i=S7e(e.currentTarget);if(typeof i.caretRangeFromPoint=="function"){var o=i.caretRangeFromPoint(e.x,e.y);n=o.startContainer,r=o.startOffset}else if(e.rangeParent)n=e.rangeParent,r=e.rangeOffset;else return null;n=yT(n),r=yT(r);var a=yT(w7e(n));return E7e(t,a,r,a,r)}var R7e={onDragEnd:function(t){t.exitCurrentMode(),e4(t)},onDrop:function(t,n){var r=new x7e(n.nativeEvent.dataTransfer),i=t._latestEditorState,o=T7e(n.nativeEvent,i);if(n.preventDefault(),t._dragCount=0,t.exitCurrentMode(),o!=null){var a=r.getFiles();if(a.length>0){if(t.props.handleDroppedFiles&&Qz(t.props.handleDroppedFiles(o,a)))return;C7e(a,function(l){l&&t.update(t4(i,o,l))});return}var s=t._internalDrag?"internal":"external";t.props.handleDrop&&Qz(t.props.handleDrop(o,r,s))||(t._internalDrag?t.update(A7e(i,o)):t.update(t4(i,o,r.getText()))),e4(t)}}};function e4(e){e._internalDrag=!1;var t=e.editorContainer;if(t){var n=new MouseEvent("mouseup",{view:k7e(t),bubbles:!0,cancelable:!0});t.dispatchEvent(n)}}function A7e(e,t){var n=$Y.moveText(e.getCurrentContent(),e.getSelection(),t);return OY.push(e,n,"insert-fragment")}function t4(e,t,n){var r=$Y.insertText(e.getCurrentContent(),t,n,e.getCurrentInlineStyle());return OY.push(e,r,"insert-fragment")}var $7e=R7e;function O7e(e){var t=e.getSelection(),n=t.getAnchorKey(),r=e.getBlockTree(n),i=t.getStartOffset(),o=!1;return r.some(function(a){return i===a.get("start")?(o=!0,!0):i<a.get("end")?a.get("leaves").some(function(s){var l=s.get("start");return i===l?(o=!0,!0):!1}):!1}),o}var I7e=O7e;(function(e,t){if(e.setImmediate)return;var n=1,r={},i=!1,o=e.document,a;function s(x){typeof x!="function"&&(x=new Function(""+x));for(var C=new Array(arguments.length-1),k=0;k<C.length;k++)C[k]=arguments[k+1];var R={callback:x,args:C};return r[n]=R,a(n),n++}function l(x){delete r[x]}function u(x){var C=x.callback,k=x.args;switch(k.length){case 0:C();break;case 1:C(k[0]);break;case 2:C(k[0],k[1]);break;case 3:C(k[0],k[1],k[2]);break;default:C.apply(t,k);break}}function f(x){if(i)setTimeout(f,0,x);else{var C=r[x];if(C){i=!0;try{u(C)}finally{l(x),i=!1}}}}function d(){a=function(x){process.nextTick(function(){f(x)})}}function p(){if(e.postMessage&&!e.importScripts){var x=!0,C=e.onmessage;return e.onmessage=function(){x=!1},e.postMessage("","*"),e.onmessage=C,x}}function g(){var x="setImmediate$"+Math.random()+"$",C=function(k){k.source===e&&typeof k.data=="string"&&k.data.indexOf(x)===0&&f(+k.data.slice(x.length))};e.addEventListener?e.addEventListener("message",C,!1):e.attachEvent("onmessage",C),a=function(k){e.postMessage(x+k,"*")}}function v(){var x=new MessageChannel;x.port1.onmessage=function(C){var k=C.data;f(k)},a=function(C){x.port2.postMessage(C)}}function y(){var x=o.documentElement;a=function(C){var k=o.createElement("script");k.onreadystatechange=function(){f(C),k.onreadystatechange=null,x.removeChild(k),k=null},x.appendChild(k)}}function w(){a=function(x){setTimeout(f,0,x)}}var b=Object.getPrototypeOf&&Object.getPrototypeOf(e);b=b&&b.setTimeout?b:e,{}.toString.call(e.process)==="[object process]"?d():p()?g():e.MessageChannel?v():o&&"onreadystatechange"in o.createElement("script")?y():w(),b.setImmediate=s,b.clearImmediate=l})(typeof self>"u"?ni:self);var D7e=ni.setImmediate,P7e=so,a$=zn,L7e=uo,n4=VI,M7e=HS,F7e=I7e,r4=lo,N7e=D7e,B7e="'",j7e="/",z7e=L7e.isBrowser("Firefox");function U7e(e){return z7e&&(e==B7e||e==j7e)}function i4(e,t,n,r,i){var o=P7e.replaceText(e.getCurrentContent(),e.getSelection(),t,n,r);return a$.push(e,o,"insert-characters",i)}function K7e(e,t){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e._latestEditorState,r=t.data;if(r){if(e.props.handleBeforeInput&&M7e(e.props.handleBeforeInput(r,n,t.timeStamp))){t.preventDefault();return}var i=n.getSelection(),o=i.getStartOffset(),a=i.getAnchorKey();if(!i.isCollapsed()){t.preventDefault(),e.update(i4(n,r,n.getCurrentInlineStyle(),n4(n.getCurrentContent(),n.getSelection()),!0));return}var s=i4(n,r,n.getCurrentInlineStyle(),n4(n.getCurrentContent(),n.getSelection()),!1),l=!1;if(l||(l=F7e(e._latestCommittedEditorState)),!l){var u=n.getBlockTree(a),f=s.getBlockTree(a);l=u.size!==f.size||u.zip(f).some(function(d){var p=d[0],g=d[1],v=p.get("start"),y=v+(v>=o?r.length:0),w=p.get("end"),b=w+(w>=o?r.length:0),x=g.get("start"),C=g.get("end"),k=g.get("decoratorKey");return p.get("decoratorKey")!==k||p.get("leaves").size!==g.get("leaves").size||y!==x||b!==C||k!=null&&C-x!==w-v})}if(l||(l=U7e(r)),l||(l=r4(s.getDirectionMap()).get(a)!==r4(n.getDirectionMap()).get(a)),l){t.preventDefault(),s=a$.set(s,{forceSelection:!0}),e.update(s);return}s=a$.set(s,{nativelyRenderedContent:s.getCurrentContent()}),e._pendingStateFromBeforeInput=s,N7e(function(){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)})}}var W7e=K7e,V7e=zn,o4=qI,H7e=hY;function q7e(e,t){var n=t.currentTarget.ownerDocument;if(!e.props.preserveSelectionOnBlur&&H7e(n)===n.body){var r=n.defaultView.getSelection(),i=e.editor;r.rangeCount===1&&o4(i,r.anchorNode)&&o4(i,r.focusNode)&&r.removeAllRanges()}var o=e._latestEditorState,a=o.getSelection();if(a.getHasFocus()){var s=a.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(t),e.update(V7e.acceptSelection(o,s))}}var G7e=q7e,Y7e=zn;function X7e(e,t){e.setMode("composite"),e.update(Y7e.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(t)}var Z7e=X7e,J7e=PS;function Q7e(e){var t=e.getSelection();return t.isCollapsed()?null:J7e(e.getCurrentContent(),t)}var IY=Q7e,eKe=IY;function tKe(e,t){var n=e._latestEditorState,r=n.getSelection();if(r.isCollapsed()){t.preventDefault();return}e.setClipboard(eKe(e._latestEditorState))}var nKe=tKe;function rKe(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){var t=e;if(!t.ownerDocument.defaultView)return t instanceof Node;if(t instanceof t.ownerDocument.defaultView.Node)return!0}return!1}var iKe=rKe,oKe=so,aKe=zn,sKe=KS,lKe=IY,uKe=WS,cKe=iKe;function fKe(e,t){var n=e._latestEditorState,r=n.getSelection(),i=t.target,o;if(r.isCollapsed()){t.preventDefault();return}if(cKe(i)){var a=i;o=uKe(sKe.getScrollParent(a))}var s=lKe(n);e.setClipboard(s),e.setMode("cut"),setTimeout(function(){e.restoreEditorDOM(o),e.exitCurrentMode(),e.update(dKe(n))},0)}function dKe(e){var t=oKe.removeRange(e.getCurrentContent(),e.getSelection(),"forward");return aKe.push(e,t,"remove-range")}var pKe=fKe;function hKe(e,t){e.setMode("drag"),t.preventDefault()}var gKe=hKe;function mKe(e){e._internalDrag=!0,e.setMode("drag")}var vKe=mKe,a4=zn,yKe=uo;function bKe(e,t){var n=e._latestEditorState,r=n.getSelection();if(!r.getHasFocus()){var i=r.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(t),yKe.isBrowser("Chrome < 60.0.3081.0")?e.update(a4.forceSelection(n,i)):e.update(a4.acceptSelection(n,i))}}var _Ke=bKe,xKe=bn,DY=55296,wKe=56319,SKe=56320,PY=57343,CKe=/[\uD800-\uDFFF]/;function LY(e){return DY<=e&&e<=PY}function EKe(e,t){if(0<=t&&t<e.length||xKe(!1),t+1===e.length)return!1;var n=e.charCodeAt(t),r=e.charCodeAt(t+1);return DY<=n&&n<=wKe&&SKe<=r&&r<=PY}function XI(e){return CKe.test(e)}function Sp(e,t){return 1+LY(e.charCodeAt(t))}function kKe(e){if(!XI(e))return e.length;for(var t=0,n=0;n<e.length;n+=Sp(e,n))t++;return t}function MY(e,t,n){if(t=t||0,n=n===void 0?1/0:n||0,!XI(e))return e.substr(t,n);var r=e.length;if(r<=0||t>r||n<=0)return"";var i=0;if(t>0){for(;t>0&&i<r;t--)i+=Sp(e,i);if(i>=r)return""}else if(t<0){for(i=r;t<0&&0<i;t++)i-=Sp(e,i-1);i<0&&(i=0)}var o=r;if(n<r)for(o=i;n>0&&o<r;n--)o+=Sp(e,o);return e.substring(i,o)}function TKe(e,t,n){t=t||0,n=n===void 0?1/0:n||0,t<0&&(t=0),n<0&&(n=0);var r=Math.abs(n-t);return t=t<n?t:n,MY(e,t,r)}function RKe(e){for(var t=[],n=0;n<e.length;n+=Sp(e,n))t.push(e.codePointAt(n));return t}var AKe={getCodePoints:RKe,getUTF16Length:Sp,hasSurrogateUnit:XI,isCodeUnitInSurrogateRange:LY,isSurrogatePair:EKe,strlen:kKe,substring:TKe,substr:MY},zf=AKe;function $Ke(e,t){var n=e.getSelection(),r=e.getCurrentContent(),i=n.getStartKey(),o=n.getStartOffset(),a=i,s=0;if(t>o){var l=r.getKeyBefore(i);if(l==null)a=i;else{a=l;var u=r.getBlockForKey(l);s=u.getText().length}}else s=o-t;return n.merge({focusKey:a,focusOffset:s,isBackward:!0})}var ZI=$Ke,OKe=so,IKe=cc,s4=IKe("draft_tree_data_support");function DKe(e,t,n){var r=e.getSelection(),i=e.getCurrentContent(),o=r,a=r.getAnchorKey(),s=r.getFocusKey(),l=i.getBlockForKey(a);if(s4&&n==="forward"&&a!==s)return i;if(r.isCollapsed()){if(n==="forward"){if(e.isSelectionAtEndOfContent())return i;if(s4){var u=r.getAnchorOffset()===i.getBlockForKey(a).getLength();if(u){var f=i.getBlockForKey(l.nextSibling);if(!f||f.getLength()===0)return i}}}else if(e.isSelectionAtStartOfContent())return i;if(o=t(e),o===r)return i}return OKe.removeRange(i,o,n)}var jy=DKe,PKe=zn,LKe=zf,MKe=ZI,FKe=jy;function NKe(e){var t=FKe(e,function(r){var i=r.getSelection(),o=r.getCurrentContent(),a=i.getAnchorKey(),s=i.getAnchorOffset(),l=o.getBlockForKey(a).getText()[s-1];return MKe(r,l?LKe.getUTF16Length(l,0):1)},"backward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return PKe.push(e,t.set("selectionBefore",n),n.isCollapsed()?"backspace-character":"remove-range")}var FY=NKe,BKe=so,jKe=Kl,zKe=zn,UKe=uo,KKe=uY,WKe=KKe.notEmptyKey,VKe=zS,HKe=FY,qKe=lo,GKe=UKe.isEngine("Gecko"),YKe=`
|
|
455
455
|
|
|
456
|
-
`;function YKe(e,t){switch(e){case"deleteContentBackward":return VKe(t)}return t}function XKe(e,t){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e.editor,r=n.ownerDocument.defaultView.getSelection(),i=r.anchorNode,o=r.isCollapsed,a=(i==null?void 0:i.nodeType)!==Node.TEXT_NODE&&(i==null?void 0:i.nodeType)!==Node.ELEMENT_NODE;if(!(i==null||a)){if(i.nodeType===Node.TEXT_NODE&&(i.previousSibling!==null||i.nextSibling!==null)){var s=i.parentNode;if(s==null)return;i.nodeValue=s.textContent;for(var l=s.firstChild;l!=null;l=l.nextSibling)l!==i&&s.removeChild(l)}var u=i.textContent,f=e._latestEditorState,d=HKe(WKe(i)),p=BKe.decode(d),g=p.blockKey,v=p.decoratorKey,y=p.leafKey,w=f.getBlockTree(g).getIn([v,"leaves",y]),b=w.start,x=w.end,C=f.getCurrentContent(),k=C.getBlockForKey(g),R=k.getText().slice(b,x);if(u.endsWith(GKe)&&(u=u.slice(0,-1)),u===R){var A=t.nativeEvent.inputType;if(A){var O=YKe(A,f);if(O!==f){e.restoreEditorDOM(),e.update(O);return}}return}var z=f.getSelection(),V=z.merge({anchorOffset:b,focusOffset:x,isBackward:!1}),D=k.getEntityAt(b),W=KKe(D)?C.getEntity(D):null,ie=W!=null?W.getMutability():null,se=ie==="MUTABLE",K=se?"spellcheck-change":"apply-entity",G=NKe.replaceText(C,V,u,k.getInlineStyleAt(b),se?k.getEntityAt(b):null),Q,le,Z,ee;if(qKe)Q=r.anchorOffset,le=r.focusOffset,Z=b+Math.min(Q,le),ee=Z+Math.abs(Q-le),Q=Z,le=ee;else{var P=u.length-R.length;Z=z.getStartOffset(),ee=z.getEndOffset(),Q=o?ee+P:Z,le=ee+P}var ge=G.merge({selectionBefore:C.getSelectionAfter(),selectionAfter:z.merge({anchorOffset:Q,focusOffset:le})});e.update(jKe.push(f,ge,K))}}var ZKe=XKe,JKe=US;function QKe(e){return e.which===JKe.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}var eWe=QKe,tWe=uo,nWe=eWe,bT=tWe.isPlatform("Mac OS X"),NY={isCtrlKeyCommand:function(t){return!!t.ctrlKey&&!t.altKey},isOptionKeyCommand:function(t){return bT&&t.altKey},usesMacOSHeuristics:function(){return bT},hasCommandModifier:function(t){return bT?!!t.metaKey&&!t.altKey:NY.isCtrlKeyCommand(t)},isSoftNewlineEvent:nWe},JI=NY,l4=so,u4=zn,rWe=PS,iWe=lo,_T=null,oWe={cut:function(t){var n=t.getCurrentContent(),r=t.getSelection(),i=null;if(r.isCollapsed()){var o=r.getAnchorKey(),a=n.getBlockForKey(o).getLength();if(a===r.getAnchorOffset()){var s=n.getKeyAfter(o);if(s==null)return t;i=r.set("focusKey",s).set("focusOffset",0)}else i=r.set("focusOffset",a)}else i=r;i=iWe(i),_T=rWe(n,i);var l=l4.removeRange(n,i,"forward");return l===n?t:u4.push(t,l,"remove-range")},paste:function(t){if(!_T)return t;var n=l4.replaceWithFragment(t.getCurrentContent(),t.getSelection(),_T);return u4.push(t,n,"insert-fragment")}},aWe=oWe,sWe=uo,lWe=bn,uWe=sWe.isBrowser("Chrome");function cWe(e){for(var t=e.cloneRange(),n=[],r=e.endContainer;r!=null;r=r.parentNode){var i=r===e.commonAncestorContainer;i?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var o=Array.from(t.getClientRects());if(n.push(o),i){var a;return n.reverse(),(a=[]).concat.apply(a,n)}t.setEndBefore(r)}lWe(!1)}var fWe=uWe?cWe:function(e){return Array.from(e.getClientRects())},BY=fWe,dWe=zf,pWe=jS,c4=BY,s$=bn;function hWe(e){var t=getComputedStyle(e),n=pWe(e),r=n.createElement("div");r.style.fontFamily=t.fontFamily,r.style.fontSize=t.fontSize,r.style.fontStyle=t.fontStyle,r.style.fontWeight=t.fontWeight,r.style.lineHeight=t.lineHeight,r.style.position="absolute",r.textContent="M";var i=n.body;i||s$(!1),i.appendChild(r);var o=r.getBoundingClientRect();return i.removeChild(r),o.height}function f4(e,t){for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<e.length;a++){var s=e[a];s.width===0||s.width===1||(n=Math.min(n,s.top),r=Math.min(r,s.bottom),i=Math.max(i,s.top),o=Math.max(o,s.bottom))}return i<=r&&i-n<t&&o-r<t}function gWe(e){switch(e.nodeType){case Node.DOCUMENT_TYPE_NODE:return 0;case Node.TEXT_NODE:case Node.PROCESSING_INSTRUCTION_NODE:case Node.COMMENT_NODE:return e.length;default:return e.childNodes.length}}function mWe(e){e.collapsed||s$(!1),e=e.cloneRange();var t=e.startContainer;t.nodeType!==1&&(t=t.parentNode);var n=hWe(t),r=e.endContainer,i=e.endOffset;for(e.setStart(e.startContainer,0);f4(c4(e),n)&&(r=e.startContainer,i=e.startOffset,r.parentNode||s$(!1),e.setStartBefore(r),!(r.nodeType===1&&getComputedStyle(r).display!=="inline")););var o=r,a=i-1;do{for(var s=o.nodeValue,l=a;l>=0;l--)if(!(s!=null&&l>0&&dWe.isSurrogatePair(s,l-1)))if(e.setStart(o,l),f4(c4(e),n))r=o,i=l;else break;if(l===-1||o.childNodes.length===0)break;o=o.childNodes[l],a=gWe(o)}while(!0);return e.setStart(r,i),e}var vWe=mWe,yWe=zn,bWe=vWe,_We=aY,xWe=ZI,wWe=jy;function SWe(e,t){var n=wWe(e,function(r){var i=r.getSelection();if(i.isCollapsed()&&i.getAnchorOffset()===0)return xWe(r,1);var o=t.currentTarget.ownerDocument,a=o.defaultView.getSelection(),s=a.getRangeAt(0);return s=bWe(s),_We(r,null,s.endContainer,s.endOffset,s.startContainer,s.startOffset).selectionState},"backward");return n===e.getCurrentContent()?e:yWe.push(e,n,"remove-range")}var CWe=SWe,EWe=`[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]`,kWe={getPunctuation:function(){return EWe}},TWe=kWe,RWe=TWe.getPunctuation(),jY="['‘’]",Cp="\\s|(?![_])"+RWe,AWe="^(?:"+Cp+")*(?:"+jY+"|(?!"+Cp+").)*(?:(?!"+Cp+").)",$We=new RegExp(AWe),OWe="(?:(?!"+Cp+").)(?:"+jY+"|(?!"+Cp+").)*(?:"+Cp+")*$",IWe=new RegExp(OWe);function d4(e,t){var n=t?IWe.exec(e):$We.exec(e);return n?n[0]:e}var DWe={getBackward:function(t){return d4(t,!0)},getForward:function(t){return d4(t,!1)}},zY=DWe,PWe=zY,LWe=zn,p4=ZI,MWe=jy;function FWe(e){var t=MWe(e,function(n){var r=n.getSelection(),i=r.getStartOffset();if(i===0)return p4(n,1);var o=r.getStartKey(),a=n.getCurrentContent(),s=a.getBlockForKey(o).getText().slice(0,i),l=PWe.getBackward(s);return p4(n,l.length||1)},"backward");return t===e.getCurrentContent()?e:LWe.push(e,t,"remove-range")}var NWe=FWe;function BWe(e,t){var n=e.getSelection(),r=n.getStartKey(),i=n.getStartOffset(),o=e.getCurrentContent(),a=r,s,l=o.getBlockForKey(r);return t>l.getText().length-i?(a=o.getKeyAfter(r),s=0):s=i+t,n.merge({focusKey:a,focusOffset:s})}var UY=BWe,jWe=zY,zWe=zn,UWe=UY,KWe=jy;function WWe(e){var t=KWe(e,function(n){var r=n.getSelection(),i=r.getStartOffset(),o=r.getStartKey(),a=n.getCurrentContent(),s=a.getBlockForKey(o).getText().slice(i),l=jWe.getForward(s);return UWe(n,l.length||1)},"forward");return t===e.getCurrentContent()?e:zWe.push(e,t,"remove-range")}var VWe=WWe,HWe=so,qWe=zn;function GWe(e){var t=HWe.splitBlock(e.getCurrentContent(),e.getSelection());return qWe.push(e,t,"split-block")}var YWe=GWe,XWe=zn;function ZWe(e){var t=e.getSelection(),n=t.getEndKey(),r=e.getCurrentContent(),i=r.getBlockForKey(n).getLength();return XWe.set(e,{selection:t.merge({anchorKey:n,anchorOffset:i,focusKey:n,focusOffset:i,isBackward:!1}),forceSelection:!0})}var JWe=ZWe,QWe=zn;function eVe(e){var t=e.getSelection(),n=t.getStartKey();return QWe.set(e,{selection:t.merge({anchorKey:n,anchorOffset:0,focusKey:n,focusOffset:0,isBackward:!1}),forceSelection:!0})}var tVe=eVe,nVe=zn,rVe=zf,iVe=UY,oVe=jy;function aVe(e){var t=oVe(e,function(r){var i=r.getSelection(),o=r.getCurrentContent(),a=i.getAnchorKey(),s=i.getAnchorOffset(),l=o.getBlockForKey(a).getText()[s];return iVe(r,l?rVe.getUTF16Length(l,0):1)},"forward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return nVe.push(e,t.set("selectionBefore",n),n.isCollapsed()?"delete-character":"remove-range")}var sVe=aVe,h4=so,g4=zn,lVe=PS;function uVe(e){var t=e.getSelection();if(!t.isCollapsed())return e;var n=t.getAnchorOffset();if(n===0)return e;var r=t.getAnchorKey(),i=e.getCurrentContent(),o=i.getBlockForKey(r),a=o.getLength();if(a<=1)return e;var s,l;n===a?(s=t.set("anchorOffset",n-1),l=t):(s=t.set("focusOffset",n+1),l=s.set("anchorOffset",n+1));var u=lVe(i,s),f=h4.removeRange(i,s,"backward"),d=f.getSelectionAfter(),p=d.getAnchorOffset()-1,g=d.merge({anchorOffset:p,focusOffset:p}),v=h4.replaceWithFragment(f,g,u),y=g4.push(e,v,"insert-fragment");return g4.acceptSelection(y,l)}var cVe=uVe,xT=zn;function fVe(e,t,n){var r=xT.undo(t);if(t.getLastChangeType()==="spellcheck-change"){var i=r.getCurrentContent();n(xT.set(r,{nativelyRenderedContent:i}));return}if(e.preventDefault(),!t.getNativelyRenderedContent()){n(r);return}n(xT.set(t,{nativelyRenderedContent:null})),setTimeout(function(){n(r)},0)}var dVe=fVe,pVe=so,KY=zn,hVe=JI,hl=US,m4=aWe,gVe=uo,v4=HS,mVe=CWe,vVe=NWe,yVe=VWe,bVe=YWe,_Ve=JWe,xVe=tVe,wVe=FY,SVe=sVe,CVe=cVe,EVe=dVe,y4=hVe.isOptionKeyCommand,b4=gVe.isBrowser("Chrome");function kVe(e,t,n){switch(e){case"redo":return KY.redo(t);case"delete":return SVe(t);case"delete-word":return yVe(t);case"backspace":return wVe(t);case"backspace-word":return vVe(t);case"backspace-to-start-of-line":return mVe(t,n);case"split-block":return bVe(t);case"transpose-characters":return CVe(t);case"move-selection-to-start-of-block":return xVe(t);case"move-selection-to-end-of-block":return _Ve(t);case"secondary-cut":return m4.cut(t);case"secondary-paste":return m4.paste(t);default:return t}}function TVe(e,t){var n=t.which,r=e._latestEditorState;function i(l){var u=e.props[l];return u?(u(t),!0):!1}switch(n){case hl.RETURN:if(t.preventDefault(),e.props.handleReturn&&v4(e.props.handleReturn(t,r)))return;break;case hl.ESC:if(t.preventDefault(),i("onEscape"))return;break;case hl.TAB:if(i("onTab"))return;break;case hl.UP:if(i("onUpArrow"))return;break;case hl.RIGHT:if(i("onRightArrow"))return;break;case hl.DOWN:if(i("onDownArrow"))return;break;case hl.LEFT:if(i("onLeftArrow"))return;break;case hl.SPACE:b4&&y4(t)&&t.preventDefault()}var o=e.props.keyBindingFn(t);if(o==null||o===""){if(n===hl.SPACE&&b4&&y4(t)){var a=pVe.replaceText(r.getCurrentContent(),r.getSelection()," ");e.update(KY.push(r,a,"insert-characters"))}return}if(o==="undo"){EVe(t,r,e.update);return}if(t.preventDefault(),!(e.props.handleKeyCommand&&v4(e.props.handleKeyCommand(o,r,t.timeStamp)))){var s=kVe(o,r,t);s!==r&&e.update(s)}}var RVe=TVe;function AVe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $Ve=function(){function e(n){AVe(this,"_uri",void 0),this._uri=n}var t=e.prototype;return t.toString=function(){return this._uri},e}(),OVe=$Ve,IVe=uo,DVe=bn,PVe=IVe.isBrowser("IE <= 9");function LVe(e){var t,n=null;return!PVe&&document.implementation&&document.implementation.createHTMLDocument&&(t=document.implementation.createHTMLDocument("foo"),t.documentElement||DVe(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}var WY=LVe,MVe=Bf;function FVe(e){return!e||!e.ownerDocument?!1:MVe(e)&&e.nodeName==="A"}var NVe=FVe,BVe=Bf;function jVe(e){return!e||!e.ownerDocument?!1:BVe(e)&&e.nodeName==="IMG"}var zVe=jVe,Dc;function wT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Qr(e,i,n[i])})}return e}function Qr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var UVe=xa,KVe=Mf,WVe=wa,VVe=KI,_4=LS,VY=OVe,ym=Ff,x4=qs,HVe=WY,HY=cc,QI=cn,pu=QI.List,qY=QI.Map,qVe=QI.OrderedSet,GY=NVe,GVe=fY,eD=By,YY=zVe,w4=HY("draft_tree_data_support"),YVe=" ",XY=" ",XVe=new RegExp("\r","g"),ZVe=new RegExp(`
|
|
457
|
-
`,"g"),
|
|
458
|
-
`,"g"),
|
|
459
|
-
`,i)},t._addImgNode=function(r,i){if(YY(r)){var o=r,a={};
|
|
460
|
-
`,a=a.push(a.last()));var u=this._extractTextFromBlockConfigs(l.childConfigs);o+=u.text,a=a.concat(u.characterList)}return{text:o,characterList:a}},e}(),
|
|
461
|
-
`,t.getCurrentInlineStyle(),null),r=ms.push(t,n,"insert-characters");return ms.forceSelection(r,n.getSelectionAfter())},onBackspace:function(t){var n=t.getSelection();if(!n.isCollapsed()||n.getAnchorOffset()||n.getFocusOffset())return null;var r=t.getCurrentContent(),i=n.getStartKey(),o=r.getBlockBefore(i);if(o&&o.getType()==="atomic"){var a=r.getBlockMap().delete(o.getKey()),s=r.merge({blockMap:a,selectionAfter:n});if(s!==r)return ms.push(t,s,"remove-range")}var l=bs.tryToRemoveBlockStyle(t);return l?ms.push(t,l,"change-block-type"):null},onDelete:function(t){var n=t.getSelection();if(!n.isCollapsed())return null;var r=t.getCurrentContent(),i=n.getStartKey(),o=r.getBlockForKey(i),a=o.getLength();if(n.getStartOffset()<a)return null;var s=r.getBlockAfter(i);if(!s||s.getType()!=="atomic")return null;var l=n.merge({focusKey:s.getKey(),focusOffset:s.getLength()}),u=Pc.removeRange(r,l,"forward");return u!==r?ms.push(t,u,"remove-range"):null},onTab:function(t,n,r){var i=n.getSelection(),o=i.getAnchorKey();if(o!==i.getFocusKey())return n;var a=n.getCurrentContent(),s=a.getBlockForKey(o),l=s.getType();if(l!=="unordered-list-item"&&l!=="ordered-list-item")return n;t.preventDefault();var u=s.getDepth();if(!t.shiftKey&&u===r)return n;var f=$He(a,i,t.shiftKey?-1:1,r);return ms.push(n,f,"adjust-depth")},toggleBlockType:function(t,n){var r=t.getSelection(),i=r.getStartKey(),o=r.getEndKey(),a=t.getCurrentContent(),s=r;if(i!==o&&r.getEndOffset()===0){var l=OHe(a.getBlockBefore(o));o=l.getKey(),s=s.merge({anchorKey:i,anchorOffset:r.getStartOffset(),focusKey:o,focusOffset:l.getLength(),isBackward:!1})}var u=a.getBlockMap().skipWhile(function(d,p){return p!==i}).reverse().skipWhile(function(d,p){return p!==o}).some(function(d){return d.getType()==="atomic"});if(u)return t;var f=a.getBlockForKey(i).getType()===n?"unstyled":n;return ms.push(t,Pc.setBlockType(a,s,f),"change-block-type")},toggleCode:function(t){var n=t.getSelection(),r=n.getAnchorKey(),i=n.getFocusKey();return n.isCollapsed()||r!==i?bs.toggleBlockType(t,"code-block"):bs.toggleInlineStyle(t,"CODE")},toggleInlineStyle:function(t,n){var r=t.getSelection(),i=t.getCurrentInlineStyle();if(r.isCollapsed())return ms.setInlineStyleOverride(t,i.has(n)?i.remove(n):i.add(n));var o=t.getCurrentContent(),a;return i.has(n)?a=Pc.removeInlineStyle(o,r,n):a=Pc.applyInlineStyle(o,r,n),ms.push(t,a,"change-inline-style")},toggleLink:function(t,n,r){var i=Pc.applyEntity(t.getCurrentContent(),n,r);return ms.push(t,i,"apply-entity")},tryToRemoveBlockStyle:function(t){var n=t.getSelection(),r=n.getAnchorOffset();if(n.isCollapsed()&&r===0){var i=n.getAnchorKey(),o=t.getCurrentContent(),a=o.getBlockForKey(i),s=a.getType(),l=o.getBlockBefore(i);if(s==="code-block"&&l&&l.getType()==="code-block"&&l.getLength()!==0)return null;if(s!=="unstyled")return Pc.setBlockType(o,n,"unstyled")}return null}},eX=bs,IHe=/\r\n?|\n/g;function DHe(e){return e.split(IHe)}var PHe=DHe,CT=Iy,E4=xa,LHe=RY,tX=so,ET=THe,nX=zn,k4=eX,T4=VI,MHe=AY,R4=HS,A4=PHe;function FHe(e,t){t.preventDefault();var n=new LHe(t.clipboardData);if(!n.isRichText()){var r=n.getFiles(),i=n.getText();if(r.length>0){if(e.props.handlePastedFiles&&R4(e.props.handlePastedFiles(r)))return;MHe(r,function(A){if(A=A||i,!!A){var O=e._latestEditorState,z=A4(A),V=E4.create({style:O.getCurrentInlineStyle(),entity:T4(O.getCurrentContent(),O.getSelection())}),D=k4.getCurrentBlockType(O),W=ET.processText(z,V,D),ie=CT.createFromArray(W),se=tX.replaceWithFragment(O.getCurrentContent(),O.getSelection(),ie);e.update(nX.push(O,se,"insert-fragment"))}});return}}var o=[],a=n.getText(),s=n.getHTML(),l=e._latestEditorState;if(e.props.formatPastedText){var u=e.props.formatPastedText(a,s),f=u.text,d=u.html;a=f,s=d}if(!(e.props.handlePastedText&&R4(e.props.handlePastedText(a,s,l)))){if(a&&(o=A4(a)),!e.props.stripPastedStyles){var p=e.getClipboard();if(!e.props.formatPastedText&&n.isRichText()&&p){var g;if(((g=s)===null||g===void 0?void 0:g.indexOf(e.getEditorKey()))!==-1||o.length===1&&p.size===1&&p.first().getText()===a){e.update(db(e._latestEditorState,p));return}}else if(p&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&NHe(o,p)){e.update(db(e._latestEditorState,p));return}if(s){var v=ET.processHTML(s,e.props.blockRenderMap);if(v){var y=v.contentBlocks,w=v.entityMap;if(y){var b=CT.createFromArray(y);e.update(db(e._latestEditorState,b,w));return}}}e.setClipboard(null)}if(o.length){var x=E4.create({style:l.getCurrentInlineStyle(),entity:T4(l.getCurrentContent(),l.getSelection())}),C=k4.getCurrentBlockType(l),k=ET.processText(o,x,C),R=CT.createFromArray(k);e.update(db(e._latestEditorState,R))}}}function db(e,t,n){var r=tX.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return nX.push(e,r.set("entityMap",n),"insert-fragment")}function NHe(e,t){return e.length===t.size&&t.valueSeq().every(function(n,r){return n.getText()===e[r]})}var BHe=FHe,rX=uo,jHe=K7e,zHe=q7e,UHe=X7e,KHe=tKe,WHe=dKe,VHe=hKe,HHe=mKe,qHe=bKe,GHe=ZKe,YHe=RVe,XHe=BHe,iX=lY,ZHe=rX.isBrowser("Chrome"),JHe=rX.isBrowser("Firefox"),$4=ZHe||JHe?iX:function(e){},QHe={onBeforeInput:jHe,onBlur:zHe,onCompositionStart:UHe,onCopy:KHe,onCut:WHe,onDragOver:VHe,onDragStart:HHe,onFocus:qHe,onInput:GHe,onKeyDown:YHe,onPaste:XHe,onSelect:iX,onMouseUp:$4,onKeyUp:$4},eqe=QHe,tqe=Af,nqe=tqe.unstable_flushControlled,rqe=nqe;function iqe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var kT=T,O4=Ff,oqe=function(e){iqe(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.shouldComponentUpdate=function(i){return this.props.text!==i.text||this.props.editorState.getSelection().getHasFocus()!==i.editorState.getSelection().getHasFocus()},n.render=function(){var i=this.props.editorState.getSelection().getHasFocus(),o=O4({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":i}),a={whiteSpace:"pre-wrap"};return kT.createElement("div",{className:o},kT.createElement("div",{className:O4("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:a},this.props.text))},t}(kT.Component),aqe=oqe,oX=JI,bm=US,aX=uo,Au=aX.isPlatform("Mac OS X"),I4=Au&&aX.isBrowser("Firefox < 29"),_u=oX.hasCommandModifier,gl=oX.isCtrlKeyCommand;function sX(e){return Au&&e.altKey||gl(e)}function sqe(e){return _u(e)?e.shiftKey?"redo":"undo":null}function lqe(e){return!Au&&e.shiftKey?null:sX(e)?"delete-word":"delete"}function uqe(e){return _u(e)&&Au?"backspace-to-start-of-line":sX(e)?"backspace-word":"backspace"}function cqe(e){switch(e.keyCode){case 66:return _u(e)?"bold":null;case 68:return gl(e)?"delete":null;case 72:return gl(e)?"backspace":null;case 73:return _u(e)?"italic":null;case 74:return _u(e)?"code":null;case 75:return Au&&gl(e)?"secondary-cut":null;case 77:return gl(e)?"split-block":null;case 79:return gl(e)?"split-block":null;case 84:return Au&&gl(e)?"transpose-characters":null;case 85:return _u(e)?"underline":null;case 87:return Au&&gl(e)?"backspace-word":null;case 89:return gl(e)?Au?"secondary-paste":"redo":null;case 90:return sqe(e)||null;case bm.RETURN:return"split-block";case bm.DELETE:return lqe(e);case bm.BACKSPACE:return uqe(e);case bm.LEFT:return I4&&_u(e)?"move-selection-to-start-of-block":null;case bm.RIGHT:return I4&&_u(e)?"move-selection-to-end-of-block":null;default:return null}}var lX=cqe,fqe=Nf;function l$(){return l$=fqe||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l$.apply(this,arguments)}function TT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){St(e,i,n[i])})}return e}function Et(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function St(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var dqe=KI,pqe=GG,hqe=T9e,gqe=Q8e,mqe=A7e,vqe=eqe,D4=rqe,yqe=aqe,bqe=dY,_qe=zn,gu=T,xqe=YI,wqe=KS,Sqe=uo,RT=Ff,Cqe=qs,Eqe=lX,kqe=WS,Tqe=cc,P4=bn,L4=By,Rqe=lo,cX=Sqe.isBrowser("IE"),Aqe=!cX,M4={edit:vqe,composite:hqe,drag:mqe,cut:null,render:null},F4=!1,$qe=function(e){uX(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.render=function(){return null},n.componentDidMount=function(){this._update()},n.componentDidUpdate=function(){this._update()},n._update=function(){var i=this.props.editor;i._latestEditorState=this.props.editorState,i._blockSelectEvents=!0},t}(gu.Component),fX=function(e){uX(t,e);function t(r){var i;return i=e.call(this,r)||this,St(Et(i),"_blockSelectEvents",void 0),St(Et(i),"_clipboard",void 0),St(Et(i),"_handler",void 0),St(Et(i),"_dragCount",void 0),St(Et(i),"_internalDrag",void 0),St(Et(i),"_editorKey",void 0),St(Et(i),"_placeholderAccessibilityID",void 0),St(Et(i),"_latestEditorState",void 0),St(Et(i),"_latestCommittedEditorState",void 0),St(Et(i),"_pendingStateFromBeforeInput",void 0),St(Et(i),"_onBeforeInput",void 0),St(Et(i),"_onBlur",void 0),St(Et(i),"_onCharacterData",void 0),St(Et(i),"_onCompositionEnd",void 0),St(Et(i),"_onCompositionStart",void 0),St(Et(i),"_onCopy",void 0),St(Et(i),"_onCut",void 0),St(Et(i),"_onDragEnd",void 0),St(Et(i),"_onDragOver",void 0),St(Et(i),"_onDragStart",void 0),St(Et(i),"_onDrop",void 0),St(Et(i),"_onInput",void 0),St(Et(i),"_onFocus",void 0),St(Et(i),"_onKeyDown",void 0),St(Et(i),"_onKeyPress",void 0),St(Et(i),"_onKeyUp",void 0),St(Et(i),"_onMouseDown",void 0),St(Et(i),"_onMouseUp",void 0),St(Et(i),"_onPaste",void 0),St(Et(i),"_onSelect",void 0),St(Et(i),"editor",void 0),St(Et(i),"editorContainer",void 0),St(Et(i),"focus",void 0),St(Et(i),"blur",void 0),St(Et(i),"setMode",void 0),St(Et(i),"exitCurrentMode",void 0),St(Et(i),"restoreEditorDOM",void 0),St(Et(i),"setClipboard",void 0),St(Et(i),"getClipboard",void 0),St(Et(i),"getEditorKey",void 0),St(Et(i),"update",void 0),St(Et(i),"onDragEnter",void 0),St(Et(i),"onDragLeave",void 0),St(Et(i),"_handleEditorContainerRef",function(o){i.editorContainer=o,i.editor=o!==null?o.firstChild:null}),St(Et(i),"focus",function(o){var a=i.props.editorState,s=a.getSelection().getHasFocus(),l=i.editor;if(l){var u=wqe.getScrollParent(l),f=o||kqe(u),d=f.x,p=f.y;L4(l)||P4(!1),l.focus(),u===window?window.scrollTo(d,p):xqe.setTop(u,p),s||i.update(_qe.forceSelection(a,a.getSelection()))}}),St(Et(i),"blur",function(){var o=i.editor;o&&(L4(o)||P4(!1),o.blur())}),St(Et(i),"setMode",function(o){var a=i.props,s=a.onPaste,l=a.onCut,u=a.onCopy,f=TT({},M4.edit);s&&(f.onPaste=s),l&&(f.onCut=l),u&&(f.onCopy=u);var d=TT({},M4,{edit:f});i._handler=d[o]}),St(Et(i),"exitCurrentMode",function(){i.setMode("edit")}),St(Et(i),"restoreEditorDOM",function(o){i.setState({contentsKey:i.state.contentsKey+1},function(){i.focus(o)})}),St(Et(i),"setClipboard",function(o){i._clipboard=o}),St(Et(i),"getClipboard",function(){return i._clipboard}),St(Et(i),"update",function(o){i._latestEditorState=o,i.props.onChange(o)}),St(Et(i),"onDragEnter",function(){i._dragCount++}),St(Et(i),"onDragLeave",function(){i._dragCount--,i._dragCount===0&&i.exitCurrentMode()}),i._blockSelectEvents=!1,i._clipboard=null,i._handler=null,i._dragCount=0,i._editorKey=r.editorKey||Cqe(),i._placeholderAccessibilityID="placeholder-"+i._editorKey,i._latestEditorState=r.editorState,i._latestCommittedEditorState=r.editorState,i._onBeforeInput=i._buildHandler("onBeforeInput"),i._onBlur=i._buildHandler("onBlur"),i._onCharacterData=i._buildHandler("onCharacterData"),i._onCompositionEnd=i._buildHandler("onCompositionEnd"),i._onCompositionStart=i._buildHandler("onCompositionStart"),i._onCopy=i._buildHandler("onCopy"),i._onCut=i._buildHandler("onCut"),i._onDragEnd=i._buildHandler("onDragEnd"),i._onDragOver=i._buildHandler("onDragOver"),i._onDragStart=i._buildHandler("onDragStart"),i._onDrop=i._buildHandler("onDrop"),i._onInput=i._buildHandler("onInput"),i._onFocus=i._buildHandler("onFocus"),i._onKeyDown=i._buildHandler("onKeyDown"),i._onKeyPress=i._buildHandler("onKeyPress"),i._onKeyUp=i._buildHandler("onKeyUp"),i._onMouseDown=i._buildHandler("onMouseDown"),i._onMouseUp=i._buildHandler("onMouseUp"),i._onPaste=i._buildHandler("onPaste"),i._onSelect=i._buildHandler("onSelect"),i.getEditorKey=function(){return i._editorKey},i.state={contentsKey:0},i}var n=t.prototype;return n._buildHandler=function(i){var o=this;return function(a){if(!o.props.readOnly){var s=o._handler&&o._handler[i];s&&(D4?D4(function(){return s(o,a)}):s(o,a))}}},n._showPlaceholder=function(){return!!this.props.placeholder&&!this.props.editorState.isInCompositionMode()&&!this.props.editorState.getCurrentContent().hasText()},n._renderPlaceholder=function(){if(this._showPlaceholder()){var i={text:Rqe(this.props.placeholder),editorState:this.props.editorState,textAlignment:this.props.textAlignment,accessibilityID:this._placeholderAccessibilityID};return gu.createElement(yqe,i)}return null},n._renderARIADescribedBy=function(){var i=this.props.ariaDescribedBy||"",o=this._showPlaceholder()?this._placeholderAccessibilityID:"";return i.replace("{{editor_id_placeholder}}",o)||void 0},n.render=function(){var i=this.props,o=i.blockRenderMap,a=i.blockRendererFn,s=i.blockStyleFn,l=i.customStyleFn,u=i.customStyleMap,f=i.editorState,d=i.preventScroll,p=i.readOnly,g=i.textAlignment,v=i.textDirectionality,y=RT({"DraftEditor/root":!0,"DraftEditor/alignLeft":g==="left","DraftEditor/alignRight":g==="right","DraftEditor/alignCenter":g==="center"}),w={outline:"none",userSelect:"text",WebkitUserSelect:"text",whiteSpace:"pre-wrap",wordWrap:"break-word"},b=this.props.role||"textbox",x=b==="combobox"?!!this.props.ariaExpanded:null,C={blockRenderMap:o,blockRendererFn:a,blockStyleFn:s,customStyleMap:TT({},pqe,u),customStyleFn:l,editorKey:this._editorKey,editorState:f,preventScroll:d,textDirectionality:v};return gu.createElement("div",{className:y},this._renderPlaceholder(),gu.createElement("div",{className:RT("DraftEditor/editorContainer"),ref:this._handleEditorContainerRef},gu.createElement("div",{"aria-activedescendant":p?null:this.props.ariaActiveDescendantID,"aria-autocomplete":p?null:this.props.ariaAutoComplete,"aria-controls":p?null:this.props.ariaControls,"aria-describedby":this._renderARIADescribedBy(),"aria-expanded":p?null:x,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-multiline":this.props.ariaMultiline,"aria-owns":p?null:this.props.ariaOwneeID,autoCapitalize:this.props.autoCapitalize,autoComplete:this.props.autoComplete,autoCorrect:this.props.autoCorrect,className:RT({notranslate:!p,"public/DraftEditor/content":!0}),contentEditable:!p,"data-testid":this.props.webDriverTestID,onBeforeInput:this._onBeforeInput,onBlur:this._onBlur,onCompositionEnd:this._onCompositionEnd,onCompositionStart:this._onCompositionStart,onCopy:this._onCopy,onCut:this._onCut,onDragEnd:this._onDragEnd,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this._onDragOver,onDragStart:this._onDragStart,onDrop:this._onDrop,onFocus:this._onFocus,onInput:this._onInput,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseUp:this._onMouseUp,onPaste:this._onPaste,onSelect:this._onSelect,ref:this.props.editorRef,role:p?null:b,spellCheck:Aqe&&this.props.spellCheck,style:w,suppressContentEditableWarning:!0,tabIndex:this.props.tabIndex},gu.createElement($qe,{editor:this,editorState:f}),gu.createElement(gqe,l$({},C,{key:"contents"+this.state.contentsKey})))))},n.componentDidMount=function(){this._blockSelectEvents=!1,!F4&&Tqe("draft_ods_enabled")&&(F4=!0,bqe.initODS()),this.setMode("edit"),cX&&(this.editor?this.editor.ownerDocument.execCommand("AutoUrlDetect",!1,!1):ni.execCommand("AutoUrlDetect",!1,!1))},n.componentDidUpdate=function(){this._blockSelectEvents=!1,this._latestEditorState=this.props.editorState,this._latestCommittedEditorState=this.props.editorState},t}(gu.Component);St(fX,"defaultProps",{ariaDescribedBy:"{{editor_id_placeholder}}",blockRenderMap:dqe,blockRendererFn:function(){return null},blockStyleFn:function(){return""},keyBindingFn:Eqe,readOnly:!1,spellCheck:!1,stripPastedStyles:!1});var Oqe=fX,Iqe={},Dqe={stringify:function(t){return"_"+String(t)},unstringify:function(t){return t.slice(1)}},dX=Dqe,Pqe=dX,Lqe=zf,N4=Lqe.strlen;function Mqe(e,t){var n=[];return e.findEntityRanges(function(r){return!!r.getEntity()},function(r,i){var o=e.getText(),a=e.getEntityAt(r);n.push({offset:N4(o.slice(0,r)),length:N4(o.slice(r,i)),key:Number(t[Pqe.stringify(a)])})}),n}var Fqe=Mqe,B4=zf,Nqe=Dy,Bqe=function(t,n){return t===n},jqe=function(t){return!!t},zqe=[];function Uqe(e,t,n){var r=[],i=t.map(function(o){return o.has(n)}).toList();return Nqe(i,Bqe,jqe,function(o,a){var s=e.getText();r.push({offset:B4.strlen(s.slice(0,o)),length:B4.strlen(s.slice(o,a)),style:n})}),r}function Kqe(e){var t=e.getCharacterList().map(function(r){return r.getStyle()}).toList(),n=t.flatten().toSet().map(function(r){return Uqe(e,t,r)});return Array.prototype.concat.apply(zqe,n.toJS())}var Wqe=Kqe;function Vqe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Hqe(e,i,n[i])})}return e}function Hqe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qqe=Mf,Gqe=wa,pX=dX,Yqe=Fqe,Xqe=Wqe,Zqe=bn,j4=function(t,n){return{key:t.getKey(),text:t.getText(),type:t.getType(),depth:t.getDepth(),inlineStyleRanges:Xqe(t),entityRanges:Yqe(t,n),data:t.getData().toObject()}},Jqe=function(t,n,r,i){if(t instanceof qqe){r.push(j4(t,n));return}t instanceof Gqe||Zqe(!1);var o=t.getParentKey(),a=i[t.getKey()]=Vqe({},j4(t,n),{children:[]});if(o){i[o].children.push(a);return}r.push(a)},Qqe=function(t,n){var r=n.entityMap,i=[],o={},a={},s=0;return t.getBlockMap().forEach(function(l){l.findEntityRanges(function(u){return u.getEntity()!==null},function(u){var f=l.getEntityAt(u),d=pX.stringify(f);a[d]||(a[d]=f,r[d]="".concat(s),s++)}),Jqe(l,r,i,o)}),{blocks:i,entityMap:r}},eGe=function(t,n){var r=n.blocks,i=n.entityMap,o={};return Object.keys(i).forEach(function(a,s){var l=t.getEntity(pX.unstringify(a));o[s]={type:l.getType(),mutability:l.getMutability(),data:l.getData()}}),{blocks:r,entityMap:o}},tGe=function(t){var n={entityMap:{},blocks:[]};return n=Qqe(t,n),n=eGe(t,n),n},nGe=tGe;function Pm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){rGe(e,i,n[i])})}return e}function rGe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var iGe=qs,hX=bn,oGe=function(t,n){for(var r=[].concat(t).reverse();r.length;){var i=r.pop();n(i);var o=i.children;Array.isArray(o)||hX(!1),r=r.concat([].concat(o.reverse()))}},z4=function(t){if(!(t&&t.type))return!1;var n=t.type;return n==="unordered-list-item"||n==="ordered-list-item"},aGe=function(t){Array.isArray(t.children)&&(t.children=t.children.map(function(n){return n.type===t.type?Pm({},n,{depth:(t.depth||0)+1}):n}))},sGe={fromRawTreeStateToRawState:function(t){var n=t.blocks,r=[];return Array.isArray(n)||hX(!1),!Array.isArray(n)||!n.length?t:(oGe(n,function(i){var o=Pm({},i);z4(i)&&(o.depth=o.depth||0,aGe(i),i.children!=null&&i.children.length>0)||(delete o.children,r.push(o))}),t.blocks=r,Pm({},t,{blocks:r}))},fromRawStateToRawTreeState:function(t){var n=[],r=[];return t.blocks.forEach(function(i){var o=z4(i),a=i.depth||0,s=Pm({},i,{children:[]});if(!o){n.push(s);return}var l=r[0];if(l==null&&a===0)n.push(s);else if(l==null||l.depth<a-1){var u={key:iGe(),text:"",depth:a-1,type:i.type,children:[],entityRanges:[],inlineStyleRanges:[]};r.unshift(u),a===1?n.push(u):l!=null&&l.children.push(u),u.children.push(s)}else if(l.depth===a-1)l.children.push(s);else{for(;l!=null&&l.depth>=a;)r.shift(),l=r[0];a>0?l.children.push(s):n.push(s)}}),Pm({},t,{blocks:n})}},lGe=sGe,uGe=xa,cGe=cn,fGe=cGe.List;function dGe(e,t){var n=e.map(function(r,i){var o=t[i];return uGe.create({style:r,entity:o})});return fGe(n)}var pGe=dGe,hGe=zf,U4=hGe.substr;function gGe(e,t){var n=Array(e.length).fill(null);return t&&t.forEach(function(r){for(var i=U4(e,0,r.offset).length,o=i+U4(e,r.offset,r.length).length,a=i;a<o;a++)n[a]=r.key}),n}var mGe=gGe,vGe=zf,yGe=cn,bGe=yGe.OrderedSet,K4=vGe.substr,_Ge=bGe();function xGe(e,t){var n=Array(e.length).fill(_Ge);return t&&t.forEach(function(r){for(var i=K4(e,0,r.offset).length,o=i+K4(e,r.offset,r.length).length;i<o;)n[i]=n[i].add(r.style),i++}),n}var wGe=xGe;function Uv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){SGe(e,i,n[i])})}return e}function SGe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var CGe=Mf,W4=wa,EGe=NI,kGe=LS,V4=lGe,H4=MS,TGe=pGe,RGe=mGe,AGe=wGe,gX=qs,$Ge=cc,tD=cn,u$=bn,q4=$Ge("draft_tree_data_support"),G4=tD.List,OGe=tD.Map,mX=tD.OrderedMap,c$=function(t,n){var r=t.key,i=t.type,o=t.data,a=t.text,s=t.depth,l={text:a,depth:s||0,type:i||"unstyled",key:r||gX(),data:OGe(o),characterList:IGe(t,n)};return l},IGe=function(t,n){var r=t.text,i=t.entityRanges,o=t.inlineStyleRanges,a=i||[],s=o||[];return TGe(AGe(r,s),RGe(r,a.filter(function(l){return n.hasOwnProperty(l.key)}).map(function(l){return Uv({},l,{key:n[l.key]})})))},AT=function(t){return Uv({},t,{key:t.key||gX()})},Y4=function(t,n,r){var i=n.map(function(o){return Uv({},o,{parentRef:r})});return t.concat(i.reverse())},DGe=function(t,n){return t.map(AT).reduce(function(r,i,o){Array.isArray(i.children)||u$(!1);var a=i.children.map(AT),s=new W4(Uv({},c$(i,n),{prevSibling:o===0?null:t[o-1].key,nextSibling:o===t.length-1?null:t[o+1].key,children:G4(a.map(function(w){return w.key}))}));r=r.set(s.getKey(),s);for(var l=Y4([],a,s);l.length>0;){var u=l.pop(),f=u.parentRef,d=f.getChildKeys(),p=d.indexOf(u.key),g=Array.isArray(u.children);if(!g){g||u$(!1);break}var v=u.children.map(AT),y=new W4(Uv({},c$(u,n),{parent:f.getKey(),children:G4(v.map(function(w){return w.key})),prevSibling:p===0?null:d.get(p-1),nextSibling:p===d.size-1?null:d.get(p+1)}));r=r.set(y.getKey(),y),l=Y4(l,v,y)}return r},mX())},PGe=function(t,n){return mX(t.map(function(r){var i=new CGe(c$(r,n));return[i.getKey(),i]}))},LGe=function(t,n){var r=t.blocks.find(function(a){return Array.isArray(a.children)&&a.children.length>0}),i=q4&&!r?V4.fromRawStateToRawTreeState(t).blocks:t.blocks;if(!q4)return PGe(r?V4.fromRawTreeStateToRawState(t).blocks:i,n);var o=DGe(i,n);return o},MGe=function(t){var n=t.entityMap,r={};return Object.keys(n).forEach(function(i){var o=n[i],a=o.type,s=o.mutability,l=o.data;r[i]=kGe.__create(a,s,l||{})}),r},FGe=function(t){Array.isArray(t.blocks)||u$(!1);var n=MGe(t),r=LGe(t,n),i=r.isEmpty()?new H4:H4.createEmpty(r.first().getKey());return new EGe({blockMap:r,entityMap:n,selectionBefore:i,selectionAfter:i})},NGe=FGe,BGe=BY;function jGe(e){var t=BGe(e),n=0,r=0,i=0,o=0;if(t.length){if(t.length>1&&t[0].width===0){var a=t[1];n=a.top,r=a.right,i=a.bottom,o=a.left}else{var s=t[0];n=s.top,r=s.right,i=s.bottom,o=s.left}for(var l=1;l<t.length;l++){var u=t[l];u.height!==0&&u.width!==0&&(n=Math.min(n,u.top),r=Math.max(r,u.right),i=Math.max(i,u.bottom),o=Math.min(o,u.left))}}return{top:n,right:r,bottom:i,left:o,width:r-o,height:i-n}}var zGe=jGe,UGe=zGe;function KGe(e){var t=e.getSelection();if(!t.rangeCount)return null;var n=t.getRangeAt(0),r=UGe(n),i=r.top,o=r.right,a=r.bottom,s=r.left;return i===0&&o===0&&a===0&&s===0?null:r}var WGe=KGe,VGe=B6e,HGe=Iy,qGe=xa,GGe=H6e,YGe=Mf,XGe=NI,ZGe=KI,JGe=GG,QGe=Oqe,eYe=kY,tYe=LS,nYe=so,rYe=IG,iYe=zn,oYe=JI,aYe=Iqe,sYe=eX,lYe=MS,uYe=nGe,cYe=NGe,fYe=qs,dYe=lX,pYe=WGe,hYe=ZY,gYe={Editor:QGe,EditorBlock:eYe,EditorState:iYe,CompositeDecorator:GGe,Entity:tYe,EntityInstance:rYe,BlockMapBuilder:HGe,CharacterMetadata:qGe,ContentBlock:YGe,ContentState:XGe,RawDraftContentState:aYe,SelectionState:lYe,AtomicBlockUtils:VGe,KeyBindingUtil:oYe,Modifier:nYe,RichUtils:sYe,DefaultDraftBlockRenderMap:ZGe,DefaultDraftInlineStyle:JGe,convertFromHTML:hYe,convertFromRaw:cYe,convertToRaw:uYe,genKey:fYe,getDefaultKeyBinding:dYe,getVisibleSelectionRect:pYe},Rn=gYe,zy="delete",Hn=5,ia=1<<Hn,Ii=ia-1,nn={};function f$(){return{value:!1}}function oa(e){e&&(e.value=!0)}function nD(){}function Zp(e){return e.size===void 0&&(e.size=e.__iterate(vX)),e.size}function Hu(e,t){if(typeof t!="number"){var n=t>>>0;if(""+n!==t||n===4294967295)return NaN;t=n}return t<0?Zp(e)+t:t}function vX(){return!0}function qS(e,t,n){return(e===0&&!bX(e)||n!==void 0&&e<=-n)&&(t===void 0||n!==void 0&&t>=n)}function Uy(e,t){return yX(e,t,0)}function GS(e,t){return yX(e,t,t)}function yX(e,t,n){return e===void 0?n:bX(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function bX(e){return e<0||e===0&&1/e===-1/0}var _X="@@__IMMUTABLE_ITERABLE__@@";function io(e){return!!(e&&e[_X])}var xX="@@__IMMUTABLE_KEYED__@@";function Qn(e){return!!(e&&e[xX])}var wX="@@__IMMUTABLE_INDEXED__@@";function eo(e){return!!(e&&e[wX])}function YS(e){return Qn(e)||eo(e)}var Er=function(t){return io(t)?t:Do(t)},Sa=function(e){function t(n){return Qn(n)?n:fc(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Er),Uf=function(e){function t(n){return eo(n)?n:ns(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Er),Ch=function(e){function t(n){return io(n)&&!YS(n)?n:Rh(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Er);Er.Keyed=Sa;Er.Indexed=Uf;Er.Set=Ch;var SX="@@__IMMUTABLE_SEQ__@@";function rD(e){return!!(e&&e[SX])}var CX="@@__IMMUTABLE_RECORD__@@";function Eh(e){return!!(e&&e[CX])}function Gs(e){return io(e)||Eh(e)}var kh="@@__IMMUTABLE_ORDERED__@@";function Xa(e){return!!(e&&e[kh])}var Ky=0,Qa=1,ga=2,d$=typeof Symbol=="function"&&Symbol.iterator,EX="@@iterator",XS=d$||EX,mn=function(t){this.next=t};mn.prototype.toString=function(){return"[Iterator]"};mn.KEYS=Ky;mn.VALUES=Qa;mn.ENTRIES=ga;mn.prototype.inspect=mn.prototype.toSource=function(){return this.toString()};mn.prototype[XS]=function(){return this};function rr(e,t,n,r){var i=e===0?t:e===1?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function oo(){return{value:void 0,done:!0}}function kX(e){return Array.isArray(e)?!0:!!ZS(e)}function X4(e){return e&&typeof e.next=="function"}function p$(e){var t=ZS(e);return t&&t.call(e)}function ZS(e){var t=e&&(d$&&e[d$]||e[EX]);if(typeof t=="function")return t}function mYe(e){var t=ZS(e);return t&&t===e.entries}function vYe(e){var t=ZS(e);return t&&t===e.keys}var Th=Object.prototype.hasOwnProperty;function TX(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var Do=function(e){function t(n){return n==null?oD():Gs(n)?n.toSeq():bYe(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(r,i){var o=this._cache;if(o){for(var a=o.length,s=0;s!==a;){var l=o[i?a-++s:s++];if(r(l[1],l[0],this)===!1)break}return s}return this.__iterateUncached(r,i)},t.prototype.__iterator=function(r,i){var o=this._cache;if(o){var a=o.length,s=0;return new mn(function(){if(s===a)return oo();var l=o[i?a-++s:s++];return rr(r,l[0],l[1])})}return this.__iteratorUncached(r,i)},t}(Er),fc=function(e){function t(n){return n==null?oD().toKeyedSeq():io(n)?Qn(n)?n.toSeq():n.fromEntrySeq():Eh(n)?n.toSeq():aD(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(Do),ns=function(e){function t(n){return n==null?oD():io(n)?Qn(n)?n.entrySeq():n.toIndexedSeq():Eh(n)?n.toSeq().entrySeq():RX(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(Do),Rh=function(e){function t(n){return(io(n)&&!YS(n)?n:ns(n)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(Do);Do.isSeq=rD;Do.Keyed=fc;Do.Set=Rh;Do.Indexed=ns;Do.prototype[SX]=!0;var wf=function(e){function t(n){this._array=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,i){return this.has(r)?this._array[Hu(this,r)]:i},t.prototype.__iterate=function(r,i){for(var o=this._array,a=o.length,s=0;s!==a;){var l=i?a-++s:s++;if(r(o[l],l,this)===!1)break}return s},t.prototype.__iterator=function(r,i){var o=this._array,a=o.length,s=0;return new mn(function(){if(s===a)return oo();var l=i?a-++s:s++;return rr(r,l,o[l])})},t}(ns),iD=function(e){function t(n){var r=Object.keys(n).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n):[]);this._object=n,this._keys=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,i){return i!==void 0&&!this.has(r)?i:this._object[r]},t.prototype.has=function(r){return Th.call(this._object,r)},t.prototype.__iterate=function(r,i){for(var o=this._object,a=this._keys,s=a.length,l=0;l!==s;){var u=a[i?s-++l:l++];if(r(o[u],u,this)===!1)break}return l},t.prototype.__iterator=function(r,i){var o=this._object,a=this._keys,s=a.length,l=0;return new mn(function(){if(l===s)return oo();var u=a[i?s-++l:l++];return rr(r,u,o[u])})},t}(fc);iD.prototype[kh]=!0;var yYe=function(e){function t(n){this._collection=n,this.size=n.length||n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(r,i){if(i)return this.cacheResult().__iterate(r,i);var o=this._collection,a=p$(o),s=0;if(X4(a))for(var l;!(l=a.next()).done&&r(l.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(r,i){if(i)return this.cacheResult().__iterator(r,i);var o=this._collection,a=p$(o);if(!X4(a))return new mn(oo);var s=0;return new mn(function(){var l=a.next();return l.done?l:rr(r,s++,l.value)})},t}(ns),Z4;function oD(){return Z4||(Z4=new wf([]))}function aD(e){var t=sD(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new iD(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function RX(e){var t=sD(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function bYe(e){var t=sD(e);if(t)return mYe(e)?t.fromEntrySeq():vYe(e)?t.toSetSeq():t;if(typeof e=="object")return new iD(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function sD(e){return TX(e)?new wf(e):kX(e)?new yYe(e):void 0}var AX="@@__IMMUTABLE_MAP__@@";function lD(e){return!!(e&&e[AX])}function $X(e){return lD(e)&&Xa(e)}function J4(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function ko(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(J4(e)&&J4(t)&&e.equals(t))}var _m=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,n){t|=0,n|=0;var r=t&65535,i=n&65535;return r*i+((t>>>16)*i+r*(n>>>16)<<16>>>0)|0};function JS(e){return e>>>1&1073741824|e&3221225471}var _Ye=Object.prototype.valueOf;function xo(e){if(e==null)return Q4(e);if(typeof e.hashCode=="function")return JS(e.hashCode(e));var t=kYe(e);if(t==null)return Q4(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return xYe(t);case"string":return t.length>TYe?wYe(t):h$(t);case"object":case"function":return CYe(t);case"symbol":return SYe(t);default:if(typeof t.toString=="function")return h$(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function Q4(e){return e===null?1108378658:1108378659}function xYe(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return JS(t)}function wYe(e){var t=IT[e];return t===void 0&&(t=h$(e),OT===RYe&&(OT=0,IT={}),OT++,IT[e]=t),t}function h$(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return JS(t)}function SYe(e){var t=n5[e];return t!==void 0||(t=OX(),n5[e]=t),t}function CYe(e){var t;if(g$&&(t=m$.get(e),t!==void 0)||(t=e[Yc],t!==void 0)||!t5&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Yc],t!==void 0||(t=EYe(e),t!==void 0)))return t;if(t=OX(),g$)m$.set(e,t);else{if(e5!==void 0&&e5(e)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(t5)Object.defineProperty(e,Yc,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Yc]=t;else if(e.nodeType!==void 0)e[Yc]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}var e5=Object.isExtensible,t5=function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}}();function EYe(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function kYe(e){return e.valueOf!==_Ye&&typeof e.valueOf=="function"?e.valueOf(e):e}function OX(){var e=++$T;return $T&1073741824&&($T=0),e}var g$=typeof WeakMap=="function",m$;g$&&(m$=new WeakMap);var n5=Object.create(null),$T=0,Yc="__immutablehash__";typeof Symbol=="function"&&(Yc=Symbol(Yc));var TYe=16,RYe=255,OT=0,IT={},QS=function(e){function t(n,r){this._iter=n,this._useKeys=r,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,i){return this._iter.get(r,i)},t.prototype.has=function(r){return this._iter.has(r)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var r=this,i=uD(this,!0);return this._useKeys||(i.valueSeq=function(){return r._iter.toSeq().reverse()}),i},t.prototype.map=function(r,i){var o=this,a=MX(this,r,i);return this._useKeys||(a.valueSeq=function(){return o._iter.toSeq().map(r,i)}),a},t.prototype.__iterate=function(r,i){var o=this;return this._iter.__iterate(function(a,s){return r(a,s,o)},i)},t.prototype.__iterator=function(r,i){return this._iter.__iterator(r,i)},t}(fc);QS.prototype[kh]=!0;var IX=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(r){return this._iter.includes(r)},t.prototype.__iterate=function(r,i){var o=this,a=0;return i&&Zp(this),this._iter.__iterate(function(s){return r(s,i?o.size-++a:a++,o)},i)},t.prototype.__iterator=function(r,i){var o=this,a=this._iter.__iterator(Qa,i),s=0;return i&&Zp(this),new mn(function(){var l=a.next();return l.done?l:rr(r,i?o.size-++s:s++,l.value,l)})},t}(ns),DX=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(r){return this._iter.includes(r)},t.prototype.__iterate=function(r,i){var o=this;return this._iter.__iterate(function(a){return r(a,a,o)},i)},t.prototype.__iterator=function(r,i){var o=this._iter.__iterator(Qa,i);return new mn(function(){var a=o.next();return a.done?a:rr(r,a.value,a.value,a)})},t}(Rh),PX=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(r,i){var o=this;return this._iter.__iterate(function(a){if(a){i5(a);var s=io(a);return r(s?a.get(1):a[1],s?a.get(0):a[0],o)}},i)},t.prototype.__iterator=function(r,i){var o=this._iter.__iterator(Qa,i);return new mn(function(){for(;;){var a=o.next();if(a.done)return a;var s=a.value;if(s){i5(s);var l=io(s);return rr(r,l?s.get(0):s[0],l?s.get(1):s[1],a)}}})},t}(fc);IX.prototype.cacheResult=QS.prototype.cacheResult=DX.prototype.cacheResult=PX.prototype.cacheResult=dD;function LX(e){var t=Ys(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var n=e.reverse.apply(this);return n.flip=function(){return e.reverse()},n},t.has=function(n){return e.includes(n)},t.includes=function(n){return e.has(n)},t.cacheResult=dD,t.__iterateUncached=function(n,r){var i=this;return e.__iterate(function(o,a){return n(a,o,i)!==!1},r)},t.__iteratorUncached=function(n,r){if(n===ga){var i=e.__iterator(n,r);return new mn(function(){var o=i.next();if(!o.done){var a=o.value[0];o.value[0]=o.value[1],o.value[1]=a}return o})}return e.__iterator(n===Qa?Ky:Qa,r)},t}function MX(e,t,n){var r=Ys(e);return r.size=e.size,r.has=function(i){return e.has(i)},r.get=function(i,o){var a=e.get(i,nn);return a===nn?o:t.call(n,a,i,e)},r.__iterateUncached=function(i,o){var a=this;return e.__iterate(function(s,l,u){return i(t.call(n,s,l,u),l,a)!==!1},o)},r.__iteratorUncached=function(i,o){var a=e.__iterator(ga,o);return new mn(function(){var s=a.next();if(s.done)return s;var l=s.value,u=l[0];return rr(i,u,t.call(n,l[1],u,e),s)})},r}function uD(e,t){var n=this,r=Ys(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var i=LX(e);return i.reverse=function(){return e.flip()},i}),r.get=function(i,o){return e.get(t?i:-1-i,o)},r.has=function(i){return e.has(t?i:-1-i)},r.includes=function(i){return e.includes(i)},r.cacheResult=dD,r.__iterate=function(i,o){var a=this,s=0;return o&&Zp(e),e.__iterate(function(l,u){return i(l,t?u:o?a.size-++s:s++,a)},!o)},r.__iterator=function(i,o){var a=0;o&&Zp(e);var s=e.__iterator(ga,!o);return new mn(function(){var l=s.next();if(l.done)return l;var u=l.value;return rr(i,t?u[0]:o?n.size-++a:a++,u[1],l)})},r}function FX(e,t,n,r){var i=Ys(e);return r&&(i.has=function(o){var a=e.get(o,nn);return a!==nn&&!!t.call(n,a,o,e)},i.get=function(o,a){var s=e.get(o,nn);return s!==nn&&t.call(n,s,o,e)?s:a}),i.__iterateUncached=function(o,a){var s=this,l=0;return e.__iterate(function(u,f,d){if(t.call(n,u,f,d))return l++,o(u,r?f:l-1,s)},a),l},i.__iteratorUncached=function(o,a){var s=e.__iterator(ga,a),l=0;return new mn(function(){for(;;){var u=s.next();if(u.done)return u;var f=u.value,d=f[0],p=f[1];if(t.call(n,p,d,e))return rr(o,r?d:l++,p,u)}})},i}function AYe(e,t,n){var r=$h().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(a){return a+1})}),r.asImmutable()}function $Ye(e,t,n){var r=Qn(e),i=(Xa(e)?Fl():$h()).asMutable();e.__iterate(function(a,s){i.update(t.call(n,a,s,e),function(l){return l=l||[],l.push(r?[s,a]:a),l})});var o=fD(e);return i.map(function(a){return In(e,o(a))}).asImmutable()}function OYe(e,t,n){var r=Qn(e),i=[[],[]];e.__iterate(function(a,s){i[t.call(n,a,s,e)?1:0].push(r?[s,a]:a)});var o=fD(e);return i.map(function(a){return In(e,o(a))})}function cD(e,t,n,r){var i=e.size;if(qS(t,n,i))return e;var o=Uy(t,i),a=GS(n,i);if(o!==o||a!==a)return cD(e.toSeq().cacheResult(),t,n,r);var s=a-o,l;s===s&&(l=s<0?0:s);var u=Ys(e);return u.size=l===0?l:e.size&&l||void 0,!r&&rD(e)&&l>=0&&(u.get=function(f,d){return f=Hu(this,f),f>=0&&f<l?e.get(f+o,d):d}),u.__iterateUncached=function(f,d){var p=this;if(l===0)return 0;if(d)return this.cacheResult().__iterate(f,d);var g=0,v=!0,y=0;return e.__iterate(function(w,b){if(!(v&&(v=g++<o)))return y++,f(w,r?b:y-1,p)!==!1&&y!==l}),y},u.__iteratorUncached=function(f,d){if(l!==0&&d)return this.cacheResult().__iterator(f,d);if(l===0)return new mn(oo);var p=e.__iterator(f,d),g=0,v=0;return new mn(function(){for(;g++<o;)p.next();if(++v>l)return oo();var y=p.next();return r||f===Qa||y.done?y:f===Ky?rr(f,v-1,void 0,y):rr(f,v-1,y.value[1],y)})},u}function IYe(e,t,n){var r=Ys(e);return r.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=0;return e.__iterate(function(l,u,f){return t.call(n,l,u,f)&&++s&&i(l,u,a)}),s},r.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(ga,o),l=!0;return new mn(function(){if(!l)return oo();var u=s.next();if(u.done)return u;var f=u.value,d=f[0],p=f[1];return t.call(n,p,d,a)?i===ga?u:rr(i,d,p,u):(l=!1,oo())})},r}function NX(e,t,n,r){var i=Ys(e);return i.__iterateUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterate(o,a);var l=!0,u=0;return e.__iterate(function(f,d,p){if(!(l&&(l=t.call(n,f,d,p))))return u++,o(f,r?d:u-1,s)}),u},i.__iteratorUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterator(o,a);var l=e.__iterator(ga,a),u=!0,f=0;return new mn(function(){var d,p,g;do{if(d=l.next(),d.done)return r||o===Qa?d:o===Ky?rr(o,f++,void 0,d):rr(o,f++,d.value[1],d);var v=d.value;p=v[0],g=v[1],u&&(u=t.call(n,g,p,s))}while(u);return o===ga?d:rr(o,p,g,d)})},i}function DYe(e,t){var n=Qn(e),r=[e].concat(t).map(function(a){return io(a)?n&&(a=Sa(a)):a=n?aD(a):RX(Array.isArray(a)?a:[a]),a}).filter(function(a){return a.size!==0});if(r.length===0)return e;if(r.length===1){var i=r[0];if(i===e||n&&Qn(i)||eo(e)&&eo(i))return i}var o=new wf(r);return n?o=o.toKeyedSeq():eo(e)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=r.reduce(function(a,s){if(a!==void 0){var l=s.size;if(l!==void 0)return a+l}},0),o}function BX(e,t,n){var r=Ys(e);return r.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,s=!1;function l(u,f){u.__iterate(function(d,p){return(!t||f<t)&&io(d)?l(d,f+1):(a++,i(d,n?p:a-1,r)===!1&&(s=!0)),!s},o)}return l(e,0),a},r.__iteratorUncached=function(i,o){if(o)return this.cacheResult().__iterator(i,o);var a=e.__iterator(i,o),s=[],l=0;return new mn(function(){for(;a;){var u=a.next();if(u.done!==!1){a=s.pop();continue}var f=u.value;if(i===ga&&(f=f[1]),(!t||s.length<t)&&io(f))s.push(a),a=f.__iterator(i,o);else return n?u:rr(i,l++,f,u)}return oo()})},r}function PYe(e,t,n){var r=fD(e);return e.toSeq().map(function(i,o){return r(t.call(n,i,o,e))}).flatten(!0)}function LYe(e,t){var n=Ys(e);return n.size=e.size&&e.size*2-1,n.__iterateUncached=function(r,i){var o=this,a=0;return e.__iterate(function(s){return(!a||r(t,a++,o)!==!1)&&r(s,a++,o)!==!1},i),a},n.__iteratorUncached=function(r,i){var o=e.__iterator(Qa,i),a=0,s;return new mn(function(){return(!s||a%2)&&(s=o.next(),s.done)?s:a%2?rr(r,a++,t):rr(r,a++,s.value,s)})},n}function Jp(e,t,n){t||(t=jX);var r=Qn(e),i=0,o=e.toSeq().map(function(a,s){return[s,a,i++,n?n(a,s,e):a]}).valueSeq().toArray();return o.sort(function(a,s){return t(a[3],s[3])||a[2]-s[2]}).forEach(r?function(a,s){o[s].length=2}:function(a,s){o[s]=a[1]}),r?fc(o):eo(e)?ns(o):Rh(o)}function pb(e,t,n){if(t||(t=jX),n){var r=e.toSeq().map(function(i,o){return[i,n(i,o,e)]}).reduce(function(i,o){return r5(t,i[1],o[1])?o:i});return r&&r[0]}return e.reduce(function(i,o){return r5(t,i,o)?o:i})}function r5(e,t,n){var r=e(n,t);return r===0&&n!==t&&(n==null||n!==n)||r>0}function hb(e,t,n,r){var i=Ys(e),o=new wf(n).map(function(a){return a.size});return i.size=r?o.max():o.min(),i.__iterate=function(a,s){for(var l=this.__iterator(Qa,s),u,f=0;!(u=l.next()).done&&a(u.value,f++,this)!==!1;);return f},i.__iteratorUncached=function(a,s){var l=n.map(function(d){return d=Er(d),p$(s?d.reverse():d)}),u=0,f=!1;return new mn(function(){var d;return f||(d=l.map(function(p){return p.next()}),f=r?d.every(function(p){return p.done}):d.some(function(p){return p.done})),f?oo():rr(a,u++,t.apply(null,d.map(function(p){return p.value})))})},i}function In(e,t){return e===t?e:rD(e)?t:e.constructor(t)}function i5(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function fD(e){return Qn(e)?Sa:eo(e)?Uf:Ch}function Ys(e){return Object.create((Qn(e)?fc:eo(e)?ns:Rh).prototype)}function dD(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Do.prototype.cacheResult.call(this)}function jX(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e<t?-1:0}function $s(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function pD(e,t){if(!e)throw new Error(t)}function Co(e){pD(e!==1/0,"Cannot perform this action with an infinite size.")}function zX(e){if(TX(e)&&typeof e!="string")return e;if(Xa(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}var MYe=Object.prototype.toString;function FYe(e){if(!e||typeof e!="object"||MYe.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t,r=Object.getPrototypeOf(t);r!==null;)n=r,r=Object.getPrototypeOf(n);return n===t}function qu(e){return typeof e=="object"&&(Gs(e)||Array.isArray(e)||FYe(e))}function Kv(e){try{return typeof e=="string"?JSON.stringify(e):String(e)}catch{return JSON.stringify(e)}}function NYe(e,t){return Gs(e)?e.has(t):qu(e)&&Th.call(e,t)}function UX(e,t,n){return Gs(e)?e.get(t,n):NYe(e,t)?typeof e.get=="function"?e.get(t):e[t]:n}function dx(e){if(Array.isArray(e))return $s(e);var t={};for(var n in e)Th.call(e,n)&&(t[n]=e[n]);return t}function BYe(e,t){if(!qu(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Gs(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!Th.call(e,t))return e;var n=dx(e);return Array.isArray(n)?n.splice(t,1):delete n[t],n}function jYe(e,t,n){if(!qu(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Gs(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,n)}if(Th.call(e,t)&&n===e[t])return e;var r=dx(e);return r[t]=n,r}function Ah(e,t,n,r){r||(r=n,n=void 0);var i=KX(Gs(e),e,zX(t),0,n,r);return i===nn?n:i}function KX(e,t,n,r,i,o){var a=t===nn;if(r===n.length){var s=a?i:t,l=o(s);return l===s?t:l}if(!a&&!qu(t))throw new TypeError("Cannot update within non-data-structure value in path ["+n.slice(0,r).map(Kv)+"]: "+t);var u=n[r],f=a?nn:UX(t,u,nn),d=KX(f===nn?e:Gs(f),f,n,r+1,i,o);return d===f?t:d===nn?BYe(t,u):jYe(a?e?Wa():{}:t,u,d)}function zYe(e,t,n){return Ah(e,t,nn,function(){return n})}function hD(e,t){return zYe(this,e,t)}function UYe(e,t){return Ah(e,t,function(){return nn})}function gD(e){return UYe(this,e)}function WX(e,t,n,r){return Ah(e,[t],n,r)}function mD(e,t,n){return arguments.length===1?e(this):WX(this,e,t,n)}function vD(e,t,n){return Ah(this,e,t,n)}function VX(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return qX(this,e)}function HX(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return qX(this,t,e)}function qX(e,t,n){for(var r=[],i=0;i<t.length;i++){var o=Sa(t[i]);o.size!==0&&r.push(o)}return r.length===0?e:e.toSeq().size===0&&!e.__ownerID&&r.length===1?e.constructor(r[0]):e.withMutations(function(a){for(var s=n?function(u,f){WX(a,f,nn,function(d){return d===nn?u:n(d,u,f)})}:function(u,f){a.set(f,u)},l=0;l<r.length;l++)r[l].forEach(s)})}function yD(e,t,n){return bD(e,t,KYe(n))}function bD(e,t,n){if(!qu(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Gs(e))return typeof n=="function"&&e.mergeWith?e.mergeWith.apply(e,[n].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var r=Array.isArray(e),i=e,o=r?Uf:Sa,a=r?function(l){i===e&&(i=dx(i)),i.push(l)}:function(l,u){var f=Th.call(i,u),d=f&&n?n(i[u],l,u):l;(!f||d!==i[u])&&(i===e&&(i=dx(i)),i[u]=d)},s=0;s<t.length;s++)o(t[s]).forEach(a);return i}function KYe(e){function t(n,r,i){return qu(n)&&qu(r)&&WYe(n,r)?bD(n,[r],t):e?e(n,r,i):r}return t}function WYe(e,t){var n=Do(e),r=Do(t);return eo(n)===eo(r)&&Qn(n)===Qn(r)}function GX(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return yD(this,e)}function YX(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return yD(this,t,e)}function _D(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ah(this,e,Wa(),function(r){return bD(r,t)})}function xD(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ah(this,e,Wa(),function(r){return yD(r,t)})}function Wy(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Vy(){return this.__ownerID?this:this.__ensureOwner(new nD)}function Hy(){return this.__ensureOwner()}function wD(){return this.__altered}var $h=function(e){function t(n){return n==null?Wa():lD(n)&&!Xa(n)?n:Wa().withMutations(function(r){var i=e(n);Co(i.size),i.forEach(function(o,a){return r.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return Wa().withMutations(function(o){for(var a=0;a<r.length;a+=2){if(a+1>=r.length)throw new Error("Missing value for key: "+r[a]);o.set(r[a],r[a+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(r,i){return this._root?this._root.get(0,void 0,r,i):i},t.prototype.set=function(r,i){return s5(this,r,i)},t.prototype.remove=function(r){return s5(this,r,nn)},t.prototype.deleteAll=function(r){var i=Er(r);return i.size===0?this:this.withMutations(function(o){i.forEach(function(a){return o.remove(a)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Wa()},t.prototype.sort=function(r){return Fl(Jp(this,r))},t.prototype.sortBy=function(r,i){return Fl(Jp(this,i,r))},t.prototype.map=function(r,i){var o=this;return this.withMutations(function(a){a.forEach(function(s,l){a.set(l,r.call(i,s,l,o))})})},t.prototype.__iterator=function(r,i){return new VYe(this,r,i)},t.prototype.__iterate=function(r,i){var o=this,a=0;return this._root&&this._root.iterate(function(s){return a++,r(s[1],s[0],o)},i),a},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?SD(this.size,this._root,r,this.__hash):this.size===0?Wa():(this.__ownerID=r,this.__altered=!1,this)},t}(Sa);$h.isMap=lD;var Gn=$h.prototype;Gn[AX]=!0;Gn[zy]=Gn.remove;Gn.removeAll=Gn.deleteAll;Gn.setIn=hD;Gn.removeIn=Gn.deleteIn=gD;Gn.update=mD;Gn.updateIn=vD;Gn.merge=Gn.concat=VX;Gn.mergeWith=HX;Gn.mergeDeep=GX;Gn.mergeDeepWith=YX;Gn.mergeIn=_D;Gn.mergeDeepIn=xD;Gn.withMutations=Wy;Gn.wasAltered=wD;Gn.asImmutable=Hy;Gn["@@transducer/init"]=Gn.asMutable=Vy;Gn["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Gn["@@transducer/result"]=function(e){return e.asImmutable()};var Wv=function(t,n){this.ownerID=t,this.entries=n};Wv.prototype.get=function(t,n,r,i){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(ko(r,o[a][0]))return o[a][1];return i};Wv.prototype.update=function(t,n,r,i,o,a,s){for(var l=o===nn,u=this.entries,f=0,d=u.length;f<d&&!ko(i,u[f][0]);f++);var p=f<d;if(p?u[f][1]===o:l)return this;if(oa(s),(l||!p)&&oa(a),!(l&&u.length===1)){if(!p&&!l&&u.length>=ZYe)return HYe(t,u,i,o);var g=t&&t===this.ownerID,v=g?u:$s(u);return p?l?f===d-1?v.pop():v[f]=v.pop():v[f]=[i,o]:v.push([i,o]),g?(this.entries=v,this):new Wv(t,v)}};var Qp=function(t,n,r){this.ownerID=t,this.bitmap=n,this.nodes=r};Qp.prototype.get=function(t,n,r,i){n===void 0&&(n=xo(r));var o=1<<((t===0?n:n>>>t)&Ii),a=this.bitmap;return a&o?this.nodes[XX(a&o-1)].get(t+Hn,n,r,i):i};Qp.prototype.update=function(t,n,r,i,o,a,s){r===void 0&&(r=xo(i));var l=(n===0?r:r>>>n)&Ii,u=1<<l,f=this.bitmap,d=(f&u)!==0;if(!d&&o===nn)return this;var p=XX(f&u-1),g=this.nodes,v=d?g[p]:void 0,y=CD(v,t,n+Hn,r,i,o,a,s);if(y===v)return this;if(!d&&y&&g.length>=JYe)return GYe(t,g,f,l,y);if(d&&!y&&g.length===2&&l5(g[p^1]))return g[p^1];if(d&&y&&g.length===1&&l5(y))return y;var w=t&&t===this.ownerID,b=d?y?f:f^u:f|u,x=d?y?ZX(g,p,y,w):XYe(g,p,w):YYe(g,p,y,w);return w?(this.bitmap=b,this.nodes=x,this):new Qp(t,b,x)};var Vv=function(t,n,r){this.ownerID=t,this.count=n,this.nodes=r};Vv.prototype.get=function(t,n,r,i){n===void 0&&(n=xo(r));var o=(t===0?n:n>>>t)&Ii,a=this.nodes[o];return a?a.get(t+Hn,n,r,i):i};Vv.prototype.update=function(t,n,r,i,o,a,s){r===void 0&&(r=xo(i));var l=(n===0?r:r>>>n)&Ii,u=o===nn,f=this.nodes,d=f[l];if(u&&!d)return this;var p=CD(d,t,n+Hn,r,i,o,a,s);if(p===d)return this;var g=this.count;if(!d)g++;else if(!p&&(g--,g<QYe))return qYe(t,f,g,l);var v=t&&t===this.ownerID,y=ZX(f,l,p,v);return v?(this.count=g,this.nodes=y,this):new Vv(t,g,y)};var eh=function(t,n,r){this.ownerID=t,this.keyHash=n,this.entries=r};eh.prototype.get=function(t,n,r,i){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(ko(r,o[a][0]))return o[a][1];return i};eh.prototype.update=function(t,n,r,i,o,a,s){r===void 0&&(r=xo(i));var l=o===nn;if(r!==this.keyHash)return l?this:(oa(s),oa(a),ED(this,t,n,r,[i,o]));for(var u=this.entries,f=0,d=u.length;f<d&&!ko(i,u[f][0]);f++);var p=f<d;if(p?u[f][1]===o:l)return this;if(oa(s),(l||!p)&&oa(a),l&&d===2)return new Ml(t,this.keyHash,u[f^1]);var g=t&&t===this.ownerID,v=g?u:$s(u);return p?l?f===d-1?v.pop():v[f]=v.pop():v[f]=[i,o]:v.push([i,o]),g?(this.entries=v,this):new eh(t,this.keyHash,v)};var Ml=function(t,n,r){this.ownerID=t,this.keyHash=n,this.entry=r};Ml.prototype.get=function(t,n,r,i){return ko(r,this.entry[0])?this.entry[1]:i};Ml.prototype.update=function(t,n,r,i,o,a,s){var l=o===nn,u=ko(i,this.entry[0]);if(u?o===this.entry[1]:l)return this;if(oa(s),l){oa(a);return}return u?t&&t===this.ownerID?(this.entry[1]=o,this):new Ml(t,this.keyHash,[i,o]):(oa(a),ED(this,t,n,xo(i),[i,o]))};Wv.prototype.iterate=eh.prototype.iterate=function(e,t){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(e(n[t?i-r:r])===!1)return!1};Qp.prototype.iterate=Vv.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[t?i-r:r];if(o&&o.iterate(e,t)===!1)return!1}};Ml.prototype.iterate=function(e,t){return e(this.entry)};var VYe=function(e){function t(n,r,i){this._type=r,this._reverse=i,this._stack=n._root&&o5(n._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var r=this._type,i=this._stack;i;){var o=i.node,a=i.index++,s=void 0;if(o.entry){if(a===0)return DT(r,o.entry)}else if(o.entries){if(s=o.entries.length-1,a<=s)return DT(r,o.entries[this._reverse?s-a:a])}else if(s=o.nodes.length-1,a<=s){var l=o.nodes[this._reverse?s-a:a];if(l){if(l.entry)return DT(r,l.entry);i=this._stack=o5(l,i)}continue}i=this._stack=this._stack.__prev}return oo()},t}(mn);function DT(e,t){return rr(e,t[0],t[1])}function o5(e,t){return{node:e,index:0,__prev:t}}function SD(e,t,n,r){var i=Object.create(Gn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var a5;function Wa(){return a5||(a5=SD(0))}function s5(e,t,n){var r,i;if(e._root){var o=f$(),a=f$();if(r=CD(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===nn?-1:1:0)}else{if(n===nn)return e;i=1,r=new Wv(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?SD(i,r):Wa()}function CD(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===nn?e:(oa(s),oa(a),new Ml(t,r,[i,o]))}function l5(e){return e.constructor===Ml||e.constructor===eh}function ED(e,t,n,r,i){if(e.keyHash===r)return new eh(t,r,[e.entry,i]);var o=(n===0?e.keyHash:e.keyHash>>>n)&Ii,a=(n===0?r:r>>>n)&Ii,s,l=o===a?[ED(e,t,n+Hn,r,i)]:(s=new Ml(t,r,i),o<a?[e,s]:[s,e]);return new Qp(t,1<<o|1<<a,l)}function HYe(e,t,n,r){e||(e=new nD);for(var i=new Ml(e,xo(n),[n,r]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function qYe(e,t,n,r){for(var i=0,o=0,a=new Array(n),s=0,l=1,u=t.length;s<u;s++,l<<=1){var f=t[s];f!==void 0&&s!==r&&(i|=l,a[o++]=f)}return new Qp(e,i,a)}function GYe(e,t,n,r,i){for(var o=0,a=new Array(ia),s=0;n!==0;s++,n>>>=1)a[s]=n&1?t[o++]:void 0;return a[r]=i,new Vv(e,o+1,a)}function XX(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function ZX(e,t,n,r){var i=r?e:$s(e);return i[t]=n,i}function YYe(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=n,a=-1):o[s]=e[s+a];return o}function XYe(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a<r;a++)a===t&&(o=1),i[a]=e[a+o];return i}var ZYe=ia/4,JYe=ia/2,QYe=ia/4,JX="@@__IMMUTABLE_LIST__@@";function QX(e){return!!(e&&e[JX])}var eC=function(e){function t(n){var r=Qb();if(n==null)return r;if(QX(n))return n;var i=e(n),o=i.size;return o===0?r:(Co(o),o>0&&o<ia?Hv(0,o,Hn,null,new ju(i.toArray())):r.withMutations(function(a){a.setSize(o),i.forEach(function(s,l){return a.set(l,s)})}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(r,i){if(r=Hu(this,r),r>=0&&r<this.size){r+=this._origin;var o=eZ(this,r);return o&&o.array[r&Ii]}return i},t.prototype.set=function(r,i){return eXe(this,r,i)},t.prototype.remove=function(r){return this.has(r)?r===0?this.shift():r===this.size-1?this.pop():this.splice(r,1):this},t.prototype.insert=function(r,i){return this.splice(r,0,i)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Hn,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):Qb()},t.prototype.push=function(){var r=arguments,i=this.size;return this.withMutations(function(o){xu(o,0,i+r.length);for(var a=0;a<r.length;a++)o.set(i+a,r[a])})},t.prototype.pop=function(){return xu(this,0,-1)},t.prototype.unshift=function(){var r=arguments;return this.withMutations(function(i){xu(i,-r.length);for(var o=0;o<r.length;o++)i.set(o,r[o])})},t.prototype.shift=function(){return xu(this,1)},t.prototype.concat=function(){for(var r=arguments,i=[],o=0;o<arguments.length;o++){var a=r[o],s=e(typeof a!="string"&&kX(a)?a:[a]);s.size!==0&&i.push(s)}return i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(l){i.forEach(function(u){return u.forEach(function(f){return l.push(f)})})})},t.prototype.setSize=function(r){return xu(this,0,r)},t.prototype.map=function(r,i){var o=this;return this.withMutations(function(a){for(var s=0;s<o.size;s++)a.set(s,r.call(i,a.get(s),s,o))})},t.prototype.slice=function(r,i){var o=this.size;return qS(r,i,o)?this:xu(this,Uy(r,o),GS(i,o))},t.prototype.__iterator=function(r,i){var o=i?this.size:0,a=u5(this,i);return new mn(function(){var s=a();return s===fv?oo():rr(r,i?--o:o++,s)})},t.prototype.__iterate=function(r,i){for(var o=i?this.size:0,a=u5(this,i),s;(s=a())!==fv&&r(s,i?--o:o++,this)!==!1;);return o},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?Hv(this._origin,this._capacity,this._level,this._root,this._tail,r,this.__hash):this.size===0?Qb():(this.__ownerID=r,this.__altered=!1,this)},t}(Uf);eC.isList=QX;var Ir=eC.prototype;Ir[JX]=!0;Ir[zy]=Ir.remove;Ir.merge=Ir.concat;Ir.setIn=hD;Ir.deleteIn=Ir.removeIn=gD;Ir.update=mD;Ir.updateIn=vD;Ir.mergeIn=_D;Ir.mergeDeepIn=xD;Ir.withMutations=Wy;Ir.wasAltered=wD;Ir.asImmutable=Hy;Ir["@@transducer/init"]=Ir.asMutable=Vy;Ir["@@transducer/step"]=function(e,t){return e.push(t)};Ir["@@transducer/result"]=function(e){return e.asImmutable()};var ju=function(t,n){this.array=t,this.ownerID=n};ju.prototype.removeBefore=function(t,n,r){if(r===n?1<<n:this.array.length===0)return this;var i=r>>>n&Ii;if(i>=this.array.length)return new ju([],t);var o=i===0,a;if(n>0){var s=this.array[i];if(a=s&&s.removeBefore(t,n-Hn,r),a===s&&o)return this}if(o&&!a)return this;var l=th(this,t);if(!o)for(var u=0;u<i;u++)l.array[u]=void 0;return a&&(l.array[i]=a),l};ju.prototype.removeAfter=function(t,n,r){if(r===(n?1<<n:0)||this.array.length===0)return this;var i=r-1>>>n&Ii;if(i>=this.array.length)return this;var o;if(n>0){var a=this.array[i];if(o=a&&a.removeAfter(t,n-Hn,r),o===a&&i===this.array.length-1)return this}var s=th(this,t);return s.array.splice(i+1),o&&(s.array[i]=o),s};var fv={};function u5(e,t){var n=e._origin,r=e._capacity,i=qv(r),o=e._tail;return a(e._root,e._level,0);function a(u,f,d){return f===0?s(u,d):l(u,f,d)}function s(u,f){var d=f===i?o&&o.array:u&&u.array,p=f>n?0:n-f,g=r-f;return g>ia&&(g=ia),function(){if(p===g)return fv;var v=t?--g:p++;return d&&d[v]}}function l(u,f,d){var p,g=u&&u.array,v=d>n?0:n-d>>f,y=(r-d>>f)+1;return y>ia&&(y=ia),function(){for(;;){if(p){var w=p();if(w!==fv)return w;p=null}if(v===y)return fv;var b=t?--y:v++;p=a(g&&g[b],f-Hn,d+(b<<f))}}}}function Hv(e,t,n,r,i,o,a){var s=Object.create(Ir);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}var c5;function Qb(){return c5||(c5=Hv(0,0,Hn))}function eXe(e,t,n){if(t=Hu(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(a){t<0?xu(a,t).set(0,n):xu(a,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=f$();return t>=qv(e._capacity)?r=v$(r,e.__ownerID,0,t,n,o):i=v$(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Hv(e._origin,e._capacity,e._level,i,r):e}function v$(e,t,n,r,i,o){var a=r>>>n&Ii,s=e&&a<e.array.length;if(!s&&i===void 0)return e;var l;if(n>0){var u=e&&e.array[a],f=v$(u,t,n-Hn,r,i,o);return f===u?e:(l=th(e,t),l.array[a]=f,l)}return s&&e.array[a]===i?e:(o&&oa(o),l=th(e,t),i===void 0&&a===l.array.length-1?l.array.pop():l.array[a]=i,l)}function th(e,t){return t&&e&&t===e.ownerID?e:new ju(e?e.array.slice():[],t)}function eZ(e,t){if(t>=qv(e._capacity))return e._tail;if(t<1<<e._level+Hn){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&Ii],r-=Hn;return n}}function xu(e,t,n){t!==void 0&&(t|=0),n!==void 0&&(n|=0);var r=e.__ownerID||new nD,i=e._origin,o=e._capacity,a=i+t,s=n===void 0?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var l=e._level,u=e._root,f=0;a+f<0;)u=new ju(u&&u.array.length?[void 0,u]:[],r),l+=Hn,f+=1<<l;f&&(a+=f,i+=f,s+=f,o+=f);for(var d=qv(o),p=qv(s);p>=1<<l+Hn;)u=new ju(u&&u.array.length?[u]:[],r),l+=Hn;var g=e._tail,v=p<d?eZ(e,s-1):p>d?new ju([],r):g;if(g&&p>d&&a<o&&g.array.length){u=th(u,r);for(var y=u,w=l;w>Hn;w-=Hn){var b=d>>>w&Ii;y=y.array[b]=th(y.array[b],r)}y.array[d>>>Hn&Ii]=g}if(s<o&&(v=v&&v.removeAfter(r,0,s)),a>=p)a-=p,s-=p,l=Hn,u=null,v=v&&v.removeBefore(r,0,a);else if(a>i||p<d){for(f=0;u;){var x=a>>>l&Ii;if(x!==p>>>l&Ii)break;x&&(f+=(1<<l)*x),l-=Hn,u=u.array[x]}u&&a>i&&(u=u.removeBefore(r,l,a-f)),u&&p<d&&(u=u.removeAfter(r,l,p-f)),f&&(a-=f,s-=f)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=l,e._root=u,e._tail=v,e.__hash=void 0,e.__altered=!0,e):Hv(a,s,l,u,v)}function qv(e){return e<ia?0:e-1>>>Hn<<Hn}var Fl=function(e){function t(n){return n==null?Lm():$X(n)?n:Lm().withMutations(function(r){var i=Sa(n);Co(i.size),i.forEach(function(o,a){return r.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(r,i){var o=this._map.get(r);return o!==void 0?this._list.get(o)[1]:i},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Lm()},t.prototype.set=function(r,i){return d5(this,r,i)},t.prototype.remove=function(r){return d5(this,r,nn)},t.prototype.__iterate=function(r,i){var o=this;return this._list.__iterate(function(a){return a&&r(a[1],a[0],o)},i)},t.prototype.__iterator=function(r,i){return this._list.fromEntrySeq().__iterator(r,i)},t.prototype.__ensureOwner=function(r){if(r===this.__ownerID)return this;var i=this._map.__ensureOwner(r),o=this._list.__ensureOwner(r);return r?kD(i,o,r,this.__hash):this.size===0?Lm():(this.__ownerID=r,this.__altered=!1,this._map=i,this._list=o,this)},t}($h);Fl.isOrderedMap=$X;Fl.prototype[kh]=!0;Fl.prototype[zy]=Fl.prototype.remove;function kD(e,t,n,r){var i=Object.create(Fl.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var f5;function Lm(){return f5||(f5=kD(Wa(),Qb()))}function d5(e,t,n){var r=e._map,i=e._list,o=r.get(t),a=o!==void 0,s,l;if(n===nn){if(!a)return e;i.size>=ia&&i.size>=r.size*2?(l=i.filter(function(u,f){return u!==void 0&&o!==f}),s=l.toKeyedSeq().map(function(u){return u[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=l.__ownerID=e.__ownerID)):(s=r.remove(t),l=o===i.size-1?i.pop():i.set(o,void 0))}else if(a){if(n===i.get(o)[1])return e;s=r,l=i.set(o,[t,n])}else s=r.set(t,i.size),l=i.set(i.size,[t,n]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=l,e.__hash=void 0,e.__altered=!0,e):kD(s,l)}var tZ="@@__IMMUTABLE_STACK__@@";function y$(e){return!!(e&&e[tZ])}var TD=function(e){function t(n){return n==null?gb():y$(n)?n:gb().pushAll(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(r,i){var o=this._head;for(r=Hu(this,r);o&&r--;)o=o.next;return o?o.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var r=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,o=this._head,a=arguments.length-1;a>=0;a--)o={value:r[a],next:o};return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Mm(i,o)},t.prototype.pushAll=function(r){if(r=e(r),r.size===0)return this;if(this.size===0&&y$(r))return r;Co(r.size);var i=this.size,o=this._head;return r.__iterate(function(a){i++,o={value:a,next:o}},!0),this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Mm(i,o)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):gb()},t.prototype.slice=function(r,i){if(qS(r,i,this.size))return this;var o=Uy(r,this.size),a=GS(i,this.size);if(a!==this.size)return e.prototype.slice.call(this,r,i);for(var s=this.size-o,l=this._head;o--;)l=l.next;return this.__ownerID?(this.size=s,this._head=l,this.__hash=void 0,this.__altered=!0,this):Mm(s,l)},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?Mm(this.size,this._head,r,this.__hash):this.size===0?gb():(this.__ownerID=r,this.__altered=!1,this)},t.prototype.__iterate=function(r,i){var o=this;if(i)return new wf(this.toArray()).__iterate(function(l,u){return r(l,u,o)},i);for(var a=0,s=this._head;s&&r(s.value,a++,this)!==!1;)s=s.next;return a},t.prototype.__iterator=function(r,i){if(i)return new wf(this.toArray()).__iterator(r,i);var o=0,a=this._head;return new mn(function(){if(a){var s=a.value;return a=a.next,rr(r,o++,s)}return oo()})},t}(Uf);TD.isStack=y$;var Pi=TD.prototype;Pi[tZ]=!0;Pi.shift=Pi.pop;Pi.unshift=Pi.push;Pi.unshiftAll=Pi.pushAll;Pi.withMutations=Wy;Pi.wasAltered=wD;Pi.asImmutable=Hy;Pi["@@transducer/init"]=Pi.asMutable=Vy;Pi["@@transducer/step"]=function(e,t){return e.unshift(t)};Pi["@@transducer/result"]=function(e){return e.asImmutable()};function Mm(e,t,n,r){var i=Object.create(Pi);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var p5;function gb(){return p5||(p5=Mm(0))}var nZ="@@__IMMUTABLE_SET__@@";function RD(e){return!!(e&&e[nZ])}function rZ(e){return RD(e)&&Xa(e)}function iZ(e,t){if(e===t)return!0;if(!io(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Qn(e)!==Qn(t)||eo(e)!==eo(t)||Xa(e)!==Xa(t))return!1;if(e.size===0&&t.size===0)return!0;var n=!YS(e);if(Xa(e)){var r=e.entries();return t.every(function(l,u){var f=r.next().value;return f&&ko(f[1],l)&&(n||ko(f[0],u))})&&r.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate(function(l,u){if(n?!e.has(l):i?!ko(l,e.get(u,nn)):!ko(e.get(u,nn),l))return a=!1,!1});return a&&e.size===s}function Kf(e,t){var n=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function px(e){if(!e||typeof e!="object")return e;if(!io(e)){if(!qu(e))return e;e=Do(e)}if(Qn(e)){var t={};return e.__iterate(function(r,i){t[i]=px(r)}),t}var n=[];return e.__iterate(function(r){n.push(px(r))}),n}var tC=function(e){function t(n){return n==null?Fm():RD(n)&&!Xa(n)?n:Fm().withMutations(function(r){var i=e(n);Co(i.size),i.forEach(function(o){return r.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(r){return this(Sa(r).keySeq())},t.intersect=function(r){return r=Er(r).toArray(),r.length?ii.intersect.apply(t(r.pop()),r):Fm()},t.union=function(r){return r=Er(r).toArray(),r.length?ii.union.apply(t(r.pop()),r):Fm()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(r){return this._map.has(r)},t.prototype.add=function(r){return mb(this,this._map.set(r,r))},t.prototype.remove=function(r){return mb(this,this._map.remove(r))},t.prototype.clear=function(){return mb(this,this._map.clear())},t.prototype.map=function(r,i){var o=this,a=!1,s=mb(this,this._map.mapEntries(function(l){var u=l[1],f=r.call(i,u,u,o);return f!==u&&(a=!0),[f,f]},i));return a?s:this},t.prototype.union=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return r=r.filter(function(o){return o.size!==0}),r.length===0?this:this.size===0&&!this.__ownerID&&r.length===1?this.constructor(r[0]):this.withMutations(function(o){for(var a=0;a<r.length;a++)typeof r[a]=="string"?o.add(r[a]):e(r[a]).forEach(function(s){return o.add(s)})})},t.prototype.intersect=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];if(r.length===0)return this;r=r.map(function(a){return e(a)});var o=[];return this.forEach(function(a){r.every(function(s){return s.includes(a)})||o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.subtract=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];if(r.length===0)return this;r=r.map(function(a){return e(a)});var o=[];return this.forEach(function(a){r.some(function(s){return s.includes(a)})&&o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.sort=function(r){return Sf(Jp(this,r))},t.prototype.sortBy=function(r,i){return Sf(Jp(this,i,r))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(r,i){var o=this;return this._map.__iterate(function(a){return r(a,a,o)},i)},t.prototype.__iterator=function(r,i){return this._map.__iterator(r,i)},t.prototype.__ensureOwner=function(r){if(r===this.__ownerID)return this;var i=this._map.__ensureOwner(r);return r?this.__make(i,r):this.size===0?this.__empty():(this.__ownerID=r,this._map=i,this)},t}(Ch);tC.isSet=RD;var ii=tC.prototype;ii[nZ]=!0;ii[zy]=ii.remove;ii.merge=ii.concat=ii.union;ii.withMutations=Wy;ii.asImmutable=Hy;ii["@@transducer/init"]=ii.asMutable=Vy;ii["@@transducer/step"]=function(e,t){return e.add(t)};ii["@@transducer/result"]=function(e){return e.asImmutable()};ii.__empty=Fm;ii.__make=oZ;function mb(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function oZ(e,t){var n=Object.create(ii);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}var h5;function Fm(){return h5||(h5=oZ(Wa()))}var tXe=function(e){function t(n,r,i){if(!(this instanceof t))return new t(n,r,i);if(pD(i!==0,"Cannot step a Range by 0"),n=n||0,r===void 0&&(r=1/0),i=i===void 0?1:Math.abs(i),r<n&&(i=-i),this._start=n,this._end=r,this._step=i,this.size=Math.max(0,Math.ceil((r-n)/i-1)+1),this.size===0){if(PT)return PT;PT=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(r,i){return this.has(r)?this._start+Hu(this,r)*this._step:i},t.prototype.includes=function(r){var i=(r-this._start)/this._step;return i>=0&&i<this.size&&i===Math.floor(i)},t.prototype.slice=function(r,i){return qS(r,i,this.size)?this:(r=Uy(r,this.size),i=GS(i,this.size),i<=r?new t(0,0):new t(this.get(r,this._end),this.get(i,this._end),this._step))},t.prototype.indexOf=function(r){var i=r-this._start;if(i%this._step===0){var o=i/this._step;if(o>=0&&o<this.size)return o}return-1},t.prototype.lastIndexOf=function(r){return this.indexOf(r)},t.prototype.__iterate=function(r,i){for(var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,l=0;l!==o&&r(s,i?o-++l:l++,this)!==!1;)s+=i?-a:a;return l},t.prototype.__iterator=function(r,i){var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,l=0;return new mn(function(){if(l===o)return oo();var u=s;return s+=i?-a:a,rr(r,i?o-++l:l++,u)})},t.prototype.equals=function(r){return r instanceof t?this._start===r._start&&this._end===r._end&&this._step===r._step:iZ(this,r)},t}(ns),PT;function aZ(e,t,n){for(var r=zX(t),i=0;i!==r.length;)if(e=UX(e,r[i++],nn),e===nn)return n;return e}function sZ(e,t){return aZ(this,e,t)}function nXe(e,t){return aZ(e,t,nn)!==nn}function rXe(e){return nXe(this,e)}function lZ(){Co(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e}Er.isIterable=io;Er.isKeyed=Qn;Er.isIndexed=eo;Er.isAssociative=YS;Er.isOrdered=Xa;Er.Iterator=mn;Kf(Er,{toArray:function(){Co(this.size);var t=new Array(this.size||0),n=Qn(this),r=0;return this.__iterate(function(i,o){t[r++]=n?[o,i]:i}),t},toIndexedSeq:function(){return new IX(this)},toJS:function(){return px(this)},toKeyedSeq:function(){return new QS(this,!0)},toMap:function(){return $h(this.toKeyedSeq())},toObject:lZ,toOrderedMap:function(){return Fl(this.toKeyedSeq())},toOrderedSet:function(){return Sf(Qn(this)?this.valueSeq():this)},toSet:function(){return tC(Qn(this)?this.valueSeq():this)},toSetSeq:function(){return new DX(this)},toSeq:function(){return eo(this)?this.toIndexedSeq():Qn(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return TD(Qn(this)?this.valueSeq():this)},toList:function(){return eC(Qn(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,n){return this.size===0?t+n:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+n},concat:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return In(this,DYe(this,t))},includes:function(t){return this.some(function(n){return ko(n,t)})},entries:function(){return this.__iterator(ga)},every:function(t,n){Co(this.size);var r=!0;return this.__iterate(function(i,o,a){if(!t.call(n,i,o,a))return r=!1,!1}),r},filter:function(t,n){return In(this,FX(this,t,n,!0))},partition:function(t,n){return OYe(this,t,n)},find:function(t,n,r){var i=this.findEntry(t,n);return i?i[1]:r},forEach:function(t,n){return Co(this.size),this.__iterate(n?t.bind(n):t)},join:function(t){Co(this.size),t=t!==void 0?""+t:",";var n="",r=!0;return this.__iterate(function(i){r?r=!1:n+=t,n+=i!=null?i.toString():""}),n},keys:function(){return this.__iterator(Ky)},map:function(t,n){return In(this,MX(this,t,n))},reduce:function(t,n,r){return g5(this,t,n,r,arguments.length<2,!1)},reduceRight:function(t,n,r){return g5(this,t,n,r,arguments.length<2,!0)},reverse:function(){return In(this,uD(this,!0))},slice:function(t,n){return In(this,cD(this,t,n,!0))},some:function(t,n){Co(this.size);var r=!1;return this.__iterate(function(i,o,a){if(t.call(n,i,o,a))return r=!0,!1}),r},sort:function(t){return In(this,Jp(this,t))},values:function(){return this.__iterator(Qa)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,n){return Zp(t?this.toSeq().filter(t,n):this)},countBy:function(t,n){return AYe(this,t,n)},equals:function(t){return iZ(this,t)},entrySeq:function(){var t=this;if(t._cache)return new wf(t._cache);var n=t.toSeq().map(oXe).toIndexedSeq();return n.fromEntrySeq=function(){return t.toSeq()},n},filterNot:function(t,n){return this.filter(LT(t),n)},findEntry:function(t,n,r){var i=r;return this.__iterate(function(o,a,s){if(t.call(n,o,a,s))return i=[a,o],!1}),i},findKey:function(t,n){var r=this.findEntry(t,n);return r&&r[0]},findLast:function(t,n,r){return this.toKeyedSeq().reverse().find(t,n,r)},findLastEntry:function(t,n,r){return this.toKeyedSeq().reverse().findEntry(t,n,r)},findLastKey:function(t,n){return this.toKeyedSeq().reverse().findKey(t,n)},first:function(t){return this.find(vX,null,t)},flatMap:function(t,n){return In(this,PYe(this,t,n))},flatten:function(t){return In(this,BX(this,t,!0))},fromEntrySeq:function(){return new PX(this)},get:function(t,n){return this.find(function(r,i){return ko(i,t)},void 0,n)},getIn:sZ,groupBy:function(t,n){return $Ye(this,t,n)},has:function(t){return this.get(t,nn)!==nn},hasIn:rXe,isSubset:function(t){return t=typeof t.includes=="function"?t:Er(t),this.every(function(n){return t.includes(n)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:Er(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(n){return ko(n,t)})},keySeq:function(){return this.toSeq().map(iXe).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return pb(this,t)},maxBy:function(t,n){return pb(this,n,t)},min:function(t){return pb(this,t?m5(t):y5)},minBy:function(t,n){return pb(this,n?m5(n):y5,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,n){return In(this,NX(this,t,n,!0))},skipUntil:function(t,n){return this.skipWhile(LT(t),n)},sortBy:function(t,n){return In(this,Jp(this,n,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,n){return In(this,IYe(this,t,n))},takeUntil:function(t,n){return this.takeWhile(LT(t),n)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=aXe(this))}});var bi=Er.prototype;bi[_X]=!0;bi[XS]=bi.values;bi.toJSON=bi.toArray;bi.__toStringMapper=Kv;bi.inspect=bi.toSource=function(){return this.toString()};bi.chain=bi.flatMap;bi.contains=bi.includes;Kf(Sa,{flip:function(){return In(this,LX(this))},mapEntries:function(t,n){var r=this,i=0;return In(this,this.toSeq().map(function(o,a){return t.call(n,[a,o],i++,r)}).fromEntrySeq())},mapKeys:function(t,n){var r=this;return In(this,this.toSeq().flip().map(function(i,o){return t.call(n,i,o,r)}).flip())}});var qy=Sa.prototype;qy[xX]=!0;qy[XS]=bi.entries;qy.toJSON=lZ;qy.__toStringMapper=function(e,t){return Kv(t)+": "+Kv(e)};Kf(Uf,{toKeyedSeq:function(){return new QS(this,!1)},filter:function(t,n){return In(this,FX(this,t,n,!1))},findIndex:function(t,n){var r=this.findEntry(t,n);return r?r[0]:-1},indexOf:function(t){var n=this.keyOf(t);return n===void 0?-1:n},lastIndexOf:function(t){var n=this.lastKeyOf(t);return n===void 0?-1:n},reverse:function(){return In(this,uD(this,!1))},slice:function(t,n){return In(this,cD(this,t,n,!1))},splice:function(t,n){var r=arguments.length;if(n=Math.max(n||0,0),r===0||r===2&&!n)return this;t=Uy(t,t<0?this.count():this.size);var i=this.slice(0,t);return In(this,r===1?i:i.concat($s(arguments,2),this.slice(t+n)))},findLastIndex:function(t,n){var r=this.findLastEntry(t,n);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return In(this,BX(this,t,!1))},get:function(t,n){return t=Hu(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?n:this.find(function(r,i){return i===t},void 0,n)},has:function(t){return t=Hu(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.indexOf(t)!==-1)},interpose:function(t){return In(this,LYe(this,t))},interleave:function(){var t=[this].concat($s(arguments)),n=hb(this.toSeq(),ns.of,t),r=n.flatten(!0);return n.size&&(r.size=n.size*t.length),In(this,r)},keySeq:function(){return tXe(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,n){return In(this,NX(this,t,n,!1))},zip:function(){var t=[this].concat($s(arguments));return In(this,hb(this,v5,t))},zipAll:function(){var t=[this].concat($s(arguments));return In(this,hb(this,v5,t,!0))},zipWith:function(t){var n=$s(arguments);return n[0]=this,In(this,hb(this,t,n))}});var Oh=Uf.prototype;Oh[wX]=!0;Oh[kh]=!0;Kf(Ch,{get:function(t,n){return this.has(t)?t:n},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var nh=Ch.prototype;nh.has=bi.includes;nh.contains=nh.includes;nh.keys=nh.values;Kf(fc,qy);Kf(ns,Oh);Kf(Rh,nh);function g5(e,t,n,r,i,o){return Co(e.size),e.__iterate(function(a,s,l){i?(i=!1,n=a):n=t.call(r,n,a,s,l)},o),n}function iXe(e,t){return t}function oXe(e,t){return[t,e]}function LT(e){return function(){return!e.apply(this,arguments)}}function m5(e){return function(){return-e.apply(this,arguments)}}function v5(){return $s(arguments)}function y5(e,t){return e<t?1:e>t?-1:0}function aXe(e){if(e.size===1/0)return 0;var t=Xa(e),n=Qn(e),r=t?1:0,i=e.__iterate(n?t?function(o,a){r=31*r+b5(xo(o),xo(a))|0}:function(o,a){r=r+b5(xo(o),xo(a))|0}:t?function(o){r=31*r+xo(o)|0}:function(o){r=r+xo(o)|0});return sXe(i,r)}function sXe(e,t){return t=_m(t,3432918353),t=_m(t<<15|t>>>-15,461845907),t=_m(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=_m(t^t>>>16,2246822507),t=_m(t^t>>>13,3266489909),t=JS(t^t>>>16),t}function b5(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var Sf=function(e){function t(n){return n==null?b$():rZ(n)?n:b$().withMutations(function(r){var i=Ch(n);Co(i.size),i.forEach(function(o){return r.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(r){return this(Sa(r).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(tC);Sf.isOrderedSet=rZ;var Wf=Sf.prototype;Wf[kh]=!0;Wf.zip=Oh.zip;Wf.zipWith=Oh.zipWith;Wf.zipAll=Oh.zipAll;Wf.__empty=b$;Wf.__make=uZ;function uZ(e,t){var n=Object.create(Wf);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}var _5;function b$(){return _5||(_5=uZ(Lm()))}function lXe(e){if(Eh(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Gs(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Vr=function(t,n){var r;lXe(t);var i=function(s){var l=this;if(s instanceof i)return s;if(!(this instanceof i))return new i(s);if(!r){r=!0;var u=Object.keys(t),f=o._indices={};o._name=n,o._keys=u,o._defaultValues=t;for(var d=0;d<u.length;d++){var p=u[d];f[p]=d,o[p]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+$D(this)+' with property "'+p+'" since that property name is part of the Record API.'):uXe(o,p)}}return this.__ownerID=void 0,this._values=eC().withMutations(function(g){g.setSize(l._keys.length),Sa(s).forEach(function(v,y){g.set(l._indices[y],v===l._defaultValues[y]?void 0:v)})}),this},o=i.prototype=Object.create(jn);return o.constructor=i,n&&(i.displayName=n),i};Vr.prototype.toString=function(){for(var t=$D(this)+" { ",n=this._keys,r,i=0,o=n.length;i!==o;i++)r=n[i],t+=(i?", ":"")+r+": "+Kv(this.get(r));return t+" }"};Vr.prototype.equals=function(t){return this===t||Eh(t)&&rh(this).equals(rh(t))};Vr.prototype.hashCode=function(){return rh(this).hashCode()};Vr.prototype.has=function(t){return this._indices.hasOwnProperty(t)};Vr.prototype.get=function(t,n){if(!this.has(t))return n;var r=this._indices[t],i=this._values.get(r);return i===void 0?this._defaultValues[t]:i};Vr.prototype.set=function(t,n){if(this.has(t)){var r=this._values.set(this._indices[t],n===this._defaultValues[t]?void 0:n);if(r!==this._values&&!this.__ownerID)return AD(this,r)}return this};Vr.prototype.remove=function(t){return this.set(t)};Vr.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:AD(this,t)};Vr.prototype.wasAltered=function(){return this._values.wasAltered()};Vr.prototype.toSeq=function(){return rh(this)};Vr.prototype.toJS=function(){return px(this)};Vr.prototype.entries=function(){return this.__iterator(ga)};Vr.prototype.__iterator=function(t,n){return rh(this).__iterator(t,n)};Vr.prototype.__iterate=function(t,n){return rh(this).__iterate(t,n)};Vr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var n=this._values.__ensureOwner(t);return t?AD(this,n,t):(this.__ownerID=t,this._values=n,this)};Vr.isRecord=Eh;Vr.getDescriptiveName=$D;var jn=Vr.prototype;jn[CX]=!0;jn[zy]=jn.remove;jn.deleteIn=jn.removeIn=gD;jn.getIn=sZ;jn.hasIn=bi.hasIn;jn.merge=VX;jn.mergeWith=HX;jn.mergeIn=_D;jn.mergeDeep=GX;jn.mergeDeepWith=YX;jn.mergeDeepIn=xD;jn.setIn=hD;jn.update=mD;jn.updateIn=vD;jn.withMutations=Wy;jn.asMutable=Vy;jn.asImmutable=Hy;jn[XS]=jn.entries;jn.toJSON=jn.toObject=bi.toObject;jn.inspect=jn.toSource=function(){return this.toString()};function AD(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._values=t,r.__ownerID=n,r}function $D(e){return e.constructor.displayName||e.constructor.name||"Record"}function rh(e){return aD(e._keys.map(function(t){return[t,e.get(t)]}))}function uXe(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(n){pD(this.__ownerID,"Cannot set on an immutable record."),this.set(t,n)}})}catch{}}function cXe(){this.__data__=[],this.size=0}var fXe=cXe;function dXe(e,t){return e===t||e!==e&&t!==t}var Gy=dXe,pXe=Gy;function hXe(e,t){for(var n=e.length;n--;)if(pXe(e[n][0],t))return n;return-1}var nC=hXe,gXe=nC,mXe=Array.prototype,vXe=mXe.splice;function yXe(e){var t=this.__data__,n=gXe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():vXe.call(t,n,1),--this.size,!0}var bXe=yXe,_Xe=nC;function xXe(e){var t=this.__data__,n=_Xe(t,e);return n<0?void 0:t[n][1]}var wXe=xXe,SXe=nC;function CXe(e){return SXe(this.__data__,e)>-1}var EXe=CXe,kXe=nC;function TXe(e,t){var n=this.__data__,r=kXe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var RXe=TXe,AXe=fXe,$Xe=bXe,OXe=wXe,IXe=EXe,DXe=RXe;function Ih(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ih.prototype.clear=AXe;Ih.prototype.delete=$Xe;Ih.prototype.get=OXe;Ih.prototype.has=IXe;Ih.prototype.set=DXe;var rC=Ih,PXe=rC;function LXe(){this.__data__=new PXe,this.size=0}var MXe=LXe;function FXe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var NXe=FXe;function BXe(e){return this.__data__.get(e)}var jXe=BXe;function zXe(e){return this.__data__.has(e)}var UXe=zXe,KXe=typeof ni=="object"&&ni&&ni.Object===Object&&ni,cZ=KXe,WXe=cZ,VXe=typeof self=="object"&&self&&self.Object===Object&&self,HXe=WXe||VXe||Function("return this")(),rs=HXe,qXe=rs,GXe=qXe.Symbol,Dh=GXe,x5=Dh,fZ=Object.prototype,YXe=fZ.hasOwnProperty,XXe=fZ.toString,xm=x5?x5.toStringTag:void 0;function ZXe(e){var t=YXe.call(e,xm),n=e[xm];try{e[xm]=void 0;var r=!0}catch{}var i=XXe.call(e);return r&&(t?e[xm]=n:delete e[xm]),i}var JXe=ZXe,QXe=Object.prototype,eZe=QXe.toString;function tZe(e){return eZe.call(e)}var nZe=tZe,w5=Dh,rZe=JXe,iZe=nZe,oZe="[object Null]",aZe="[object Undefined]",S5=w5?w5.toStringTag:void 0;function sZe(e){return e==null?e===void 0?aZe:oZe:S5&&S5 in Object(e)?rZe(e):iZe(e)}var Ph=sZe;function lZe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var is=lZe,uZe=Ph,cZe=is,fZe="[object AsyncFunction]",dZe="[object Function]",pZe="[object GeneratorFunction]",hZe="[object Proxy]";function gZe(e){if(!cZe(e))return!1;var t=uZe(e);return t==dZe||t==pZe||t==fZe||t==hZe}var OD=gZe,mZe=rs,vZe=mZe["__core-js_shared__"],yZe=vZe,MT=yZe,C5=function(){var e=/[^.]+$/.exec(MT&&MT.keys&&MT.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bZe(e){return!!C5&&C5 in e}var _Ze=bZe,xZe=Function.prototype,wZe=xZe.toString;function SZe(e){if(e!=null){try{return wZe.call(e)}catch{}try{return e+""}catch{}}return""}var dZ=SZe,CZe=OD,EZe=_Ze,kZe=is,TZe=dZ,RZe=/[\\^$.*+?()[\]{}|]/g,AZe=/^\[object .+?Constructor\]$/,$Ze=Function.prototype,OZe=Object.prototype,IZe=$Ze.toString,DZe=OZe.hasOwnProperty,PZe=RegExp("^"+IZe.call(DZe).replace(RZe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function LZe(e){if(!kZe(e)||EZe(e))return!1;var t=CZe(e)?PZe:AZe;return t.test(TZe(e))}var MZe=LZe;function FZe(e,t){return e==null?void 0:e[t]}var NZe=FZe,BZe=MZe,jZe=NZe;function zZe(e,t){var n=jZe(e,t);return BZe(n)?n:void 0}var Vf=zZe,UZe=Vf,KZe=rs,WZe=UZe(KZe,"Map"),ID=WZe,VZe=Vf,HZe=VZe(Object,"create"),iC=HZe,E5=iC;function qZe(){this.__data__=E5?E5(null):{},this.size=0}var GZe=qZe;function YZe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var XZe=YZe,ZZe=iC,JZe="__lodash_hash_undefined__",QZe=Object.prototype,eJe=QZe.hasOwnProperty;function tJe(e){var t=this.__data__;if(ZZe){var n=t[e];return n===JZe?void 0:n}return eJe.call(t,e)?t[e]:void 0}var nJe=tJe,rJe=iC,iJe=Object.prototype,oJe=iJe.hasOwnProperty;function aJe(e){var t=this.__data__;return rJe?t[e]!==void 0:oJe.call(t,e)}var sJe=aJe,lJe=iC,uJe="__lodash_hash_undefined__";function cJe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=lJe&&t===void 0?uJe:t,this}var fJe=cJe,dJe=GZe,pJe=XZe,hJe=nJe,gJe=sJe,mJe=fJe;function Lh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Lh.prototype.clear=dJe;Lh.prototype.delete=pJe;Lh.prototype.get=hJe;Lh.prototype.has=gJe;Lh.prototype.set=mJe;var vJe=Lh,k5=vJe,yJe=rC,bJe=ID;function _Je(){this.size=0,this.__data__={hash:new k5,map:new(bJe||yJe),string:new k5}}var xJe=_Je;function wJe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var SJe=wJe,CJe=SJe;function EJe(e,t){var n=e.__data__;return CJe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var oC=EJe,kJe=oC;function TJe(e){var t=kJe(this,e).delete(e);return this.size-=t?1:0,t}var RJe=TJe,AJe=oC;function $Je(e){return AJe(this,e).get(e)}var OJe=$Je,IJe=oC;function DJe(e){return IJe(this,e).has(e)}var PJe=DJe,LJe=oC;function MJe(e,t){var n=LJe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var FJe=MJe,NJe=xJe,BJe=RJe,jJe=OJe,zJe=PJe,UJe=FJe;function Mh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mh.prototype.clear=NJe;Mh.prototype.delete=BJe;Mh.prototype.get=jJe;Mh.prototype.has=zJe;Mh.prototype.set=UJe;var DD=Mh,KJe=rC,WJe=ID,VJe=DD,HJe=200;function qJe(e,t){var n=this.__data__;if(n instanceof KJe){var r=n.__data__;if(!WJe||r.length<HJe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new VJe(r)}return n.set(e,t),this.size=n.size,this}var GJe=qJe,YJe=rC,XJe=MXe,ZJe=NXe,JJe=jXe,QJe=UXe,eQe=GJe;function Fh(e){var t=this.__data__=new YJe(e);this.size=t.size}Fh.prototype.clear=XJe;Fh.prototype.delete=ZJe;Fh.prototype.get=JJe;Fh.prototype.has=QJe;Fh.prototype.set=eQe;var aC=Fh,tQe=Vf,nQe=function(){try{var e=tQe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),pZ=nQe,T5=pZ;function rQe(e,t,n){t=="__proto__"&&T5?T5(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var sC=rQe,iQe=sC,oQe=Gy;function aQe(e,t,n){(n!==void 0&&!oQe(e[t],n)||n===void 0&&!(t in e))&&iQe(e,t,n)}var hZ=aQe;function sQe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(n(o[l],l,o)===!1)break}return t}}var lQe=sQe,uQe=lQe,cQe=uQe(),gZ=cQe,hx={exports:{}};hx.exports;(function(e,t){var n=rs,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;function l(u,f){if(f)return u.slice();var d=u.length,p=s?s(d):new u.constructor(d);return u.copy(p),p}e.exports=l})(hx,hx.exports);var mZ=hx.exports,fQe=rs,dQe=fQe.Uint8Array,vZ=dQe,R5=vZ;function pQe(e){var t=new e.constructor(e.byteLength);return new R5(t).set(new R5(e)),t}var PD=pQe,hQe=PD;function gQe(e,t){var n=t?hQe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var yZ=gQe;function mQe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var bZ=mQe,vQe=is,A5=Object.create,yQe=function(){function e(){}return function(t){if(!vQe(t))return{};if(A5)return A5(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),bQe=yQe;function _Qe(e,t){return function(n){return e(t(n))}}var _Z=_Qe,xQe=_Z,wQe=xQe(Object.getPrototypeOf,Object),LD=wQe,SQe=Object.prototype;function CQe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||SQe;return e===n}var MD=CQe,EQe=bQe,kQe=LD,TQe=MD;function RQe(e){return typeof e.constructor=="function"&&!TQe(e)?EQe(kQe(e)):{}}var xZ=RQe;function AQe(e){return e!=null&&typeof e=="object"}var Wl=AQe,$Qe=Ph,OQe=Wl,IQe="[object Arguments]";function DQe(e){return OQe(e)&&$Qe(e)==IQe}var PQe=DQe,$5=PQe,LQe=Wl,wZ=Object.prototype,MQe=wZ.hasOwnProperty,FQe=wZ.propertyIsEnumerable,NQe=$5(function(){return arguments}())?$5:function(e){return LQe(e)&&MQe.call(e,"callee")&&!FQe.call(e,"callee")},lC=NQe,BQe=Array.isArray,Ca=BQe,jQe=9007199254740991;function zQe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jQe}var FD=zQe,UQe=OD,KQe=FD;function WQe(e){return e!=null&&KQe(e.length)&&!UQe(e)}var Nh=WQe,VQe=Nh,HQe=Wl;function qQe(e){return HQe(e)&&VQe(e)}var GQe=qQe,gx={exports:{}};function YQe(){return!1}var XQe=YQe;gx.exports;(function(e,t){var n=rs,r=XQe,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;e.exports=u})(gx,gx.exports);var uC=gx.exports,ZQe=Ph,JQe=LD,QQe=Wl,eet="[object Object]",tet=Function.prototype,net=Object.prototype,SZ=tet.toString,ret=net.hasOwnProperty,iet=SZ.call(Object);function oet(e){if(!QQe(e)||ZQe(e)!=eet)return!1;var t=JQe(e);if(t===null)return!0;var n=ret.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SZ.call(n)==iet}var CZ=oet,aet=Ph,set=FD,uet=Wl,cet="[object Arguments]",fet="[object Array]",det="[object Boolean]",pet="[object Date]",het="[object Error]",get="[object Function]",met="[object Map]",vet="[object Number]",yet="[object Object]",bet="[object RegExp]",_et="[object Set]",xet="[object String]",wet="[object WeakMap]",Cet="[object ArrayBuffer]",Eet="[object DataView]",ket="[object Float32Array]",Tet="[object Float64Array]",Ret="[object Int8Array]",Aet="[object Int16Array]",$et="[object Int32Array]",Oet="[object Uint8Array]",Iet="[object Uint8ClampedArray]",Det="[object Uint16Array]",Pet="[object Uint32Array]",Wn={};Wn[ket]=Wn[Tet]=Wn[Ret]=Wn[Aet]=Wn[$et]=Wn[Oet]=Wn[Iet]=Wn[Det]=Wn[Pet]=!0;Wn[cet]=Wn[fet]=Wn[Cet]=Wn[det]=Wn[Eet]=Wn[pet]=Wn[het]=Wn[get]=Wn[met]=Wn[vet]=Wn[yet]=Wn[bet]=Wn[_et]=Wn[xet]=Wn[wet]=!1;function Let(e){return uet(e)&&set(e.length)&&!!Wn[aet(e)]}var Met=Let;function Fet(e){return function(t){return e(t)}}var ND=Fet,mx={exports:{}};mx.exports;(function(e,t){var n=cZ,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(mx,mx.exports);var BD=mx.exports,Net=Met,Bet=ND,O5=BD,I5=O5&&O5.isTypedArray,jet=I5?Bet(I5):Net,jD=jet;function zet(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var EZ=zet,Uet=sC,Ket=Gy,Wet=Object.prototype,Vet=Wet.hasOwnProperty;function Het(e,t,n){var r=e[t];(!(Vet.call(e,t)&&Ket(r,n))||n===void 0&&!(t in e))&&Uet(e,t,n)}var kZ=Het,qet=kZ,Get=sC;function Yet(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?Get(n,s,l):qet(n,s,l)}return n}var Bh=Yet;function Xet(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Zet=Xet,Jet=9007199254740991,Qet=/^(?:0|[1-9]\d*)$/;function ett(e,t){var n=typeof e;return t=t??Jet,!!t&&(n=="number"||n!="symbol"&&Qet.test(e))&&e>-1&&e%1==0&&e<t}var zD=ett,ttt=Zet,ntt=lC,rtt=Ca,itt=uC,ott=zD,att=jD,stt=Object.prototype,ltt=stt.hasOwnProperty;function utt(e,t){var n=rtt(e),r=!n&&ntt(e),i=!n&&!r&&itt(e),o=!n&&!r&&!i&&att(e),a=n||r||i||o,s=a?ttt(e.length,String):[],l=s.length;for(var u in e)(t||ltt.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ott(u,l)))&&s.push(u);return s}var TZ=utt;function ctt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ftt=ctt,dtt=is,ptt=MD,htt=ftt,gtt=Object.prototype,mtt=gtt.hasOwnProperty;function vtt(e){if(!dtt(e))return htt(e);var t=ptt(e),n=[];for(var r in e)r=="constructor"&&(t||!mtt.call(e,r))||n.push(r);return n}var ytt=vtt,btt=TZ,_tt=ytt,xtt=Nh;function wtt(e){return xtt(e)?btt(e,!0):_tt(e)}var Yy=wtt,Stt=Bh,Ctt=Yy;function Ett(e){return Stt(e,Ctt(e))}var ktt=Ett,D5=hZ,Ttt=mZ,Rtt=yZ,Att=bZ,$tt=xZ,P5=lC,L5=Ca,Ott=GQe,Itt=uC,Dtt=OD,Ptt=is,Ltt=CZ,Mtt=jD,M5=EZ,Ftt=ktt;function Ntt(e,t,n,r,i,o,a){var s=M5(e,n),l=M5(t,n),u=a.get(l);if(u){D5(e,n,u);return}var f=o?o(s,l,n+"",e,t,a):void 0,d=f===void 0;if(d){var p=L5(l),g=!p&&Itt(l),v=!p&&!g&&Mtt(l);f=l,p||g||v?L5(s)?f=s:Ott(s)?f=Att(s):g?(d=!1,f=Ttt(l,!0)):v?(d=!1,f=Rtt(l,!0)):f=[]:Ltt(l)||P5(l)?(f=s,P5(s)?f=Ftt(s):(!Ptt(s)||Dtt(s))&&(f=$tt(l))):d=!1}d&&(a.set(l,f),i(f,l,r,o,a),a.delete(l)),D5(e,n,f)}var Btt=Ntt,jtt=aC,ztt=hZ,Utt=gZ,Ktt=Btt,Wtt=is,Vtt=Yy,Htt=EZ;function RZ(e,t,n,r,i){e!==t&&Utt(t,function(o,a){if(i||(i=new jtt),Wtt(o))Ktt(e,t,a,n,RZ,r,i);else{var s=r?r(Htt(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),ztt(e,a,s)}},Vtt)}var qtt=RZ;function Gtt(e){return e}var UD=Gtt;function Ytt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Xtt=Ytt,Ztt=Xtt,F5=Math.max;function Jtt(e,t,n){return t=F5(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=F5(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),Ztt(e,this,s)}}var AZ=Jtt;function Qtt(e){return function(){return e}}var ent=Qtt,tnt=ent,N5=pZ,nnt=UD,rnt=N5?function(e,t){return N5(e,"toString",{configurable:!0,enumerable:!1,value:tnt(t),writable:!0})}:nnt,int=rnt,ont=800,ant=16,snt=Date.now;function lnt(e){var t=0,n=0;return function(){var r=snt(),i=ant-(r-n);if(n=r,i>0){if(++t>=ont)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var unt=lnt,cnt=int,fnt=unt,dnt=fnt(cnt),$Z=dnt,pnt=UD,hnt=AZ,gnt=$Z;function mnt(e,t){return gnt(hnt(e,t,pnt),e+"")}var vnt=mnt,ynt=Gy,bnt=Nh,_nt=zD,xnt=is;function wnt(e,t,n){if(!xnt(n))return!1;var r=typeof t;return(r=="number"?bnt(n)&&_nt(t,n.length):r=="string"&&t in n)?ynt(n[t],e):!1}var Snt=wnt,Cnt=vnt,Ent=Snt;function knt(e){return Cnt(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&Ent(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var Tnt=knt,Rnt=qtt,Ant=Tnt,$nt=Ant(function(e,t,n){Rnt(e,t,n)}),Ont=$nt;const vx=_i(Ont);function cC({children:e,className:t,clipboardValue:n,sx:r,sxChildren:i,title:o}){const a=Xn();return S.jsxs(Ht,{spacing:o?1.5:0,sx:vx({width:"100%",flex:1,overflowY:"auto"},r),children:[S.jsx(Yt,{fontSize:"14px",fontWeight:700,color:_t[400],children:o}),S.jsxs(at,{className:t,sx:vx({position:"relative",fontFamily:"Inter",fontSize:"16px",lineHeight:"24px",padding:3,paddingRight:4,border:`1.5px solid ${a.palette.divider}`,borderRadius:"8px",overflowY:"auto",flexGrow:1,caretColor:a.palette.text.primary,backgroundColor:a.palette.background.paper,"&:hover":{borderColor:a.palette.mode==="light"?_t[400]:"white"}},i),children:[n?S.jsx(Pq,{value:n}):null,e]})]})}var KD={},Int=vn;Object.defineProperty(KD,"__esModule",{value:!0});var OZ=KD.default=void 0,Dnt=Int(yn()),Pnt=S,Lnt=(0,Dnt.default)((0,Pnt.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");OZ=KD.default=Lnt;function IZ({count:e,inputProps:t}){const n=Xn();return e?t?(()=>{const o=a=>`${e.toString().length*8+(a?18:0)}px`;return t?S.jsx(lS,{id:t.id,inputProps:{type:"number",max:t.max,min:t.min,step:t.step||1,sx:{width:o(),padding:a=>a.spacing(.5,1),fontSize:"12px",fontWeight:600,color:"text.secondary","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"},"&:focus":{width:o(!0),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"flex"}}}},sx:{borderRadius:"6px",backgroundColor:a=>a.palette.mode==="light"?"grey.100":"grey.800","& fieldset":{border:"none"}},value:e,onChange:t.onChange}):null})():(()=>S.jsx(at,{display:"flex",alignItems:"center",className:"notification-count",sx:{borderRadius:"6px",padding:"4px 8px",backgroundColor:n.palette.mode==="light"?"grey.100":"grey.800"},children:S.jsx(Yt,{className:"notification-count",color:"text.secondary",sx:{fontSize:"12px",fontWeight:600},children:e})}))():null}var WD={},Mnt=vn;Object.defineProperty(WD,"__esModule",{value:!0});var DZ=WD.default=void 0,Fnt=Mnt(yn()),Nnt=S,Bnt=(0,Fnt.default)((0,Nnt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");DZ=WD.default=Bnt;function jnt({id:e,label:t,tooltip:n,notificationsProps:r}){return S.jsxs(at,{display:"flex",justifyContent:"space-between",width:"100%",children:[S.jsxs(at,{display:"flex",gap:.5,alignItems:"center",children:[S.jsx(yV,{htmlFor:e,sx:{fontWeight:600,fontSize:"12px",color:"grey.500"},children:t}),n?S.jsx(yi,{title:n,children:S.jsx(DZ,{sx:{fontSize:12,color:"grey.600"}})}):null]}),r?S.jsx(IZ,{...r}):null]})}function jh(e){const{children:t,description:n,hasError:r,id:i,label:o,notificationsProps:a,tooltip:s,sx:l}=e;return S.jsxs(Ht,{width:"100%",sx:l,gap:.5,children:[o?S.jsx(jnt,{id:i,label:o,tooltip:s,notificationsProps:a}):null,S.jsxs(fV,{error:r,fullWidth:!0,children:[t,n?S.jsx(dV,{children:n}):null]})]})}const znt=({item:e,selected:t,isDarkMode:n,index:r})=>S.jsxs(ov,{value:e.value,sx:{display:"flex",justifyContent:"space-between",fontWeight:500,fontSize:"14px",color:n&&_t[400]||(t?As[500]:_t[700]),"&:hover":{backgroundColor:n?_t[800]:As[50],color:n?_t[400]:As[500],"& .notification-count":{backgroundColor:n?_t[850]:As[100],color:n?_t[400]:As[500]}}},children:[e.label||e.value,e.notificationCount?S.jsx(IZ,{count:e.notificationCount}):null]},`select-${r}`);function zh({children:e,description:t,disabled:n=!1,hasError:r,id:i,items:o,label:a,name:s,onChange:l,size:u="small",tooltip:f,value:d,placeholder:p="Select",renderLabel:g,onClose:v,sx:y,iconSx:w,...b}){const x=Ty();return S.jsx(jh,{id:i,hasError:r,description:t,label:a,tooltip:f,sx:y,children:S.jsx(TV,{...b,onClose:v,labelId:i,value:d==null?void 0:d.toString(),onChange:l,size:u,disabled:n,displayEmpty:!0,renderValue:()=>{var C;return!d||d===""?p:g&&g()||`${(C=o==null?void 0:o.find(k=>k.value===d))==null?void 0:C.label}`},sx:{backgroundColor:C=>C.palette.background.paper,borderRadius:1,padding:.5,"&.MuiOutlinedInput-root":{"& fieldset":{border:C=>`1px solid ${C.palette.divider}`}}},inputProps:{id:i,name:s||i,sx:{color:_t[600],fontSize:"14px",fontWeight:400,px:"16px",py:u==="small"?"10px":"14px",h:"48px"}},MenuProps:{PaperProps:{sx:{border:C=>`1px solid ${C.palette.divider}`,boxShadow:C=>C.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D","&& .Mui-selected, .Mui-selected.Mui-selected:hover":{backgroundColor:x?_t[800]:As[50]}}},MenuListProps:{sx:{backgroundColor:x?_t[900]:""}}},IconComponent:C=>S.jsx(OZ,{...C,fontSize:"16px",sx:{px:"9px",color:n?"":`${x?_t[300]:_t[600]} !important`,...w}}),children:e||(o==null?void 0:o.map((C,k)=>znt({item:C,index:k,selected:C.value===d,isDarkMode:x})))})})}const Unt=["Assistant","System","User"],PZ=({canSelectRole:e,children:t,index:n,message:r,role:i,name:o})=>{const a=gn(ts),[s,l]=T.useState(!1),u=f=>{const d=f.target.value;d&&a(p=>{var g,v;return{...p,prompt:{...p.prompt,messages:(v=(g=p.prompt)==null?void 0:g.messages)==null?void 0:v.map((y,w)=>({...y,...w===n?{role:d}:{}}))}}}),l(!1)};return S.jsxs(at,{children:[S.jsx(at,{sx:{border:f=>`1px solid ${f.palette.divider}`,borderRadius:1}}),S.jsxs(Ht,{direction:"row",width:"100%",sx:{gap:2,flex:10,paddingY:1,"&:hover":{background:f=>f.palette.background.paper}},children:[S.jsxs(at,{sx:{flex:1,paddingLeft:2},children:[s?S.jsx(zh,{onClose:()=>l(!1),defaultOpen:!0,items:Unt.map(f=>({label:f,value:f.toLowerCase()})),id:"role-select",value:r==null?void 0:r.role,onChange:u,sx:{width:"fit-content"},iconSx:{px:0,marginRight:"2px !important"}}):S.jsx(Yt,{onClick:()=>e&&l(!0),color:"text.primary",sx:{p:1,borderRadius:.5,marginTop:1,cursor:e?"pointer":"default",fontSize:"12px",fontWeight:700,width:"fit-content",...e&&{"&:hover":{backgroundColor:f=>f.palette.divider}}},children:i}),o?S.jsx(Yt,{color:"text.secondary",variant:"caption",sx:{ml:1,width:"fit-content"},children:o}):null]}),S.jsx(at,{width:"100%",flex:8,children:t})]})]},n)};function LZ({completion:e,chatMode:t}){const[n,r]=T.useState(Rn.EditorState.createEmpty()),[i,o]=T.useState(!0);T.useEffect(()=>{let l=Rn.EditorState.createEmpty();e&&(l=a(l,e)),r(l),o(!0)},[e]);const a=(l,u)=>{const f=l.getCurrentContent(),d=f.getBlockMap(),p=d.last().getKey(),g=d.last().getLength(),v=new Rn.SelectionState({anchorKey:p,anchorOffset:g,focusKey:p,focusOffset:g}),y=Rn.Modifier.insertText(f,v,u,Sf.of("COMPLETION")),w=Rn.EditorState.push(l,y,"insert-characters");return Rn.EditorState.forceSelection(w,y.getSelectionAfter())},s=()=>S.jsx(cC,{className:"completion-editor",clipboardValue:n.getCurrentContent().getPlainText(),sxChildren:{borderColor:l=>l.palette.success.main,"&:hover":{borderColor:l=>l.palette.success.main}},children:S.jsx(Rn.Editor,{editorState:n,onChange:l=>{l=Rn.EditorState.push(l,n.getCurrentContent(),"insert-characters"),r(l)}})});return t?S.jsx(PZ,{role:"ASSISTANT",children:s()}):S.jsxs(at,{marginTop:2,children:[S.jsxs(Ht,{sx:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingRight:"6px"},children:[S.jsx(Yt,{fontSize:"14px",fontWeight:700,color:dw[400],children:"Completion"}),S.jsx(or,{onClick:()=>o(!i),children:i?S.jsx(IS,{}):S.jsx(DS,{})})]}),S.jsx(at,{sx:{border:l=>`1px solid ${l.palette.divider}`,borderRadius:1,marginTop:1}}),S.jsx(at,{sx:{maxHeight:i?"220px":"0px",transition:"max-height 0.5s ease-in-out",overflow:"auto",marginTop:2},children:s()})]})}function MZ(e,t){switch(t){case"f-string":return new RegExp(`\\{+(${e}+)\\}+`,"g");default:throw new Error(`Unsupported template format ${t}`)}}function Knt(e={},t){const n=Object.keys(e).sort((r,i)=>i.length-r.length);switch(t){case"f-string":{const r=n.map(i=>`${i}`).join("|");return MZ(r,t)}default:throw new Error(`Unsupported template format ${t}`)}}function Wnt(e,t){switch(t){case"f-string":return e=e.replaceAll("{{","{"),e=e.replaceAll("}}","}"),e;default:throw new Error(`Unsupported template format ${t}`)}}function Vnt(e){switch(e){case"f-string":return/\{+([^{}]+)\}+|{{|}}/g;default:throw new Error(`Unsupported template format ${e}`)}}function FZ(e,t){switch(t){case"f-string":return`{${e}}`;default:throw new Error(`Unsupported template format ${t}`)}}function VD(e,t,n){switch(n){case"f-string":{const r=t.split(e)[0].length,i=t.split(e)[1].length,a=r%2&&r===i,s=FZ(e,n),l=t.indexOf(s),u=l+s.length;return{ok:a,localStartIndex:l,localEndIndex:u}}default:throw new Error(`Unsupported template format ${n}`)}}var yx={exports:{}};/**
|
|
456
|
+
`;function XKe(e,t){switch(e){case"deleteContentBackward":return HKe(t)}return t}function ZKe(e,t){e._pendingStateFromBeforeInput!==void 0&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e.editor,r=n.ownerDocument.defaultView.getSelection(),i=r.anchorNode,o=r.isCollapsed,a=(i==null?void 0:i.nodeType)!==Node.TEXT_NODE&&(i==null?void 0:i.nodeType)!==Node.ELEMENT_NODE;if(!(i==null||a)){if(i.nodeType===Node.TEXT_NODE&&(i.previousSibling!==null||i.nextSibling!==null)){var s=i.parentNode;if(s==null)return;i.nodeValue=s.textContent;for(var l=s.firstChild;l!=null;l=l.nextSibling)l!==i&&s.removeChild(l)}var u=i.textContent,f=e._latestEditorState,d=qKe(VKe(i)),p=jKe.decode(d),g=p.blockKey,v=p.decoratorKey,y=p.leafKey,w=f.getBlockTree(g).getIn([v,"leaves",y]),b=w.start,x=w.end,C=f.getCurrentContent(),k=C.getBlockForKey(g),R=k.getText().slice(b,x);if(u.endsWith(YKe)&&(u=u.slice(0,-1)),u===R){var A=t.nativeEvent.inputType;if(A){var O=XKe(A,f);if(O!==f){e.restoreEditorDOM(),e.update(O);return}}return}var z=f.getSelection(),V=z.merge({anchorOffset:b,focusOffset:x,isBackward:!1}),D=k.getEntityAt(b),W=WKe(D)?C.getEntity(D):null,ie=W!=null?W.getMutability():null,se=ie==="MUTABLE",K=se?"spellcheck-change":"apply-entity",G=BKe.replaceText(C,V,u,k.getInlineStyleAt(b),se?k.getEntityAt(b):null),Q,le,Z,ee;if(GKe)Q=r.anchorOffset,le=r.focusOffset,Z=b+Math.min(Q,le),ee=Z+Math.abs(Q-le),Q=Z,le=ee;else{var P=u.length-R.length;Z=z.getStartOffset(),ee=z.getEndOffset(),Q=o?ee+P:Z,le=ee+P}var ge=G.merge({selectionBefore:C.getSelectionAfter(),selectionAfter:z.merge({anchorOffset:Q,focusOffset:le})});e.update(zKe.push(f,ge,K))}}var JKe=ZKe,QKe=US;function eWe(e){return e.which===QKe.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}var tWe=eWe,nWe=uo,rWe=tWe,bT=nWe.isPlatform("Mac OS X"),NY={isCtrlKeyCommand:function(t){return!!t.ctrlKey&&!t.altKey},isOptionKeyCommand:function(t){return bT&&t.altKey},usesMacOSHeuristics:function(){return bT},hasCommandModifier:function(t){return bT?!!t.metaKey&&!t.altKey:NY.isCtrlKeyCommand(t)},isSoftNewlineEvent:rWe},JI=NY,l4=so,u4=zn,iWe=PS,oWe=lo,_T=null,aWe={cut:function(t){var n=t.getCurrentContent(),r=t.getSelection(),i=null;if(r.isCollapsed()){var o=r.getAnchorKey(),a=n.getBlockForKey(o).getLength();if(a===r.getAnchorOffset()){var s=n.getKeyAfter(o);if(s==null)return t;i=r.set("focusKey",s).set("focusOffset",0)}else i=r.set("focusOffset",a)}else i=r;i=oWe(i),_T=iWe(n,i);var l=l4.removeRange(n,i,"forward");return l===n?t:u4.push(t,l,"remove-range")},paste:function(t){if(!_T)return t;var n=l4.replaceWithFragment(t.getCurrentContent(),t.getSelection(),_T);return u4.push(t,n,"insert-fragment")}},sWe=aWe,lWe=uo,uWe=bn,cWe=lWe.isBrowser("Chrome");function fWe(e){for(var t=e.cloneRange(),n=[],r=e.endContainer;r!=null;r=r.parentNode){var i=r===e.commonAncestorContainer;i?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var o=Array.from(t.getClientRects());if(n.push(o),i){var a;return n.reverse(),(a=[]).concat.apply(a,n)}t.setEndBefore(r)}uWe(!1)}var dWe=cWe?fWe:function(e){return Array.from(e.getClientRects())},BY=dWe,pWe=zf,hWe=jS,c4=BY,s$=bn;function gWe(e){var t=getComputedStyle(e),n=hWe(e),r=n.createElement("div");r.style.fontFamily=t.fontFamily,r.style.fontSize=t.fontSize,r.style.fontStyle=t.fontStyle,r.style.fontWeight=t.fontWeight,r.style.lineHeight=t.lineHeight,r.style.position="absolute",r.textContent="M";var i=n.body;i||s$(!1),i.appendChild(r);var o=r.getBoundingClientRect();return i.removeChild(r),o.height}function f4(e,t){for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<e.length;a++){var s=e[a];s.width===0||s.width===1||(n=Math.min(n,s.top),r=Math.min(r,s.bottom),i=Math.max(i,s.top),o=Math.max(o,s.bottom))}return i<=r&&i-n<t&&o-r<t}function mWe(e){switch(e.nodeType){case Node.DOCUMENT_TYPE_NODE:return 0;case Node.TEXT_NODE:case Node.PROCESSING_INSTRUCTION_NODE:case Node.COMMENT_NODE:return e.length;default:return e.childNodes.length}}function vWe(e){e.collapsed||s$(!1),e=e.cloneRange();var t=e.startContainer;t.nodeType!==1&&(t=t.parentNode);var n=gWe(t),r=e.endContainer,i=e.endOffset;for(e.setStart(e.startContainer,0);f4(c4(e),n)&&(r=e.startContainer,i=e.startOffset,r.parentNode||s$(!1),e.setStartBefore(r),!(r.nodeType===1&&getComputedStyle(r).display!=="inline")););var o=r,a=i-1;do{for(var s=o.nodeValue,l=a;l>=0;l--)if(!(s!=null&&l>0&&pWe.isSurrogatePair(s,l-1)))if(e.setStart(o,l),f4(c4(e),n))r=o,i=l;else break;if(l===-1||o.childNodes.length===0)break;o=o.childNodes[l],a=mWe(o)}while(!0);return e.setStart(r,i),e}var yWe=vWe,bWe=zn,_We=yWe,xWe=aY,wWe=ZI,SWe=jy;function CWe(e,t){var n=SWe(e,function(r){var i=r.getSelection();if(i.isCollapsed()&&i.getAnchorOffset()===0)return wWe(r,1);var o=t.currentTarget.ownerDocument,a=o.defaultView.getSelection(),s=a.getRangeAt(0);return s=_We(s),xWe(r,null,s.endContainer,s.endOffset,s.startContainer,s.startOffset).selectionState},"backward");return n===e.getCurrentContent()?e:bWe.push(e,n,"remove-range")}var EWe=CWe,kWe=`[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;・、。〈-】〔-〟:-?!-/[-`{-・⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]`,TWe={getPunctuation:function(){return kWe}},RWe=TWe,AWe=RWe.getPunctuation(),jY="['‘’]",Cp="\\s|(?![_])"+AWe,$We="^(?:"+Cp+")*(?:"+jY+"|(?!"+Cp+").)*(?:(?!"+Cp+").)",OWe=new RegExp($We),IWe="(?:(?!"+Cp+").)(?:"+jY+"|(?!"+Cp+").)*(?:"+Cp+")*$",DWe=new RegExp(IWe);function d4(e,t){var n=t?DWe.exec(e):OWe.exec(e);return n?n[0]:e}var PWe={getBackward:function(t){return d4(t,!0)},getForward:function(t){return d4(t,!1)}},zY=PWe,LWe=zY,MWe=zn,p4=ZI,FWe=jy;function NWe(e){var t=FWe(e,function(n){var r=n.getSelection(),i=r.getStartOffset();if(i===0)return p4(n,1);var o=r.getStartKey(),a=n.getCurrentContent(),s=a.getBlockForKey(o).getText().slice(0,i),l=LWe.getBackward(s);return p4(n,l.length||1)},"backward");return t===e.getCurrentContent()?e:MWe.push(e,t,"remove-range")}var BWe=NWe;function jWe(e,t){var n=e.getSelection(),r=n.getStartKey(),i=n.getStartOffset(),o=e.getCurrentContent(),a=r,s,l=o.getBlockForKey(r);return t>l.getText().length-i?(a=o.getKeyAfter(r),s=0):s=i+t,n.merge({focusKey:a,focusOffset:s})}var UY=jWe,zWe=zY,UWe=zn,KWe=UY,WWe=jy;function VWe(e){var t=WWe(e,function(n){var r=n.getSelection(),i=r.getStartOffset(),o=r.getStartKey(),a=n.getCurrentContent(),s=a.getBlockForKey(o).getText().slice(i),l=zWe.getForward(s);return KWe(n,l.length||1)},"forward");return t===e.getCurrentContent()?e:UWe.push(e,t,"remove-range")}var HWe=VWe,qWe=so,GWe=zn;function YWe(e){var t=qWe.splitBlock(e.getCurrentContent(),e.getSelection());return GWe.push(e,t,"split-block")}var XWe=YWe,ZWe=zn;function JWe(e){var t=e.getSelection(),n=t.getEndKey(),r=e.getCurrentContent(),i=r.getBlockForKey(n).getLength();return ZWe.set(e,{selection:t.merge({anchorKey:n,anchorOffset:i,focusKey:n,focusOffset:i,isBackward:!1}),forceSelection:!0})}var QWe=JWe,eVe=zn;function tVe(e){var t=e.getSelection(),n=t.getStartKey();return eVe.set(e,{selection:t.merge({anchorKey:n,anchorOffset:0,focusKey:n,focusOffset:0,isBackward:!1}),forceSelection:!0})}var nVe=tVe,rVe=zn,iVe=zf,oVe=UY,aVe=jy;function sVe(e){var t=aVe(e,function(r){var i=r.getSelection(),o=r.getCurrentContent(),a=i.getAnchorKey(),s=i.getAnchorOffset(),l=o.getBlockForKey(a).getText()[s];return oVe(r,l?iVe.getUTF16Length(l,0):1)},"forward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return rVe.push(e,t.set("selectionBefore",n),n.isCollapsed()?"delete-character":"remove-range")}var lVe=sVe,h4=so,g4=zn,uVe=PS;function cVe(e){var t=e.getSelection();if(!t.isCollapsed())return e;var n=t.getAnchorOffset();if(n===0)return e;var r=t.getAnchorKey(),i=e.getCurrentContent(),o=i.getBlockForKey(r),a=o.getLength();if(a<=1)return e;var s,l;n===a?(s=t.set("anchorOffset",n-1),l=t):(s=t.set("focusOffset",n+1),l=s.set("anchorOffset",n+1));var u=uVe(i,s),f=h4.removeRange(i,s,"backward"),d=f.getSelectionAfter(),p=d.getAnchorOffset()-1,g=d.merge({anchorOffset:p,focusOffset:p}),v=h4.replaceWithFragment(f,g,u),y=g4.push(e,v,"insert-fragment");return g4.acceptSelection(y,l)}var fVe=cVe,xT=zn;function dVe(e,t,n){var r=xT.undo(t);if(t.getLastChangeType()==="spellcheck-change"){var i=r.getCurrentContent();n(xT.set(r,{nativelyRenderedContent:i}));return}if(e.preventDefault(),!t.getNativelyRenderedContent()){n(r);return}n(xT.set(t,{nativelyRenderedContent:null})),setTimeout(function(){n(r)},0)}var pVe=dVe,hVe=so,KY=zn,gVe=JI,hl=US,m4=sWe,mVe=uo,v4=HS,vVe=EWe,yVe=BWe,bVe=HWe,_Ve=XWe,xVe=QWe,wVe=nVe,SVe=FY,CVe=lVe,EVe=fVe,kVe=pVe,y4=gVe.isOptionKeyCommand,b4=mVe.isBrowser("Chrome");function TVe(e,t,n){switch(e){case"redo":return KY.redo(t);case"delete":return CVe(t);case"delete-word":return bVe(t);case"backspace":return SVe(t);case"backspace-word":return yVe(t);case"backspace-to-start-of-line":return vVe(t,n);case"split-block":return _Ve(t);case"transpose-characters":return EVe(t);case"move-selection-to-start-of-block":return wVe(t);case"move-selection-to-end-of-block":return xVe(t);case"secondary-cut":return m4.cut(t);case"secondary-paste":return m4.paste(t);default:return t}}function RVe(e,t){var n=t.which,r=e._latestEditorState;function i(l){var u=e.props[l];return u?(u(t),!0):!1}switch(n){case hl.RETURN:if(t.preventDefault(),e.props.handleReturn&&v4(e.props.handleReturn(t,r)))return;break;case hl.ESC:if(t.preventDefault(),i("onEscape"))return;break;case hl.TAB:if(i("onTab"))return;break;case hl.UP:if(i("onUpArrow"))return;break;case hl.RIGHT:if(i("onRightArrow"))return;break;case hl.DOWN:if(i("onDownArrow"))return;break;case hl.LEFT:if(i("onLeftArrow"))return;break;case hl.SPACE:b4&&y4(t)&&t.preventDefault()}var o=e.props.keyBindingFn(t);if(o==null||o===""){if(n===hl.SPACE&&b4&&y4(t)){var a=hVe.replaceText(r.getCurrentContent(),r.getSelection()," ");e.update(KY.push(r,a,"insert-characters"))}return}if(o==="undo"){kVe(t,r,e.update);return}if(t.preventDefault(),!(e.props.handleKeyCommand&&v4(e.props.handleKeyCommand(o,r,t.timeStamp)))){var s=TVe(o,r,t);s!==r&&e.update(s)}}var AVe=RVe;function $Ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var OVe=function(){function e(n){$Ve(this,"_uri",void 0),this._uri=n}var t=e.prototype;return t.toString=function(){return this._uri},e}(),IVe=OVe,DVe=uo,PVe=bn,LVe=DVe.isBrowser("IE <= 9");function MVe(e){var t,n=null;return!LVe&&document.implementation&&document.implementation.createHTMLDocument&&(t=document.implementation.createHTMLDocument("foo"),t.documentElement||PVe(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}var WY=MVe,FVe=Bf;function NVe(e){return!e||!e.ownerDocument?!1:FVe(e)&&e.nodeName==="A"}var BVe=NVe,jVe=Bf;function zVe(e){return!e||!e.ownerDocument?!1:jVe(e)&&e.nodeName==="IMG"}var UVe=zVe,Dc;function wT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Qr(e,i,n[i])})}return e}function Qr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var KVe=xa,WVe=Mf,VVe=wa,HVe=KI,_4=LS,VY=IVe,ym=Ff,x4=qs,qVe=WY,HY=cc,QI=cn,pu=QI.List,qY=QI.Map,GVe=QI.OrderedSet,GY=BVe,YVe=fY,eD=By,YY=UVe,w4=HY("draft_tree_data_support"),XVe=" ",XY=" ",ZVe=new RegExp("\r","g"),JVe=new RegExp(`
|
|
457
|
+
`,"g"),QVe=new RegExp(`^
|
|
458
|
+
`,"g"),eHe=new RegExp(XVe,"g"),tHe=new RegExp(" ?","g"),nHe=new RegExp("​?","g"),rHe=["bold","bolder","500","600","700","800","900"],iHe=["light","lighter","normal","100","200","300","400"],oHe=["className","href","rel","target","title"],aHe=["alt","className","height","src","width"],S4=(Dc={},Qr(Dc,ym("public/DraftStyleDefault/depth0"),0),Qr(Dc,ym("public/DraftStyleDefault/depth1"),1),Qr(Dc,ym("public/DraftStyleDefault/depth2"),2),Qr(Dc,ym("public/DraftStyleDefault/depth3"),3),Qr(Dc,ym("public/DraftStyleDefault/depth4"),4),Dc),C4=qY({b:"BOLD",code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",i:"ITALIC",s:"STRIKETHROUGH",strike:"STRIKETHROUGH",strong:"BOLD",u:"UNDERLINE",mark:"HIGHLIGHT"}),sHe=function(t){var n={};return t.mapKeys(function(r,i){var o=[i.element];i.aliasedElements!==void 0&&o.push.apply(o,i.aliasedElements),o.forEach(function(a){n[a]===void 0?n[a]=r:typeof n[a]=="string"?n[a]=[n[a],r]:n[a].push(r)})}),qY(n)},lHe=function(t){if(eD(t)){var n=t;if(n.style.fontFamily.includes("monospace"))return"CODE"}return null},uHe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Object.keys(S4).some(function(r){t.classList.contains(r)&&(n=S4[r])}),n},cHe=function(t){if(!GY(t))return!1;var n=t;if(!n.href||n.protocol!=="http:"&&n.protocol!=="https:"&&n.protocol!=="mailto:"&&n.protocol!=="tel:")return!1;try{var r=new VY(n.href);return!0}catch{return!1}},fHe=function(t){if(!YY(t))return!1;var n=t;return!!(n.attributes.getNamedItem("src")&&n.attributes.getNamedItem("src").value)},dHe=function(t,n){if(!eD(t))return n;var r=t,i=r.style.fontWeight,o=r.style.fontStyle,a=r.style.textDecoration;return n.withMutations(function(s){rHe.indexOf(i)>=0?s.add("BOLD"):iHe.indexOf(i)>=0&&s.remove("BOLD"),o==="italic"?s.add("ITALIC"):o==="normal"&&s.remove("ITALIC"),a==="underline"&&s.add("UNDERLINE"),a==="line-through"&&s.add("STRIKETHROUGH"),a==="none"&&(s.remove("UNDERLINE"),s.remove("STRIKETHROUGH"))})},ST=function(t){return t==="ul"||t==="ol"},pHe=function(){function e(n,r){Qr(this,"characterList",pu()),Qr(this,"currentBlockType","unstyled"),Qr(this,"currentDepth",0),Qr(this,"currentEntity",null),Qr(this,"currentText",""),Qr(this,"wrapper",null),Qr(this,"blockConfigs",[]),Qr(this,"contentBlocks",[]),Qr(this,"entityMap",_4),Qr(this,"blockTypeMap",void 0),Qr(this,"disambiguate",void 0),this.clear(),this.blockTypeMap=n,this.disambiguate=r}var t=e.prototype;return t.clear=function(){this.characterList=pu(),this.blockConfigs=[],this.currentBlockType="unstyled",this.currentDepth=0,this.currentEntity=null,this.currentText="",this.entityMap=_4,this.wrapper=null,this.contentBlocks=[]},t.addDOMNode=function(r){var i;return this.contentBlocks=[],this.currentDepth=0,(i=this.blockConfigs).push.apply(i,this._toBlockConfigs([r],GVe())),this._trimCurrentText(),this.currentText!==""&&this.blockConfigs.push(this._makeBlockConfig()),this},t.getContentBlocks=function(){return this.contentBlocks.length===0&&(w4?this._toContentBlocks(this.blockConfigs):this._toFlatContentBlocks(this.blockConfigs)),{contentBlocks:this.contentBlocks,entityMap:this.entityMap}},t._makeBlockConfig=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.key||x4(),o=wT({key:i,type:this.currentBlockType,text:this.currentText,characterList:this.characterList,depth:this.currentDepth,parent:null,children:pu(),prevSibling:null,nextSibling:null,childConfigs:[]},r);return this.characterList=pu(),this.currentBlockType="unstyled",this.currentText="",o},t._toBlockConfigs=function(r,i){for(var o=[],a=0;a<r.length;a++){var s=r[a],l=s.nodeName.toLowerCase();if(l==="body"||ST(l)){this._trimCurrentText(),this.currentText!==""&&o.push(this._makeBlockConfig());var u=this.currentDepth,f=this.wrapper;ST(l)&&(this.wrapper=l,ST(f)&&this.currentDepth++),o.push.apply(o,this._toBlockConfigs(Array.from(s.childNodes),i)),this.currentDepth=u,this.wrapper=f;continue}var d=this.blockTypeMap.get(l);if(d!==void 0){this._trimCurrentText(),this.currentText!==""&&o.push(this._makeBlockConfig());var p=this.currentDepth,g=this.wrapper;if(this.wrapper=l==="pre"?"pre":this.wrapper,typeof d!="string"&&(d=this.disambiguate(l,this.wrapper)||d[0]||"unstyled"),!w4&&eD(s)&&(d==="unordered-list-item"||d==="ordered-list-item")){var v=s;this.currentDepth=uHe(v,this.currentDepth)}var y=x4(),w=this._toBlockConfigs(Array.from(s.childNodes),i);this._trimCurrentText(),o.push(this._makeBlockConfig({key:y,childConfigs:w,type:d})),this.currentDepth=p,this.wrapper=g;continue}if(l==="#text"){this._addTextNode(s,i);continue}if(l==="br"){this._addBreakNode(s,i);continue}if(fHe(s)){this._addImgNode(s,i);continue}if(cHe(s)){this._addAnchorNode(s,o,i);continue}var b=i;C4.has(l)&&(b=b.add(C4.get(l))),b=dHe(s,b);var x=lHe(s);x!=null&&(b=b.add(x)),o.push.apply(o,this._toBlockConfigs(Array.from(s.childNodes),b))}return o},t._appendText=function(r,i){var o;this.currentText+=r;var a=KVe.create({style:i,entity:this.currentEntity});this.characterList=(o=this.characterList).push.apply(o,Array(r.length).fill(a))},t._trimCurrentText=function(){var r=this.currentText.length,i=r-this.currentText.trimLeft().length,o=this.currentText.trimRight().length,a=this.characterList.findEntry(function(s){return s.getEntity()!==null});i=a!==void 0?Math.min(i,a[0]):i,a=this.characterList.reverse().findEntry(function(s){return s.getEntity()!==null}),o=a!==void 0?Math.max(o,r-a[0]):o,i>o?(this.currentText="",this.characterList=pu()):(this.currentText=this.currentText.slice(i,o),this.characterList=this.characterList.slice(i,o))},t._addTextNode=function(r,i){var o=r.textContent,a=o.trim();a===""&&this.wrapper!=="pre"&&(o=" "),this.wrapper!=="pre"&&(o=o.replace(QVe,""),o=o.replace(JVe,XY)),this._appendText(o,i)},t._addBreakNode=function(r,i){YVe(r)&&this._appendText(`
|
|
459
|
+
`,i)},t._addImgNode=function(r,i){if(YY(r)){var o=r,a={};aHe.forEach(function(s){var l=o.getAttribute(s);l&&(a[s]=l)}),this.currentEntity=this.entityMap.__create("IMAGE","IMMUTABLE",a),HY("draftjs_fix_paste_for_img")?o.getAttribute("role")!=="presentation"&&this._appendText("📷",i):this._appendText("📷",i),this.currentEntity=null}},t._addAnchorNode=function(r,i,o){if(GY(r)){var a=r,s={};oHe.forEach(function(l){var u=a.getAttribute(l);u&&(s[l]=u)}),s.url=new VY(a.href).toString(),this.currentEntity=this.entityMap.__create("LINK","MUTABLE",s||{}),i.push.apply(i,this._toBlockConfigs(Array.from(r.childNodes),o)),this.currentEntity=null}},t._toContentBlocks=function(r){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=r.length-1,a=0;a<=o;a++){var s=r[a];s.parent=i,s.prevSibling=a>0?r[a-1].key:null,s.nextSibling=a<o?r[a+1].key:null,s.children=pu(s.childConfigs.map(function(l){return l.key})),this.contentBlocks.push(new VVe(wT({},s))),this._toContentBlocks(s.childConfigs,s.key)}},t._hoistContainersInBlockConfigs=function(r){var i=this,o=pu(r).flatMap(function(a){return a.type!=="unstyled"||a.text!==""?[a]:i._hoistContainersInBlockConfigs(a.childConfigs)});return o},t._toFlatContentBlocks=function(r){var i=this,o=this._hoistContainersInBlockConfigs(r);o.forEach(function(a){var s=i._extractTextFromBlockConfigs(a.childConfigs),l=s.text,u=s.characterList;i.contentBlocks.push(new WVe(wT({},a,{text:a.text+l,characterList:a.characterList.concat(u)})))})},t._extractTextFromBlockConfigs=function(r){for(var i=r.length-1,o="",a=pu(),s=0;s<=i;s++){var l=r[s];o+=l.text,a=a.concat(l.characterList),o!==""&&l.type!=="unstyled"&&(o+=`
|
|
460
|
+
`,a=a.push(a.last()));var u=this._extractTextFromBlockConfigs(l.childConfigs);o+=u.text,a=a.concat(u.characterList)}return{text:o,characterList:a}},e}(),hHe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:qVe,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:HVe;t=t.trim().replace(ZVe,"").replace(eHe,XY).replace(tHe,"").replace(nHe,"");var i=n(t);if(!i)return null;var o=sHe(r),a=function(l,u){return l==="li"?u==="ol"?"ordered-list-item":"unordered-list-item":null};return new pHe(o,a).addDOMNode(i).getContentBlocks()},ZY=hHe;function gHe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){mHe(e,i,n[i])})}return e}function mHe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vHe=Mf,yHe=wa,bHe=ZY,_He=qs,xHe=WY,wHe=cc,JY=cn,SHe=DG,CHe=JY.List,EHe=JY.Repeat,QY=wHe("draft_tree_data_support"),kHe=QY?yHe:vHe,THe={processHTML:function(t,n){return bHe(t,xHe,n)},processText:function(t,n,r){return t.reduce(function(i,o,a){o=SHe(o);var s=_He(),l={key:s,type:r,text:o,characterList:CHe(EHe(n,o.length))};if(QY&&a!==0){var u=a-1,f=i[u]=i[u].merge({nextSibling:s});l=gHe({},l,{prevSibling:f.getKey()})}return i.push(new kHe(l)),i},[])}},RHe=THe;function AHe(e,t,n,r){var i=t.getStartKey(),o=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil(function(l,u){return u===i}).takeUntil(function(l,u){return u===o}).concat([[o,a.get(o)]]).map(function(l){var u=l.getDepth()+n;return u=Math.max(0,Math.min(u,r)),l.set("depth",u)});return a=a.merge(s),e.merge({blockMap:a,selectionBefore:t,selectionAfter:t})}var $He=AHe,Pc=so,ms=zn,OHe=$He,IHe=lo,bs={currentBlockContainsLink:function(t){var n=t.getSelection(),r=t.getCurrentContent(),i=r.getEntityMap();return r.getBlockForKey(n.getAnchorKey()).getCharacterList().slice(n.getStartOffset(),n.getEndOffset()).some(function(o){var a=o.getEntity();return!!a&&i.__get(a).getType()==="LINK"})},getCurrentBlockType:function(t){var n=t.getSelection();return t.getCurrentContent().getBlockForKey(n.getStartKey()).getType()},getDataObjectForLinkURL:function(t){return{url:t.toString()}},handleKeyCommand:function(t,n,r){switch(n){case"bold":return bs.toggleInlineStyle(t,"BOLD");case"italic":return bs.toggleInlineStyle(t,"ITALIC");case"underline":return bs.toggleInlineStyle(t,"UNDERLINE");case"code":return bs.toggleCode(t);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return bs.onBackspace(t);case"delete":case"delete-word":case"delete-to-end-of-block":return bs.onDelete(t);default:return null}},insertSoftNewline:function(t){var n=Pc.insertText(t.getCurrentContent(),t.getSelection(),`
|
|
461
|
+
`,t.getCurrentInlineStyle(),null),r=ms.push(t,n,"insert-characters");return ms.forceSelection(r,n.getSelectionAfter())},onBackspace:function(t){var n=t.getSelection();if(!n.isCollapsed()||n.getAnchorOffset()||n.getFocusOffset())return null;var r=t.getCurrentContent(),i=n.getStartKey(),o=r.getBlockBefore(i);if(o&&o.getType()==="atomic"){var a=r.getBlockMap().delete(o.getKey()),s=r.merge({blockMap:a,selectionAfter:n});if(s!==r)return ms.push(t,s,"remove-range")}var l=bs.tryToRemoveBlockStyle(t);return l?ms.push(t,l,"change-block-type"):null},onDelete:function(t){var n=t.getSelection();if(!n.isCollapsed())return null;var r=t.getCurrentContent(),i=n.getStartKey(),o=r.getBlockForKey(i),a=o.getLength();if(n.getStartOffset()<a)return null;var s=r.getBlockAfter(i);if(!s||s.getType()!=="atomic")return null;var l=n.merge({focusKey:s.getKey(),focusOffset:s.getLength()}),u=Pc.removeRange(r,l,"forward");return u!==r?ms.push(t,u,"remove-range"):null},onTab:function(t,n,r){var i=n.getSelection(),o=i.getAnchorKey();if(o!==i.getFocusKey())return n;var a=n.getCurrentContent(),s=a.getBlockForKey(o),l=s.getType();if(l!=="unordered-list-item"&&l!=="ordered-list-item")return n;t.preventDefault();var u=s.getDepth();if(!t.shiftKey&&u===r)return n;var f=OHe(a,i,t.shiftKey?-1:1,r);return ms.push(n,f,"adjust-depth")},toggleBlockType:function(t,n){var r=t.getSelection(),i=r.getStartKey(),o=r.getEndKey(),a=t.getCurrentContent(),s=r;if(i!==o&&r.getEndOffset()===0){var l=IHe(a.getBlockBefore(o));o=l.getKey(),s=s.merge({anchorKey:i,anchorOffset:r.getStartOffset(),focusKey:o,focusOffset:l.getLength(),isBackward:!1})}var u=a.getBlockMap().skipWhile(function(d,p){return p!==i}).reverse().skipWhile(function(d,p){return p!==o}).some(function(d){return d.getType()==="atomic"});if(u)return t;var f=a.getBlockForKey(i).getType()===n?"unstyled":n;return ms.push(t,Pc.setBlockType(a,s,f),"change-block-type")},toggleCode:function(t){var n=t.getSelection(),r=n.getAnchorKey(),i=n.getFocusKey();return n.isCollapsed()||r!==i?bs.toggleBlockType(t,"code-block"):bs.toggleInlineStyle(t,"CODE")},toggleInlineStyle:function(t,n){var r=t.getSelection(),i=t.getCurrentInlineStyle();if(r.isCollapsed())return ms.setInlineStyleOverride(t,i.has(n)?i.remove(n):i.add(n));var o=t.getCurrentContent(),a;return i.has(n)?a=Pc.removeInlineStyle(o,r,n):a=Pc.applyInlineStyle(o,r,n),ms.push(t,a,"change-inline-style")},toggleLink:function(t,n,r){var i=Pc.applyEntity(t.getCurrentContent(),n,r);return ms.push(t,i,"apply-entity")},tryToRemoveBlockStyle:function(t){var n=t.getSelection(),r=n.getAnchorOffset();if(n.isCollapsed()&&r===0){var i=n.getAnchorKey(),o=t.getCurrentContent(),a=o.getBlockForKey(i),s=a.getType(),l=o.getBlockBefore(i);if(s==="code-block"&&l&&l.getType()==="code-block"&&l.getLength()!==0)return null;if(s!=="unstyled")return Pc.setBlockType(o,n,"unstyled")}return null}},eX=bs,DHe=/\r\n?|\n/g;function PHe(e){return e.split(DHe)}var LHe=PHe,CT=Iy,E4=xa,MHe=RY,tX=so,ET=RHe,nX=zn,k4=eX,T4=VI,FHe=AY,R4=HS,A4=LHe;function NHe(e,t){t.preventDefault();var n=new MHe(t.clipboardData);if(!n.isRichText()){var r=n.getFiles(),i=n.getText();if(r.length>0){if(e.props.handlePastedFiles&&R4(e.props.handlePastedFiles(r)))return;FHe(r,function(A){if(A=A||i,!!A){var O=e._latestEditorState,z=A4(A),V=E4.create({style:O.getCurrentInlineStyle(),entity:T4(O.getCurrentContent(),O.getSelection())}),D=k4.getCurrentBlockType(O),W=ET.processText(z,V,D),ie=CT.createFromArray(W),se=tX.replaceWithFragment(O.getCurrentContent(),O.getSelection(),ie);e.update(nX.push(O,se,"insert-fragment"))}});return}}var o=[],a=n.getText(),s=n.getHTML(),l=e._latestEditorState;if(e.props.formatPastedText){var u=e.props.formatPastedText(a,s),f=u.text,d=u.html;a=f,s=d}if(!(e.props.handlePastedText&&R4(e.props.handlePastedText(a,s,l)))){if(a&&(o=A4(a)),!e.props.stripPastedStyles){var p=e.getClipboard();if(!e.props.formatPastedText&&n.isRichText()&&p){var g;if(((g=s)===null||g===void 0?void 0:g.indexOf(e.getEditorKey()))!==-1||o.length===1&&p.size===1&&p.first().getText()===a){e.update(db(e._latestEditorState,p));return}}else if(p&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&BHe(o,p)){e.update(db(e._latestEditorState,p));return}if(s){var v=ET.processHTML(s,e.props.blockRenderMap);if(v){var y=v.contentBlocks,w=v.entityMap;if(y){var b=CT.createFromArray(y);e.update(db(e._latestEditorState,b,w));return}}}e.setClipboard(null)}if(o.length){var x=E4.create({style:l.getCurrentInlineStyle(),entity:T4(l.getCurrentContent(),l.getSelection())}),C=k4.getCurrentBlockType(l),k=ET.processText(o,x,C),R=CT.createFromArray(k);e.update(db(e._latestEditorState,R))}}}function db(e,t,n){var r=tX.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return nX.push(e,r.set("entityMap",n),"insert-fragment")}function BHe(e,t){return e.length===t.size&&t.valueSeq().every(function(n,r){return n.getText()===e[r]})}var jHe=NHe,rX=uo,zHe=W7e,UHe=G7e,KHe=Z7e,WHe=nKe,VHe=pKe,HHe=gKe,qHe=vKe,GHe=_Ke,YHe=JKe,XHe=AVe,ZHe=jHe,iX=lY,JHe=rX.isBrowser("Chrome"),QHe=rX.isBrowser("Firefox"),$4=JHe||QHe?iX:function(e){},eqe={onBeforeInput:zHe,onBlur:UHe,onCompositionStart:KHe,onCopy:WHe,onCut:VHe,onDragOver:HHe,onDragStart:qHe,onFocus:GHe,onInput:YHe,onKeyDown:XHe,onPaste:ZHe,onSelect:iX,onMouseUp:$4,onKeyUp:$4},tqe=eqe,nqe=Af,rqe=nqe.unstable_flushControlled,iqe=rqe;function oqe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var kT=T,O4=Ff,aqe=function(e){oqe(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.shouldComponentUpdate=function(i){return this.props.text!==i.text||this.props.editorState.getSelection().getHasFocus()!==i.editorState.getSelection().getHasFocus()},n.render=function(){var i=this.props.editorState.getSelection().getHasFocus(),o=O4({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":i}),a={whiteSpace:"pre-wrap"};return kT.createElement("div",{className:o},kT.createElement("div",{className:O4("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:a},this.props.text))},t}(kT.Component),sqe=aqe,oX=JI,bm=US,aX=uo,Au=aX.isPlatform("Mac OS X"),I4=Au&&aX.isBrowser("Firefox < 29"),_u=oX.hasCommandModifier,gl=oX.isCtrlKeyCommand;function sX(e){return Au&&e.altKey||gl(e)}function lqe(e){return _u(e)?e.shiftKey?"redo":"undo":null}function uqe(e){return!Au&&e.shiftKey?null:sX(e)?"delete-word":"delete"}function cqe(e){return _u(e)&&Au?"backspace-to-start-of-line":sX(e)?"backspace-word":"backspace"}function fqe(e){switch(e.keyCode){case 66:return _u(e)?"bold":null;case 68:return gl(e)?"delete":null;case 72:return gl(e)?"backspace":null;case 73:return _u(e)?"italic":null;case 74:return _u(e)?"code":null;case 75:return Au&&gl(e)?"secondary-cut":null;case 77:return gl(e)?"split-block":null;case 79:return gl(e)?"split-block":null;case 84:return Au&&gl(e)?"transpose-characters":null;case 85:return _u(e)?"underline":null;case 87:return Au&&gl(e)?"backspace-word":null;case 89:return gl(e)?Au?"secondary-paste":"redo":null;case 90:return lqe(e)||null;case bm.RETURN:return"split-block";case bm.DELETE:return uqe(e);case bm.BACKSPACE:return cqe(e);case bm.LEFT:return I4&&_u(e)?"move-selection-to-start-of-block":null;case bm.RIGHT:return I4&&_u(e)?"move-selection-to-end-of-block":null;default:return null}}var lX=fqe,dqe=Nf;function l$(){return l$=dqe||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l$.apply(this,arguments)}function TT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){St(e,i,n[i])})}return e}function Et(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function St(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uX(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var pqe=KI,hqe=GG,gqe=R9e,mqe=e7e,vqe=$7e,yqe=tqe,D4=iqe,bqe=sqe,_qe=dY,xqe=zn,gu=T,wqe=YI,Sqe=KS,Cqe=uo,RT=Ff,Eqe=qs,kqe=lX,Tqe=WS,Rqe=cc,P4=bn,L4=By,Aqe=lo,cX=Cqe.isBrowser("IE"),$qe=!cX,M4={edit:yqe,composite:gqe,drag:vqe,cut:null,render:null},F4=!1,Oqe=function(e){uX(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.render=function(){return null},n.componentDidMount=function(){this._update()},n.componentDidUpdate=function(){this._update()},n._update=function(){var i=this.props.editor;i._latestEditorState=this.props.editorState,i._blockSelectEvents=!0},t}(gu.Component),fX=function(e){uX(t,e);function t(r){var i;return i=e.call(this,r)||this,St(Et(i),"_blockSelectEvents",void 0),St(Et(i),"_clipboard",void 0),St(Et(i),"_handler",void 0),St(Et(i),"_dragCount",void 0),St(Et(i),"_internalDrag",void 0),St(Et(i),"_editorKey",void 0),St(Et(i),"_placeholderAccessibilityID",void 0),St(Et(i),"_latestEditorState",void 0),St(Et(i),"_latestCommittedEditorState",void 0),St(Et(i),"_pendingStateFromBeforeInput",void 0),St(Et(i),"_onBeforeInput",void 0),St(Et(i),"_onBlur",void 0),St(Et(i),"_onCharacterData",void 0),St(Et(i),"_onCompositionEnd",void 0),St(Et(i),"_onCompositionStart",void 0),St(Et(i),"_onCopy",void 0),St(Et(i),"_onCut",void 0),St(Et(i),"_onDragEnd",void 0),St(Et(i),"_onDragOver",void 0),St(Et(i),"_onDragStart",void 0),St(Et(i),"_onDrop",void 0),St(Et(i),"_onInput",void 0),St(Et(i),"_onFocus",void 0),St(Et(i),"_onKeyDown",void 0),St(Et(i),"_onKeyPress",void 0),St(Et(i),"_onKeyUp",void 0),St(Et(i),"_onMouseDown",void 0),St(Et(i),"_onMouseUp",void 0),St(Et(i),"_onPaste",void 0),St(Et(i),"_onSelect",void 0),St(Et(i),"editor",void 0),St(Et(i),"editorContainer",void 0),St(Et(i),"focus",void 0),St(Et(i),"blur",void 0),St(Et(i),"setMode",void 0),St(Et(i),"exitCurrentMode",void 0),St(Et(i),"restoreEditorDOM",void 0),St(Et(i),"setClipboard",void 0),St(Et(i),"getClipboard",void 0),St(Et(i),"getEditorKey",void 0),St(Et(i),"update",void 0),St(Et(i),"onDragEnter",void 0),St(Et(i),"onDragLeave",void 0),St(Et(i),"_handleEditorContainerRef",function(o){i.editorContainer=o,i.editor=o!==null?o.firstChild:null}),St(Et(i),"focus",function(o){var a=i.props.editorState,s=a.getSelection().getHasFocus(),l=i.editor;if(l){var u=Sqe.getScrollParent(l),f=o||Tqe(u),d=f.x,p=f.y;L4(l)||P4(!1),l.focus(),u===window?window.scrollTo(d,p):wqe.setTop(u,p),s||i.update(xqe.forceSelection(a,a.getSelection()))}}),St(Et(i),"blur",function(){var o=i.editor;o&&(L4(o)||P4(!1),o.blur())}),St(Et(i),"setMode",function(o){var a=i.props,s=a.onPaste,l=a.onCut,u=a.onCopy,f=TT({},M4.edit);s&&(f.onPaste=s),l&&(f.onCut=l),u&&(f.onCopy=u);var d=TT({},M4,{edit:f});i._handler=d[o]}),St(Et(i),"exitCurrentMode",function(){i.setMode("edit")}),St(Et(i),"restoreEditorDOM",function(o){i.setState({contentsKey:i.state.contentsKey+1},function(){i.focus(o)})}),St(Et(i),"setClipboard",function(o){i._clipboard=o}),St(Et(i),"getClipboard",function(){return i._clipboard}),St(Et(i),"update",function(o){i._latestEditorState=o,i.props.onChange(o)}),St(Et(i),"onDragEnter",function(){i._dragCount++}),St(Et(i),"onDragLeave",function(){i._dragCount--,i._dragCount===0&&i.exitCurrentMode()}),i._blockSelectEvents=!1,i._clipboard=null,i._handler=null,i._dragCount=0,i._editorKey=r.editorKey||Eqe(),i._placeholderAccessibilityID="placeholder-"+i._editorKey,i._latestEditorState=r.editorState,i._latestCommittedEditorState=r.editorState,i._onBeforeInput=i._buildHandler("onBeforeInput"),i._onBlur=i._buildHandler("onBlur"),i._onCharacterData=i._buildHandler("onCharacterData"),i._onCompositionEnd=i._buildHandler("onCompositionEnd"),i._onCompositionStart=i._buildHandler("onCompositionStart"),i._onCopy=i._buildHandler("onCopy"),i._onCut=i._buildHandler("onCut"),i._onDragEnd=i._buildHandler("onDragEnd"),i._onDragOver=i._buildHandler("onDragOver"),i._onDragStart=i._buildHandler("onDragStart"),i._onDrop=i._buildHandler("onDrop"),i._onInput=i._buildHandler("onInput"),i._onFocus=i._buildHandler("onFocus"),i._onKeyDown=i._buildHandler("onKeyDown"),i._onKeyPress=i._buildHandler("onKeyPress"),i._onKeyUp=i._buildHandler("onKeyUp"),i._onMouseDown=i._buildHandler("onMouseDown"),i._onMouseUp=i._buildHandler("onMouseUp"),i._onPaste=i._buildHandler("onPaste"),i._onSelect=i._buildHandler("onSelect"),i.getEditorKey=function(){return i._editorKey},i.state={contentsKey:0},i}var n=t.prototype;return n._buildHandler=function(i){var o=this;return function(a){if(!o.props.readOnly){var s=o._handler&&o._handler[i];s&&(D4?D4(function(){return s(o,a)}):s(o,a))}}},n._showPlaceholder=function(){return!!this.props.placeholder&&!this.props.editorState.isInCompositionMode()&&!this.props.editorState.getCurrentContent().hasText()},n._renderPlaceholder=function(){if(this._showPlaceholder()){var i={text:Aqe(this.props.placeholder),editorState:this.props.editorState,textAlignment:this.props.textAlignment,accessibilityID:this._placeholderAccessibilityID};return gu.createElement(bqe,i)}return null},n._renderARIADescribedBy=function(){var i=this.props.ariaDescribedBy||"",o=this._showPlaceholder()?this._placeholderAccessibilityID:"";return i.replace("{{editor_id_placeholder}}",o)||void 0},n.render=function(){var i=this.props,o=i.blockRenderMap,a=i.blockRendererFn,s=i.blockStyleFn,l=i.customStyleFn,u=i.customStyleMap,f=i.editorState,d=i.preventScroll,p=i.readOnly,g=i.textAlignment,v=i.textDirectionality,y=RT({"DraftEditor/root":!0,"DraftEditor/alignLeft":g==="left","DraftEditor/alignRight":g==="right","DraftEditor/alignCenter":g==="center"}),w={outline:"none",userSelect:"text",WebkitUserSelect:"text",whiteSpace:"pre-wrap",wordWrap:"break-word"},b=this.props.role||"textbox",x=b==="combobox"?!!this.props.ariaExpanded:null,C={blockRenderMap:o,blockRendererFn:a,blockStyleFn:s,customStyleMap:TT({},hqe,u),customStyleFn:l,editorKey:this._editorKey,editorState:f,preventScroll:d,textDirectionality:v};return gu.createElement("div",{className:y},this._renderPlaceholder(),gu.createElement("div",{className:RT("DraftEditor/editorContainer"),ref:this._handleEditorContainerRef},gu.createElement("div",{"aria-activedescendant":p?null:this.props.ariaActiveDescendantID,"aria-autocomplete":p?null:this.props.ariaAutoComplete,"aria-controls":p?null:this.props.ariaControls,"aria-describedby":this._renderARIADescribedBy(),"aria-expanded":p?null:x,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-multiline":this.props.ariaMultiline,"aria-owns":p?null:this.props.ariaOwneeID,autoCapitalize:this.props.autoCapitalize,autoComplete:this.props.autoComplete,autoCorrect:this.props.autoCorrect,className:RT({notranslate:!p,"public/DraftEditor/content":!0}),contentEditable:!p,"data-testid":this.props.webDriverTestID,onBeforeInput:this._onBeforeInput,onBlur:this._onBlur,onCompositionEnd:this._onCompositionEnd,onCompositionStart:this._onCompositionStart,onCopy:this._onCopy,onCut:this._onCut,onDragEnd:this._onDragEnd,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this._onDragOver,onDragStart:this._onDragStart,onDrop:this._onDrop,onFocus:this._onFocus,onInput:this._onInput,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseUp:this._onMouseUp,onPaste:this._onPaste,onSelect:this._onSelect,ref:this.props.editorRef,role:p?null:b,spellCheck:$qe&&this.props.spellCheck,style:w,suppressContentEditableWarning:!0,tabIndex:this.props.tabIndex},gu.createElement(Oqe,{editor:this,editorState:f}),gu.createElement(mqe,l$({},C,{key:"contents"+this.state.contentsKey})))))},n.componentDidMount=function(){this._blockSelectEvents=!1,!F4&&Rqe("draft_ods_enabled")&&(F4=!0,_qe.initODS()),this.setMode("edit"),cX&&(this.editor?this.editor.ownerDocument.execCommand("AutoUrlDetect",!1,!1):ni.execCommand("AutoUrlDetect",!1,!1))},n.componentDidUpdate=function(){this._blockSelectEvents=!1,this._latestEditorState=this.props.editorState,this._latestCommittedEditorState=this.props.editorState},t}(gu.Component);St(fX,"defaultProps",{ariaDescribedBy:"{{editor_id_placeholder}}",blockRenderMap:pqe,blockRendererFn:function(){return null},blockStyleFn:function(){return""},keyBindingFn:kqe,readOnly:!1,spellCheck:!1,stripPastedStyles:!1});var Iqe=fX,Dqe={},Pqe={stringify:function(t){return"_"+String(t)},unstringify:function(t){return t.slice(1)}},dX=Pqe,Lqe=dX,Mqe=zf,N4=Mqe.strlen;function Fqe(e,t){var n=[];return e.findEntityRanges(function(r){return!!r.getEntity()},function(r,i){var o=e.getText(),a=e.getEntityAt(r);n.push({offset:N4(o.slice(0,r)),length:N4(o.slice(r,i)),key:Number(t[Lqe.stringify(a)])})}),n}var Nqe=Fqe,B4=zf,Bqe=Dy,jqe=function(t,n){return t===n},zqe=function(t){return!!t},Uqe=[];function Kqe(e,t,n){var r=[],i=t.map(function(o){return o.has(n)}).toList();return Bqe(i,jqe,zqe,function(o,a){var s=e.getText();r.push({offset:B4.strlen(s.slice(0,o)),length:B4.strlen(s.slice(o,a)),style:n})}),r}function Wqe(e){var t=e.getCharacterList().map(function(r){return r.getStyle()}).toList(),n=t.flatten().toSet().map(function(r){return Kqe(e,t,r)});return Array.prototype.concat.apply(Uqe,n.toJS())}var Vqe=Wqe;function Hqe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){qqe(e,i,n[i])})}return e}function qqe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gqe=Mf,Yqe=wa,pX=dX,Xqe=Nqe,Zqe=Vqe,Jqe=bn,j4=function(t,n){return{key:t.getKey(),text:t.getText(),type:t.getType(),depth:t.getDepth(),inlineStyleRanges:Zqe(t),entityRanges:Xqe(t,n),data:t.getData().toObject()}},Qqe=function(t,n,r,i){if(t instanceof Gqe){r.push(j4(t,n));return}t instanceof Yqe||Jqe(!1);var o=t.getParentKey(),a=i[t.getKey()]=Hqe({},j4(t,n),{children:[]});if(o){i[o].children.push(a);return}r.push(a)},eGe=function(t,n){var r=n.entityMap,i=[],o={},a={},s=0;return t.getBlockMap().forEach(function(l){l.findEntityRanges(function(u){return u.getEntity()!==null},function(u){var f=l.getEntityAt(u),d=pX.stringify(f);a[d]||(a[d]=f,r[d]="".concat(s),s++)}),Qqe(l,r,i,o)}),{blocks:i,entityMap:r}},tGe=function(t,n){var r=n.blocks,i=n.entityMap,o={};return Object.keys(i).forEach(function(a,s){var l=t.getEntity(pX.unstringify(a));o[s]={type:l.getType(),mutability:l.getMutability(),data:l.getData()}}),{blocks:r,entityMap:o}},nGe=function(t){var n={entityMap:{},blocks:[]};return n=eGe(t,n),n=tGe(t,n),n},rGe=nGe;function Pm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){iGe(e,i,n[i])})}return e}function iGe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oGe=qs,hX=bn,aGe=function(t,n){for(var r=[].concat(t).reverse();r.length;){var i=r.pop();n(i);var o=i.children;Array.isArray(o)||hX(!1),r=r.concat([].concat(o.reverse()))}},z4=function(t){if(!(t&&t.type))return!1;var n=t.type;return n==="unordered-list-item"||n==="ordered-list-item"},sGe=function(t){Array.isArray(t.children)&&(t.children=t.children.map(function(n){return n.type===t.type?Pm({},n,{depth:(t.depth||0)+1}):n}))},lGe={fromRawTreeStateToRawState:function(t){var n=t.blocks,r=[];return Array.isArray(n)||hX(!1),!Array.isArray(n)||!n.length?t:(aGe(n,function(i){var o=Pm({},i);z4(i)&&(o.depth=o.depth||0,sGe(i),i.children!=null&&i.children.length>0)||(delete o.children,r.push(o))}),t.blocks=r,Pm({},t,{blocks:r}))},fromRawStateToRawTreeState:function(t){var n=[],r=[];return t.blocks.forEach(function(i){var o=z4(i),a=i.depth||0,s=Pm({},i,{children:[]});if(!o){n.push(s);return}var l=r[0];if(l==null&&a===0)n.push(s);else if(l==null||l.depth<a-1){var u={key:oGe(),text:"",depth:a-1,type:i.type,children:[],entityRanges:[],inlineStyleRanges:[]};r.unshift(u),a===1?n.push(u):l!=null&&l.children.push(u),u.children.push(s)}else if(l.depth===a-1)l.children.push(s);else{for(;l!=null&&l.depth>=a;)r.shift(),l=r[0];a>0?l.children.push(s):n.push(s)}}),Pm({},t,{blocks:n})}},uGe=lGe,cGe=xa,fGe=cn,dGe=fGe.List;function pGe(e,t){var n=e.map(function(r,i){var o=t[i];return cGe.create({style:r,entity:o})});return dGe(n)}var hGe=pGe,gGe=zf,U4=gGe.substr;function mGe(e,t){var n=Array(e.length).fill(null);return t&&t.forEach(function(r){for(var i=U4(e,0,r.offset).length,o=i+U4(e,r.offset,r.length).length,a=i;a<o;a++)n[a]=r.key}),n}var vGe=mGe,yGe=zf,bGe=cn,_Ge=bGe.OrderedSet,K4=yGe.substr,xGe=_Ge();function wGe(e,t){var n=Array(e.length).fill(xGe);return t&&t.forEach(function(r){for(var i=K4(e,0,r.offset).length,o=i+K4(e,r.offset,r.length).length;i<o;)n[i]=n[i].add(r.style),i++}),n}var SGe=wGe;function Uv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){CGe(e,i,n[i])})}return e}function CGe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EGe=Mf,W4=wa,kGe=NI,TGe=LS,V4=uGe,H4=MS,RGe=hGe,AGe=vGe,$Ge=SGe,gX=qs,OGe=cc,tD=cn,u$=bn,q4=OGe("draft_tree_data_support"),G4=tD.List,IGe=tD.Map,mX=tD.OrderedMap,c$=function(t,n){var r=t.key,i=t.type,o=t.data,a=t.text,s=t.depth,l={text:a,depth:s||0,type:i||"unstyled",key:r||gX(),data:IGe(o),characterList:DGe(t,n)};return l},DGe=function(t,n){var r=t.text,i=t.entityRanges,o=t.inlineStyleRanges,a=i||[],s=o||[];return RGe($Ge(r,s),AGe(r,a.filter(function(l){return n.hasOwnProperty(l.key)}).map(function(l){return Uv({},l,{key:n[l.key]})})))},AT=function(t){return Uv({},t,{key:t.key||gX()})},Y4=function(t,n,r){var i=n.map(function(o){return Uv({},o,{parentRef:r})});return t.concat(i.reverse())},PGe=function(t,n){return t.map(AT).reduce(function(r,i,o){Array.isArray(i.children)||u$(!1);var a=i.children.map(AT),s=new W4(Uv({},c$(i,n),{prevSibling:o===0?null:t[o-1].key,nextSibling:o===t.length-1?null:t[o+1].key,children:G4(a.map(function(w){return w.key}))}));r=r.set(s.getKey(),s);for(var l=Y4([],a,s);l.length>0;){var u=l.pop(),f=u.parentRef,d=f.getChildKeys(),p=d.indexOf(u.key),g=Array.isArray(u.children);if(!g){g||u$(!1);break}var v=u.children.map(AT),y=new W4(Uv({},c$(u,n),{parent:f.getKey(),children:G4(v.map(function(w){return w.key})),prevSibling:p===0?null:d.get(p-1),nextSibling:p===d.size-1?null:d.get(p+1)}));r=r.set(y.getKey(),y),l=Y4(l,v,y)}return r},mX())},LGe=function(t,n){return mX(t.map(function(r){var i=new EGe(c$(r,n));return[i.getKey(),i]}))},MGe=function(t,n){var r=t.blocks.find(function(a){return Array.isArray(a.children)&&a.children.length>0}),i=q4&&!r?V4.fromRawStateToRawTreeState(t).blocks:t.blocks;if(!q4)return LGe(r?V4.fromRawTreeStateToRawState(t).blocks:i,n);var o=PGe(i,n);return o},FGe=function(t){var n=t.entityMap,r={};return Object.keys(n).forEach(function(i){var o=n[i],a=o.type,s=o.mutability,l=o.data;r[i]=TGe.__create(a,s,l||{})}),r},NGe=function(t){Array.isArray(t.blocks)||u$(!1);var n=FGe(t),r=MGe(t,n),i=r.isEmpty()?new H4:H4.createEmpty(r.first().getKey());return new kGe({blockMap:r,entityMap:n,selectionBefore:i,selectionAfter:i})},BGe=NGe,jGe=BY;function zGe(e){var t=jGe(e),n=0,r=0,i=0,o=0;if(t.length){if(t.length>1&&t[0].width===0){var a=t[1];n=a.top,r=a.right,i=a.bottom,o=a.left}else{var s=t[0];n=s.top,r=s.right,i=s.bottom,o=s.left}for(var l=1;l<t.length;l++){var u=t[l];u.height!==0&&u.width!==0&&(n=Math.min(n,u.top),r=Math.max(r,u.right),i=Math.max(i,u.bottom),o=Math.min(o,u.left))}}return{top:n,right:r,bottom:i,left:o,width:r-o,height:i-n}}var UGe=zGe,KGe=UGe;function WGe(e){var t=e.getSelection();if(!t.rangeCount)return null;var n=t.getRangeAt(0),r=KGe(n),i=r.top,o=r.right,a=r.bottom,s=r.left;return i===0&&o===0&&a===0&&s===0?null:r}var VGe=WGe,HGe=j6e,qGe=Iy,GGe=xa,YGe=q6e,XGe=Mf,ZGe=NI,JGe=KI,QGe=GG,eYe=Iqe,tYe=kY,nYe=LS,rYe=so,iYe=IG,oYe=zn,aYe=JI,sYe=Dqe,lYe=eX,uYe=MS,cYe=rGe,fYe=BGe,dYe=qs,pYe=lX,hYe=VGe,gYe=ZY,mYe={Editor:eYe,EditorBlock:tYe,EditorState:oYe,CompositeDecorator:YGe,Entity:nYe,EntityInstance:iYe,BlockMapBuilder:qGe,CharacterMetadata:GGe,ContentBlock:XGe,ContentState:ZGe,RawDraftContentState:sYe,SelectionState:uYe,AtomicBlockUtils:HGe,KeyBindingUtil:aYe,Modifier:rYe,RichUtils:lYe,DefaultDraftBlockRenderMap:JGe,DefaultDraftInlineStyle:QGe,convertFromHTML:gYe,convertFromRaw:fYe,convertToRaw:cYe,genKey:dYe,getDefaultKeyBinding:pYe,getVisibleSelectionRect:hYe},Rn=mYe,zy="delete",Hn=5,ia=1<<Hn,Ii=ia-1,nn={};function f$(){return{value:!1}}function oa(e){e&&(e.value=!0)}function nD(){}function Zp(e){return e.size===void 0&&(e.size=e.__iterate(vX)),e.size}function Hu(e,t){if(typeof t!="number"){var n=t>>>0;if(""+n!==t||n===4294967295)return NaN;t=n}return t<0?Zp(e)+t:t}function vX(){return!0}function qS(e,t,n){return(e===0&&!bX(e)||n!==void 0&&e<=-n)&&(t===void 0||n!==void 0&&t>=n)}function Uy(e,t){return yX(e,t,0)}function GS(e,t){return yX(e,t,t)}function yX(e,t,n){return e===void 0?n:bX(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function bX(e){return e<0||e===0&&1/e===-1/0}var _X="@@__IMMUTABLE_ITERABLE__@@";function io(e){return!!(e&&e[_X])}var xX="@@__IMMUTABLE_KEYED__@@";function Qn(e){return!!(e&&e[xX])}var wX="@@__IMMUTABLE_INDEXED__@@";function eo(e){return!!(e&&e[wX])}function YS(e){return Qn(e)||eo(e)}var Er=function(t){return io(t)?t:Do(t)},Sa=function(e){function t(n){return Qn(n)?n:fc(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Er),Uf=function(e){function t(n){return eo(n)?n:ns(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Er),Ch=function(e){function t(n){return io(n)&&!YS(n)?n:Rh(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Er);Er.Keyed=Sa;Er.Indexed=Uf;Er.Set=Ch;var SX="@@__IMMUTABLE_SEQ__@@";function rD(e){return!!(e&&e[SX])}var CX="@@__IMMUTABLE_RECORD__@@";function Eh(e){return!!(e&&e[CX])}function Gs(e){return io(e)||Eh(e)}var kh="@@__IMMUTABLE_ORDERED__@@";function Xa(e){return!!(e&&e[kh])}var Ky=0,Qa=1,ga=2,d$=typeof Symbol=="function"&&Symbol.iterator,EX="@@iterator",XS=d$||EX,mn=function(t){this.next=t};mn.prototype.toString=function(){return"[Iterator]"};mn.KEYS=Ky;mn.VALUES=Qa;mn.ENTRIES=ga;mn.prototype.inspect=mn.prototype.toSource=function(){return this.toString()};mn.prototype[XS]=function(){return this};function rr(e,t,n,r){var i=e===0?t:e===1?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function oo(){return{value:void 0,done:!0}}function kX(e){return Array.isArray(e)?!0:!!ZS(e)}function X4(e){return e&&typeof e.next=="function"}function p$(e){var t=ZS(e);return t&&t.call(e)}function ZS(e){var t=e&&(d$&&e[d$]||e[EX]);if(typeof t=="function")return t}function vYe(e){var t=ZS(e);return t&&t===e.entries}function yYe(e){var t=ZS(e);return t&&t===e.keys}var Th=Object.prototype.hasOwnProperty;function TX(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var Do=function(e){function t(n){return n==null?oD():Gs(n)?n.toSeq():_Ye(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(r,i){var o=this._cache;if(o){for(var a=o.length,s=0;s!==a;){var l=o[i?a-++s:s++];if(r(l[1],l[0],this)===!1)break}return s}return this.__iterateUncached(r,i)},t.prototype.__iterator=function(r,i){var o=this._cache;if(o){var a=o.length,s=0;return new mn(function(){if(s===a)return oo();var l=o[i?a-++s:s++];return rr(r,l[0],l[1])})}return this.__iteratorUncached(r,i)},t}(Er),fc=function(e){function t(n){return n==null?oD().toKeyedSeq():io(n)?Qn(n)?n.toSeq():n.fromEntrySeq():Eh(n)?n.toSeq():aD(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(Do),ns=function(e){function t(n){return n==null?oD():io(n)?Qn(n)?n.entrySeq():n.toIndexedSeq():Eh(n)?n.toSeq().entrySeq():RX(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(Do),Rh=function(e){function t(n){return(io(n)&&!YS(n)?n:ns(n)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(Do);Do.isSeq=rD;Do.Keyed=fc;Do.Set=Rh;Do.Indexed=ns;Do.prototype[SX]=!0;var wf=function(e){function t(n){this._array=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,i){return this.has(r)?this._array[Hu(this,r)]:i},t.prototype.__iterate=function(r,i){for(var o=this._array,a=o.length,s=0;s!==a;){var l=i?a-++s:s++;if(r(o[l],l,this)===!1)break}return s},t.prototype.__iterator=function(r,i){var o=this._array,a=o.length,s=0;return new mn(function(){if(s===a)return oo();var l=i?a-++s:s++;return rr(r,l,o[l])})},t}(ns),iD=function(e){function t(n){var r=Object.keys(n).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n):[]);this._object=n,this._keys=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,i){return i!==void 0&&!this.has(r)?i:this._object[r]},t.prototype.has=function(r){return Th.call(this._object,r)},t.prototype.__iterate=function(r,i){for(var o=this._object,a=this._keys,s=a.length,l=0;l!==s;){var u=a[i?s-++l:l++];if(r(o[u],u,this)===!1)break}return l},t.prototype.__iterator=function(r,i){var o=this._object,a=this._keys,s=a.length,l=0;return new mn(function(){if(l===s)return oo();var u=a[i?s-++l:l++];return rr(r,u,o[u])})},t}(fc);iD.prototype[kh]=!0;var bYe=function(e){function t(n){this._collection=n,this.size=n.length||n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(r,i){if(i)return this.cacheResult().__iterate(r,i);var o=this._collection,a=p$(o),s=0;if(X4(a))for(var l;!(l=a.next()).done&&r(l.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(r,i){if(i)return this.cacheResult().__iterator(r,i);var o=this._collection,a=p$(o);if(!X4(a))return new mn(oo);var s=0;return new mn(function(){var l=a.next();return l.done?l:rr(r,s++,l.value)})},t}(ns),Z4;function oD(){return Z4||(Z4=new wf([]))}function aD(e){var t=sD(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new iD(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function RX(e){var t=sD(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function _Ye(e){var t=sD(e);if(t)return vYe(e)?t.fromEntrySeq():yYe(e)?t.toSetSeq():t;if(typeof e=="object")return new iD(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function sD(e){return TX(e)?new wf(e):kX(e)?new bYe(e):void 0}var AX="@@__IMMUTABLE_MAP__@@";function lD(e){return!!(e&&e[AX])}function $X(e){return lD(e)&&Xa(e)}function J4(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function ko(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(J4(e)&&J4(t)&&e.equals(t))}var _m=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,n){t|=0,n|=0;var r=t&65535,i=n&65535;return r*i+((t>>>16)*i+r*(n>>>16)<<16>>>0)|0};function JS(e){return e>>>1&1073741824|e&3221225471}var xYe=Object.prototype.valueOf;function xo(e){if(e==null)return Q4(e);if(typeof e.hashCode=="function")return JS(e.hashCode(e));var t=TYe(e);if(t==null)return Q4(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return wYe(t);case"string":return t.length>RYe?SYe(t):h$(t);case"object":case"function":return EYe(t);case"symbol":return CYe(t);default:if(typeof t.toString=="function")return h$(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function Q4(e){return e===null?1108378658:1108378659}function wYe(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return JS(t)}function SYe(e){var t=IT[e];return t===void 0&&(t=h$(e),OT===AYe&&(OT=0,IT={}),OT++,IT[e]=t),t}function h$(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return JS(t)}function CYe(e){var t=n5[e];return t!==void 0||(t=OX(),n5[e]=t),t}function EYe(e){var t;if(g$&&(t=m$.get(e),t!==void 0)||(t=e[Yc],t!==void 0)||!t5&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Yc],t!==void 0||(t=kYe(e),t!==void 0)))return t;if(t=OX(),g$)m$.set(e,t);else{if(e5!==void 0&&e5(e)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(t5)Object.defineProperty(e,Yc,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Yc]=t;else if(e.nodeType!==void 0)e[Yc]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}var e5=Object.isExtensible,t5=function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}}();function kYe(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function TYe(e){return e.valueOf!==xYe&&typeof e.valueOf=="function"?e.valueOf(e):e}function OX(){var e=++$T;return $T&1073741824&&($T=0),e}var g$=typeof WeakMap=="function",m$;g$&&(m$=new WeakMap);var n5=Object.create(null),$T=0,Yc="__immutablehash__";typeof Symbol=="function"&&(Yc=Symbol(Yc));var RYe=16,AYe=255,OT=0,IT={},QS=function(e){function t(n,r){this._iter=n,this._useKeys=r,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,i){return this._iter.get(r,i)},t.prototype.has=function(r){return this._iter.has(r)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var r=this,i=uD(this,!0);return this._useKeys||(i.valueSeq=function(){return r._iter.toSeq().reverse()}),i},t.prototype.map=function(r,i){var o=this,a=MX(this,r,i);return this._useKeys||(a.valueSeq=function(){return o._iter.toSeq().map(r,i)}),a},t.prototype.__iterate=function(r,i){var o=this;return this._iter.__iterate(function(a,s){return r(a,s,o)},i)},t.prototype.__iterator=function(r,i){return this._iter.__iterator(r,i)},t}(fc);QS.prototype[kh]=!0;var IX=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(r){return this._iter.includes(r)},t.prototype.__iterate=function(r,i){var o=this,a=0;return i&&Zp(this),this._iter.__iterate(function(s){return r(s,i?o.size-++a:a++,o)},i)},t.prototype.__iterator=function(r,i){var o=this,a=this._iter.__iterator(Qa,i),s=0;return i&&Zp(this),new mn(function(){var l=a.next();return l.done?l:rr(r,i?o.size-++s:s++,l.value,l)})},t}(ns),DX=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(r){return this._iter.includes(r)},t.prototype.__iterate=function(r,i){var o=this;return this._iter.__iterate(function(a){return r(a,a,o)},i)},t.prototype.__iterator=function(r,i){var o=this._iter.__iterator(Qa,i);return new mn(function(){var a=o.next();return a.done?a:rr(r,a.value,a.value,a)})},t}(Rh),PX=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(r,i){var o=this;return this._iter.__iterate(function(a){if(a){i5(a);var s=io(a);return r(s?a.get(1):a[1],s?a.get(0):a[0],o)}},i)},t.prototype.__iterator=function(r,i){var o=this._iter.__iterator(Qa,i);return new mn(function(){for(;;){var a=o.next();if(a.done)return a;var s=a.value;if(s){i5(s);var l=io(s);return rr(r,l?s.get(0):s[0],l?s.get(1):s[1],a)}}})},t}(fc);IX.prototype.cacheResult=QS.prototype.cacheResult=DX.prototype.cacheResult=PX.prototype.cacheResult=dD;function LX(e){var t=Ys(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var n=e.reverse.apply(this);return n.flip=function(){return e.reverse()},n},t.has=function(n){return e.includes(n)},t.includes=function(n){return e.has(n)},t.cacheResult=dD,t.__iterateUncached=function(n,r){var i=this;return e.__iterate(function(o,a){return n(a,o,i)!==!1},r)},t.__iteratorUncached=function(n,r){if(n===ga){var i=e.__iterator(n,r);return new mn(function(){var o=i.next();if(!o.done){var a=o.value[0];o.value[0]=o.value[1],o.value[1]=a}return o})}return e.__iterator(n===Qa?Ky:Qa,r)},t}function MX(e,t,n){var r=Ys(e);return r.size=e.size,r.has=function(i){return e.has(i)},r.get=function(i,o){var a=e.get(i,nn);return a===nn?o:t.call(n,a,i,e)},r.__iterateUncached=function(i,o){var a=this;return e.__iterate(function(s,l,u){return i(t.call(n,s,l,u),l,a)!==!1},o)},r.__iteratorUncached=function(i,o){var a=e.__iterator(ga,o);return new mn(function(){var s=a.next();if(s.done)return s;var l=s.value,u=l[0];return rr(i,u,t.call(n,l[1],u,e),s)})},r}function uD(e,t){var n=this,r=Ys(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var i=LX(e);return i.reverse=function(){return e.flip()},i}),r.get=function(i,o){return e.get(t?i:-1-i,o)},r.has=function(i){return e.has(t?i:-1-i)},r.includes=function(i){return e.includes(i)},r.cacheResult=dD,r.__iterate=function(i,o){var a=this,s=0;return o&&Zp(e),e.__iterate(function(l,u){return i(l,t?u:o?a.size-++s:s++,a)},!o)},r.__iterator=function(i,o){var a=0;o&&Zp(e);var s=e.__iterator(ga,!o);return new mn(function(){var l=s.next();if(l.done)return l;var u=l.value;return rr(i,t?u[0]:o?n.size-++a:a++,u[1],l)})},r}function FX(e,t,n,r){var i=Ys(e);return r&&(i.has=function(o){var a=e.get(o,nn);return a!==nn&&!!t.call(n,a,o,e)},i.get=function(o,a){var s=e.get(o,nn);return s!==nn&&t.call(n,s,o,e)?s:a}),i.__iterateUncached=function(o,a){var s=this,l=0;return e.__iterate(function(u,f,d){if(t.call(n,u,f,d))return l++,o(u,r?f:l-1,s)},a),l},i.__iteratorUncached=function(o,a){var s=e.__iterator(ga,a),l=0;return new mn(function(){for(;;){var u=s.next();if(u.done)return u;var f=u.value,d=f[0],p=f[1];if(t.call(n,p,d,e))return rr(o,r?d:l++,p,u)}})},i}function $Ye(e,t,n){var r=$h().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(a){return a+1})}),r.asImmutable()}function OYe(e,t,n){var r=Qn(e),i=(Xa(e)?Fl():$h()).asMutable();e.__iterate(function(a,s){i.update(t.call(n,a,s,e),function(l){return l=l||[],l.push(r?[s,a]:a),l})});var o=fD(e);return i.map(function(a){return In(e,o(a))}).asImmutable()}function IYe(e,t,n){var r=Qn(e),i=[[],[]];e.__iterate(function(a,s){i[t.call(n,a,s,e)?1:0].push(r?[s,a]:a)});var o=fD(e);return i.map(function(a){return In(e,o(a))})}function cD(e,t,n,r){var i=e.size;if(qS(t,n,i))return e;var o=Uy(t,i),a=GS(n,i);if(o!==o||a!==a)return cD(e.toSeq().cacheResult(),t,n,r);var s=a-o,l;s===s&&(l=s<0?0:s);var u=Ys(e);return u.size=l===0?l:e.size&&l||void 0,!r&&rD(e)&&l>=0&&(u.get=function(f,d){return f=Hu(this,f),f>=0&&f<l?e.get(f+o,d):d}),u.__iterateUncached=function(f,d){var p=this;if(l===0)return 0;if(d)return this.cacheResult().__iterate(f,d);var g=0,v=!0,y=0;return e.__iterate(function(w,b){if(!(v&&(v=g++<o)))return y++,f(w,r?b:y-1,p)!==!1&&y!==l}),y},u.__iteratorUncached=function(f,d){if(l!==0&&d)return this.cacheResult().__iterator(f,d);if(l===0)return new mn(oo);var p=e.__iterator(f,d),g=0,v=0;return new mn(function(){for(;g++<o;)p.next();if(++v>l)return oo();var y=p.next();return r||f===Qa||y.done?y:f===Ky?rr(f,v-1,void 0,y):rr(f,v-1,y.value[1],y)})},u}function DYe(e,t,n){var r=Ys(e);return r.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=0;return e.__iterate(function(l,u,f){return t.call(n,l,u,f)&&++s&&i(l,u,a)}),s},r.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(ga,o),l=!0;return new mn(function(){if(!l)return oo();var u=s.next();if(u.done)return u;var f=u.value,d=f[0],p=f[1];return t.call(n,p,d,a)?i===ga?u:rr(i,d,p,u):(l=!1,oo())})},r}function NX(e,t,n,r){var i=Ys(e);return i.__iterateUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterate(o,a);var l=!0,u=0;return e.__iterate(function(f,d,p){if(!(l&&(l=t.call(n,f,d,p))))return u++,o(f,r?d:u-1,s)}),u},i.__iteratorUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterator(o,a);var l=e.__iterator(ga,a),u=!0,f=0;return new mn(function(){var d,p,g;do{if(d=l.next(),d.done)return r||o===Qa?d:o===Ky?rr(o,f++,void 0,d):rr(o,f++,d.value[1],d);var v=d.value;p=v[0],g=v[1],u&&(u=t.call(n,g,p,s))}while(u);return o===ga?d:rr(o,p,g,d)})},i}function PYe(e,t){var n=Qn(e),r=[e].concat(t).map(function(a){return io(a)?n&&(a=Sa(a)):a=n?aD(a):RX(Array.isArray(a)?a:[a]),a}).filter(function(a){return a.size!==0});if(r.length===0)return e;if(r.length===1){var i=r[0];if(i===e||n&&Qn(i)||eo(e)&&eo(i))return i}var o=new wf(r);return n?o=o.toKeyedSeq():eo(e)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=r.reduce(function(a,s){if(a!==void 0){var l=s.size;if(l!==void 0)return a+l}},0),o}function BX(e,t,n){var r=Ys(e);return r.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,s=!1;function l(u,f){u.__iterate(function(d,p){return(!t||f<t)&&io(d)?l(d,f+1):(a++,i(d,n?p:a-1,r)===!1&&(s=!0)),!s},o)}return l(e,0),a},r.__iteratorUncached=function(i,o){if(o)return this.cacheResult().__iterator(i,o);var a=e.__iterator(i,o),s=[],l=0;return new mn(function(){for(;a;){var u=a.next();if(u.done!==!1){a=s.pop();continue}var f=u.value;if(i===ga&&(f=f[1]),(!t||s.length<t)&&io(f))s.push(a),a=f.__iterator(i,o);else return n?u:rr(i,l++,f,u)}return oo()})},r}function LYe(e,t,n){var r=fD(e);return e.toSeq().map(function(i,o){return r(t.call(n,i,o,e))}).flatten(!0)}function MYe(e,t){var n=Ys(e);return n.size=e.size&&e.size*2-1,n.__iterateUncached=function(r,i){var o=this,a=0;return e.__iterate(function(s){return(!a||r(t,a++,o)!==!1)&&r(s,a++,o)!==!1},i),a},n.__iteratorUncached=function(r,i){var o=e.__iterator(Qa,i),a=0,s;return new mn(function(){return(!s||a%2)&&(s=o.next(),s.done)?s:a%2?rr(r,a++,t):rr(r,a++,s.value,s)})},n}function Jp(e,t,n){t||(t=jX);var r=Qn(e),i=0,o=e.toSeq().map(function(a,s){return[s,a,i++,n?n(a,s,e):a]}).valueSeq().toArray();return o.sort(function(a,s){return t(a[3],s[3])||a[2]-s[2]}).forEach(r?function(a,s){o[s].length=2}:function(a,s){o[s]=a[1]}),r?fc(o):eo(e)?ns(o):Rh(o)}function pb(e,t,n){if(t||(t=jX),n){var r=e.toSeq().map(function(i,o){return[i,n(i,o,e)]}).reduce(function(i,o){return r5(t,i[1],o[1])?o:i});return r&&r[0]}return e.reduce(function(i,o){return r5(t,i,o)?o:i})}function r5(e,t,n){var r=e(n,t);return r===0&&n!==t&&(n==null||n!==n)||r>0}function hb(e,t,n,r){var i=Ys(e),o=new wf(n).map(function(a){return a.size});return i.size=r?o.max():o.min(),i.__iterate=function(a,s){for(var l=this.__iterator(Qa,s),u,f=0;!(u=l.next()).done&&a(u.value,f++,this)!==!1;);return f},i.__iteratorUncached=function(a,s){var l=n.map(function(d){return d=Er(d),p$(s?d.reverse():d)}),u=0,f=!1;return new mn(function(){var d;return f||(d=l.map(function(p){return p.next()}),f=r?d.every(function(p){return p.done}):d.some(function(p){return p.done})),f?oo():rr(a,u++,t.apply(null,d.map(function(p){return p.value})))})},i}function In(e,t){return e===t?e:rD(e)?t:e.constructor(t)}function i5(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function fD(e){return Qn(e)?Sa:eo(e)?Uf:Ch}function Ys(e){return Object.create((Qn(e)?fc:eo(e)?ns:Rh).prototype)}function dD(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Do.prototype.cacheResult.call(this)}function jX(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e<t?-1:0}function $s(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),i=0;i<n;i++)r[i]=e[i+t];return r}function pD(e,t){if(!e)throw new Error(t)}function Co(e){pD(e!==1/0,"Cannot perform this action with an infinite size.")}function zX(e){if(TX(e)&&typeof e!="string")return e;if(Xa(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}var FYe=Object.prototype.toString;function NYe(e){if(!e||typeof e!="object"||FYe.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t,r=Object.getPrototypeOf(t);r!==null;)n=r,r=Object.getPrototypeOf(n);return n===t}function qu(e){return typeof e=="object"&&(Gs(e)||Array.isArray(e)||NYe(e))}function Kv(e){try{return typeof e=="string"?JSON.stringify(e):String(e)}catch{return JSON.stringify(e)}}function BYe(e,t){return Gs(e)?e.has(t):qu(e)&&Th.call(e,t)}function UX(e,t,n){return Gs(e)?e.get(t,n):BYe(e,t)?typeof e.get=="function"?e.get(t):e[t]:n}function dx(e){if(Array.isArray(e))return $s(e);var t={};for(var n in e)Th.call(e,n)&&(t[n]=e[n]);return t}function jYe(e,t){if(!qu(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Gs(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!Th.call(e,t))return e;var n=dx(e);return Array.isArray(n)?n.splice(t,1):delete n[t],n}function zYe(e,t,n){if(!qu(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Gs(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,n)}if(Th.call(e,t)&&n===e[t])return e;var r=dx(e);return r[t]=n,r}function Ah(e,t,n,r){r||(r=n,n=void 0);var i=KX(Gs(e),e,zX(t),0,n,r);return i===nn?n:i}function KX(e,t,n,r,i,o){var a=t===nn;if(r===n.length){var s=a?i:t,l=o(s);return l===s?t:l}if(!a&&!qu(t))throw new TypeError("Cannot update within non-data-structure value in path ["+n.slice(0,r).map(Kv)+"]: "+t);var u=n[r],f=a?nn:UX(t,u,nn),d=KX(f===nn?e:Gs(f),f,n,r+1,i,o);return d===f?t:d===nn?jYe(t,u):zYe(a?e?Wa():{}:t,u,d)}function UYe(e,t,n){return Ah(e,t,nn,function(){return n})}function hD(e,t){return UYe(this,e,t)}function KYe(e,t){return Ah(e,t,function(){return nn})}function gD(e){return KYe(this,e)}function WX(e,t,n,r){return Ah(e,[t],n,r)}function mD(e,t,n){return arguments.length===1?e(this):WX(this,e,t,n)}function vD(e,t,n){return Ah(this,e,t,n)}function VX(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return qX(this,e)}function HX(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return qX(this,t,e)}function qX(e,t,n){for(var r=[],i=0;i<t.length;i++){var o=Sa(t[i]);o.size!==0&&r.push(o)}return r.length===0?e:e.toSeq().size===0&&!e.__ownerID&&r.length===1?e.constructor(r[0]):e.withMutations(function(a){for(var s=n?function(u,f){WX(a,f,nn,function(d){return d===nn?u:n(d,u,f)})}:function(u,f){a.set(f,u)},l=0;l<r.length;l++)r[l].forEach(s)})}function yD(e,t,n){return bD(e,t,WYe(n))}function bD(e,t,n){if(!qu(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Gs(e))return typeof n=="function"&&e.mergeWith?e.mergeWith.apply(e,[n].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var r=Array.isArray(e),i=e,o=r?Uf:Sa,a=r?function(l){i===e&&(i=dx(i)),i.push(l)}:function(l,u){var f=Th.call(i,u),d=f&&n?n(i[u],l,u):l;(!f||d!==i[u])&&(i===e&&(i=dx(i)),i[u]=d)},s=0;s<t.length;s++)o(t[s]).forEach(a);return i}function WYe(e){function t(n,r,i){return qu(n)&&qu(r)&&VYe(n,r)?bD(n,[r],t):e?e(n,r,i):r}return t}function VYe(e,t){var n=Do(e),r=Do(t);return eo(n)===eo(r)&&Qn(n)===Qn(r)}function GX(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return yD(this,e)}function YX(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return yD(this,t,e)}function _D(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ah(this,e,Wa(),function(r){return bD(r,t)})}function xD(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ah(this,e,Wa(),function(r){return yD(r,t)})}function Wy(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Vy(){return this.__ownerID?this:this.__ensureOwner(new nD)}function Hy(){return this.__ensureOwner()}function wD(){return this.__altered}var $h=function(e){function t(n){return n==null?Wa():lD(n)&&!Xa(n)?n:Wa().withMutations(function(r){var i=e(n);Co(i.size),i.forEach(function(o,a){return r.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return Wa().withMutations(function(o){for(var a=0;a<r.length;a+=2){if(a+1>=r.length)throw new Error("Missing value for key: "+r[a]);o.set(r[a],r[a+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(r,i){return this._root?this._root.get(0,void 0,r,i):i},t.prototype.set=function(r,i){return s5(this,r,i)},t.prototype.remove=function(r){return s5(this,r,nn)},t.prototype.deleteAll=function(r){var i=Er(r);return i.size===0?this:this.withMutations(function(o){i.forEach(function(a){return o.remove(a)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Wa()},t.prototype.sort=function(r){return Fl(Jp(this,r))},t.prototype.sortBy=function(r,i){return Fl(Jp(this,i,r))},t.prototype.map=function(r,i){var o=this;return this.withMutations(function(a){a.forEach(function(s,l){a.set(l,r.call(i,s,l,o))})})},t.prototype.__iterator=function(r,i){return new HYe(this,r,i)},t.prototype.__iterate=function(r,i){var o=this,a=0;return this._root&&this._root.iterate(function(s){return a++,r(s[1],s[0],o)},i),a},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?SD(this.size,this._root,r,this.__hash):this.size===0?Wa():(this.__ownerID=r,this.__altered=!1,this)},t}(Sa);$h.isMap=lD;var Gn=$h.prototype;Gn[AX]=!0;Gn[zy]=Gn.remove;Gn.removeAll=Gn.deleteAll;Gn.setIn=hD;Gn.removeIn=Gn.deleteIn=gD;Gn.update=mD;Gn.updateIn=vD;Gn.merge=Gn.concat=VX;Gn.mergeWith=HX;Gn.mergeDeep=GX;Gn.mergeDeepWith=YX;Gn.mergeIn=_D;Gn.mergeDeepIn=xD;Gn.withMutations=Wy;Gn.wasAltered=wD;Gn.asImmutable=Hy;Gn["@@transducer/init"]=Gn.asMutable=Vy;Gn["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Gn["@@transducer/result"]=function(e){return e.asImmutable()};var Wv=function(t,n){this.ownerID=t,this.entries=n};Wv.prototype.get=function(t,n,r,i){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(ko(r,o[a][0]))return o[a][1];return i};Wv.prototype.update=function(t,n,r,i,o,a,s){for(var l=o===nn,u=this.entries,f=0,d=u.length;f<d&&!ko(i,u[f][0]);f++);var p=f<d;if(p?u[f][1]===o:l)return this;if(oa(s),(l||!p)&&oa(a),!(l&&u.length===1)){if(!p&&!l&&u.length>=JYe)return qYe(t,u,i,o);var g=t&&t===this.ownerID,v=g?u:$s(u);return p?l?f===d-1?v.pop():v[f]=v.pop():v[f]=[i,o]:v.push([i,o]),g?(this.entries=v,this):new Wv(t,v)}};var Qp=function(t,n,r){this.ownerID=t,this.bitmap=n,this.nodes=r};Qp.prototype.get=function(t,n,r,i){n===void 0&&(n=xo(r));var o=1<<((t===0?n:n>>>t)&Ii),a=this.bitmap;return a&o?this.nodes[XX(a&o-1)].get(t+Hn,n,r,i):i};Qp.prototype.update=function(t,n,r,i,o,a,s){r===void 0&&(r=xo(i));var l=(n===0?r:r>>>n)&Ii,u=1<<l,f=this.bitmap,d=(f&u)!==0;if(!d&&o===nn)return this;var p=XX(f&u-1),g=this.nodes,v=d?g[p]:void 0,y=CD(v,t,n+Hn,r,i,o,a,s);if(y===v)return this;if(!d&&y&&g.length>=QYe)return YYe(t,g,f,l,y);if(d&&!y&&g.length===2&&l5(g[p^1]))return g[p^1];if(d&&y&&g.length===1&&l5(y))return y;var w=t&&t===this.ownerID,b=d?y?f:f^u:f|u,x=d?y?ZX(g,p,y,w):ZYe(g,p,w):XYe(g,p,y,w);return w?(this.bitmap=b,this.nodes=x,this):new Qp(t,b,x)};var Vv=function(t,n,r){this.ownerID=t,this.count=n,this.nodes=r};Vv.prototype.get=function(t,n,r,i){n===void 0&&(n=xo(r));var o=(t===0?n:n>>>t)&Ii,a=this.nodes[o];return a?a.get(t+Hn,n,r,i):i};Vv.prototype.update=function(t,n,r,i,o,a,s){r===void 0&&(r=xo(i));var l=(n===0?r:r>>>n)&Ii,u=o===nn,f=this.nodes,d=f[l];if(u&&!d)return this;var p=CD(d,t,n+Hn,r,i,o,a,s);if(p===d)return this;var g=this.count;if(!d)g++;else if(!p&&(g--,g<eXe))return GYe(t,f,g,l);var v=t&&t===this.ownerID,y=ZX(f,l,p,v);return v?(this.count=g,this.nodes=y,this):new Vv(t,g,y)};var eh=function(t,n,r){this.ownerID=t,this.keyHash=n,this.entries=r};eh.prototype.get=function(t,n,r,i){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(ko(r,o[a][0]))return o[a][1];return i};eh.prototype.update=function(t,n,r,i,o,a,s){r===void 0&&(r=xo(i));var l=o===nn;if(r!==this.keyHash)return l?this:(oa(s),oa(a),ED(this,t,n,r,[i,o]));for(var u=this.entries,f=0,d=u.length;f<d&&!ko(i,u[f][0]);f++);var p=f<d;if(p?u[f][1]===o:l)return this;if(oa(s),(l||!p)&&oa(a),l&&d===2)return new Ml(t,this.keyHash,u[f^1]);var g=t&&t===this.ownerID,v=g?u:$s(u);return p?l?f===d-1?v.pop():v[f]=v.pop():v[f]=[i,o]:v.push([i,o]),g?(this.entries=v,this):new eh(t,this.keyHash,v)};var Ml=function(t,n,r){this.ownerID=t,this.keyHash=n,this.entry=r};Ml.prototype.get=function(t,n,r,i){return ko(r,this.entry[0])?this.entry[1]:i};Ml.prototype.update=function(t,n,r,i,o,a,s){var l=o===nn,u=ko(i,this.entry[0]);if(u?o===this.entry[1]:l)return this;if(oa(s),l){oa(a);return}return u?t&&t===this.ownerID?(this.entry[1]=o,this):new Ml(t,this.keyHash,[i,o]):(oa(a),ED(this,t,n,xo(i),[i,o]))};Wv.prototype.iterate=eh.prototype.iterate=function(e,t){for(var n=this.entries,r=0,i=n.length-1;r<=i;r++)if(e(n[t?i-r:r])===!1)return!1};Qp.prototype.iterate=Vv.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,i=n.length-1;r<=i;r++){var o=n[t?i-r:r];if(o&&o.iterate(e,t)===!1)return!1}};Ml.prototype.iterate=function(e,t){return e(this.entry)};var HYe=function(e){function t(n,r,i){this._type=r,this._reverse=i,this._stack=n._root&&o5(n._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var r=this._type,i=this._stack;i;){var o=i.node,a=i.index++,s=void 0;if(o.entry){if(a===0)return DT(r,o.entry)}else if(o.entries){if(s=o.entries.length-1,a<=s)return DT(r,o.entries[this._reverse?s-a:a])}else if(s=o.nodes.length-1,a<=s){var l=o.nodes[this._reverse?s-a:a];if(l){if(l.entry)return DT(r,l.entry);i=this._stack=o5(l,i)}continue}i=this._stack=this._stack.__prev}return oo()},t}(mn);function DT(e,t){return rr(e,t[0],t[1])}function o5(e,t){return{node:e,index:0,__prev:t}}function SD(e,t,n,r){var i=Object.create(Gn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var a5;function Wa(){return a5||(a5=SD(0))}function s5(e,t,n){var r,i;if(e._root){var o=f$(),a=f$();if(r=CD(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===nn?-1:1:0)}else{if(n===nn)return e;i=1,r=new Wv(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?SD(i,r):Wa()}function CD(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===nn?e:(oa(s),oa(a),new Ml(t,r,[i,o]))}function l5(e){return e.constructor===Ml||e.constructor===eh}function ED(e,t,n,r,i){if(e.keyHash===r)return new eh(t,r,[e.entry,i]);var o=(n===0?e.keyHash:e.keyHash>>>n)&Ii,a=(n===0?r:r>>>n)&Ii,s,l=o===a?[ED(e,t,n+Hn,r,i)]:(s=new Ml(t,r,i),o<a?[e,s]:[s,e]);return new Qp(t,1<<o|1<<a,l)}function qYe(e,t,n,r){e||(e=new nD);for(var i=new Ml(e,xo(n),[n,r]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function GYe(e,t,n,r){for(var i=0,o=0,a=new Array(n),s=0,l=1,u=t.length;s<u;s++,l<<=1){var f=t[s];f!==void 0&&s!==r&&(i|=l,a[o++]=f)}return new Qp(e,i,a)}function YYe(e,t,n,r,i){for(var o=0,a=new Array(ia),s=0;n!==0;s++,n>>>=1)a[s]=n&1?t[o++]:void 0;return a[r]=i,new Vv(e,o+1,a)}function XX(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function ZX(e,t,n,r){var i=r?e:$s(e);return i[t]=n,i}function XYe(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=n,a=-1):o[s]=e[s+a];return o}function ZYe(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var i=new Array(r),o=0,a=0;a<r;a++)a===t&&(o=1),i[a]=e[a+o];return i}var JYe=ia/4,QYe=ia/2,eXe=ia/4,JX="@@__IMMUTABLE_LIST__@@";function QX(e){return!!(e&&e[JX])}var eC=function(e){function t(n){var r=Qb();if(n==null)return r;if(QX(n))return n;var i=e(n),o=i.size;return o===0?r:(Co(o),o>0&&o<ia?Hv(0,o,Hn,null,new ju(i.toArray())):r.withMutations(function(a){a.setSize(o),i.forEach(function(s,l){return a.set(l,s)})}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(r,i){if(r=Hu(this,r),r>=0&&r<this.size){r+=this._origin;var o=eZ(this,r);return o&&o.array[r&Ii]}return i},t.prototype.set=function(r,i){return tXe(this,r,i)},t.prototype.remove=function(r){return this.has(r)?r===0?this.shift():r===this.size-1?this.pop():this.splice(r,1):this},t.prototype.insert=function(r,i){return this.splice(r,0,i)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Hn,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):Qb()},t.prototype.push=function(){var r=arguments,i=this.size;return this.withMutations(function(o){xu(o,0,i+r.length);for(var a=0;a<r.length;a++)o.set(i+a,r[a])})},t.prototype.pop=function(){return xu(this,0,-1)},t.prototype.unshift=function(){var r=arguments;return this.withMutations(function(i){xu(i,-r.length);for(var o=0;o<r.length;o++)i.set(o,r[o])})},t.prototype.shift=function(){return xu(this,1)},t.prototype.concat=function(){for(var r=arguments,i=[],o=0;o<arguments.length;o++){var a=r[o],s=e(typeof a!="string"&&kX(a)?a:[a]);s.size!==0&&i.push(s)}return i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(l){i.forEach(function(u){return u.forEach(function(f){return l.push(f)})})})},t.prototype.setSize=function(r){return xu(this,0,r)},t.prototype.map=function(r,i){var o=this;return this.withMutations(function(a){for(var s=0;s<o.size;s++)a.set(s,r.call(i,a.get(s),s,o))})},t.prototype.slice=function(r,i){var o=this.size;return qS(r,i,o)?this:xu(this,Uy(r,o),GS(i,o))},t.prototype.__iterator=function(r,i){var o=i?this.size:0,a=u5(this,i);return new mn(function(){var s=a();return s===fv?oo():rr(r,i?--o:o++,s)})},t.prototype.__iterate=function(r,i){for(var o=i?this.size:0,a=u5(this,i),s;(s=a())!==fv&&r(s,i?--o:o++,this)!==!1;);return o},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?Hv(this._origin,this._capacity,this._level,this._root,this._tail,r,this.__hash):this.size===0?Qb():(this.__ownerID=r,this.__altered=!1,this)},t}(Uf);eC.isList=QX;var Ir=eC.prototype;Ir[JX]=!0;Ir[zy]=Ir.remove;Ir.merge=Ir.concat;Ir.setIn=hD;Ir.deleteIn=Ir.removeIn=gD;Ir.update=mD;Ir.updateIn=vD;Ir.mergeIn=_D;Ir.mergeDeepIn=xD;Ir.withMutations=Wy;Ir.wasAltered=wD;Ir.asImmutable=Hy;Ir["@@transducer/init"]=Ir.asMutable=Vy;Ir["@@transducer/step"]=function(e,t){return e.push(t)};Ir["@@transducer/result"]=function(e){return e.asImmutable()};var ju=function(t,n){this.array=t,this.ownerID=n};ju.prototype.removeBefore=function(t,n,r){if(r===n?1<<n:this.array.length===0)return this;var i=r>>>n&Ii;if(i>=this.array.length)return new ju([],t);var o=i===0,a;if(n>0){var s=this.array[i];if(a=s&&s.removeBefore(t,n-Hn,r),a===s&&o)return this}if(o&&!a)return this;var l=th(this,t);if(!o)for(var u=0;u<i;u++)l.array[u]=void 0;return a&&(l.array[i]=a),l};ju.prototype.removeAfter=function(t,n,r){if(r===(n?1<<n:0)||this.array.length===0)return this;var i=r-1>>>n&Ii;if(i>=this.array.length)return this;var o;if(n>0){var a=this.array[i];if(o=a&&a.removeAfter(t,n-Hn,r),o===a&&i===this.array.length-1)return this}var s=th(this,t);return s.array.splice(i+1),o&&(s.array[i]=o),s};var fv={};function u5(e,t){var n=e._origin,r=e._capacity,i=qv(r),o=e._tail;return a(e._root,e._level,0);function a(u,f,d){return f===0?s(u,d):l(u,f,d)}function s(u,f){var d=f===i?o&&o.array:u&&u.array,p=f>n?0:n-f,g=r-f;return g>ia&&(g=ia),function(){if(p===g)return fv;var v=t?--g:p++;return d&&d[v]}}function l(u,f,d){var p,g=u&&u.array,v=d>n?0:n-d>>f,y=(r-d>>f)+1;return y>ia&&(y=ia),function(){for(;;){if(p){var w=p();if(w!==fv)return w;p=null}if(v===y)return fv;var b=t?--y:v++;p=a(g&&g[b],f-Hn,d+(b<<f))}}}}function Hv(e,t,n,r,i,o,a){var s=Object.create(Ir);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}var c5;function Qb(){return c5||(c5=Hv(0,0,Hn))}function tXe(e,t,n){if(t=Hu(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(a){t<0?xu(a,t).set(0,n):xu(a,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=f$();return t>=qv(e._capacity)?r=v$(r,e.__ownerID,0,t,n,o):i=v$(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Hv(e._origin,e._capacity,e._level,i,r):e}function v$(e,t,n,r,i,o){var a=r>>>n&Ii,s=e&&a<e.array.length;if(!s&&i===void 0)return e;var l;if(n>0){var u=e&&e.array[a],f=v$(u,t,n-Hn,r,i,o);return f===u?e:(l=th(e,t),l.array[a]=f,l)}return s&&e.array[a]===i?e:(o&&oa(o),l=th(e,t),i===void 0&&a===l.array.length-1?l.array.pop():l.array[a]=i,l)}function th(e,t){return t&&e&&t===e.ownerID?e:new ju(e?e.array.slice():[],t)}function eZ(e,t){if(t>=qv(e._capacity))return e._tail;if(t<1<<e._level+Hn){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&Ii],r-=Hn;return n}}function xu(e,t,n){t!==void 0&&(t|=0),n!==void 0&&(n|=0);var r=e.__ownerID||new nD,i=e._origin,o=e._capacity,a=i+t,s=n===void 0?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var l=e._level,u=e._root,f=0;a+f<0;)u=new ju(u&&u.array.length?[void 0,u]:[],r),l+=Hn,f+=1<<l;f&&(a+=f,i+=f,s+=f,o+=f);for(var d=qv(o),p=qv(s);p>=1<<l+Hn;)u=new ju(u&&u.array.length?[u]:[],r),l+=Hn;var g=e._tail,v=p<d?eZ(e,s-1):p>d?new ju([],r):g;if(g&&p>d&&a<o&&g.array.length){u=th(u,r);for(var y=u,w=l;w>Hn;w-=Hn){var b=d>>>w&Ii;y=y.array[b]=th(y.array[b],r)}y.array[d>>>Hn&Ii]=g}if(s<o&&(v=v&&v.removeAfter(r,0,s)),a>=p)a-=p,s-=p,l=Hn,u=null,v=v&&v.removeBefore(r,0,a);else if(a>i||p<d){for(f=0;u;){var x=a>>>l&Ii;if(x!==p>>>l&Ii)break;x&&(f+=(1<<l)*x),l-=Hn,u=u.array[x]}u&&a>i&&(u=u.removeBefore(r,l,a-f)),u&&p<d&&(u=u.removeAfter(r,l,p-f)),f&&(a-=f,s-=f)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=l,e._root=u,e._tail=v,e.__hash=void 0,e.__altered=!0,e):Hv(a,s,l,u,v)}function qv(e){return e<ia?0:e-1>>>Hn<<Hn}var Fl=function(e){function t(n){return n==null?Lm():$X(n)?n:Lm().withMutations(function(r){var i=Sa(n);Co(i.size),i.forEach(function(o,a){return r.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(r,i){var o=this._map.get(r);return o!==void 0?this._list.get(o)[1]:i},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Lm()},t.prototype.set=function(r,i){return d5(this,r,i)},t.prototype.remove=function(r){return d5(this,r,nn)},t.prototype.__iterate=function(r,i){var o=this;return this._list.__iterate(function(a){return a&&r(a[1],a[0],o)},i)},t.prototype.__iterator=function(r,i){return this._list.fromEntrySeq().__iterator(r,i)},t.prototype.__ensureOwner=function(r){if(r===this.__ownerID)return this;var i=this._map.__ensureOwner(r),o=this._list.__ensureOwner(r);return r?kD(i,o,r,this.__hash):this.size===0?Lm():(this.__ownerID=r,this.__altered=!1,this._map=i,this._list=o,this)},t}($h);Fl.isOrderedMap=$X;Fl.prototype[kh]=!0;Fl.prototype[zy]=Fl.prototype.remove;function kD(e,t,n,r){var i=Object.create(Fl.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var f5;function Lm(){return f5||(f5=kD(Wa(),Qb()))}function d5(e,t,n){var r=e._map,i=e._list,o=r.get(t),a=o!==void 0,s,l;if(n===nn){if(!a)return e;i.size>=ia&&i.size>=r.size*2?(l=i.filter(function(u,f){return u!==void 0&&o!==f}),s=l.toKeyedSeq().map(function(u){return u[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=l.__ownerID=e.__ownerID)):(s=r.remove(t),l=o===i.size-1?i.pop():i.set(o,void 0))}else if(a){if(n===i.get(o)[1])return e;s=r,l=i.set(o,[t,n])}else s=r.set(t,i.size),l=i.set(i.size,[t,n]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=l,e.__hash=void 0,e.__altered=!0,e):kD(s,l)}var tZ="@@__IMMUTABLE_STACK__@@";function y$(e){return!!(e&&e[tZ])}var TD=function(e){function t(n){return n==null?gb():y$(n)?n:gb().pushAll(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(r,i){var o=this._head;for(r=Hu(this,r);o&&r--;)o=o.next;return o?o.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var r=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,o=this._head,a=arguments.length-1;a>=0;a--)o={value:r[a],next:o};return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Mm(i,o)},t.prototype.pushAll=function(r){if(r=e(r),r.size===0)return this;if(this.size===0&&y$(r))return r;Co(r.size);var i=this.size,o=this._head;return r.__iterate(function(a){i++,o={value:a,next:o}},!0),this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Mm(i,o)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):gb()},t.prototype.slice=function(r,i){if(qS(r,i,this.size))return this;var o=Uy(r,this.size),a=GS(i,this.size);if(a!==this.size)return e.prototype.slice.call(this,r,i);for(var s=this.size-o,l=this._head;o--;)l=l.next;return this.__ownerID?(this.size=s,this._head=l,this.__hash=void 0,this.__altered=!0,this):Mm(s,l)},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?Mm(this.size,this._head,r,this.__hash):this.size===0?gb():(this.__ownerID=r,this.__altered=!1,this)},t.prototype.__iterate=function(r,i){var o=this;if(i)return new wf(this.toArray()).__iterate(function(l,u){return r(l,u,o)},i);for(var a=0,s=this._head;s&&r(s.value,a++,this)!==!1;)s=s.next;return a},t.prototype.__iterator=function(r,i){if(i)return new wf(this.toArray()).__iterator(r,i);var o=0,a=this._head;return new mn(function(){if(a){var s=a.value;return a=a.next,rr(r,o++,s)}return oo()})},t}(Uf);TD.isStack=y$;var Pi=TD.prototype;Pi[tZ]=!0;Pi.shift=Pi.pop;Pi.unshift=Pi.push;Pi.unshiftAll=Pi.pushAll;Pi.withMutations=Wy;Pi.wasAltered=wD;Pi.asImmutable=Hy;Pi["@@transducer/init"]=Pi.asMutable=Vy;Pi["@@transducer/step"]=function(e,t){return e.unshift(t)};Pi["@@transducer/result"]=function(e){return e.asImmutable()};function Mm(e,t,n,r){var i=Object.create(Pi);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}var p5;function gb(){return p5||(p5=Mm(0))}var nZ="@@__IMMUTABLE_SET__@@";function RD(e){return!!(e&&e[nZ])}function rZ(e){return RD(e)&&Xa(e)}function iZ(e,t){if(e===t)return!0;if(!io(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Qn(e)!==Qn(t)||eo(e)!==eo(t)||Xa(e)!==Xa(t))return!1;if(e.size===0&&t.size===0)return!0;var n=!YS(e);if(Xa(e)){var r=e.entries();return t.every(function(l,u){var f=r.next().value;return f&&ko(f[1],l)&&(n||ko(f[0],u))})&&r.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate(function(l,u){if(n?!e.has(l):i?!ko(l,e.get(u,nn)):!ko(e.get(u,nn),l))return a=!1,!1});return a&&e.size===s}function Kf(e,t){var n=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function px(e){if(!e||typeof e!="object")return e;if(!io(e)){if(!qu(e))return e;e=Do(e)}if(Qn(e)){var t={};return e.__iterate(function(r,i){t[i]=px(r)}),t}var n=[];return e.__iterate(function(r){n.push(px(r))}),n}var tC=function(e){function t(n){return n==null?Fm():RD(n)&&!Xa(n)?n:Fm().withMutations(function(r){var i=e(n);Co(i.size),i.forEach(function(o){return r.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(r){return this(Sa(r).keySeq())},t.intersect=function(r){return r=Er(r).toArray(),r.length?ii.intersect.apply(t(r.pop()),r):Fm()},t.union=function(r){return r=Er(r).toArray(),r.length?ii.union.apply(t(r.pop()),r):Fm()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(r){return this._map.has(r)},t.prototype.add=function(r){return mb(this,this._map.set(r,r))},t.prototype.remove=function(r){return mb(this,this._map.remove(r))},t.prototype.clear=function(){return mb(this,this._map.clear())},t.prototype.map=function(r,i){var o=this,a=!1,s=mb(this,this._map.mapEntries(function(l){var u=l[1],f=r.call(i,u,u,o);return f!==u&&(a=!0),[f,f]},i));return a?s:this},t.prototype.union=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return r=r.filter(function(o){return o.size!==0}),r.length===0?this:this.size===0&&!this.__ownerID&&r.length===1?this.constructor(r[0]):this.withMutations(function(o){for(var a=0;a<r.length;a++)typeof r[a]=="string"?o.add(r[a]):e(r[a]).forEach(function(s){return o.add(s)})})},t.prototype.intersect=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];if(r.length===0)return this;r=r.map(function(a){return e(a)});var o=[];return this.forEach(function(a){r.every(function(s){return s.includes(a)})||o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.subtract=function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];if(r.length===0)return this;r=r.map(function(a){return e(a)});var o=[];return this.forEach(function(a){r.some(function(s){return s.includes(a)})&&o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.sort=function(r){return Sf(Jp(this,r))},t.prototype.sortBy=function(r,i){return Sf(Jp(this,i,r))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(r,i){var o=this;return this._map.__iterate(function(a){return r(a,a,o)},i)},t.prototype.__iterator=function(r,i){return this._map.__iterator(r,i)},t.prototype.__ensureOwner=function(r){if(r===this.__ownerID)return this;var i=this._map.__ensureOwner(r);return r?this.__make(i,r):this.size===0?this.__empty():(this.__ownerID=r,this._map=i,this)},t}(Ch);tC.isSet=RD;var ii=tC.prototype;ii[nZ]=!0;ii[zy]=ii.remove;ii.merge=ii.concat=ii.union;ii.withMutations=Wy;ii.asImmutable=Hy;ii["@@transducer/init"]=ii.asMutable=Vy;ii["@@transducer/step"]=function(e,t){return e.add(t)};ii["@@transducer/result"]=function(e){return e.asImmutable()};ii.__empty=Fm;ii.__make=oZ;function mb(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function oZ(e,t){var n=Object.create(ii);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}var h5;function Fm(){return h5||(h5=oZ(Wa()))}var nXe=function(e){function t(n,r,i){if(!(this instanceof t))return new t(n,r,i);if(pD(i!==0,"Cannot step a Range by 0"),n=n||0,r===void 0&&(r=1/0),i=i===void 0?1:Math.abs(i),r<n&&(i=-i),this._start=n,this._end=r,this._step=i,this.size=Math.max(0,Math.ceil((r-n)/i-1)+1),this.size===0){if(PT)return PT;PT=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(r,i){return this.has(r)?this._start+Hu(this,r)*this._step:i},t.prototype.includes=function(r){var i=(r-this._start)/this._step;return i>=0&&i<this.size&&i===Math.floor(i)},t.prototype.slice=function(r,i){return qS(r,i,this.size)?this:(r=Uy(r,this.size),i=GS(i,this.size),i<=r?new t(0,0):new t(this.get(r,this._end),this.get(i,this._end),this._step))},t.prototype.indexOf=function(r){var i=r-this._start;if(i%this._step===0){var o=i/this._step;if(o>=0&&o<this.size)return o}return-1},t.prototype.lastIndexOf=function(r){return this.indexOf(r)},t.prototype.__iterate=function(r,i){for(var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,l=0;l!==o&&r(s,i?o-++l:l++,this)!==!1;)s+=i?-a:a;return l},t.prototype.__iterator=function(r,i){var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,l=0;return new mn(function(){if(l===o)return oo();var u=s;return s+=i?-a:a,rr(r,i?o-++l:l++,u)})},t.prototype.equals=function(r){return r instanceof t?this._start===r._start&&this._end===r._end&&this._step===r._step:iZ(this,r)},t}(ns),PT;function aZ(e,t,n){for(var r=zX(t),i=0;i!==r.length;)if(e=UX(e,r[i++],nn),e===nn)return n;return e}function sZ(e,t){return aZ(this,e,t)}function rXe(e,t){return aZ(e,t,nn)!==nn}function iXe(e){return rXe(this,e)}function lZ(){Co(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e}Er.isIterable=io;Er.isKeyed=Qn;Er.isIndexed=eo;Er.isAssociative=YS;Er.isOrdered=Xa;Er.Iterator=mn;Kf(Er,{toArray:function(){Co(this.size);var t=new Array(this.size||0),n=Qn(this),r=0;return this.__iterate(function(i,o){t[r++]=n?[o,i]:i}),t},toIndexedSeq:function(){return new IX(this)},toJS:function(){return px(this)},toKeyedSeq:function(){return new QS(this,!0)},toMap:function(){return $h(this.toKeyedSeq())},toObject:lZ,toOrderedMap:function(){return Fl(this.toKeyedSeq())},toOrderedSet:function(){return Sf(Qn(this)?this.valueSeq():this)},toSet:function(){return tC(Qn(this)?this.valueSeq():this)},toSetSeq:function(){return new DX(this)},toSeq:function(){return eo(this)?this.toIndexedSeq():Qn(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return TD(Qn(this)?this.valueSeq():this)},toList:function(){return eC(Qn(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,n){return this.size===0?t+n:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+n},concat:function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return In(this,PYe(this,t))},includes:function(t){return this.some(function(n){return ko(n,t)})},entries:function(){return this.__iterator(ga)},every:function(t,n){Co(this.size);var r=!0;return this.__iterate(function(i,o,a){if(!t.call(n,i,o,a))return r=!1,!1}),r},filter:function(t,n){return In(this,FX(this,t,n,!0))},partition:function(t,n){return IYe(this,t,n)},find:function(t,n,r){var i=this.findEntry(t,n);return i?i[1]:r},forEach:function(t,n){return Co(this.size),this.__iterate(n?t.bind(n):t)},join:function(t){Co(this.size),t=t!==void 0?""+t:",";var n="",r=!0;return this.__iterate(function(i){r?r=!1:n+=t,n+=i!=null?i.toString():""}),n},keys:function(){return this.__iterator(Ky)},map:function(t,n){return In(this,MX(this,t,n))},reduce:function(t,n,r){return g5(this,t,n,r,arguments.length<2,!1)},reduceRight:function(t,n,r){return g5(this,t,n,r,arguments.length<2,!0)},reverse:function(){return In(this,uD(this,!0))},slice:function(t,n){return In(this,cD(this,t,n,!0))},some:function(t,n){Co(this.size);var r=!1;return this.__iterate(function(i,o,a){if(t.call(n,i,o,a))return r=!0,!1}),r},sort:function(t){return In(this,Jp(this,t))},values:function(){return this.__iterator(Qa)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,n){return Zp(t?this.toSeq().filter(t,n):this)},countBy:function(t,n){return $Ye(this,t,n)},equals:function(t){return iZ(this,t)},entrySeq:function(){var t=this;if(t._cache)return new wf(t._cache);var n=t.toSeq().map(aXe).toIndexedSeq();return n.fromEntrySeq=function(){return t.toSeq()},n},filterNot:function(t,n){return this.filter(LT(t),n)},findEntry:function(t,n,r){var i=r;return this.__iterate(function(o,a,s){if(t.call(n,o,a,s))return i=[a,o],!1}),i},findKey:function(t,n){var r=this.findEntry(t,n);return r&&r[0]},findLast:function(t,n,r){return this.toKeyedSeq().reverse().find(t,n,r)},findLastEntry:function(t,n,r){return this.toKeyedSeq().reverse().findEntry(t,n,r)},findLastKey:function(t,n){return this.toKeyedSeq().reverse().findKey(t,n)},first:function(t){return this.find(vX,null,t)},flatMap:function(t,n){return In(this,LYe(this,t,n))},flatten:function(t){return In(this,BX(this,t,!0))},fromEntrySeq:function(){return new PX(this)},get:function(t,n){return this.find(function(r,i){return ko(i,t)},void 0,n)},getIn:sZ,groupBy:function(t,n){return OYe(this,t,n)},has:function(t){return this.get(t,nn)!==nn},hasIn:iXe,isSubset:function(t){return t=typeof t.includes=="function"?t:Er(t),this.every(function(n){return t.includes(n)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:Er(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(n){return ko(n,t)})},keySeq:function(){return this.toSeq().map(oXe).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return pb(this,t)},maxBy:function(t,n){return pb(this,n,t)},min:function(t){return pb(this,t?m5(t):y5)},minBy:function(t,n){return pb(this,n?m5(n):y5,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,n){return In(this,NX(this,t,n,!0))},skipUntil:function(t,n){return this.skipWhile(LT(t),n)},sortBy:function(t,n){return In(this,Jp(this,n,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,n){return In(this,DYe(this,t,n))},takeUntil:function(t,n){return this.takeWhile(LT(t),n)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=sXe(this))}});var bi=Er.prototype;bi[_X]=!0;bi[XS]=bi.values;bi.toJSON=bi.toArray;bi.__toStringMapper=Kv;bi.inspect=bi.toSource=function(){return this.toString()};bi.chain=bi.flatMap;bi.contains=bi.includes;Kf(Sa,{flip:function(){return In(this,LX(this))},mapEntries:function(t,n){var r=this,i=0;return In(this,this.toSeq().map(function(o,a){return t.call(n,[a,o],i++,r)}).fromEntrySeq())},mapKeys:function(t,n){var r=this;return In(this,this.toSeq().flip().map(function(i,o){return t.call(n,i,o,r)}).flip())}});var qy=Sa.prototype;qy[xX]=!0;qy[XS]=bi.entries;qy.toJSON=lZ;qy.__toStringMapper=function(e,t){return Kv(t)+": "+Kv(e)};Kf(Uf,{toKeyedSeq:function(){return new QS(this,!1)},filter:function(t,n){return In(this,FX(this,t,n,!1))},findIndex:function(t,n){var r=this.findEntry(t,n);return r?r[0]:-1},indexOf:function(t){var n=this.keyOf(t);return n===void 0?-1:n},lastIndexOf:function(t){var n=this.lastKeyOf(t);return n===void 0?-1:n},reverse:function(){return In(this,uD(this,!1))},slice:function(t,n){return In(this,cD(this,t,n,!1))},splice:function(t,n){var r=arguments.length;if(n=Math.max(n||0,0),r===0||r===2&&!n)return this;t=Uy(t,t<0?this.count():this.size);var i=this.slice(0,t);return In(this,r===1?i:i.concat($s(arguments,2),this.slice(t+n)))},findLastIndex:function(t,n){var r=this.findLastEntry(t,n);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return In(this,BX(this,t,!1))},get:function(t,n){return t=Hu(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?n:this.find(function(r,i){return i===t},void 0,n)},has:function(t){return t=Hu(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.indexOf(t)!==-1)},interpose:function(t){return In(this,MYe(this,t))},interleave:function(){var t=[this].concat($s(arguments)),n=hb(this.toSeq(),ns.of,t),r=n.flatten(!0);return n.size&&(r.size=n.size*t.length),In(this,r)},keySeq:function(){return nXe(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,n){return In(this,NX(this,t,n,!1))},zip:function(){var t=[this].concat($s(arguments));return In(this,hb(this,v5,t))},zipAll:function(){var t=[this].concat($s(arguments));return In(this,hb(this,v5,t,!0))},zipWith:function(t){var n=$s(arguments);return n[0]=this,In(this,hb(this,t,n))}});var Oh=Uf.prototype;Oh[wX]=!0;Oh[kh]=!0;Kf(Ch,{get:function(t,n){return this.has(t)?t:n},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var nh=Ch.prototype;nh.has=bi.includes;nh.contains=nh.includes;nh.keys=nh.values;Kf(fc,qy);Kf(ns,Oh);Kf(Rh,nh);function g5(e,t,n,r,i,o){return Co(e.size),e.__iterate(function(a,s,l){i?(i=!1,n=a):n=t.call(r,n,a,s,l)},o),n}function oXe(e,t){return t}function aXe(e,t){return[t,e]}function LT(e){return function(){return!e.apply(this,arguments)}}function m5(e){return function(){return-e.apply(this,arguments)}}function v5(){return $s(arguments)}function y5(e,t){return e<t?1:e>t?-1:0}function sXe(e){if(e.size===1/0)return 0;var t=Xa(e),n=Qn(e),r=t?1:0,i=e.__iterate(n?t?function(o,a){r=31*r+b5(xo(o),xo(a))|0}:function(o,a){r=r+b5(xo(o),xo(a))|0}:t?function(o){r=31*r+xo(o)|0}:function(o){r=r+xo(o)|0});return lXe(i,r)}function lXe(e,t){return t=_m(t,3432918353),t=_m(t<<15|t>>>-15,461845907),t=_m(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=_m(t^t>>>16,2246822507),t=_m(t^t>>>13,3266489909),t=JS(t^t>>>16),t}function b5(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var Sf=function(e){function t(n){return n==null?b$():rZ(n)?n:b$().withMutations(function(r){var i=Ch(n);Co(i.size),i.forEach(function(o){return r.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(r){return this(Sa(r).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(tC);Sf.isOrderedSet=rZ;var Wf=Sf.prototype;Wf[kh]=!0;Wf.zip=Oh.zip;Wf.zipWith=Oh.zipWith;Wf.zipAll=Oh.zipAll;Wf.__empty=b$;Wf.__make=uZ;function uZ(e,t){var n=Object.create(Wf);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}var _5;function b$(){return _5||(_5=uZ(Lm()))}function uXe(e){if(Eh(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Gs(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Vr=function(t,n){var r;uXe(t);var i=function(s){var l=this;if(s instanceof i)return s;if(!(this instanceof i))return new i(s);if(!r){r=!0;var u=Object.keys(t),f=o._indices={};o._name=n,o._keys=u,o._defaultValues=t;for(var d=0;d<u.length;d++){var p=u[d];f[p]=d,o[p]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+$D(this)+' with property "'+p+'" since that property name is part of the Record API.'):cXe(o,p)}}return this.__ownerID=void 0,this._values=eC().withMutations(function(g){g.setSize(l._keys.length),Sa(s).forEach(function(v,y){g.set(l._indices[y],v===l._defaultValues[y]?void 0:v)})}),this},o=i.prototype=Object.create(jn);return o.constructor=i,n&&(i.displayName=n),i};Vr.prototype.toString=function(){for(var t=$D(this)+" { ",n=this._keys,r,i=0,o=n.length;i!==o;i++)r=n[i],t+=(i?", ":"")+r+": "+Kv(this.get(r));return t+" }"};Vr.prototype.equals=function(t){return this===t||Eh(t)&&rh(this).equals(rh(t))};Vr.prototype.hashCode=function(){return rh(this).hashCode()};Vr.prototype.has=function(t){return this._indices.hasOwnProperty(t)};Vr.prototype.get=function(t,n){if(!this.has(t))return n;var r=this._indices[t],i=this._values.get(r);return i===void 0?this._defaultValues[t]:i};Vr.prototype.set=function(t,n){if(this.has(t)){var r=this._values.set(this._indices[t],n===this._defaultValues[t]?void 0:n);if(r!==this._values&&!this.__ownerID)return AD(this,r)}return this};Vr.prototype.remove=function(t){return this.set(t)};Vr.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:AD(this,t)};Vr.prototype.wasAltered=function(){return this._values.wasAltered()};Vr.prototype.toSeq=function(){return rh(this)};Vr.prototype.toJS=function(){return px(this)};Vr.prototype.entries=function(){return this.__iterator(ga)};Vr.prototype.__iterator=function(t,n){return rh(this).__iterator(t,n)};Vr.prototype.__iterate=function(t,n){return rh(this).__iterate(t,n)};Vr.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var n=this._values.__ensureOwner(t);return t?AD(this,n,t):(this.__ownerID=t,this._values=n,this)};Vr.isRecord=Eh;Vr.getDescriptiveName=$D;var jn=Vr.prototype;jn[CX]=!0;jn[zy]=jn.remove;jn.deleteIn=jn.removeIn=gD;jn.getIn=sZ;jn.hasIn=bi.hasIn;jn.merge=VX;jn.mergeWith=HX;jn.mergeIn=_D;jn.mergeDeep=GX;jn.mergeDeepWith=YX;jn.mergeDeepIn=xD;jn.setIn=hD;jn.update=mD;jn.updateIn=vD;jn.withMutations=Wy;jn.asMutable=Vy;jn.asImmutable=Hy;jn[XS]=jn.entries;jn.toJSON=jn.toObject=bi.toObject;jn.inspect=jn.toSource=function(){return this.toString()};function AD(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._values=t,r.__ownerID=n,r}function $D(e){return e.constructor.displayName||e.constructor.name||"Record"}function rh(e){return aD(e._keys.map(function(t){return[t,e.get(t)]}))}function cXe(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(n){pD(this.__ownerID,"Cannot set on an immutable record."),this.set(t,n)}})}catch{}}function fXe(){this.__data__=[],this.size=0}var dXe=fXe;function pXe(e,t){return e===t||e!==e&&t!==t}var Gy=pXe,hXe=Gy;function gXe(e,t){for(var n=e.length;n--;)if(hXe(e[n][0],t))return n;return-1}var nC=gXe,mXe=nC,vXe=Array.prototype,yXe=vXe.splice;function bXe(e){var t=this.__data__,n=mXe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():yXe.call(t,n,1),--this.size,!0}var _Xe=bXe,xXe=nC;function wXe(e){var t=this.__data__,n=xXe(t,e);return n<0?void 0:t[n][1]}var SXe=wXe,CXe=nC;function EXe(e){return CXe(this.__data__,e)>-1}var kXe=EXe,TXe=nC;function RXe(e,t){var n=this.__data__,r=TXe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var AXe=RXe,$Xe=dXe,OXe=_Xe,IXe=SXe,DXe=kXe,PXe=AXe;function Ih(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ih.prototype.clear=$Xe;Ih.prototype.delete=OXe;Ih.prototype.get=IXe;Ih.prototype.has=DXe;Ih.prototype.set=PXe;var rC=Ih,LXe=rC;function MXe(){this.__data__=new LXe,this.size=0}var FXe=MXe;function NXe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var BXe=NXe;function jXe(e){return this.__data__.get(e)}var zXe=jXe;function UXe(e){return this.__data__.has(e)}var KXe=UXe,WXe=typeof ni=="object"&&ni&&ni.Object===Object&&ni,cZ=WXe,VXe=cZ,HXe=typeof self=="object"&&self&&self.Object===Object&&self,qXe=VXe||HXe||Function("return this")(),rs=qXe,GXe=rs,YXe=GXe.Symbol,Dh=YXe,x5=Dh,fZ=Object.prototype,XXe=fZ.hasOwnProperty,ZXe=fZ.toString,xm=x5?x5.toStringTag:void 0;function JXe(e){var t=XXe.call(e,xm),n=e[xm];try{e[xm]=void 0;var r=!0}catch{}var i=ZXe.call(e);return r&&(t?e[xm]=n:delete e[xm]),i}var QXe=JXe,eZe=Object.prototype,tZe=eZe.toString;function nZe(e){return tZe.call(e)}var rZe=nZe,w5=Dh,iZe=QXe,oZe=rZe,aZe="[object Null]",sZe="[object Undefined]",S5=w5?w5.toStringTag:void 0;function lZe(e){return e==null?e===void 0?sZe:aZe:S5&&S5 in Object(e)?iZe(e):oZe(e)}var Ph=lZe;function uZe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var is=uZe,cZe=Ph,fZe=is,dZe="[object AsyncFunction]",pZe="[object Function]",hZe="[object GeneratorFunction]",gZe="[object Proxy]";function mZe(e){if(!fZe(e))return!1;var t=cZe(e);return t==pZe||t==hZe||t==dZe||t==gZe}var OD=mZe,vZe=rs,yZe=vZe["__core-js_shared__"],bZe=yZe,MT=bZe,C5=function(){var e=/[^.]+$/.exec(MT&&MT.keys&&MT.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _Ze(e){return!!C5&&C5 in e}var xZe=_Ze,wZe=Function.prototype,SZe=wZe.toString;function CZe(e){if(e!=null){try{return SZe.call(e)}catch{}try{return e+""}catch{}}return""}var dZ=CZe,EZe=OD,kZe=xZe,TZe=is,RZe=dZ,AZe=/[\\^$.*+?()[\]{}|]/g,$Ze=/^\[object .+?Constructor\]$/,OZe=Function.prototype,IZe=Object.prototype,DZe=OZe.toString,PZe=IZe.hasOwnProperty,LZe=RegExp("^"+DZe.call(PZe).replace(AZe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function MZe(e){if(!TZe(e)||kZe(e))return!1;var t=EZe(e)?LZe:$Ze;return t.test(RZe(e))}var FZe=MZe;function NZe(e,t){return e==null?void 0:e[t]}var BZe=NZe,jZe=FZe,zZe=BZe;function UZe(e,t){var n=zZe(e,t);return jZe(n)?n:void 0}var Vf=UZe,KZe=Vf,WZe=rs,VZe=KZe(WZe,"Map"),ID=VZe,HZe=Vf,qZe=HZe(Object,"create"),iC=qZe,E5=iC;function GZe(){this.__data__=E5?E5(null):{},this.size=0}var YZe=GZe;function XZe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ZZe=XZe,JZe=iC,QZe="__lodash_hash_undefined__",eJe=Object.prototype,tJe=eJe.hasOwnProperty;function nJe(e){var t=this.__data__;if(JZe){var n=t[e];return n===QZe?void 0:n}return tJe.call(t,e)?t[e]:void 0}var rJe=nJe,iJe=iC,oJe=Object.prototype,aJe=oJe.hasOwnProperty;function sJe(e){var t=this.__data__;return iJe?t[e]!==void 0:aJe.call(t,e)}var lJe=sJe,uJe=iC,cJe="__lodash_hash_undefined__";function fJe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=uJe&&t===void 0?cJe:t,this}var dJe=fJe,pJe=YZe,hJe=ZZe,gJe=rJe,mJe=lJe,vJe=dJe;function Lh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Lh.prototype.clear=pJe;Lh.prototype.delete=hJe;Lh.prototype.get=gJe;Lh.prototype.has=mJe;Lh.prototype.set=vJe;var yJe=Lh,k5=yJe,bJe=rC,_Je=ID;function xJe(){this.size=0,this.__data__={hash:new k5,map:new(_Je||bJe),string:new k5}}var wJe=xJe;function SJe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var CJe=SJe,EJe=CJe;function kJe(e,t){var n=e.__data__;return EJe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var oC=kJe,TJe=oC;function RJe(e){var t=TJe(this,e).delete(e);return this.size-=t?1:0,t}var AJe=RJe,$Je=oC;function OJe(e){return $Je(this,e).get(e)}var IJe=OJe,DJe=oC;function PJe(e){return DJe(this,e).has(e)}var LJe=PJe,MJe=oC;function FJe(e,t){var n=MJe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var NJe=FJe,BJe=wJe,jJe=AJe,zJe=IJe,UJe=LJe,KJe=NJe;function Mh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mh.prototype.clear=BJe;Mh.prototype.delete=jJe;Mh.prototype.get=zJe;Mh.prototype.has=UJe;Mh.prototype.set=KJe;var DD=Mh,WJe=rC,VJe=ID,HJe=DD,qJe=200;function GJe(e,t){var n=this.__data__;if(n instanceof WJe){var r=n.__data__;if(!VJe||r.length<qJe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new HJe(r)}return n.set(e,t),this.size=n.size,this}var YJe=GJe,XJe=rC,ZJe=FXe,JJe=BXe,QJe=zXe,eQe=KXe,tQe=YJe;function Fh(e){var t=this.__data__=new XJe(e);this.size=t.size}Fh.prototype.clear=ZJe;Fh.prototype.delete=JJe;Fh.prototype.get=QJe;Fh.prototype.has=eQe;Fh.prototype.set=tQe;var aC=Fh,nQe=Vf,rQe=function(){try{var e=nQe(Object,"defineProperty");return e({},"",{}),e}catch{}}(),pZ=rQe,T5=pZ;function iQe(e,t,n){t=="__proto__"&&T5?T5(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var sC=iQe,oQe=sC,aQe=Gy;function sQe(e,t,n){(n!==void 0&&!aQe(e[t],n)||n===void 0&&!(t in e))&&oQe(e,t,n)}var hZ=sQe;function lQe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(n(o[l],l,o)===!1)break}return t}}var uQe=lQe,cQe=uQe,fQe=cQe(),gZ=fQe,hx={exports:{}};hx.exports;(function(e,t){var n=rs,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;function l(u,f){if(f)return u.slice();var d=u.length,p=s?s(d):new u.constructor(d);return u.copy(p),p}e.exports=l})(hx,hx.exports);var mZ=hx.exports,dQe=rs,pQe=dQe.Uint8Array,vZ=pQe,R5=vZ;function hQe(e){var t=new e.constructor(e.byteLength);return new R5(t).set(new R5(e)),t}var PD=hQe,gQe=PD;function mQe(e,t){var n=t?gQe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var yZ=mQe;function vQe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var bZ=vQe,yQe=is,A5=Object.create,bQe=function(){function e(){}return function(t){if(!yQe(t))return{};if(A5)return A5(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),_Qe=bQe;function xQe(e,t){return function(n){return e(t(n))}}var _Z=xQe,wQe=_Z,SQe=wQe(Object.getPrototypeOf,Object),LD=SQe,CQe=Object.prototype;function EQe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||CQe;return e===n}var MD=EQe,kQe=_Qe,TQe=LD,RQe=MD;function AQe(e){return typeof e.constructor=="function"&&!RQe(e)?kQe(TQe(e)):{}}var xZ=AQe;function $Qe(e){return e!=null&&typeof e=="object"}var Wl=$Qe,OQe=Ph,IQe=Wl,DQe="[object Arguments]";function PQe(e){return IQe(e)&&OQe(e)==DQe}var LQe=PQe,$5=LQe,MQe=Wl,wZ=Object.prototype,FQe=wZ.hasOwnProperty,NQe=wZ.propertyIsEnumerable,BQe=$5(function(){return arguments}())?$5:function(e){return MQe(e)&&FQe.call(e,"callee")&&!NQe.call(e,"callee")},lC=BQe,jQe=Array.isArray,Ca=jQe,zQe=9007199254740991;function UQe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=zQe}var FD=UQe,KQe=OD,WQe=FD;function VQe(e){return e!=null&&WQe(e.length)&&!KQe(e)}var Nh=VQe,HQe=Nh,qQe=Wl;function GQe(e){return qQe(e)&&HQe(e)}var YQe=GQe,gx={exports:{}};function XQe(){return!1}var ZQe=XQe;gx.exports;(function(e,t){var n=rs,r=ZQe,i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;e.exports=u})(gx,gx.exports);var uC=gx.exports,JQe=Ph,QQe=LD,eet=Wl,tet="[object Object]",net=Function.prototype,ret=Object.prototype,SZ=net.toString,iet=ret.hasOwnProperty,oet=SZ.call(Object);function aet(e){if(!eet(e)||JQe(e)!=tet)return!1;var t=QQe(e);if(t===null)return!0;var n=iet.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SZ.call(n)==oet}var CZ=aet,set=Ph,uet=FD,cet=Wl,fet="[object Arguments]",det="[object Array]",pet="[object Boolean]",het="[object Date]",get="[object Error]",met="[object Function]",vet="[object Map]",yet="[object Number]",bet="[object Object]",_et="[object RegExp]",xet="[object Set]",wet="[object String]",Cet="[object WeakMap]",Eet="[object ArrayBuffer]",ket="[object DataView]",Tet="[object Float32Array]",Ret="[object Float64Array]",Aet="[object Int8Array]",$et="[object Int16Array]",Oet="[object Int32Array]",Iet="[object Uint8Array]",Det="[object Uint8ClampedArray]",Pet="[object Uint16Array]",Let="[object Uint32Array]",Wn={};Wn[Tet]=Wn[Ret]=Wn[Aet]=Wn[$et]=Wn[Oet]=Wn[Iet]=Wn[Det]=Wn[Pet]=Wn[Let]=!0;Wn[fet]=Wn[det]=Wn[Eet]=Wn[pet]=Wn[ket]=Wn[het]=Wn[get]=Wn[met]=Wn[vet]=Wn[yet]=Wn[bet]=Wn[_et]=Wn[xet]=Wn[wet]=Wn[Cet]=!1;function Met(e){return cet(e)&&uet(e.length)&&!!Wn[set(e)]}var Fet=Met;function Net(e){return function(t){return e(t)}}var ND=Net,mx={exports:{}};mx.exports;(function(e,t){var n=cZ,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(mx,mx.exports);var BD=mx.exports,Bet=Fet,jet=ND,O5=BD,I5=O5&&O5.isTypedArray,zet=I5?jet(I5):Bet,jD=zet;function Uet(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var EZ=Uet,Ket=sC,Wet=Gy,Vet=Object.prototype,Het=Vet.hasOwnProperty;function qet(e,t,n){var r=e[t];(!(Het.call(e,t)&&Wet(r,n))||n===void 0&&!(t in e))&&Ket(e,t,n)}var kZ=qet,Get=kZ,Yet=sC;function Xet(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?Yet(n,s,l):Get(n,s,l)}return n}var Bh=Xet;function Zet(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Jet=Zet,Qet=9007199254740991,ett=/^(?:0|[1-9]\d*)$/;function ttt(e,t){var n=typeof e;return t=t??Qet,!!t&&(n=="number"||n!="symbol"&&ett.test(e))&&e>-1&&e%1==0&&e<t}var zD=ttt,ntt=Jet,rtt=lC,itt=Ca,ott=uC,att=zD,stt=jD,ltt=Object.prototype,utt=ltt.hasOwnProperty;function ctt(e,t){var n=itt(e),r=!n&&rtt(e),i=!n&&!r&&ott(e),o=!n&&!r&&!i&&stt(e),a=n||r||i||o,s=a?ntt(e.length,String):[],l=s.length;for(var u in e)(t||utt.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||att(u,l)))&&s.push(u);return s}var TZ=ctt;function ftt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var dtt=ftt,ptt=is,htt=MD,gtt=dtt,mtt=Object.prototype,vtt=mtt.hasOwnProperty;function ytt(e){if(!ptt(e))return gtt(e);var t=htt(e),n=[];for(var r in e)r=="constructor"&&(t||!vtt.call(e,r))||n.push(r);return n}var btt=ytt,_tt=TZ,xtt=btt,wtt=Nh;function Stt(e){return wtt(e)?_tt(e,!0):xtt(e)}var Yy=Stt,Ctt=Bh,Ett=Yy;function ktt(e){return Ctt(e,Ett(e))}var Ttt=ktt,D5=hZ,Rtt=mZ,Att=yZ,$tt=bZ,Ott=xZ,P5=lC,L5=Ca,Itt=YQe,Dtt=uC,Ptt=OD,Ltt=is,Mtt=CZ,Ftt=jD,M5=EZ,Ntt=Ttt;function Btt(e,t,n,r,i,o,a){var s=M5(e,n),l=M5(t,n),u=a.get(l);if(u){D5(e,n,u);return}var f=o?o(s,l,n+"",e,t,a):void 0,d=f===void 0;if(d){var p=L5(l),g=!p&&Dtt(l),v=!p&&!g&&Ftt(l);f=l,p||g||v?L5(s)?f=s:Itt(s)?f=$tt(s):g?(d=!1,f=Rtt(l,!0)):v?(d=!1,f=Att(l,!0)):f=[]:Mtt(l)||P5(l)?(f=s,P5(s)?f=Ntt(s):(!Ltt(s)||Ptt(s))&&(f=Ott(l))):d=!1}d&&(a.set(l,f),i(f,l,r,o,a),a.delete(l)),D5(e,n,f)}var jtt=Btt,ztt=aC,Utt=hZ,Ktt=gZ,Wtt=jtt,Vtt=is,Htt=Yy,qtt=EZ;function RZ(e,t,n,r,i){e!==t&&Ktt(t,function(o,a){if(i||(i=new ztt),Vtt(o))Wtt(e,t,a,n,RZ,r,i);else{var s=r?r(qtt(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),Utt(e,a,s)}},Htt)}var Gtt=RZ;function Ytt(e){return e}var UD=Ytt;function Xtt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Ztt=Xtt,Jtt=Ztt,F5=Math.max;function Qtt(e,t,n){return t=F5(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=F5(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),Jtt(e,this,s)}}var AZ=Qtt;function ent(e){return function(){return e}}var tnt=ent,nnt=tnt,N5=pZ,rnt=UD,int=N5?function(e,t){return N5(e,"toString",{configurable:!0,enumerable:!1,value:nnt(t),writable:!0})}:rnt,ont=int,ant=800,snt=16,lnt=Date.now;function unt(e){var t=0,n=0;return function(){var r=lnt(),i=snt-(r-n);if(n=r,i>0){if(++t>=ant)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var cnt=unt,fnt=ont,dnt=cnt,pnt=dnt(fnt),$Z=pnt,hnt=UD,gnt=AZ,mnt=$Z;function vnt(e,t){return mnt(gnt(e,t,hnt),e+"")}var ynt=vnt,bnt=Gy,_nt=Nh,xnt=zD,wnt=is;function Snt(e,t,n){if(!wnt(n))return!1;var r=typeof t;return(r=="number"?_nt(n)&&xnt(t,n.length):r=="string"&&t in n)?bnt(n[t],e):!1}var Cnt=Snt,Ent=ynt,knt=Cnt;function Tnt(e){return Ent(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&knt(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var Rnt=Tnt,Ant=Gtt,$nt=Rnt,Ont=$nt(function(e,t,n){Ant(e,t,n)}),Int=Ont;const vx=_i(Int);function cC({children:e,className:t,clipboardValue:n,sx:r,sxChildren:i,title:o}){const a=Xn();return S.jsxs(Ht,{spacing:o?1.5:0,sx:vx({width:"100%",flex:1,overflowY:"auto"},r),children:[S.jsx(Yt,{fontSize:"14px",fontWeight:700,color:_t[400],children:o}),S.jsxs(at,{className:t,sx:vx({position:"relative",fontFamily:"Inter",fontSize:"16px",lineHeight:"24px",padding:3,paddingRight:4,border:`1.5px solid ${a.palette.divider}`,borderRadius:"8px",overflowY:"auto",flexGrow:1,caretColor:a.palette.text.primary,backgroundColor:a.palette.background.paper,"&:hover":{borderColor:a.palette.mode==="light"?_t[400]:"white"}},i),children:[n?S.jsx(Pq,{value:n}):null,e]})]})}var KD={},Dnt=vn;Object.defineProperty(KD,"__esModule",{value:!0});var OZ=KD.default=void 0,Pnt=Dnt(yn()),Lnt=S,Mnt=(0,Pnt.default)((0,Lnt.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");OZ=KD.default=Mnt;function IZ({count:e,inputProps:t}){const n=Xn();return e?t?(()=>{const o=a=>`${e.toString().length*8+(a?18:0)}px`;return t?S.jsx(lS,{id:t.id,inputProps:{type:"number",max:t.max,min:t.min,step:t.step||1,sx:{width:o(),padding:a=>a.spacing(.5,1),fontSize:"12px",fontWeight:600,color:"text.secondary","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"},"&:focus":{width:o(!0),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"flex"}}}},sx:{borderRadius:"6px",backgroundColor:a=>a.palette.mode==="light"?"grey.100":"grey.800","& fieldset":{border:"none"}},value:e,onChange:t.onChange}):null})():(()=>S.jsx(at,{display:"flex",alignItems:"center",className:"notification-count",sx:{borderRadius:"6px",padding:"4px 8px",backgroundColor:n.palette.mode==="light"?"grey.100":"grey.800"},children:S.jsx(Yt,{className:"notification-count",color:"text.secondary",sx:{fontSize:"12px",fontWeight:600},children:e})}))():null}var WD={},Fnt=vn;Object.defineProperty(WD,"__esModule",{value:!0});var DZ=WD.default=void 0,Nnt=Fnt(yn()),Bnt=S,jnt=(0,Nnt.default)((0,Bnt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");DZ=WD.default=jnt;function znt({id:e,label:t,tooltip:n,notificationsProps:r}){return S.jsxs(at,{display:"flex",justifyContent:"space-between",width:"100%",children:[S.jsxs(at,{display:"flex",gap:.5,alignItems:"center",children:[S.jsx(yV,{htmlFor:e,sx:{fontWeight:600,fontSize:"12px",color:"grey.500"},children:t}),n?S.jsx(yi,{title:n,children:S.jsx(DZ,{sx:{fontSize:12,color:"grey.600"}})}):null]}),r?S.jsx(IZ,{...r}):null]})}function jh(e){const{children:t,description:n,hasError:r,id:i,label:o,notificationsProps:a,tooltip:s,sx:l}=e;return S.jsxs(Ht,{width:"100%",sx:l,gap:.5,children:[o?S.jsx(znt,{id:i,label:o,tooltip:s,notificationsProps:a}):null,S.jsxs(fV,{error:r,fullWidth:!0,children:[t,n?S.jsx(dV,{children:n}):null]})]})}const Unt=({item:e,selected:t,isDarkMode:n,index:r})=>S.jsxs(ov,{value:e.value,sx:{display:"flex",justifyContent:"space-between",fontWeight:500,fontSize:"14px",color:n&&_t[400]||(t?As[500]:_t[700]),"&:hover":{backgroundColor:n?_t[800]:As[50],color:n?_t[400]:As[500],"& .notification-count":{backgroundColor:n?_t[850]:As[100],color:n?_t[400]:As[500]}}},children:[e.label||e.value,e.notificationCount?S.jsx(IZ,{count:e.notificationCount}):null]},`select-${r}`);function zh({children:e,description:t,disabled:n=!1,hasError:r,id:i,items:o,label:a,name:s,onChange:l,size:u="small",tooltip:f,value:d,placeholder:p="Select",renderLabel:g,onClose:v,sx:y,iconSx:w,...b}){const x=Ty();return S.jsx(jh,{id:i,hasError:r,description:t,label:a,tooltip:f,sx:y,children:S.jsx(TV,{...b,onClose:v,labelId:i,value:d==null?void 0:d.toString(),onChange:l,size:u,disabled:n,displayEmpty:!0,renderValue:()=>{var C;return!d||d===""?p:g&&g()||`${(C=o==null?void 0:o.find(k=>k.value===d))==null?void 0:C.label}`},sx:{backgroundColor:C=>C.palette.background.paper,borderRadius:1,padding:.5,"&.MuiOutlinedInput-root":{"& fieldset":{border:C=>`1px solid ${C.palette.divider}`}}},inputProps:{id:i,name:s||i,sx:{color:_t[600],fontSize:"14px",fontWeight:400,px:"16px",py:u==="small"?"10px":"14px",h:"48px"}},MenuProps:{PaperProps:{sx:{border:C=>`1px solid ${C.palette.divider}`,boxShadow:C=>C.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D","&& .Mui-selected, .Mui-selected.Mui-selected:hover":{backgroundColor:x?_t[800]:As[50]}}},MenuListProps:{sx:{backgroundColor:x?_t[900]:""}}},IconComponent:C=>S.jsx(OZ,{...C,fontSize:"16px",sx:{px:"9px",color:n?"":`${x?_t[300]:_t[600]} !important`,...w}}),children:e||(o==null?void 0:o.map((C,k)=>Unt({item:C,index:k,selected:C.value===d,isDarkMode:x})))})})}const Knt=["Assistant","System","User"],PZ=({canSelectRole:e,children:t,index:n,message:r,role:i,name:o})=>{const a=gn(ts),[s,l]=T.useState(!1),u=f=>{const d=f.target.value;d&&a(p=>{var g,v;return{...p,prompt:{...p.prompt,messages:(v=(g=p.prompt)==null?void 0:g.messages)==null?void 0:v.map((y,w)=>({...y,...w===n?{role:d}:{}}))}}}),l(!1)};return S.jsxs(at,{children:[S.jsx(at,{sx:{border:f=>`1px solid ${f.palette.divider}`,borderRadius:1}}),S.jsxs(Ht,{direction:"row",width:"100%",sx:{gap:2,flex:10,paddingY:1,"&:hover":{background:f=>f.palette.background.paper}},children:[S.jsxs(at,{sx:{flex:1,paddingLeft:2},children:[s?S.jsx(zh,{onClose:()=>l(!1),defaultOpen:!0,items:Knt.map(f=>({label:f,value:f.toLowerCase()})),id:"role-select",value:r==null?void 0:r.role,onChange:u,sx:{width:"fit-content"},iconSx:{px:0,marginRight:"2px !important"}}):S.jsx(Yt,{onClick:()=>e&&l(!0),color:"text.primary",sx:{p:1,borderRadius:.5,marginTop:1,cursor:e?"pointer":"default",fontSize:"12px",fontWeight:700,width:"fit-content",...e&&{"&:hover":{backgroundColor:f=>f.palette.divider}}},children:i}),o?S.jsx(Yt,{color:"text.secondary",variant:"caption",sx:{ml:1,width:"fit-content"},children:o}):null]}),S.jsx(at,{width:"100%",flex:8,children:t})]})]},n)};function LZ({completion:e,chatMode:t}){const[n,r]=T.useState(Rn.EditorState.createEmpty()),[i,o]=T.useState(!0);T.useEffect(()=>{let l=Rn.EditorState.createEmpty();e&&(l=a(l,e)),r(l),o(!0)},[e]);const a=(l,u)=>{const f=l.getCurrentContent(),d=f.getBlockMap(),p=d.last().getKey(),g=d.last().getLength(),v=new Rn.SelectionState({anchorKey:p,anchorOffset:g,focusKey:p,focusOffset:g}),y=Rn.Modifier.insertText(f,v,u,Sf.of("COMPLETION")),w=Rn.EditorState.push(l,y,"insert-characters");return Rn.EditorState.forceSelection(w,y.getSelectionAfter())},s=()=>S.jsx(cC,{className:"completion-editor",clipboardValue:n.getCurrentContent().getPlainText(),sxChildren:{borderColor:l=>l.palette.success.main,"&:hover":{borderColor:l=>l.palette.success.main}},children:S.jsx(Rn.Editor,{editorState:n,onChange:l=>{l=Rn.EditorState.push(l,n.getCurrentContent(),"insert-characters"),r(l)}})});return t?S.jsx(PZ,{role:"ASSISTANT",children:s()}):S.jsxs(at,{marginTop:2,children:[S.jsxs(Ht,{sx:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingRight:"6px"},children:[S.jsx(Yt,{fontSize:"14px",fontWeight:700,color:dw[400],children:"Completion"}),S.jsx(or,{onClick:()=>o(!i),children:i?S.jsx(IS,{}):S.jsx(DS,{})})]}),S.jsx(at,{sx:{border:l=>`1px solid ${l.palette.divider}`,borderRadius:1,marginTop:1}}),S.jsx(at,{sx:{maxHeight:i?"220px":"0px",transition:"max-height 0.5s ease-in-out",overflow:"auto",marginTop:2},children:s()})]})}function MZ(e,t){switch(t){case"f-string":return new RegExp(`\\{+(${e}+)\\}+`,"g");default:throw new Error(`Unsupported template format ${t}`)}}function Wnt(e={},t){const n=Object.keys(e).sort((r,i)=>i.length-r.length);switch(t){case"f-string":{const r=n.map(i=>`${i}`).join("|");return MZ(r,t)}default:throw new Error(`Unsupported template format ${t}`)}}function Vnt(e,t){switch(t){case"f-string":return e=e.replaceAll("{{","{"),e=e.replaceAll("}}","}"),e;default:throw new Error(`Unsupported template format ${t}`)}}function Hnt(e){switch(e){case"f-string":return/\{+([^{}]+)\}+|{{|}}/g;default:throw new Error(`Unsupported template format ${e}`)}}function FZ(e,t){switch(t){case"f-string":return`{${e}}`;default:throw new Error(`Unsupported template format ${t}`)}}function VD(e,t,n){switch(n){case"f-string":{const r=t.split(e)[0].length,i=t.split(e)[1].length,a=r%2&&r===i,s=FZ(e,n),l=t.indexOf(s),u=l+s.length;return{ok:a,localStartIndex:l,localEndIndex:u}}default:throw new Error(`Unsupported template format ${n}`)}}var yx={exports:{}};/**
|
|
462
462
|
* @license
|
|
463
463
|
* Lodash <https://lodash.com/>
|
|
464
464
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -484,10 +484,10 @@ __p += '`),en&&(qe+=`' +
|
|
|
484
484
|
function print() { __p += __j.call(arguments, '') }
|
|
485
485
|
`:`;
|
|
486
486
|
`)+qe+`return __p
|
|
487
|
-
}`;var Bt=SM(function(){return wt(J,xt+"return "+qe).apply(n,ce)});if(Bt.source=qe,hE(Bt))throw Bt;return Bt}function Qie(c){return _n(c).toLowerCase()}function eoe(c){return _n(c).toUpperCase()}function toe(c,h,_){if(c=_n(c),c&&(_||h===n))return yg(c);if(!c||!(h=po(h)))return c;var $=I(c),N=I(h),J=bg($,N),ce=cd($,N)+1;return ou($,J,ce).join("")}function noe(c,h,_){if(c=_n(c),c&&(_||h===n))return c.slice(0,F(c)+1);if(!c||!(h=po(h)))return c;var $=I(c),N=cd($,I(h))+1;return ou($,0,N).join("")}function roe(c,h,_){if(c=_n(c),c&&(_||h===n))return c.replace(kr,"");if(!c||!(h=po(h)))return c;var $=I(c),N=bg($,I(h));return ou($,N).join("")}function ioe(c,h){var _=D,$=W;if(sr(h)){var N="separator"in h?h.separator:N;_="length"in h?Mt(h.length):_,$="omission"in h?po(h.omission):$}c=_n(c);var J=c.length;if($a(c)){var ce=I(c);J=ce.length}if(_>=J)return c;var ve=_-E($);if(ve<1)return $;var ke=ce?ou(ce,0,ve).join(""):c.slice(0,ve);if(N===n)return ke+$;if(ce&&(ve+=ke.length-ve),gE(N)){if(c.slice(ve).search(N)){var Ue,Ke=ke;for(N.global||(N=eu(N.source,_n(co.exec(N))+"g")),N.lastIndex=0;Ue=N.exec(Ke);)var qe=Ue.index;ke=ke.slice(0,qe===n?ve:qe)}}else if(c.indexOf(po(N),ve)!=ve){var ut=ke.lastIndexOf(N);ut>-1&&(ke=ke.slice(0,ut))}return ke+$}function ooe(c){return c=_n(c),c&&ot.test(c)?c.replace(dt,j):c}var aoe=yd(function(c,h,_){return c+(_?" ":"")+h.toUpperCase()}),yE=CL("toUpperCase");function wM(c,h,_){return c=_n(c),h=_?n:h,h===n?_0(c)?Se(c):gg(c):c.match(h)||[]}var SM=Kt(function(c,h){try{return Lt(c,n,h)}catch(_){return hE(_)?_:new it(_)}}),soe=ol(function(c,h){return Ci(h,function(_){_=fs(_),rl(c,_,dE(c[_],c))}),c});function loe(c){var h=c==null?0:c.length,_=Tt();return c=h?Wt(c,function($){if(typeof $[1]!="function")throw new zo(a);return[_($[0]),$[1]]}):[],Kt(function($){for(var N=-1;++N<h;){var J=c[N];if(Lt(J[0],this,$))return Lt(J[1],this,$)}})}function uoe(c){return Pee(Ko(c,d))}function bE(c){return function(){return c}}function coe(c,h){return c==null||c!==c?h:c}var foe=kL(),doe=kL(!0);function zi(c){return c}function _E(c){return nL(typeof c=="function"?c:Ko(c,d))}function poe(c){return iL(Ko(c,d))}function hoe(c,h){return oL(c,Ko(h,d))}var goe=Kt(function(c,h){return function(_){return Ag(_,c,h)}}),moe=Kt(function(c,h){return function(_){return Ag(c,_,h)}});function xE(c,h,_){var $=jr(h),N=B0(h,$);_==null&&!(sr(h)&&(N.length||!$.length))&&(_=h,h=c,c=this,N=B0(h,jr(h)));var J=!(sr(_)&&"chain"in _)||!!_.chain,ce=sl(c);return Ci(N,function(ve){var ke=h[ve];c[ve]=ke,ce&&(c.prototype[ve]=function(){var Ue=this.__chain__;if(J||Ue){var Ke=c(this.__wrapped__),qe=Ke.__actions__=Ni(this.__actions__);return qe.push({func:ke,args:arguments,thisArg:c}),Ke.__chain__=Ue,Ke}return ke.apply(c,Ln([this.value()],arguments))})}),c}function voe(){return Dr._===this&&(Dr._=KQ),this}function wE(){}function yoe(c){return c=Mt(c),Kt(function(h){return aL(h,c)})}var boe=QC(Wt),_oe=QC(fo),xoe=QC(hg);function CM(c){return aE(c)?Fi(fs(c)):Zee(c)}function woe(c){return function(h){return c==null?n:Ec(c,h)}}var Soe=RL(),Coe=RL(!0);function SE(){return[]}function CE(){return!1}function Eoe(){return{}}function koe(){return""}function Toe(){return!0}function Roe(c,h){if(c=Mt(c),c<1||c>Z)return[];var _=ge,$=si(c,ge);h=Tt(h),c-=ge;for(var N=_c($,h);++_<c;)h(_);return N}function Aoe(c){return It(c)?Wt(c,fs):ho(c)?[c]:Ni(WL(_n(c)))}function $oe(c){var h=++zQ;return _n(c)+h}var Ooe=V0(function(c,h){return c+h},0),Ioe=eE("ceil"),Doe=V0(function(c,h){return c/h},1),Poe=eE("floor");function Loe(c){return c&&c.length?N0(c,zi,BC):n}function Moe(c,h){return c&&c.length?N0(c,Tt(h,2),BC):n}function Foe(c){return sd(c,zi)}function Noe(c,h){return sd(c,Tt(h,2))}function Boe(c){return c&&c.length?N0(c,zi,KC):n}function joe(c,h){return c&&c.length?N0(c,Tt(h,2),KC):n}var zoe=V0(function(c,h){return c*h},1),Uoe=eE("round"),Koe=V0(function(c,h){return c-h},0);function Woe(c){return c&&c.length?ud(c,zi):0}function Voe(c,h){return c&&c.length?ud(c,Tt(h,2)):0}return q.after=pre,q.ary=tM,q.assign=eie,q.assignIn=gM,q.assignInWith=i1,q.assignWith=tie,q.at=nie,q.before=nM,q.bind=dE,q.bindAll=soe,q.bindKey=rM,q.castArray=Ere,q.chain=JL,q.chunk=Pte,q.compact=Lte,q.concat=Mte,q.cond=loe,q.conforms=uoe,q.constant=bE,q.countBy=Wne,q.create=rie,q.curry=iM,q.curryRight=oM,q.debounce=aM,q.defaults=iie,q.defaultsDeep=oie,q.defer=hre,q.delay=gre,q.difference=Fte,q.differenceBy=Nte,q.differenceWith=Bte,q.drop=jte,q.dropRight=zte,q.dropRightWhile=Ute,q.dropWhile=Kte,q.fill=Wte,q.filter=Hne,q.flatMap=Yne,q.flatMapDeep=Xne,q.flatMapDepth=Zne,q.flatten=GL,q.flattenDeep=Vte,q.flattenDepth=Hte,q.flip=mre,q.flow=foe,q.flowRight=doe,q.fromPairs=qte,q.functions=die,q.functionsIn=pie,q.groupBy=Jne,q.initial=Yte,q.intersection=Xte,q.intersectionBy=Zte,q.intersectionWith=Jte,q.invert=gie,q.invertBy=mie,q.invokeMap=ere,q.iteratee=_E,q.keyBy=tre,q.keys=jr,q.keysIn=ji,q.map=J0,q.mapKeys=yie,q.mapValues=bie,q.matches=poe,q.matchesProperty=hoe,q.memoize=e1,q.merge=_ie,q.mergeWith=mM,q.method=goe,q.methodOf=moe,q.mixin=xE,q.negate=t1,q.nthArg=yoe,q.omit=xie,q.omitBy=wie,q.once=vre,q.orderBy=nre,q.over=boe,q.overArgs=yre,q.overEvery=_oe,q.overSome=xoe,q.partial=pE,q.partialRight=sM,q.partition=rre,q.pick=Sie,q.pickBy=vM,q.property=CM,q.propertyOf=woe,q.pull=nne,q.pullAll=XL,q.pullAllBy=rne,q.pullAllWith=ine,q.pullAt=one,q.range=Soe,q.rangeRight=Coe,q.rearg=bre,q.reject=are,q.remove=ane,q.rest=_re,q.reverse=cE,q.sampleSize=lre,q.set=Eie,q.setWith=kie,q.shuffle=ure,q.slice=sne,q.sortBy=dre,q.sortedUniq=hne,q.sortedUniqBy=gne,q.split=Yie,q.spread=xre,q.tail=mne,q.take=vne,q.takeRight=yne,q.takeRightWhile=bne,q.takeWhile=_ne,q.tap=Lne,q.throttle=wre,q.thru=Z0,q.toArray=dM,q.toPairs=yM,q.toPairsIn=bM,q.toPath=Aoe,q.toPlainObject=hM,q.transform=Tie,q.unary=Sre,q.union=xne,q.unionBy=wne,q.unionWith=Sne,q.uniq=Cne,q.uniqBy=Ene,q.uniqWith=kne,q.unset=Rie,q.unzip=fE,q.unzipWith=ZL,q.update=Aie,q.updateWith=$ie,q.values=xd,q.valuesIn=Oie,q.without=Tne,q.words=wM,q.wrap=Cre,q.xor=Rne,q.xorBy=Ane,q.xorWith=$ne,q.zip=One,q.zipObject=Ine,q.zipObjectDeep=Dne,q.zipWith=Pne,q.entries=yM,q.entriesIn=bM,q.extend=gM,q.extendWith=i1,xE(q,q),q.add=Ooe,q.attempt=SM,q.camelCase=Lie,q.capitalize=_M,q.ceil=Ioe,q.clamp=Iie,q.clone=kre,q.cloneDeep=Rre,q.cloneDeepWith=Are,q.cloneWith=Tre,q.conformsTo=$re,q.deburr=xM,q.defaultTo=coe,q.divide=Doe,q.endsWith=Mie,q.eq=Ia,q.escape=Fie,q.escapeRegExp=Nie,q.every=Vne,q.find=qne,q.findIndex=HL,q.findKey=aie,q.findLast=Gne,q.findLastIndex=qL,q.findLastKey=sie,q.floor=Poe,q.forEach=QL,q.forEachRight=eM,q.forIn=lie,q.forInRight=uie,q.forOwn=cie,q.forOwnRight=fie,q.get=mE,q.gt=Ore,q.gte=Ire,q.has=hie,q.hasIn=vE,q.head=YL,q.identity=zi,q.includes=Qne,q.indexOf=Gte,q.inRange=Die,q.invoke=vie,q.isArguments=Rc,q.isArray=It,q.isArrayBuffer=Dre,q.isArrayLike=Bi,q.isArrayLikeObject=wr,q.isBoolean=Pre,q.isBuffer=au,q.isDate=Lre,q.isElement=Mre,q.isEmpty=Fre,q.isEqual=Nre,q.isEqualWith=Bre,q.isError=hE,q.isFinite=jre,q.isFunction=sl,q.isInteger=lM,q.isLength=n1,q.isMap=uM,q.isMatch=zre,q.isMatchWith=Ure,q.isNaN=Kre,q.isNative=Wre,q.isNil=Hre,q.isNull=Vre,q.isNumber=cM,q.isObject=sr,q.isObjectLike=hr,q.isPlainObject=Lg,q.isRegExp=gE,q.isSafeInteger=qre,q.isSet=fM,q.isString=r1,q.isSymbol=ho,q.isTypedArray=_d,q.isUndefined=Gre,q.isWeakMap=Yre,q.isWeakSet=Xre,q.join=Qte,q.kebabCase=Bie,q.last=Vo,q.lastIndexOf=ene,q.lowerCase=jie,q.lowerFirst=zie,q.lt=Zre,q.lte=Jre,q.max=Loe,q.maxBy=Moe,q.mean=Foe,q.meanBy=Noe,q.min=Boe,q.minBy=joe,q.stubArray=SE,q.stubFalse=CE,q.stubObject=Eoe,q.stubString=koe,q.stubTrue=Toe,q.multiply=zoe,q.nth=tne,q.noConflict=voe,q.noop=wE,q.now=Q0,q.pad=Uie,q.padEnd=Kie,q.padStart=Wie,q.parseInt=Vie,q.random=Pie,q.reduce=ire,q.reduceRight=ore,q.repeat=Hie,q.replace=qie,q.result=Cie,q.round=Uoe,q.runInContext=te,q.sample=sre,q.size=cre,q.snakeCase=Gie,q.some=fre,q.sortedIndex=lne,q.sortedIndexBy=une,q.sortedIndexOf=cne,q.sortedLastIndex=fne,q.sortedLastIndexBy=dne,q.sortedLastIndexOf=pne,q.startCase=Xie,q.startsWith=Zie,q.subtract=Koe,q.sum=Woe,q.sumBy=Voe,q.template=Jie,q.times=Roe,q.toFinite=ll,q.toInteger=Mt,q.toLength=pM,q.toLower=Qie,q.toNumber=Ho,q.toSafeInteger=Qre,q.toString=_n,q.toUpper=eoe,q.trim=toe,q.trimEnd=noe,q.trimStart=roe,q.truncate=ioe,q.unescape=ooe,q.uniqueId=$oe,q.upperCase=aoe,q.upperFirst=yE,q.each=QL,q.eachRight=eM,q.first=YL,xE(q,function(){var c={};return us(q,function(h,_){wn.call(q.prototype,_)||(c[_]=h)}),c}(),{chain:!1}),q.VERSION=r,Ci(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){q[c].placeholder=q}),Ci(["drop","take"],function(c,h){Zt.prototype[c]=function(_){_=_===n?1:Pr(Mt(_),0);var $=this.__filtered__&&!h?new Zt(this):this.clone();return $.__filtered__?$.__takeCount__=si(_,$.__takeCount__):$.__views__.push({size:si(_,ge),type:c+($.__dir__<0?"Right":"")}),$},Zt.prototype[c+"Right"]=function(_){return this.reverse()[c](_).reverse()}}),Ci(["filter","map","takeWhile"],function(c,h){var _=h+1,$=_==K||_==Q;Zt.prototype[c]=function(N){var J=this.clone();return J.__iteratees__.push({iteratee:Tt(N,3),type:_}),J.__filtered__=J.__filtered__||$,J}}),Ci(["head","last"],function(c,h){var _="take"+(h?"Right":"");Zt.prototype[c]=function(){return this[_](1).value()[0]}}),Ci(["initial","tail"],function(c,h){var _="drop"+(h?"":"Right");Zt.prototype[c]=function(){return this.__filtered__?new Zt(this):this[_](1)}}),Zt.prototype.compact=function(){return this.filter(zi)},Zt.prototype.find=function(c){return this.filter(c).head()},Zt.prototype.findLast=function(c){return this.reverse().find(c)},Zt.prototype.invokeMap=Kt(function(c,h){return typeof c=="function"?new Zt(this):this.map(function(_){return Ag(_,c,h)})}),Zt.prototype.reject=function(c){return this.filter(t1(Tt(c)))},Zt.prototype.slice=function(c,h){c=Mt(c);var _=this;return _.__filtered__&&(c>0||h<0)?new Zt(_):(c<0?_=_.takeRight(-c):c&&(_=_.drop(c)),h!==n&&(h=Mt(h),_=h<0?_.dropRight(-h):_.take(h-c)),_)},Zt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Zt.prototype.toArray=function(){return this.take(ge)},us(Zt.prototype,function(c,h){var _=/^(?:filter|find|map|reject)|While$/.test(h),$=/^(?:head|last)$/.test(h),N=q[$?"take"+(h=="last"?"Right":""):h],J=$||/^find/.test(h);N&&(q.prototype[h]=function(){var ce=this.__wrapped__,ve=$?[1]:arguments,ke=ce instanceof Zt,Ue=ve[0],Ke=ke||It(ce),qe=function(qt){var en=N.apply(q,Ln([qt],ve));return $&&ut?en[0]:en};Ke&&_&&typeof Ue=="function"&&Ue.length!=1&&(ke=Ke=!1);var ut=this.__chain__,xt=!!this.__actions__.length,Rt=J&&!ut,Bt=ke&&!xt;if(!J&&Ke){ce=Bt?ce:new Zt(this);var At=c.apply(ce,ve);return At.__actions__.push({func:Z0,args:[qe],thisArg:n}),new Uo(At,ut)}return Rt&&Bt?c.apply(this,ve):(At=this.thru(qe),Rt?$?At.value()[0]:At.value():At)})}),Ci(["pop","push","shift","sort","splice","unshift"],function(c){var h=S0[c],_=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",$=/^(?:pop|shift)$/.test(c);q.prototype[c]=function(){var N=arguments;if($&&!this.__chain__){var J=this.value();return h.apply(It(J)?J:[],N)}return this[_](function(ce){return h.apply(It(ce)?ce:[],N)})}}),us(Zt.prototype,function(c,h){var _=q[h];if(_){var $=_.name+"";wn.call(gd,$)||(gd[$]=[]),gd[$].push({name:h,func:_})}}),gd[W0(n,b).name]=[{name:"wrapper",func:n}],Zt.prototype.clone=oee,Zt.prototype.reverse=aee,Zt.prototype.value=see,q.prototype.at=Mne,q.prototype.chain=Fne,q.prototype.commit=Nne,q.prototype.next=Bne,q.prototype.plant=zne,q.prototype.reverse=Une,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=Kne,q.prototype.first=q.prototype.head,wg&&(q.prototype[wg]=jne),q},De=Oe();Qs?((Qs.exports=De)._=De,mc._=De):Dr._=De}).call(ni)})(yx,yx.exports);var NZ=yx.exports;function Hnt(){const e=CI(!0),t={};for(let n=0;n<e.length;n++)t[n.toString()]={background:e[n],borderRadius:"2px",cursor:"pointer"};return t}function qnt(e,t){const n=Vnt(t),r=[];let i;for(;(i=n.exec(e))!==null;)i.index>-1&&r.push(i);return r}function Gnt(e,t,n){const i=MZ(t,n).exec(e),o=i==null?void 0:i[0];if(o){const{ok:a}=VD(t,o,n);return{match:o,ok:a}}else return{match:"",ok:!1}}function Ynt(e,t,n){let r=e.getCurrentContent(),i=e;return r.getBlockMap().forEach(o=>{if(!o)return;const a=o.getKey(),s=o.getText(),l=qnt(s,n);let u=0;const f=l.map(p=>{const g=p[0];let v;for(const C of t){const{match:k,ok:R}=Gnt(g,C.name,n);if(R){v={variable:C,match:k};break}}const y=p.index+u,w=y+g.length,b=new Rn.SelectionState({anchorKey:a,anchorOffset:y,focusKey:a,focusOffset:w}),x=Wnt(g,n);return u+=x.length-g.length,r=Rn.Modifier.replaceText(r,b,x),i=Rn.EditorState.push(e,r,"apply-entity"),p[0]=x,p.index=y,{ssm:p,variableFound:v}});let d=0;f.forEach(({ssm:p,variableFound:g})=>{if(!g)return;const{variable:v}=g,y=p[0],w=i.getSelection(),{localEndIndex:b,localStartIndex:x}=VD(v.name,y,n),C=p.index+x+d,k=p.index+b+d,R=new Rn.SelectionState({anchorKey:a,anchorOffset:C,focusKey:a,focusOffset:k}),A=v.content||"";d+=A.length-(b-x),r=i.getCurrentContent(),r=r.createEntity("TOKEN","SEGMENTED",v);const O=r.getLastCreatedEntityKey();r=Rn.Modifier.replaceText(r,R,A,Sf.of(v.styleIndex.toString()),O),i=Rn.EditorState.push(i,r,"apply-entity"),i=Rn.EditorState.forceSelection(i,w)})}),i}function Xnt(e){const t=e.getSelection(),n=t.getStartKey(),r=e.getCurrentContent(),i=r.getBlockForKey(n);if(!i)return;const o=i.getEntityAt(t.getStartOffset());if(o){const a=r.getEntity(o);return{type:a.getType(),mutability:a.getMutability(),data:a.getData()}}}function bx({template:e,formatted:t,prompt:n,readOnly:r,onChange:i,showTitle:o=!1,sxEditorChildren:a}){const s=T.useRef(null),l=gn(AS),u=gn($S),[f,d]=T.useState(),[p,g]=T.useState(),v=Hnt();if(aH()||!NZ.isEqual(n.inputs,p)){if(typeof e=="string"){const x=n.inputs||{},C=Object.keys(x),k=[];for(let z=0;z<C.length;z++){const V=C[z],D=x[V];k.push({name:V,styleIndex:z,content:D})}const R=k.sort((z,V)=>V.name.length-z.name.length),A=Rn.EditorState.createWithContent(Rn.ContentState.createFromText(e)),O=Ynt(A,R,n.template_format);d(O)}else if(typeof t=="string"){const x=Rn.EditorState.createWithContent(Rn.ContentState.createFromText(t));d(x)}g(n.inputs)}const w=x=>{const C=x.getSelection().getHasFocus(),k=Xnt(x);if(k&&C&&s.current&&(l(k.data.name),s.current.blur()),!r)i&&i(x);else if(f){const R=f.getCurrentContent(),A=x.getCurrentContent();R!==A&&(gi.error("Formatted prompt is read only. Edit the template/variables instead."),u("Template")),x=Rn.EditorState.push(x,R,"insert-characters")}d(x)};if(!f)return null;const b=r?"Formatted prompt [Read Only]":"Formatted prompt";return S.jsx(cC,{className:"formatted-editor",title:o?b:void 0,clipboardValue:f==null?void 0:f.getCurrentContent().getPlainText(),sxChildren:vx(a||{},r?{caretColor:"transparent",backgroundColor:"transparent",borderColor:"transparent !important"}:{}),children:S.jsx(Rn.Editor,{ref:s,customStyleMap:v,editorState:f,onChange:w})})}function Znt(e,t=200){return e.length>t?e.slice(0,t-1)+"...":e}function Jnt({children:e,decoratedText:t}){const n=gn(AS),r=Ct(ts),i=CI(!0),[o,a]=T.useState(),[s,l]=T.useState({}),u=r==null?void 0:r.prompt;if(!u)return null;T.useEffect(()=>{if(u.inputs&&t){const p=Object.keys(u.inputs).findIndex(g=>FZ(g,u.template_format)===t);if(p>-1){a(p);const g=p%(i.length-1);l({backgroundColor:i[g],borderRadius:"2px",cursor:"pointer"})}}},[t,u]);const[f,d]=o!==void 0?Object.entries(u.inputs||{})[o]:[];return S.jsx(yi,{title:d?Znt(d):void 0,children:S.jsx("span",{className:f?`input-${f}`:void 0,style:s,onMouseDown:()=>n(f),children:e})})}const Qnt=(e,t,n,r)=>{const i=n.getText();let o;for(;(o=e.exec(i))!==null;){const{ok:a,localEndIndex:s,localStartIndex:l}=VD(o[1],o[0],t);if(!a)continue;const u=o.index+l,f=o.index+s;r(u,f)}};function BZ({prompt:e,template:t,onChange:n,showTitle:r=!0,sxEditorChildren:i}){const[o,a]=T.useState();if(aH()){const l=Rn.ContentState.createFromText(t),u={strategy:(d,p)=>{Qnt(Knt(e.inputs,e.template_format),e.template_format,d,p)},component:Jnt},f=new Rn.CompositeDecorator([u]);a(Rn.EditorState.createWithContent(l,f))}return o?S.jsx(cC,{className:"template-editor",title:r?"Prompt Template":void 0,clipboardValue:o==null?void 0:o.getCurrentContent().getPlainText(),sxChildren:i,children:S.jsx(Rn.Editor,{editorState:o,onChange:l=>{a(l),n&&n(l)}})}):null}function ert({hasTemplate:e,prompt:t,restoredTime:n}){const r=Ct($S),i=gn(ts);if(t.messages)return null;const o=u=>{const f=u.getCurrentContent().getPlainText();i(d=>({...d,prompt:{...d.prompt,template:f}}))},a=u=>{const f=u.getCurrentContent().getPlainText();i(d=>({...d,prompt:{...d.prompt,formatted:f}}))},s=()=>S.jsx(BZ,{showTitle:!0,template:t.template||"",prompt:t,onChange:o}),l=()=>e?S.jsx(bx,{showTitle:!0,template:t.template,prompt:t,readOnly:!0}):typeof t.formatted=="string"?S.jsx(bx,{showTitle:!0,formatted:t.formatted,prompt:t,readOnly:!1,onChange:a}):S.jsx(ro,{severity:"error",children:"Neither template or formatted prompt provided."});return S.jsxs(Ht,{flex:1,width:"100%",children:[r==="Template"?s():null,r==="Formatted"?l():null,S.jsx(LZ,{completion:t.completion})]},n)}function trt({message:e,prompt:t,mode:n,index:r,onChange:i}){var u;const o=Xn(),a={prompt:t,sxEditorChildren:{padding:o.spacing(2),backgroundColor:"","&:hover":{background:o.palette.background.paper}}},s=()=>S.jsx(BZ,{...a,showTitle:!1,template:e.template,onChange:f=>i(r,f)}),l=()=>typeof e.template=="string"?S.jsx(bx,{...a,template:e.template,readOnly:!0}):typeof e.formatted=="string"?S.jsx(bx,{...a,onChange:f=>i(r,f),formatted:e.formatted,readOnly:!1,showTitle:!1}):S.jsx(ro,{severity:"error",children:"Neither template or formatted prompt provided."});return S.jsx(PZ,{canSelectRole:!0,index:r,message:e,role:(u=e.role)==null?void 0:u.toUpperCase(),name:e.name,children:S.jsxs(S.Fragment,{children:[n==="Template"?s():null,n==="Formatted"?l():null]})})}const nrt=T.forwardRef(({hasTemplate:e,prompt:t,restoredTime:n},r)=>{const i=gn(ts),o=Ct($S),a=t.messages;if(!a)return null;const s=(u,f)=>{const d=f.getCurrentContent().getPlainText(),p=e?"template":"formatted";i(g=>{var v,y;return{...g,prompt:{...g.prompt,messages:(y=(v=g.prompt)==null?void 0:v.messages)==null?void 0:y.map((w,b)=>b===u?{...w,[p]:d}:w)}}})},l=o==="Formatted"?e?"Formatted messages [Read Only]":"Formatted messages":"Prompt messages";return S.jsxs(Ht,{sx:{width:"100%"},children:[S.jsx(Yt,{fontSize:"14px",fontWeight:700,color:dw[400],children:l}),S.jsxs(at,{ref:r,sx:{flex:1,height:"auto",overflow:"scroll",marginTop:1,gap:1},children:[a.length>0?S.jsx(Ht,{children:a.map((u,f)=>S.jsx(T.Fragment,{children:S.jsx(trt,{message:u,prompt:t,mode:o,index:f,onChange:s})},`prompt-message-${f}`))}):null,S.jsx(LZ,{completion:t.completion,chatMode:!0})]},n)]})});function Gu({children:e,...t}){const n=Xn();return S.jsx("span",{style:{color:n.palette.text.primary},children:S.jsx(If,{color:n.palette.mode==="dark"?"inherit":"primary",...t,children:e})})}const rrt=()=>{const[e,t]=T.useState(),[n,r]=ir(ts),[i,o]=ir(AS),a=Xn();T.useEffect(()=>{var u;i&&((u=n.prompt)!=null&&u.inputs)&&t(Rn.EditorState.createWithContent(Rn.ContentState.createFromText(n.prompt.inputs[i])))},[i]);const s=()=>{i&&(r(u=>{var f;return u!=null&&u.prompt?{...u,prompt:{...u.prompt,inputs:{...(f=u==null?void 0:u.prompt)==null?void 0:f.inputs,[i]:(e==null?void 0:e.getCurrentContent().getPlainText())||""}}}:u}),o(void 0))},l=()=>{o(void 0)};return i?S.jsx(mh,{id:"variable-modal",open:!!i,onClose:l,fullWidth:!0,maxWidth:"md",sx:{border:u=>u.palette.mode==="dark"?`1px solid ${dw[800]}`:null,borderRadius:1},children:S.jsxs(at,{bgcolor:"background.paper",children:[S.jsx(by,{children:S.jsx(Yt,{fontSize:"16px",fontWeight:700,color:"text.secondary",children:`Edit ${i}`})}),S.jsxs(vh,{children:[S.jsx(ro,{sx:{my:1},severity:"info",children:"Editing a variable will update its value in the formatted view. If you want to update the template instead, go to the template view."}),e?S.jsx(cC,{sx:{minHeight:"250px"},sxChildren:{padding:1},children:S.jsx(Rn.Editor,{customStyleFn:()=>({color:a.palette.text.primary,padding:"2px"}),editorState:e,onChange:u=>{u&&t(u)}})}):null]}),S.jsx(oS,{sx:{padding:a.spacing(0,3,2)},children:S.jsx(Gu,{id:"edit-variable",onClick:s,variant:"outlined",children:"Save"})})]})}):null};var HD={},irt=vn;Object.defineProperty(HD,"__esModule",{value:!0});var qD=HD.default=void 0,ort=irt(yn()),art=S,srt=(0,ort.default)((0,art.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"Tune");qD=HD.default=srt;const lrt=e=>{const{id:t,items:n,label:r,onChange:i,value:o}=e,a=Ty();return S.jsx(jh,{id:t,label:r,sx:{width:"fit-content"},children:S.jsx(at,{sx:{border:s=>`1px solid ${s.palette.divider}`,backgroundColor:s=>s.palette.background.paper,borderRadius:1,padding:.5},children:S.jsx(x$e,{value:n.findIndex(s=>s===o),onChange:(s,l)=>i(n[l]),sx:{minHeight:"40px !important","& .MuiButtonBase-root":{textTransform:"none",zIndex:1,color:_t[a?600:500],fontSize:"14px",fontWeight:500,padding:0,minHeight:"40px !important",width:"125px"},"& .Mui-selected":{color:"white !important"},"& .MuiTabs-indicator":{background:s=>a?s.palette.divider:As[600],height:"100%",borderRadius:"5px"}},children:n.map(s=>S.jsx(tAe,{className:`tab-${s}`,disableRipple:!0,label:s},`tab-${s}`))})})})};function urt({hasTemplate:e}){const[t,n]=ir($S);return t==="Template"&&!e?(n("Formatted"),null):e?S.jsx(lrt,{label:"View",id:"toggle-prompt-mode",value:t,items:["Template","Formatted"],onChange:r=>n(r)}):S.jsx(ro,{sx:{alignSelf:"flex-end"},severity:"info",id:"template-warning",children:"Prompt template not found. Only displaying formatted prompt instead."})}function crt({hasTemplate:e}){return e?S.jsx(yi,{title:"Coming soon!",children:S.jsx("span",{children:S.jsx(Gu,{size:"large",variant:"contained",disabled:!0,children:"Save"})})}):null}function frt(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var GD=frt,drt="__lodash_hash_undefined__";function prt(e){return this.__data__.set(e,drt),this}var hrt=prt;function grt(e){return this.__data__.has(e)}var mrt=grt,vrt=DD,yrt=hrt,brt=mrt;function _x(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new vrt;++t<n;)this.add(e[t])}_x.prototype.add=_x.prototype.push=yrt;_x.prototype.has=brt;var _rt=_x;function xrt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var wrt=xrt;function Srt(e,t){return e.has(t)}var Crt=Srt,Ert=_rt,krt=wrt,Trt=Crt,Rrt=1,Art=2;function $rt(e,t,n,r,i,o){var a=n&Rrt,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),f=o.get(t);if(u&&f)return u==t&&f==e;var d=-1,p=!0,g=n&Art?new Ert:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var v=e[d],y=t[d];if(r)var w=a?r(y,v,d,t,e,o):r(v,y,d,e,t,o);if(w!==void 0){if(w)continue;p=!1;break}if(g){if(!krt(t,function(b,x){if(!Trt(g,x)&&(v===b||i(v,b,n,r,o)))return g.push(x)})){p=!1;break}}else if(!(v===y||i(v,y,n,r,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var jZ=$rt;function Ort(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var Irt=Ort;function Drt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Prt=Drt,B5=Dh,j5=vZ,Lrt=Gy,Mrt=jZ,Frt=Irt,Nrt=Prt,Brt=1,jrt=2,zrt="[object Boolean]",Urt="[object Date]",Krt="[object Error]",Wrt="[object Map]",Vrt="[object Number]",Hrt="[object RegExp]",qrt="[object Set]",Grt="[object String]",Yrt="[object Symbol]",Xrt="[object ArrayBuffer]",Zrt="[object DataView]",z5=B5?B5.prototype:void 0,FT=z5?z5.valueOf:void 0;function Jrt(e,t,n,r,i,o,a){switch(n){case Zrt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Xrt:return!(e.byteLength!=t.byteLength||!o(new j5(e),new j5(t)));case zrt:case Urt:case Vrt:return Lrt(+e,+t);case Krt:return e.name==t.name&&e.message==t.message;case Hrt:case Grt:return e==t+"";case Wrt:var s=Frt;case qrt:var l=r&Brt;if(s||(s=Nrt),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=jrt,a.set(e,t);var f=Mrt(s(e),s(t),r,i,o,a);return a.delete(e),f;case Yrt:if(FT)return FT.call(e)==FT.call(t)}return!1}var Qrt=Jrt;function eit(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var YD=eit,tit=YD,nit=Ca;function rit(e,t,n){var r=t(e);return nit(e)?r:tit(r,n(e))}var zZ=rit;function iit(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}var oit=iit;function ait(){return[]}var UZ=ait,sit=oit,lit=UZ,uit=Object.prototype,cit=uit.propertyIsEnumerable,U5=Object.getOwnPropertySymbols,fit=U5?function(e){return e==null?[]:(e=Object(e),sit(U5(e),function(t){return cit.call(e,t)}))}:lit,XD=fit,dit=_Z,pit=dit(Object.keys,Object),hit=pit,git=MD,mit=hit,vit=Object.prototype,yit=vit.hasOwnProperty;function bit(e){if(!git(e))return mit(e);var t=[];for(var n in Object(e))yit.call(e,n)&&n!="constructor"&&t.push(n);return t}var _it=bit,xit=TZ,wit=_it,Sit=Nh;function Cit(e){return Sit(e)?xit(e):wit(e)}var Xy=Cit,Eit=zZ,kit=XD,Tit=Xy;function Rit(e){return Eit(e,Tit,kit)}var KZ=Rit,K5=KZ,Ait=1,$it=Object.prototype,Oit=$it.hasOwnProperty;function Iit(e,t,n,r,i,o){var a=n&Ait,s=K5(e),l=s.length,u=K5(t),f=u.length;if(l!=f&&!a)return!1;for(var d=l;d--;){var p=s[d];if(!(a?p in t:Oit.call(t,p)))return!1}var g=o.get(e),v=o.get(t);if(g&&v)return g==t&&v==e;var y=!0;o.set(e,t),o.set(t,e);for(var w=a;++d<l;){p=s[d];var b=e[p],x=t[p];if(r)var C=a?r(x,b,p,t,e,o):r(b,x,p,e,t,o);if(!(C===void 0?b===x||i(b,x,n,r,o):C)){y=!1;break}w||(w=p=="constructor")}if(y&&!w){var k=e.constructor,R=t.constructor;k!=R&&"constructor"in e&&"constructor"in t&&!(typeof k=="function"&&k instanceof k&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(e),o.delete(t),y}var Dit=Iit,Pit=Vf,Lit=rs,Mit=Pit(Lit,"DataView"),Fit=Mit,Nit=Vf,Bit=rs,jit=Nit(Bit,"Promise"),zit=jit,Uit=Vf,Kit=rs,Wit=Uit(Kit,"Set"),Vit=Wit,Hit=Vf,qit=rs,Git=Hit(qit,"WeakMap"),Yit=Git,_$=Fit,x$=ID,w$=zit,S$=Vit,C$=Yit,WZ=Ph,Uh=dZ,W5="[object Map]",Xit="[object Object]",V5="[object Promise]",H5="[object Set]",q5="[object WeakMap]",G5="[object DataView]",Zit=Uh(_$),Jit=Uh(x$),Qit=Uh(w$),eot=Uh(S$),tot=Uh(C$),zc=WZ;(_$&&zc(new _$(new ArrayBuffer(1)))!=G5||x$&&zc(new x$)!=W5||w$&&zc(w$.resolve())!=V5||S$&&zc(new S$)!=H5||C$&&zc(new C$)!=q5)&&(zc=function(e){var t=WZ(e),n=t==Xit?e.constructor:void 0,r=n?Uh(n):"";if(r)switch(r){case Zit:return G5;case Jit:return W5;case Qit:return V5;case eot:return H5;case tot:return q5}return t});var fC=zc,NT=aC,not=jZ,rot=Qrt,iot=Dit,Y5=fC,X5=Ca,Z5=uC,oot=jD,aot=1,J5="[object Arguments]",Q5="[object Array]",vb="[object Object]",sot=Object.prototype,e6=sot.hasOwnProperty;function lot(e,t,n,r,i,o){var a=X5(e),s=X5(t),l=a?Q5:Y5(e),u=s?Q5:Y5(t);l=l==J5?vb:l,u=u==J5?vb:u;var f=l==vb,d=u==vb,p=l==u;if(p&&Z5(e)){if(!Z5(t))return!1;a=!0,f=!1}if(p&&!f)return o||(o=new NT),a||oot(e)?not(e,t,n,r,i,o):rot(e,t,l,n,r,i,o);if(!(n&aot)){var g=f&&e6.call(e,"__wrapped__"),v=d&&e6.call(t,"__wrapped__");if(g||v){var y=g?e.value():e,w=v?t.value():t;return o||(o=new NT),i(y,w,n,r,o)}}return p?(o||(o=new NT),iot(e,t,n,r,i,o)):!1}var uot=lot,cot=uot,t6=Wl;function VZ(e,t,n,r,i){return e===t?!0:e==null||t==null||!t6(e)&&!t6(t)?e!==e&&t!==t:cot(e,t,n,r,VZ,i)}var HZ=VZ,fot=aC,dot=HZ,pot=1,hot=2;function got(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],u=e[l],f=s[1];if(a&&s[2]){if(u===void 0&&!(l in e))return!1}else{var d=new fot;if(r)var p=r(u,f,l,e,t,d);if(!(p===void 0?dot(f,u,pot|hot,r,d):p))return!1}}return!0}var mot=got,vot=is;function yot(e){return e===e&&!vot(e)}var qZ=yot,bot=qZ,_ot=Xy;function xot(e){for(var t=_ot(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,bot(i)]}return t}var wot=xot;function Sot(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var GZ=Sot,Cot=mot,Eot=wot,kot=GZ;function Tot(e){var t=Eot(e);return t.length==1&&t[0][2]?kot(t[0][0],t[0][1]):function(n){return n===e||Cot(n,e,t)}}var Rot=Tot,Aot=Ph,$ot=Wl,Oot="[object Symbol]";function Iot(e){return typeof e=="symbol"||$ot(e)&&Aot(e)==Oot}var dC=Iot,Dot=Ca,Pot=dC,Lot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mot=/^\w*$/;function Fot(e,t){if(Dot(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Pot(e)?!0:Mot.test(e)||!Lot.test(e)||t!=null&&e in Object(t)}var ZD=Fot,YZ=DD,Not="Expected a function";function JD(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Not);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(JD.Cache||YZ),n}JD.Cache=YZ;var Bot=JD,jot=Bot,zot=500;function Uot(e){var t=jot(e,function(r){return n.size===zot&&n.clear(),r}),n=t.cache;return t}var Kot=Uot,Wot=Kot,Vot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hot=/\\(\\)?/g,qot=Wot(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Vot,function(n,r,i,o){t.push(i?o.replace(Hot,"$1"):r||n)}),t}),Got=qot,n6=Dh,Yot=GD,Xot=Ca,Zot=dC,Jot=1/0,r6=n6?n6.prototype:void 0,i6=r6?r6.toString:void 0;function XZ(e){if(typeof e=="string")return e;if(Xot(e))return Yot(e,XZ)+"";if(Zot(e))return i6?i6.call(e):"";var t=e+"";return t=="0"&&1/e==-Jot?"-0":t}var Qot=XZ,eat=Qot;function tat(e){return e==null?"":eat(e)}var nat=tat,rat=Ca,iat=ZD,oat=Got,aat=nat;function sat(e,t){return rat(e)?e:iat(e,t)?[e]:oat(aat(e))}var pC=sat,lat=dC,uat=1/0;function cat(e){if(typeof e=="string"||lat(e))return e;var t=e+"";return t=="0"&&1/e==-uat?"-0":t}var Zy=cat,fat=pC,dat=Zy;function pat(e,t){t=fat(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[dat(t[n++])];return n&&n==r?e:void 0}var QD=pat,hat=QD;function gat(e,t,n){var r=e==null?void 0:hat(e,t);return r===void 0?n:r}var mat=gat;function vat(e,t){return e!=null&&t in Object(e)}var yat=vat,bat=pC,_at=lC,xat=Ca,wat=zD,Sat=FD,Cat=Zy;function Eat(e,t,n){t=bat(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=Cat(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Sat(i)&&wat(a,i)&&(xat(e)||_at(e)))}var kat=Eat,Tat=yat,Rat=kat;function Aat(e,t){return e!=null&&Rat(e,t,Tat)}var $at=Aat,Oat=HZ,Iat=mat,Dat=$at,Pat=ZD,Lat=qZ,Mat=GZ,Fat=Zy,Nat=1,Bat=2;function jat(e,t){return Pat(e)&&Lat(t)?Mat(Fat(e),t):function(n){var r=Iat(n,e);return r===void 0&&r===t?Dat(n,e):Oat(t,r,Nat|Bat)}}var zat=jat;function Uat(e){return function(t){return t==null?void 0:t[e]}}var Kat=Uat,Wat=QD;function Vat(e){return function(t){return Wat(t,e)}}var Hat=Vat,qat=Kat,Gat=Hat,Yat=ZD,Xat=Zy;function Zat(e){return Yat(e)?qat(Xat(e)):Gat(e)}var Jat=Zat,Qat=Rot,est=zat,tst=UD,nst=Ca,rst=Jat;function ist(e){return typeof e=="function"?e:e==null?tst:typeof e=="object"?nst(e)?est(e[0],e[1]):Qat(e):rst(e)}var ZZ=ist,ost=gZ,ast=Xy;function sst(e,t){return e&&ost(e,t,ast)}var JZ=sst,lst=Nh;function ust(e,t){return function(n,r){if(n==null)return n;if(!lst(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var cst=ust,fst=JZ,dst=cst,pst=dst(fst),hst=pst,gst=hst,mst=Nh;function vst(e,t){var n=-1,r=mst(e)?Array(e.length):[];return gst(e,function(i,o,a){r[++n]=t(i,o,a)}),r}var yst=vst,bst=GD,_st=ZZ,xst=yst,wst=Ca;function Sst(e,t){var n=wst(e)?bst:xst;return n(e,_st(t))}var Cst=Sst;const Est=_i(Cst),kst=()=>{var i;const[e,t]=ir(AS),n=Ct(ts),r=Est((i=n==null?void 0:n.prompt)==null?void 0:i.inputs,(o,a)=>({label:a,value:a}));return(r==null?void 0:r.length)>0?S.jsx(zh,{items:r,id:"variable-select",value:e||"",label:"Select a variable",onChange:o=>t(o.target.value),sx:{maxWidth:"270px"}}):null};function Tst({hasTemplate:e,isSmallScreen:t,toggleDrawer:n,handleClose:r}){return S.jsxs(Ht,{direction:"row",alignItems:"center",children:[S.jsxs(Ht,{direction:"row",alignItems:"center",gap:1,children:[S.jsx(urt,{hasTemplate:e}),S.jsx(kst,{})]}),S.jsxs(Ht,{sx:{ml:"auto"},direction:"row",alignItems:"center",gap:1,children:[S.jsx(Gu,{size:"large",target:"_blank",href:"https://docs.chainlit.io/concepts/prompt-playground",children:"Help"}),S.jsx(crt,{hasTemplate:e}),t?S.jsx(or,{"aria-label":"open drawer",edge:"end",onClick:n,sx:{mr:"4px"},children:S.jsx(qD,{})}):null,S.jsx(or,{edge:"end",id:"close-playground",onClick:r,children:S.jsx(yh,{sx:{height:"32px",width:"32px",color:_t[500]}})})]})]})}var o6=Array.isArray,a6=Object.keys,Rst=Object.prototype.hasOwnProperty,Ast=typeof Element<"u";function E$(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=o6(e),r=o6(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!E$(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();var d=a6(e);if(o=d.length,o!==a6(t).length)return!1;for(i=o;i--!==0;)if(!Rst.call(t,d[i]))return!1;if(Ast&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=d[i],!(a==="_owner"&&e.$$typeof)&&!E$(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var $st=function(t,n){try{return E$(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Uc=_i($st);var Ost=function(t){return Ist(t)&&!Dst(t)};function Ist(e){return!!e&&typeof e=="object"}function Dst(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Mst(e)}var Pst=typeof Symbol=="function"&&Symbol.for,Lst=Pst?Symbol.for("react.element"):60103;function Mst(e){return e.$$typeof===Lst}function Fst(e){return Array.isArray(e)?[]:{}}function xx(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Gv(Fst(e),e,t):e}function Nst(e,t,n){return e.concat(t).map(function(r){return xx(r,n)})}function Bst(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=xx(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=xx(t[i],n):r[i]=Gv(e[i],t[i],n)}),r}function Gv(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Nst,n.isMergeableObject=n.isMergeableObject||Ost;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):Bst(e,t,n):xx(t,n)}Gv.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Gv(r,i,n)},{})};var k$=Gv,jst=typeof global=="object"&&global&&global.Object===Object&&global;const QZ=jst;var zst=typeof self=="object"&&self&&self.Object===Object&&self,Ust=QZ||zst||Function("return this")();const Xs=Ust;var Kst=Xs.Symbol;const Yu=Kst;var eJ=Object.prototype,Wst=eJ.hasOwnProperty,Vst=eJ.toString,wm=Yu?Yu.toStringTag:void 0;function Hst(e){var t=Wst.call(e,wm),n=e[wm];try{e[wm]=void 0;var r=!0}catch{}var i=Vst.call(e);return r&&(t?e[wm]=n:delete e[wm]),i}var qst=Object.prototype,Gst=qst.toString;function Yst(e){return Gst.call(e)}var Xst="[object Null]",Zst="[object Undefined]",s6=Yu?Yu.toStringTag:void 0;function Hf(e){return e==null?e===void 0?Zst:Xst:s6&&s6 in Object(e)?Hst(e):Yst(e)}function tJ(e,t){return function(n){return e(t(n))}}var Jst=tJ(Object.getPrototypeOf,Object);const eP=Jst;function qf(e){return e!=null&&typeof e=="object"}var Qst="[object Object]",elt=Function.prototype,tlt=Object.prototype,nJ=elt.toString,nlt=tlt.hasOwnProperty,rlt=nJ.call(Object);function l6(e){if(!qf(e)||Hf(e)!=Qst)return!1;var t=eP(e);if(t===null)return!0;var n=nlt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&nJ.call(n)==rlt}function ilt(){this.__data__=[],this.size=0}function rJ(e,t){return e===t||e!==e&&t!==t}function hC(e,t){for(var n=e.length;n--;)if(rJ(e[n][0],t))return n;return-1}var olt=Array.prototype,alt=olt.splice;function slt(e){var t=this.__data__,n=hC(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():alt.call(t,n,1),--this.size,!0}function llt(e){var t=this.__data__,n=hC(t,e);return n<0?void 0:t[n][1]}function ult(e){return hC(this.__data__,e)>-1}function clt(e,t){var n=this.__data__,r=hC(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Vl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Vl.prototype.clear=ilt;Vl.prototype.delete=slt;Vl.prototype.get=llt;Vl.prototype.has=ult;Vl.prototype.set=clt;function flt(){this.__data__=new Vl,this.size=0}function dlt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function plt(e){return this.__data__.get(e)}function hlt(e){return this.__data__.has(e)}function Jy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var glt="[object AsyncFunction]",mlt="[object Function]",vlt="[object GeneratorFunction]",ylt="[object Proxy]";function iJ(e){if(!Jy(e))return!1;var t=Hf(e);return t==mlt||t==vlt||t==glt||t==ylt}var blt=Xs["__core-js_shared__"];const BT=blt;var u6=function(){var e=/[^.]+$/.exec(BT&&BT.keys&&BT.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _lt(e){return!!u6&&u6 in e}var xlt=Function.prototype,wlt=xlt.toString;function Gf(e){if(e!=null){try{return wlt.call(e)}catch{}try{return e+""}catch{}}return""}var Slt=/[\\^$.*+?()[\]{}|]/g,Clt=/^\[object .+?Constructor\]$/,Elt=Function.prototype,klt=Object.prototype,Tlt=Elt.toString,Rlt=klt.hasOwnProperty,Alt=RegExp("^"+Tlt.call(Rlt).replace(Slt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $lt(e){if(!Jy(e)||_lt(e))return!1;var t=iJ(e)?Alt:Clt;return t.test(Gf(e))}function Olt(e,t){return e==null?void 0:e[t]}function Yf(e,t){var n=Olt(e,t);return $lt(n)?n:void 0}var Ilt=Yf(Xs,"Map");const Yv=Ilt;var Dlt=Yf(Object,"create");const Xv=Dlt;function Plt(){this.__data__=Xv?Xv(null):{},this.size=0}function Llt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Mlt="__lodash_hash_undefined__",Flt=Object.prototype,Nlt=Flt.hasOwnProperty;function Blt(e){var t=this.__data__;if(Xv){var n=t[e];return n===Mlt?void 0:n}return Nlt.call(t,e)?t[e]:void 0}var jlt=Object.prototype,zlt=jlt.hasOwnProperty;function Ult(e){var t=this.__data__;return Xv?t[e]!==void 0:zlt.call(t,e)}var Klt="__lodash_hash_undefined__";function Wlt(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Xv&&t===void 0?Klt:t,this}function Cf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Cf.prototype.clear=Plt;Cf.prototype.delete=Llt;Cf.prototype.get=Blt;Cf.prototype.has=Ult;Cf.prototype.set=Wlt;function Vlt(){this.size=0,this.__data__={hash:new Cf,map:new(Yv||Vl),string:new Cf}}function Hlt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function gC(e,t){var n=e.__data__;return Hlt(t)?n[typeof t=="string"?"string":"hash"]:n.map}function qlt(e){var t=gC(this,e).delete(e);return this.size-=t?1:0,t}function Glt(e){return gC(this,e).get(e)}function Ylt(e){return gC(this,e).has(e)}function Xlt(e,t){var n=gC(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function dc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dc.prototype.clear=Vlt;dc.prototype.delete=qlt;dc.prototype.get=Glt;dc.prototype.has=Ylt;dc.prototype.set=Xlt;var Zlt=200;function Jlt(e,t){var n=this.__data__;if(n instanceof Vl){var r=n.__data__;if(!Yv||r.length<Zlt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dc(r)}return n.set(e,t),this.size=n.size,this}function Kh(e){var t=this.__data__=new Vl(e);this.size=t.size}Kh.prototype.clear=flt;Kh.prototype.delete=dlt;Kh.prototype.get=plt;Kh.prototype.has=hlt;Kh.prototype.set=Jlt;function Qlt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var eut=function(){try{var e=Yf(Object,"defineProperty");return e({},"",{}),e}catch{}}();const c6=eut;function oJ(e,t,n){t=="__proto__"&&c6?c6(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var tut=Object.prototype,nut=tut.hasOwnProperty;function aJ(e,t,n){var r=e[t];(!(nut.call(e,t)&&rJ(r,n))||n===void 0&&!(t in e))&&oJ(e,t,n)}function mC(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?oJ(n,s,l):aJ(n,s,l)}return n}function rut(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var iut="[object Arguments]";function f6(e){return qf(e)&&Hf(e)==iut}var sJ=Object.prototype,out=sJ.hasOwnProperty,aut=sJ.propertyIsEnumerable,sut=f6(function(){return arguments}())?f6:function(e){return qf(e)&&out.call(e,"callee")&&!aut.call(e,"callee")};const lut=sut;var uut=Array.isArray;const Qy=uut;function cut(){return!1}var lJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,d6=lJ&&typeof module=="object"&&module&&!module.nodeType&&module,fut=d6&&d6.exports===lJ,p6=fut?Xs.Buffer:void 0,dut=p6?p6.isBuffer:void 0,put=dut||cut;const uJ=put;var hut=9007199254740991,gut=/^(?:0|[1-9]\d*)$/;function mut(e,t){var n=typeof e;return t=t??hut,!!t&&(n=="number"||n!="symbol"&&gut.test(e))&&e>-1&&e%1==0&&e<t}var vut=9007199254740991;function cJ(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=vut}var yut="[object Arguments]",but="[object Array]",_ut="[object Boolean]",xut="[object Date]",wut="[object Error]",Sut="[object Function]",Cut="[object Map]",Eut="[object Number]",kut="[object Object]",Tut="[object RegExp]",Rut="[object Set]",Aut="[object String]",$ut="[object WeakMap]",Out="[object ArrayBuffer]",Iut="[object DataView]",Dut="[object Float32Array]",Put="[object Float64Array]",Lut="[object Int8Array]",Mut="[object Int16Array]",Fut="[object Int32Array]",Nut="[object Uint8Array]",But="[object Uint8ClampedArray]",jut="[object Uint16Array]",zut="[object Uint32Array]",Vn={};Vn[Dut]=Vn[Put]=Vn[Lut]=Vn[Mut]=Vn[Fut]=Vn[Nut]=Vn[But]=Vn[jut]=Vn[zut]=!0;Vn[yut]=Vn[but]=Vn[Out]=Vn[_ut]=Vn[Iut]=Vn[xut]=Vn[wut]=Vn[Sut]=Vn[Cut]=Vn[Eut]=Vn[kut]=Vn[Tut]=Vn[Rut]=Vn[Aut]=Vn[$ut]=!1;function Uut(e){return qf(e)&&cJ(e.length)&&!!Vn[Hf(e)]}function tP(e){return function(t){return e(t)}}var fJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dv=fJ&&typeof module=="object"&&module&&!module.nodeType&&module,Kut=dv&&dv.exports===fJ,jT=Kut&&QZ.process,Wut=function(){try{var e=dv&&dv.require&&dv.require("util").types;return e||jT&&jT.binding&&jT.binding("util")}catch{}}();const ih=Wut;var h6=ih&&ih.isTypedArray,Vut=h6?tP(h6):Uut;const Hut=Vut;var qut=Object.prototype,Gut=qut.hasOwnProperty;function dJ(e,t){var n=Qy(e),r=!n&&lut(e),i=!n&&!r&&uJ(e),o=!n&&!r&&!i&&Hut(e),a=n||r||i||o,s=a?rut(e.length,String):[],l=s.length;for(var u in e)(t||Gut.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||mut(u,l)))&&s.push(u);return s}var Yut=Object.prototype;function nP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Yut;return e===n}var Xut=tJ(Object.keys,Object);const Zut=Xut;var Jut=Object.prototype,Qut=Jut.hasOwnProperty;function ect(e){if(!nP(e))return Zut(e);var t=[];for(var n in Object(e))Qut.call(e,n)&&n!="constructor"&&t.push(n);return t}function pJ(e){return e!=null&&cJ(e.length)&&!iJ(e)}function rP(e){return pJ(e)?dJ(e):ect(e)}function tct(e,t){return e&&mC(t,rP(t),e)}function nct(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var rct=Object.prototype,ict=rct.hasOwnProperty;function oct(e){if(!Jy(e))return nct(e);var t=nP(e),n=[];for(var r in e)r=="constructor"&&(t||!ict.call(e,r))||n.push(r);return n}function iP(e){return pJ(e)?dJ(e,!0):oct(e)}function act(e,t){return e&&mC(t,iP(t),e)}var hJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,g6=hJ&&typeof module=="object"&&module&&!module.nodeType&&module,sct=g6&&g6.exports===hJ,m6=sct?Xs.Buffer:void 0,v6=m6?m6.allocUnsafe:void 0;function lct(e,t){if(t)return e.slice();var n=e.length,r=v6?v6(n):new e.constructor(n);return e.copy(r),r}function gJ(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function uct(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function mJ(){return[]}var cct=Object.prototype,fct=cct.propertyIsEnumerable,y6=Object.getOwnPropertySymbols,dct=y6?function(e){return e==null?[]:(e=Object(e),uct(y6(e),function(t){return fct.call(e,t)}))}:mJ;const oP=dct;function pct(e,t){return mC(e,oP(e),t)}function vJ(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var hct=Object.getOwnPropertySymbols,gct=hct?function(e){for(var t=[];e;)vJ(t,oP(e)),e=eP(e);return t}:mJ;const yJ=gct;function mct(e,t){return mC(e,yJ(e),t)}function bJ(e,t,n){var r=t(e);return Qy(e)?r:vJ(r,n(e))}function vct(e){return bJ(e,rP,oP)}function yct(e){return bJ(e,iP,yJ)}var bct=Yf(Xs,"DataView");const T$=bct;var _ct=Yf(Xs,"Promise");const R$=_ct;var xct=Yf(Xs,"Set");const A$=xct;var wct=Yf(Xs,"WeakMap");const $$=wct;var b6="[object Map]",Sct="[object Object]",_6="[object Promise]",x6="[object Set]",w6="[object WeakMap]",S6="[object DataView]",Cct=Gf(T$),Ect=Gf(Yv),kct=Gf(R$),Tct=Gf(A$),Rct=Gf($$),Kc=Hf;(T$&&Kc(new T$(new ArrayBuffer(1)))!=S6||Yv&&Kc(new Yv)!=b6||R$&&Kc(R$.resolve())!=_6||A$&&Kc(new A$)!=x6||$$&&Kc(new $$)!=w6)&&(Kc=function(e){var t=Hf(e),n=t==Sct?e.constructor:void 0,r=n?Gf(n):"";if(r)switch(r){case Cct:return S6;case Ect:return b6;case kct:return _6;case Tct:return x6;case Rct:return w6}return t});const aP=Kc;var Act=Object.prototype,$ct=Act.hasOwnProperty;function Oct(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&$ct.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ict=Xs.Uint8Array;const C6=Ict;function sP(e){var t=new e.constructor(e.byteLength);return new C6(t).set(new C6(e)),t}function Dct(e,t){var n=t?sP(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Pct=/\w*$/;function Lct(e){var t=new e.constructor(e.source,Pct.exec(e));return t.lastIndex=e.lastIndex,t}var E6=Yu?Yu.prototype:void 0,k6=E6?E6.valueOf:void 0;function Mct(e){return k6?Object(k6.call(e)):{}}function Fct(e,t){var n=t?sP(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Nct="[object Boolean]",Bct="[object Date]",jct="[object Map]",zct="[object Number]",Uct="[object RegExp]",Kct="[object Set]",Wct="[object String]",Vct="[object Symbol]",Hct="[object ArrayBuffer]",qct="[object DataView]",Gct="[object Float32Array]",Yct="[object Float64Array]",Xct="[object Int8Array]",Zct="[object Int16Array]",Jct="[object Int32Array]",Qct="[object Uint8Array]",eft="[object Uint8ClampedArray]",tft="[object Uint16Array]",nft="[object Uint32Array]";function rft(e,t,n){var r=e.constructor;switch(t){case Hct:return sP(e);case Nct:case Bct:return new r(+e);case qct:return Dct(e,n);case Gct:case Yct:case Xct:case Zct:case Jct:case Qct:case eft:case tft:case nft:return Fct(e,n);case jct:return new r;case zct:case Wct:return new r(e);case Uct:return Lct(e);case Kct:return new r;case Vct:return Mct(e)}}var T6=Object.create,ift=function(){function e(){}return function(t){if(!Jy(t))return{};if(T6)return T6(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const oft=ift;function aft(e){return typeof e.constructor=="function"&&!nP(e)?oft(eP(e)):{}}var sft="[object Map]";function lft(e){return qf(e)&&aP(e)==sft}var R6=ih&&ih.isMap,uft=R6?tP(R6):lft;const cft=uft;var fft="[object Set]";function dft(e){return qf(e)&&aP(e)==fft}var A6=ih&&ih.isSet,pft=A6?tP(A6):dft;const hft=pft;var gft=1,mft=2,vft=4,_J="[object Arguments]",yft="[object Array]",bft="[object Boolean]",_ft="[object Date]",xft="[object Error]",xJ="[object Function]",wft="[object GeneratorFunction]",Sft="[object Map]",Cft="[object Number]",wJ="[object Object]",Eft="[object RegExp]",kft="[object Set]",Tft="[object String]",Rft="[object Symbol]",Aft="[object WeakMap]",$ft="[object ArrayBuffer]",Oft="[object DataView]",Ift="[object Float32Array]",Dft="[object Float64Array]",Pft="[object Int8Array]",Lft="[object Int16Array]",Mft="[object Int32Array]",Fft="[object Uint8Array]",Nft="[object Uint8ClampedArray]",Bft="[object Uint16Array]",jft="[object Uint32Array]",Fn={};Fn[_J]=Fn[yft]=Fn[$ft]=Fn[Oft]=Fn[bft]=Fn[_ft]=Fn[Ift]=Fn[Dft]=Fn[Pft]=Fn[Lft]=Fn[Mft]=Fn[Sft]=Fn[Cft]=Fn[wJ]=Fn[Eft]=Fn[kft]=Fn[Tft]=Fn[Rft]=Fn[Fft]=Fn[Nft]=Fn[Bft]=Fn[jft]=!0;Fn[xft]=Fn[xJ]=Fn[Aft]=!1;function e_(e,t,n,r,i,o){var a,s=t&gft,l=t&mft,u=t&vft;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!Jy(e))return e;var f=Qy(e);if(f){if(a=Oct(e),!s)return gJ(e,a)}else{var d=aP(e),p=d==xJ||d==wft;if(uJ(e))return lct(e,s);if(d==wJ||d==_J||p&&!i){if(a=l||p?{}:aft(e),!s)return l?mct(e,act(a,e)):pct(e,tct(a,e))}else{if(!Fn[d])return i?e:{};a=rft(e,d,s)}}o||(o=new Kh);var g=o.get(e);if(g)return g;o.set(e,a),hft(e)?e.forEach(function(w){a.add(e_(w,t,n,w,e,o))}):cft(e)&&e.forEach(function(w,b){a.set(b,e_(w,t,n,b,e,o))});var v=u?l?yct:vct:l?iP:rP,y=f?void 0:v(e);return Qlt(y||e,function(w,b){y&&(b=w,w=e[b]),aJ(a,b,e_(w,t,n,b,e,o))}),a}var zft=4;function $6(e){return e_(e,zft)}function SJ(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Uft="[object Symbol]";function lP(e){return typeof e=="symbol"||qf(e)&&Hf(e)==Uft}var Kft="Expected a function";function uP(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Kft);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(uP.Cache||dc),n}uP.Cache=dc;var Wft=500;function Vft(e){var t=uP(e,function(r){return n.size===Wft&&n.clear(),r}),n=t.cache;return t}var Hft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qft=/\\(\\)?/g,Gft=Vft(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Hft,function(n,r,i,o){t.push(i?o.replace(qft,"$1"):r||n)}),t});const Yft=Gft;var Xft=1/0;function Zft(e){if(typeof e=="string"||lP(e))return e;var t=e+"";return t=="0"&&1/e==-Xft?"-0":t}var Jft=1/0,O6=Yu?Yu.prototype:void 0,I6=O6?O6.toString:void 0;function CJ(e){if(typeof e=="string")return e;if(Qy(e))return SJ(e,CJ)+"";if(lP(e))return I6?I6.call(e):"";var t=e+"";return t=="0"&&1/e==-Jft?"-0":t}function Qft(e){return e==null?"":CJ(e)}function EJ(e){return Qy(e)?SJ(e,Zft):lP(e)?[e]:gJ(Yft(Qft(e)))}var edt=!0;function tdt(e,t){if(!edt){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}function Zr(){return Zr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zr.apply(this,arguments)}function kJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Fa=function(t){return typeof t=="function"},vC=function(t){return t!==null&&typeof t=="object"},ndt=function(t){return String(Math.floor(Number(t)))===t},zT=function(t){return Object.prototype.toString.call(t)==="[object String]"},UT=function(t){return vC(t)&&Fa(t.then)};function Xo(e,t,n,r){r===void 0&&(r=0);for(var i=EJ(t);e&&r<i.length;)e=e[i[r++]];return e===void 0?n:e}function sf(e,t,n){for(var r=$6(e),i=r,o=0,a=EJ(t);o<a.length-1;o++){var s=a[o],l=Xo(e,a.slice(0,o+1));if(l&&(vC(l)||Array.isArray(l)))i=i[s]=$6(l);else{var u=a[o+1];i=i[s]=ndt(u)&&Number(u)>=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function TJ(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],s=e[a];vC(s)?n.get(s)||(n.set(s,!0),r[a]=Array.isArray(s)?[]:{},TJ(s,t,n,r[a])):r[a]=t}return r}var yC=T.createContext(void 0);yC.displayName="FormikContext";yC.Provider;yC.Consumer;function rdt(){var e=T.useContext(yC);return e||tdt(!1),e}function idt(e,t){switch(t.type){case"SET_VALUES":return Zr({},e,{values:t.payload});case"SET_TOUCHED":return Zr({},e,{touched:t.payload});case"SET_ERRORS":return Uc(e.errors,t.payload)?e:Zr({},e,{errors:t.payload});case"SET_STATUS":return Zr({},e,{status:t.payload});case"SET_ISSUBMITTING":return Zr({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Zr({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Zr({},e,{values:sf(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Zr({},e,{touched:sf(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Zr({},e,{errors:sf(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Zr({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Zr({},e,{touched:TJ(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return Zr({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Zr({},e,{isSubmitting:!1});default:return e}}var Lc={},yb={};function cP(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,o=e.validateOnMount,a=o===void 0?!1:o,s=e.isInitialValid,l=e.enableReinitialize,u=l===void 0?!1:l,f=e.onSubmit,d=kJ(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=Zr({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:f},d),g=T.useRef(p.initialValues),v=T.useRef(p.initialErrors||Lc),y=T.useRef(p.initialTouched||yb),w=T.useRef(p.initialStatus),b=T.useRef(!1),x=T.useRef({});T.useEffect(function(){return b.current=!0,function(){b.current=!1}},[]);var C=T.useReducer(idt,{values:p.initialValues,errors:p.initialErrors||Lc,touched:p.initialTouched||yb,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),k=C[0],R=C[1],A=T.useCallback(function(he,Ae){return new Promise(function(Re,Ne){var U=p.validate(he,Ae);U==null?Re(Lc):UT(U)?U.then(function(H){Re(H||Lc)},function(H){Ne(H)}):Re(U)})},[p.validate]),O=T.useCallback(function(he,Ae){var Re=p.validationSchema,Ne=Fa(Re)?Re(Ae):Re,U=Ae&&Ne.validateAt?Ne.validateAt(Ae,he):adt(he,Ne);return new Promise(function(H,fe){U.then(function(){H(Lc)},function(Y){Y.name==="ValidationError"?H(odt(Y)):fe(Y)})})},[p.validationSchema]),z=T.useCallback(function(he,Ae){return new Promise(function(Re){return Re(x.current[he].validate(Ae))})},[]),V=T.useCallback(function(he){var Ae=Object.keys(x.current).filter(function(Ne){return Fa(x.current[Ne].validate)}),Re=Ae.length>0?Ae.map(function(Ne){return z(Ne,Xo(he,Ne))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Re).then(function(Ne){return Ne.reduce(function(U,H,fe){return H==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||H&&(U=sf(U,Ae[fe],H)),U},{})})},[z]),D=T.useCallback(function(he){return Promise.all([V(he),p.validationSchema?O(he):{},p.validate?A(he):{}]).then(function(Ae){var Re=Ae[0],Ne=Ae[1],U=Ae[2],H=k$.all([Re,Ne,U],{arrayMerge:sdt});return H})},[p.validate,p.validationSchema,V,A,O]),W=Go(function(he){return he===void 0&&(he=k.values),R({type:"SET_ISVALIDATING",payload:!0}),D(he).then(function(Ae){return b.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:Ae})),Ae})});T.useEffect(function(){a&&b.current===!0&&Uc(g.current,p.initialValues)&&W(g.current)},[a,W]);var ie=T.useCallback(function(he){var Ae=he&&he.values?he.values:g.current,Re=he&&he.errors?he.errors:v.current?v.current:p.initialErrors||{},Ne=he&&he.touched?he.touched:y.current?y.current:p.initialTouched||{},U=he&&he.status?he.status:w.current?w.current:p.initialStatus;g.current=Ae,v.current=Re,y.current=Ne,w.current=U;var H=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!he&&!!he.isSubmitting,errors:Re,touched:Ne,status:U,values:Ae,isValidating:!!he&&!!he.isValidating,submitCount:he&&he.submitCount&&typeof he.submitCount=="number"?he.submitCount:0}})};if(p.onReset){var fe=p.onReset(k.values,Be);UT(fe)?fe.then(H):H()}else H()},[p.initialErrors,p.initialStatus,p.initialTouched]);T.useEffect(function(){b.current===!0&&!Uc(g.current,p.initialValues)&&(u&&(g.current=p.initialValues,ie()),a&&W(g.current))},[u,p.initialValues,ie,a,W]),T.useEffect(function(){u&&b.current===!0&&!Uc(v.current,p.initialErrors)&&(v.current=p.initialErrors||Lc,R({type:"SET_ERRORS",payload:p.initialErrors||Lc}))},[u,p.initialErrors]),T.useEffect(function(){u&&b.current===!0&&!Uc(y.current,p.initialTouched)&&(y.current=p.initialTouched||yb,R({type:"SET_TOUCHED",payload:p.initialTouched||yb}))},[u,p.initialTouched]),T.useEffect(function(){u&&b.current===!0&&!Uc(w.current,p.initialStatus)&&(w.current=p.initialStatus,R({type:"SET_STATUS",payload:p.initialStatus}))},[u,p.initialStatus,p.initialTouched]);var se=Go(function(he){if(x.current[he]&&Fa(x.current[he].validate)){var Ae=Xo(k.values,he),Re=x.current[he].validate(Ae);return UT(Re)?(R({type:"SET_ISVALIDATING",payload:!0}),Re.then(function(Ne){return Ne}).then(function(Ne){R({type:"SET_FIELD_ERROR",payload:{field:he,value:Ne}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:he,value:Re}}),Promise.resolve(Re))}else if(p.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),O(k.values,he).then(function(Ne){return Ne}).then(function(Ne){R({type:"SET_FIELD_ERROR",payload:{field:he,value:Ne[he]}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),K=T.useCallback(function(he,Ae){var Re=Ae.validate;x.current[he]={validate:Re}},[]),G=T.useCallback(function(he){delete x.current[he]},[]),Q=Go(function(he,Ae){R({type:"SET_TOUCHED",payload:he});var Re=Ae===void 0?i:Ae;return Re?W(k.values):Promise.resolve()}),le=T.useCallback(function(he){R({type:"SET_ERRORS",payload:he})},[]),Z=Go(function(he,Ae){var Re=Fa(he)?he(k.values):he;R({type:"SET_VALUES",payload:Re});var Ne=Ae===void 0?n:Ae;return Ne?W(Re):Promise.resolve()}),ee=T.useCallback(function(he,Ae){R({type:"SET_FIELD_ERROR",payload:{field:he,value:Ae}})},[]),P=Go(function(he,Ae,Re){R({type:"SET_FIELD_VALUE",payload:{field:he,value:Ae}});var Ne=Re===void 0?n:Re;return Ne?W(sf(k.values,he,Ae)):Promise.resolve()}),ge=T.useCallback(function(he,Ae){var Re=Ae,Ne=he,U;if(!zT(he)){he.persist&&he.persist();var H=he.target?he.target:he.currentTarget,fe=H.type,Y=H.name,X=H.id,oe=H.value,xe=H.checked,Ce=H.outerHTML,_e=H.options,nt=H.multiple;Re=Ae||Y||X,Ne=/number|range/.test(fe)?(U=parseFloat(oe),isNaN(U)?"":U):/checkbox/.test(fe)?udt(Xo(k.values,Re),xe,oe):_e&&nt?ldt(_e):oe}Re&&P(Re,Ne)},[P,k.values]),B=Go(function(he){if(zT(he))return function(Ae){return ge(Ae,he)};ge(he)}),L=Go(function(he,Ae,Re){Ae===void 0&&(Ae=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:he,value:Ae}});var Ne=Re===void 0?i:Re;return Ne?W(k.values):Promise.resolve()}),ae=T.useCallback(function(he,Ae){he.persist&&he.persist();var Re=he.target,Ne=Re.name,U=Re.id,H=Re.outerHTML,fe=Ae||Ne||U;L(fe,!0)},[L]),ue=Go(function(he){if(zT(he))return function(Ae){return ae(Ae,he)};ae(he)}),ne=T.useCallback(function(he){Fa(he)?R({type:"SET_FORMIK_STATE",payload:he}):R({type:"SET_FORMIK_STATE",payload:function(){return he}})},[]),we=T.useCallback(function(he){R({type:"SET_STATUS",payload:he})},[]),Te=T.useCallback(function(he){R({type:"SET_ISSUBMITTING",payload:he})},[]),Ee=Go(function(){return R({type:"SUBMIT_ATTEMPT"}),W().then(function(he){var Ae=he instanceof Error,Re=!Ae&&Object.keys(he).length===0;if(Re){var Ne;try{if(Ne=Ie(),Ne===void 0)return}catch(U){throw U}return Promise.resolve(Ne).then(function(U){return b.current&&R({type:"SUBMIT_SUCCESS"}),U}).catch(function(U){if(b.current)throw R({type:"SUBMIT_FAILURE"}),U})}else if(b.current&&(R({type:"SUBMIT_FAILURE"}),Ae))throw he})}),Le=Go(function(he){he&&he.preventDefault&&Fa(he.preventDefault)&&he.preventDefault(),he&&he.stopPropagation&&Fa(he.stopPropagation)&&he.stopPropagation(),Ee().catch(function(Ae){console.warn("Warning: An unhandled error was caught from submitForm()",Ae)})}),Be={resetForm:ie,validateForm:W,validateField:se,setErrors:le,setFieldError:ee,setFieldTouched:L,setFieldValue:P,setStatus:we,setSubmitting:Te,setTouched:Q,setValues:Z,setFormikState:ne,submitForm:Ee},Ie=Go(function(){return f(k.values,Be)}),Pe=Go(function(he){he&&he.preventDefault&&Fa(he.preventDefault)&&he.preventDefault(),he&&he.stopPropagation&&Fa(he.stopPropagation)&&he.stopPropagation(),ie()}),je=T.useCallback(function(he){return{value:Xo(k.values,he),error:Xo(k.errors,he),touched:!!Xo(k.touched,he),initialValue:Xo(g.current,he),initialTouched:!!Xo(y.current,he),initialError:Xo(v.current,he)}},[k.errors,k.touched,k.values]),Fe=T.useCallback(function(he){return{setValue:function(Re,Ne){return P(he,Re,Ne)},setTouched:function(Re,Ne){return L(he,Re,Ne)},setError:function(Re){return ee(he,Re)}}},[P,L,ee]),tt=T.useCallback(function(he){var Ae=vC(he),Re=Ae?he.name:he,Ne=Xo(k.values,Re),U={name:Re,value:Ne,onChange:B,onBlur:ue};if(Ae){var H=he.type,fe=he.value,Y=he.as,X=he.multiple;H==="checkbox"?fe===void 0?U.checked=!!Ne:(U.checked=!!(Array.isArray(Ne)&&~Ne.indexOf(fe)),U.value=fe):H==="radio"?(U.checked=Ne===fe,U.value=fe):Y==="select"&&X&&(U.value=U.value||[],U.multiple=!0)}return U},[ue,B,k.values]),Xe=T.useMemo(function(){return!Uc(g.current,k.values)},[g.current,k.values]),Ye=T.useMemo(function(){return typeof s<"u"?Xe?k.errors&&Object.keys(k.errors).length===0:s!==!1&&Fa(s)?s(p):s:k.errors&&Object.keys(k.errors).length===0},[s,Xe,k.errors,p]),st=Zr({},k,{initialValues:g.current,initialErrors:v.current,initialTouched:y.current,initialStatus:w.current,handleBlur:ue,handleChange:B,handleReset:Pe,handleSubmit:Le,resetForm:ie,setErrors:le,setFormikState:ne,setFieldTouched:L,setFieldValue:P,setFieldError:ee,setStatus:we,setSubmitting:Te,setTouched:Q,setValues:Z,submitForm:Ee,validateForm:W,validateField:se,isValid:Ye,dirty:Xe,unregisterField:G,registerField:K,getFieldProps:tt,getFieldMeta:je,getFieldHelpers:Fe,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return st}function odt(e){var t={};if(e.inner){if(e.inner.length===0)return sf(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Xo(t,a.path)||(t=sf(t,a.path,a.message))}}return t}function adt(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=O$(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function O$(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||l6(i)?O$(i):i!==""?i:void 0}):l6(e[r])?t[r]=O$(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function sdt(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?k$(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=k$(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function ldt(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function udt(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var cdt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?T.useLayoutEffect:T.useEffect;function Go(e){var t=T.useRef(e);return cdt(function(){t.current=e}),T.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var fdt=T.forwardRef(function(e,t){var n=e.action,r=kJ(e,["action"]),i=n??"#",o=rdt(),a=o.handleReset,s=o.handleSubmit;return T.createElement("form",Object.assign({onSubmit:s,ref:t,onReset:a,action:i},r))});fdt.displayName="Form";function ddt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var pdt=ddt,hdt=Bh,gdt=Xy;function mdt(e,t){return e&&hdt(t,gdt(t),e)}var vdt=mdt,ydt=Bh,bdt=Yy;function _dt(e,t){return e&&ydt(t,bdt(t),e)}var xdt=_dt,wdt=Bh,Sdt=XD;function Cdt(e,t){return wdt(e,Sdt(e),t)}var Edt=Cdt,kdt=YD,Tdt=LD,Rdt=XD,Adt=UZ,$dt=Object.getOwnPropertySymbols,Odt=$dt?function(e){for(var t=[];e;)kdt(t,Rdt(e)),e=Tdt(e);return t}:Adt,RJ=Odt,Idt=Bh,Ddt=RJ;function Pdt(e,t){return Idt(e,Ddt(e),t)}var Ldt=Pdt,Mdt=zZ,Fdt=RJ,Ndt=Yy;function Bdt(e){return Mdt(e,Ndt,Fdt)}var AJ=Bdt,jdt=Object.prototype,zdt=jdt.hasOwnProperty;function Udt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&zdt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Kdt=Udt,Wdt=PD;function Vdt(e,t){var n=t?Wdt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Hdt=Vdt,qdt=/\w*$/;function Gdt(e){var t=new e.constructor(e.source,qdt.exec(e));return t.lastIndex=e.lastIndex,t}var Ydt=Gdt,D6=Dh,P6=D6?D6.prototype:void 0,L6=P6?P6.valueOf:void 0;function Xdt(e){return L6?Object(L6.call(e)):{}}var Zdt=Xdt,Jdt=PD,Qdt=Hdt,ept=Ydt,tpt=Zdt,npt=yZ,rpt="[object Boolean]",ipt="[object Date]",opt="[object Map]",apt="[object Number]",spt="[object RegExp]",lpt="[object Set]",upt="[object String]",cpt="[object Symbol]",fpt="[object ArrayBuffer]",dpt="[object DataView]",ppt="[object Float32Array]",hpt="[object Float64Array]",gpt="[object Int8Array]",mpt="[object Int16Array]",vpt="[object Int32Array]",ypt="[object Uint8Array]",bpt="[object Uint8ClampedArray]",_pt="[object Uint16Array]",xpt="[object Uint32Array]";function wpt(e,t,n){var r=e.constructor;switch(t){case fpt:return Jdt(e);case rpt:case ipt:return new r(+e);case dpt:return Qdt(e,n);case ppt:case hpt:case gpt:case mpt:case vpt:case ypt:case bpt:case _pt:case xpt:return npt(e,n);case opt:return new r;case apt:case upt:return new r(e);case spt:return ept(e);case lpt:return new r;case cpt:return tpt(e)}}var Spt=wpt,Cpt=fC,Ept=Wl,kpt="[object Map]";function Tpt(e){return Ept(e)&&Cpt(e)==kpt}var Rpt=Tpt,Apt=Rpt,$pt=ND,M6=BD,F6=M6&&M6.isMap,Opt=F6?$pt(F6):Apt,Ipt=Opt,Dpt=fC,Ppt=Wl,Lpt="[object Set]";function Mpt(e){return Ppt(e)&&Dpt(e)==Lpt}var Fpt=Mpt,Npt=Fpt,Bpt=ND,N6=BD,B6=N6&&N6.isSet,jpt=B6?Bpt(B6):Npt,zpt=jpt,Upt=aC,Kpt=pdt,Wpt=kZ,Vpt=vdt,Hpt=xdt,qpt=mZ,Gpt=bZ,Ypt=Edt,Xpt=Ldt,Zpt=KZ,Jpt=AJ,Qpt=fC,eht=Kdt,tht=Spt,nht=xZ,rht=Ca,iht=uC,oht=Ipt,aht=is,sht=zpt,lht=Xy,uht=Yy,cht=1,fht=2,dht=4,$J="[object Arguments]",pht="[object Array]",hht="[object Boolean]",ght="[object Date]",mht="[object Error]",OJ="[object Function]",vht="[object GeneratorFunction]",yht="[object Map]",bht="[object Number]",IJ="[object Object]",_ht="[object RegExp]",xht="[object Set]",wht="[object String]",Sht="[object Symbol]",Cht="[object WeakMap]",Eht="[object ArrayBuffer]",kht="[object DataView]",Tht="[object Float32Array]",Rht="[object Float64Array]",Aht="[object Int8Array]",$ht="[object Int16Array]",Oht="[object Int32Array]",Iht="[object Uint8Array]",Dht="[object Uint8ClampedArray]",Pht="[object Uint16Array]",Lht="[object Uint32Array]",Nn={};Nn[$J]=Nn[pht]=Nn[Eht]=Nn[kht]=Nn[hht]=Nn[ght]=Nn[Tht]=Nn[Rht]=Nn[Aht]=Nn[$ht]=Nn[Oht]=Nn[yht]=Nn[bht]=Nn[IJ]=Nn[_ht]=Nn[xht]=Nn[wht]=Nn[Sht]=Nn[Iht]=Nn[Dht]=Nn[Pht]=Nn[Lht]=!0;Nn[mht]=Nn[OJ]=Nn[Cht]=!1;function t_(e,t,n,r,i,o){var a,s=t&cht,l=t&fht,u=t&dht;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!aht(e))return e;var f=rht(e);if(f){if(a=eht(e),!s)return Gpt(e,a)}else{var d=Qpt(e),p=d==OJ||d==vht;if(iht(e))return qpt(e,s);if(d==IJ||d==$J||p&&!i){if(a=l||p?{}:nht(e),!s)return l?Xpt(e,Hpt(a,e)):Ypt(e,Vpt(a,e))}else{if(!Nn[d])return i?e:{};a=tht(e,d,s)}}o||(o=new Upt);var g=o.get(e);if(g)return g;o.set(e,a),sht(e)?e.forEach(function(w){a.add(t_(w,t,n,w,e,o))}):oht(e)&&e.forEach(function(w,b){a.set(b,t_(w,t,n,b,e,o))});var v=u?l?Jpt:Zpt:l?uht:lht,y=f?void 0:v(e);return Kpt(y||e,function(w,b){y&&(b=w,w=e[b]),Wpt(a,b,t_(w,t,n,b,e,o))}),a}var DJ=t_,Mht=DJ,Fht=1,Nht=4;function Bht(e){return Mht(e,Fht|Nht)}var jht=Bht;const PJ=_i(jht);function Xf(e){this._maxSize=e,this.clear()}Xf.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Xf.prototype.get=function(e){return this._values[e]};Xf.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var zht=/[^.^\]^[]+|(?=\[\]|\.\.)/g,LJ=/^\d+$/,Uht=/^\d/,Kht=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Wht=/^\s*(['"]?)(.*?)(\1)\s*$/,fP=512,j6=new Xf(fP),z6=new Xf(fP),U6=new Xf(fP),lf={Cache:Xf,split:I$,normalizePath:KT,setter:function(e){var t=KT(e);return z6.get(e)||z6.set(e,function(r,i){for(var o=0,a=t.length,s=r;o<a-1;){var l=t[o];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;s=s[t[o++]]}s[t[o]]=i})},getter:function(e,t){var n=KT(e);return U6.get(e)||U6.set(e,function(i){for(var o=0,a=n.length;o<a;)if(i!=null||!t)i=i[n[o++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(dP(n)||LJ.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){Vht(Array.isArray(e)?e:I$(e),t,n)}};function KT(e){return j6.get(e)||j6.set(e,I$(e).map(function(t){return t.replace(Wht,"$2")}))}function I$(e){return e.match(zht)||[""]}function Vht(e,t,n){var r=e.length,i,o,a,s;for(o=0;o<r;o++)i=e[o],i&&(Ght(i)&&(i='"'+i+'"'),s=dP(i),a=!s&&/^\d+$/.test(i),t.call(n,i,s,a,o,e))}function dP(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Hht(e){return e.match(Uht)&&!e.match(LJ)}function qht(e){return Kht.test(e)}function Ght(e){return!dP(e)&&(Hht(e)||qht(e))}const Yht=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,bC=e=>e.match(Yht)||[],_C=e=>e[0].toUpperCase()+e.slice(1),pP=(e,t)=>bC(e).join(t).toLowerCase(),MJ=e=>bC(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),Xht=e=>_C(MJ(e)),Zht=e=>pP(e,"_"),Jht=e=>pP(e,"-"),Qht=e=>_C(pP(e," ")),egt=e=>bC(e).map(_C).join(" ");var WT={words:bC,upperFirst:_C,camelCase:MJ,pascalCase:Xht,snakeCase:Zht,kebabCase:Jht,sentenceCase:Qht,titleCase:egt},hP={exports:{}};hP.exports=function(e){return FJ(tgt(e),e)};hP.exports.array=FJ;function FJ(e,t){var n=e.length,r=new Array(n),i={},o=n,a=ngt(t),s=rgt(e);for(t.forEach(function(u){if(!s.has(u[0])||!s.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});o--;)i[o]||l(e[o],o,new Set);return r;function l(u,f,d){if(d.has(u)){var p;try{p=", node was:"+JSON.stringify(u)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[f]){i[f]=!0;var g=a.get(u)||new Set;if(g=Array.from(g),f=g.length){d.add(u);do{var v=g[--f];l(v,s.get(v),d)}while(f);d.delete(u)}r[--n]=u}}}function tgt(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function ngt(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function rgt(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var igt=hP.exports;const ogt=_i(igt),agt=Object.prototype.toString,sgt=Error.prototype.toString,lgt=RegExp.prototype.toString,ugt=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",cgt=/^Symbol\((.*)\)(.*)$/;function fgt(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function K6(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return fgt(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return ugt.call(e).replace(cgt,"Symbol($1)");const r=agt.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+sgt.call(e)+"]":r==="RegExp"?lgt.call(e):null}function uf(e,t){let n=K6(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let o=K6(this[r],t);return o!==null?o:i},2)}function NJ(e){return e==null?[]:[].concat(e)}let dgt=/\$\{\s*(\w+)\s*\}/g;class wo extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(dgt,(i,o)=>uf(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],NJ(t).forEach(o=>{wo.isError(o)?(this.errors.push(...o.errors),this.inner=this.inner.concat(o.inner.length?o.inner:o)):this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,wo)}}let bl={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${uf(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${uf(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${uf(n,!0)}\``+i}},Na={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},mu={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},D$={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pgt={isValue:"${path} field must be ${value}"},P$={noUnknown:"${path} field has unspecified keys: ${unknown}"},n_={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:bl,string:Na,number:mu,date:D$,object:P$,array:n_,boolean:pgt});const xC=e=>e&&e.__isYupSchema__;class wx{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:o}=n,a=typeof r=="function"?r:(...s)=>s.every(l=>l===r);return new wx(t,(s,l)=>{var u;let f=a(...s)?i:o;return(u=f==null?void 0:f(l))!=null?u:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!xC(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const bb={context:"$",value:"."};class Zf{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===bb.context,this.isValue=this.key[0]===bb.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?bb.context:this.isValue?bb.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&lf.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Zf.prototype.__isYupRef=!0;const Is=e=>e==null;function Nd(e){function t({value:n,path:r="",options:i,originalValue:o,schema:a},s,l){const{name:u,test:f,params:d,message:p,skipAbsent:g}=e;let{parent:v,context:y,abortEarly:w=a.spec.abortEarly}=i;function b(D){return Zf.isRef(D)?D.getValue(n,v,y):D}function x(D={}){const W=Object.assign({value:n,originalValue:o,label:a.spec.label,path:D.path||r,spec:a.spec},d,D.params);for(const se of Object.keys(W))W[se]=b(W[se]);const ie=new wo(wo.formatError(D.message||p,W),n,W.path,D.type||u);return ie.params=W,ie}const C=w?s:l;let k={path:r,parent:v,type:u,from:i.from,createError:x,resolve:b,options:i,originalValue:o,schema:a};const R=D=>{wo.isError(D)?C(D):D?l(null):C(x())},A=D=>{wo.isError(D)?C(D):s(D)},O=g&&Is(n);if(!i.sync){try{Promise.resolve(O?!0:f.call(k,n,k)).then(R,A)}catch(D){A(D)}return}let z;try{var V;if(z=O?!0:f.call(k,n,k),typeof((V=z)==null?void 0:V.then)=="function")throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(D){A(D);return}R(z)}return t.OPTIONS=e,t}function hgt(e,t,n,r=n){let i,o,a;return t?(lf.forEach(t,(s,l,u)=>{let f=l?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:i,value:n});let d=e.type==="tuple",p=u?parseInt(f,10):0;if(e.innerType||d){if(d&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=d?e.spec.types[p]:e.innerType}if(!u){if(!e.fields||!e.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=n,n=n&&n[f],e=e.fields[f]}o=f,a=l?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:o}):{parent:i,parentPath:t,schema:e}}class Sx extends Set{describe(){const t=[];for(const n of this.values())t.push(Zf.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Sx(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function up(e,t=new Map){if(xC(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=up(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,up(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(up(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=up(i,t)}else throw Error(`Unable to clone ${e}`);return n}class ma{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Sx,this._blacklist=new Sx,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(bl.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=up(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(o=>{t.tests.forEach(a=>{o.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,o)=>o.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",o=r._cast(t,n);if(n.assert!==!1&&!r.isType(o)){if(i&&Is(o))return o;let a=uf(t),s=uf(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
487
|
+
}`;var Bt=SM(function(){return wt(J,xt+"return "+qe).apply(n,ce)});if(Bt.source=qe,hE(Bt))throw Bt;return Bt}function Qie(c){return _n(c).toLowerCase()}function eoe(c){return _n(c).toUpperCase()}function toe(c,h,_){if(c=_n(c),c&&(_||h===n))return yg(c);if(!c||!(h=po(h)))return c;var $=I(c),N=I(h),J=bg($,N),ce=cd($,N)+1;return ou($,J,ce).join("")}function noe(c,h,_){if(c=_n(c),c&&(_||h===n))return c.slice(0,F(c)+1);if(!c||!(h=po(h)))return c;var $=I(c),N=cd($,I(h))+1;return ou($,0,N).join("")}function roe(c,h,_){if(c=_n(c),c&&(_||h===n))return c.replace(kr,"");if(!c||!(h=po(h)))return c;var $=I(c),N=bg($,I(h));return ou($,N).join("")}function ioe(c,h){var _=D,$=W;if(sr(h)){var N="separator"in h?h.separator:N;_="length"in h?Mt(h.length):_,$="omission"in h?po(h.omission):$}c=_n(c);var J=c.length;if($a(c)){var ce=I(c);J=ce.length}if(_>=J)return c;var ve=_-E($);if(ve<1)return $;var ke=ce?ou(ce,0,ve).join(""):c.slice(0,ve);if(N===n)return ke+$;if(ce&&(ve+=ke.length-ve),gE(N)){if(c.slice(ve).search(N)){var Ue,Ke=ke;for(N.global||(N=eu(N.source,_n(co.exec(N))+"g")),N.lastIndex=0;Ue=N.exec(Ke);)var qe=Ue.index;ke=ke.slice(0,qe===n?ve:qe)}}else if(c.indexOf(po(N),ve)!=ve){var ut=ke.lastIndexOf(N);ut>-1&&(ke=ke.slice(0,ut))}return ke+$}function ooe(c){return c=_n(c),c&&ot.test(c)?c.replace(dt,j):c}var aoe=yd(function(c,h,_){return c+(_?" ":"")+h.toUpperCase()}),yE=CL("toUpperCase");function wM(c,h,_){return c=_n(c),h=_?n:h,h===n?_0(c)?Se(c):gg(c):c.match(h)||[]}var SM=Kt(function(c,h){try{return Lt(c,n,h)}catch(_){return hE(_)?_:new it(_)}}),soe=ol(function(c,h){return Ci(h,function(_){_=fs(_),rl(c,_,dE(c[_],c))}),c});function loe(c){var h=c==null?0:c.length,_=Tt();return c=h?Wt(c,function($){if(typeof $[1]!="function")throw new zo(a);return[_($[0]),$[1]]}):[],Kt(function($){for(var N=-1;++N<h;){var J=c[N];if(Lt(J[0],this,$))return Lt(J[1],this,$)}})}function uoe(c){return Pee(Ko(c,d))}function bE(c){return function(){return c}}function coe(c,h){return c==null||c!==c?h:c}var foe=kL(),doe=kL(!0);function zi(c){return c}function _E(c){return nL(typeof c=="function"?c:Ko(c,d))}function poe(c){return iL(Ko(c,d))}function hoe(c,h){return oL(c,Ko(h,d))}var goe=Kt(function(c,h){return function(_){return Ag(_,c,h)}}),moe=Kt(function(c,h){return function(_){return Ag(c,_,h)}});function xE(c,h,_){var $=jr(h),N=B0(h,$);_==null&&!(sr(h)&&(N.length||!$.length))&&(_=h,h=c,c=this,N=B0(h,jr(h)));var J=!(sr(_)&&"chain"in _)||!!_.chain,ce=sl(c);return Ci(N,function(ve){var ke=h[ve];c[ve]=ke,ce&&(c.prototype[ve]=function(){var Ue=this.__chain__;if(J||Ue){var Ke=c(this.__wrapped__),qe=Ke.__actions__=Ni(this.__actions__);return qe.push({func:ke,args:arguments,thisArg:c}),Ke.__chain__=Ue,Ke}return ke.apply(c,Ln([this.value()],arguments))})}),c}function voe(){return Dr._===this&&(Dr._=KQ),this}function wE(){}function yoe(c){return c=Mt(c),Kt(function(h){return aL(h,c)})}var boe=QC(Wt),_oe=QC(fo),xoe=QC(hg);function CM(c){return aE(c)?Fi(fs(c)):Zee(c)}function woe(c){return function(h){return c==null?n:Ec(c,h)}}var Soe=RL(),Coe=RL(!0);function SE(){return[]}function CE(){return!1}function Eoe(){return{}}function koe(){return""}function Toe(){return!0}function Roe(c,h){if(c=Mt(c),c<1||c>Z)return[];var _=ge,$=si(c,ge);h=Tt(h),c-=ge;for(var N=_c($,h);++_<c;)h(_);return N}function Aoe(c){return It(c)?Wt(c,fs):ho(c)?[c]:Ni(WL(_n(c)))}function $oe(c){var h=++zQ;return _n(c)+h}var Ooe=V0(function(c,h){return c+h},0),Ioe=eE("ceil"),Doe=V0(function(c,h){return c/h},1),Poe=eE("floor");function Loe(c){return c&&c.length?N0(c,zi,BC):n}function Moe(c,h){return c&&c.length?N0(c,Tt(h,2),BC):n}function Foe(c){return sd(c,zi)}function Noe(c,h){return sd(c,Tt(h,2))}function Boe(c){return c&&c.length?N0(c,zi,KC):n}function joe(c,h){return c&&c.length?N0(c,Tt(h,2),KC):n}var zoe=V0(function(c,h){return c*h},1),Uoe=eE("round"),Koe=V0(function(c,h){return c-h},0);function Woe(c){return c&&c.length?ud(c,zi):0}function Voe(c,h){return c&&c.length?ud(c,Tt(h,2)):0}return q.after=pre,q.ary=tM,q.assign=eie,q.assignIn=gM,q.assignInWith=i1,q.assignWith=tie,q.at=nie,q.before=nM,q.bind=dE,q.bindAll=soe,q.bindKey=rM,q.castArray=Ere,q.chain=JL,q.chunk=Pte,q.compact=Lte,q.concat=Mte,q.cond=loe,q.conforms=uoe,q.constant=bE,q.countBy=Wne,q.create=rie,q.curry=iM,q.curryRight=oM,q.debounce=aM,q.defaults=iie,q.defaultsDeep=oie,q.defer=hre,q.delay=gre,q.difference=Fte,q.differenceBy=Nte,q.differenceWith=Bte,q.drop=jte,q.dropRight=zte,q.dropRightWhile=Ute,q.dropWhile=Kte,q.fill=Wte,q.filter=Hne,q.flatMap=Yne,q.flatMapDeep=Xne,q.flatMapDepth=Zne,q.flatten=GL,q.flattenDeep=Vte,q.flattenDepth=Hte,q.flip=mre,q.flow=foe,q.flowRight=doe,q.fromPairs=qte,q.functions=die,q.functionsIn=pie,q.groupBy=Jne,q.initial=Yte,q.intersection=Xte,q.intersectionBy=Zte,q.intersectionWith=Jte,q.invert=gie,q.invertBy=mie,q.invokeMap=ere,q.iteratee=_E,q.keyBy=tre,q.keys=jr,q.keysIn=ji,q.map=J0,q.mapKeys=yie,q.mapValues=bie,q.matches=poe,q.matchesProperty=hoe,q.memoize=e1,q.merge=_ie,q.mergeWith=mM,q.method=goe,q.methodOf=moe,q.mixin=xE,q.negate=t1,q.nthArg=yoe,q.omit=xie,q.omitBy=wie,q.once=vre,q.orderBy=nre,q.over=boe,q.overArgs=yre,q.overEvery=_oe,q.overSome=xoe,q.partial=pE,q.partialRight=sM,q.partition=rre,q.pick=Sie,q.pickBy=vM,q.property=CM,q.propertyOf=woe,q.pull=nne,q.pullAll=XL,q.pullAllBy=rne,q.pullAllWith=ine,q.pullAt=one,q.range=Soe,q.rangeRight=Coe,q.rearg=bre,q.reject=are,q.remove=ane,q.rest=_re,q.reverse=cE,q.sampleSize=lre,q.set=Eie,q.setWith=kie,q.shuffle=ure,q.slice=sne,q.sortBy=dre,q.sortedUniq=hne,q.sortedUniqBy=gne,q.split=Yie,q.spread=xre,q.tail=mne,q.take=vne,q.takeRight=yne,q.takeRightWhile=bne,q.takeWhile=_ne,q.tap=Lne,q.throttle=wre,q.thru=Z0,q.toArray=dM,q.toPairs=yM,q.toPairsIn=bM,q.toPath=Aoe,q.toPlainObject=hM,q.transform=Tie,q.unary=Sre,q.union=xne,q.unionBy=wne,q.unionWith=Sne,q.uniq=Cne,q.uniqBy=Ene,q.uniqWith=kne,q.unset=Rie,q.unzip=fE,q.unzipWith=ZL,q.update=Aie,q.updateWith=$ie,q.values=xd,q.valuesIn=Oie,q.without=Tne,q.words=wM,q.wrap=Cre,q.xor=Rne,q.xorBy=Ane,q.xorWith=$ne,q.zip=One,q.zipObject=Ine,q.zipObjectDeep=Dne,q.zipWith=Pne,q.entries=yM,q.entriesIn=bM,q.extend=gM,q.extendWith=i1,xE(q,q),q.add=Ooe,q.attempt=SM,q.camelCase=Lie,q.capitalize=_M,q.ceil=Ioe,q.clamp=Iie,q.clone=kre,q.cloneDeep=Rre,q.cloneDeepWith=Are,q.cloneWith=Tre,q.conformsTo=$re,q.deburr=xM,q.defaultTo=coe,q.divide=Doe,q.endsWith=Mie,q.eq=Ia,q.escape=Fie,q.escapeRegExp=Nie,q.every=Vne,q.find=qne,q.findIndex=HL,q.findKey=aie,q.findLast=Gne,q.findLastIndex=qL,q.findLastKey=sie,q.floor=Poe,q.forEach=QL,q.forEachRight=eM,q.forIn=lie,q.forInRight=uie,q.forOwn=cie,q.forOwnRight=fie,q.get=mE,q.gt=Ore,q.gte=Ire,q.has=hie,q.hasIn=vE,q.head=YL,q.identity=zi,q.includes=Qne,q.indexOf=Gte,q.inRange=Die,q.invoke=vie,q.isArguments=Rc,q.isArray=It,q.isArrayBuffer=Dre,q.isArrayLike=Bi,q.isArrayLikeObject=wr,q.isBoolean=Pre,q.isBuffer=au,q.isDate=Lre,q.isElement=Mre,q.isEmpty=Fre,q.isEqual=Nre,q.isEqualWith=Bre,q.isError=hE,q.isFinite=jre,q.isFunction=sl,q.isInteger=lM,q.isLength=n1,q.isMap=uM,q.isMatch=zre,q.isMatchWith=Ure,q.isNaN=Kre,q.isNative=Wre,q.isNil=Hre,q.isNull=Vre,q.isNumber=cM,q.isObject=sr,q.isObjectLike=hr,q.isPlainObject=Lg,q.isRegExp=gE,q.isSafeInteger=qre,q.isSet=fM,q.isString=r1,q.isSymbol=ho,q.isTypedArray=_d,q.isUndefined=Gre,q.isWeakMap=Yre,q.isWeakSet=Xre,q.join=Qte,q.kebabCase=Bie,q.last=Vo,q.lastIndexOf=ene,q.lowerCase=jie,q.lowerFirst=zie,q.lt=Zre,q.lte=Jre,q.max=Loe,q.maxBy=Moe,q.mean=Foe,q.meanBy=Noe,q.min=Boe,q.minBy=joe,q.stubArray=SE,q.stubFalse=CE,q.stubObject=Eoe,q.stubString=koe,q.stubTrue=Toe,q.multiply=zoe,q.nth=tne,q.noConflict=voe,q.noop=wE,q.now=Q0,q.pad=Uie,q.padEnd=Kie,q.padStart=Wie,q.parseInt=Vie,q.random=Pie,q.reduce=ire,q.reduceRight=ore,q.repeat=Hie,q.replace=qie,q.result=Cie,q.round=Uoe,q.runInContext=te,q.sample=sre,q.size=cre,q.snakeCase=Gie,q.some=fre,q.sortedIndex=lne,q.sortedIndexBy=une,q.sortedIndexOf=cne,q.sortedLastIndex=fne,q.sortedLastIndexBy=dne,q.sortedLastIndexOf=pne,q.startCase=Xie,q.startsWith=Zie,q.subtract=Koe,q.sum=Woe,q.sumBy=Voe,q.template=Jie,q.times=Roe,q.toFinite=ll,q.toInteger=Mt,q.toLength=pM,q.toLower=Qie,q.toNumber=Ho,q.toSafeInteger=Qre,q.toString=_n,q.toUpper=eoe,q.trim=toe,q.trimEnd=noe,q.trimStart=roe,q.truncate=ioe,q.unescape=ooe,q.uniqueId=$oe,q.upperCase=aoe,q.upperFirst=yE,q.each=QL,q.eachRight=eM,q.first=YL,xE(q,function(){var c={};return us(q,function(h,_){wn.call(q.prototype,_)||(c[_]=h)}),c}(),{chain:!1}),q.VERSION=r,Ci(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){q[c].placeholder=q}),Ci(["drop","take"],function(c,h){Zt.prototype[c]=function(_){_=_===n?1:Pr(Mt(_),0);var $=this.__filtered__&&!h?new Zt(this):this.clone();return $.__filtered__?$.__takeCount__=si(_,$.__takeCount__):$.__views__.push({size:si(_,ge),type:c+($.__dir__<0?"Right":"")}),$},Zt.prototype[c+"Right"]=function(_){return this.reverse()[c](_).reverse()}}),Ci(["filter","map","takeWhile"],function(c,h){var _=h+1,$=_==K||_==Q;Zt.prototype[c]=function(N){var J=this.clone();return J.__iteratees__.push({iteratee:Tt(N,3),type:_}),J.__filtered__=J.__filtered__||$,J}}),Ci(["head","last"],function(c,h){var _="take"+(h?"Right":"");Zt.prototype[c]=function(){return this[_](1).value()[0]}}),Ci(["initial","tail"],function(c,h){var _="drop"+(h?"":"Right");Zt.prototype[c]=function(){return this.__filtered__?new Zt(this):this[_](1)}}),Zt.prototype.compact=function(){return this.filter(zi)},Zt.prototype.find=function(c){return this.filter(c).head()},Zt.prototype.findLast=function(c){return this.reverse().find(c)},Zt.prototype.invokeMap=Kt(function(c,h){return typeof c=="function"?new Zt(this):this.map(function(_){return Ag(_,c,h)})}),Zt.prototype.reject=function(c){return this.filter(t1(Tt(c)))},Zt.prototype.slice=function(c,h){c=Mt(c);var _=this;return _.__filtered__&&(c>0||h<0)?new Zt(_):(c<0?_=_.takeRight(-c):c&&(_=_.drop(c)),h!==n&&(h=Mt(h),_=h<0?_.dropRight(-h):_.take(h-c)),_)},Zt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Zt.prototype.toArray=function(){return this.take(ge)},us(Zt.prototype,function(c,h){var _=/^(?:filter|find|map|reject)|While$/.test(h),$=/^(?:head|last)$/.test(h),N=q[$?"take"+(h=="last"?"Right":""):h],J=$||/^find/.test(h);N&&(q.prototype[h]=function(){var ce=this.__wrapped__,ve=$?[1]:arguments,ke=ce instanceof Zt,Ue=ve[0],Ke=ke||It(ce),qe=function(qt){var en=N.apply(q,Ln([qt],ve));return $&&ut?en[0]:en};Ke&&_&&typeof Ue=="function"&&Ue.length!=1&&(ke=Ke=!1);var ut=this.__chain__,xt=!!this.__actions__.length,Rt=J&&!ut,Bt=ke&&!xt;if(!J&&Ke){ce=Bt?ce:new Zt(this);var At=c.apply(ce,ve);return At.__actions__.push({func:Z0,args:[qe],thisArg:n}),new Uo(At,ut)}return Rt&&Bt?c.apply(this,ve):(At=this.thru(qe),Rt?$?At.value()[0]:At.value():At)})}),Ci(["pop","push","shift","sort","splice","unshift"],function(c){var h=S0[c],_=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",$=/^(?:pop|shift)$/.test(c);q.prototype[c]=function(){var N=arguments;if($&&!this.__chain__){var J=this.value();return h.apply(It(J)?J:[],N)}return this[_](function(ce){return h.apply(It(ce)?ce:[],N)})}}),us(Zt.prototype,function(c,h){var _=q[h];if(_){var $=_.name+"";wn.call(gd,$)||(gd[$]=[]),gd[$].push({name:h,func:_})}}),gd[W0(n,b).name]=[{name:"wrapper",func:n}],Zt.prototype.clone=oee,Zt.prototype.reverse=aee,Zt.prototype.value=see,q.prototype.at=Mne,q.prototype.chain=Fne,q.prototype.commit=Nne,q.prototype.next=Bne,q.prototype.plant=zne,q.prototype.reverse=Une,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=Kne,q.prototype.first=q.prototype.head,wg&&(q.prototype[wg]=jne),q},De=Oe();Qs?((Qs.exports=De)._=De,mc._=De):Dr._=De}).call(ni)})(yx,yx.exports);var NZ=yx.exports;function qnt(){const e=CI(!0),t={};for(let n=0;n<e.length;n++)t[n.toString()]={background:e[n],borderRadius:"2px",cursor:"pointer"};return t}function Gnt(e,t){const n=Hnt(t),r=[];let i;for(;(i=n.exec(e))!==null;)i.index>-1&&r.push(i);return r}function Ynt(e,t,n){const i=MZ(t,n).exec(e),o=i==null?void 0:i[0];if(o){const{ok:a}=VD(t,o,n);return{match:o,ok:a}}else return{match:"",ok:!1}}function Xnt(e,t,n){let r=e.getCurrentContent(),i=e;return r.getBlockMap().forEach(o=>{if(!o)return;const a=o.getKey(),s=o.getText(),l=Gnt(s,n);let u=0;const f=l.map(p=>{const g=p[0];let v;for(const C of t){const{match:k,ok:R}=Ynt(g,C.name,n);if(R){v={variable:C,match:k};break}}const y=p.index+u,w=y+g.length,b=new Rn.SelectionState({anchorKey:a,anchorOffset:y,focusKey:a,focusOffset:w}),x=Vnt(g,n);return u+=x.length-g.length,r=Rn.Modifier.replaceText(r,b,x),i=Rn.EditorState.push(e,r,"apply-entity"),p[0]=x,p.index=y,{ssm:p,variableFound:v}});let d=0;f.forEach(({ssm:p,variableFound:g})=>{if(!g)return;const{variable:v}=g,y=p[0],w=i.getSelection(),{localEndIndex:b,localStartIndex:x}=VD(v.name,y,n),C=p.index+x+d,k=p.index+b+d,R=new Rn.SelectionState({anchorKey:a,anchorOffset:C,focusKey:a,focusOffset:k}),A=v.content||"";d+=A.length-(b-x),r=i.getCurrentContent(),r=r.createEntity("TOKEN","SEGMENTED",v);const O=r.getLastCreatedEntityKey();r=Rn.Modifier.replaceText(r,R,A,Sf.of(v.styleIndex.toString()),O),i=Rn.EditorState.push(i,r,"apply-entity"),i=Rn.EditorState.forceSelection(i,w)})}),i}function Znt(e){const t=e.getSelection(),n=t.getStartKey(),r=e.getCurrentContent(),i=r.getBlockForKey(n);if(!i)return;const o=i.getEntityAt(t.getStartOffset());if(o){const a=r.getEntity(o);return{type:a.getType(),mutability:a.getMutability(),data:a.getData()}}}function bx({template:e,formatted:t,prompt:n,readOnly:r,onChange:i,showTitle:o=!1,sxEditorChildren:a}){const s=T.useRef(null),l=gn(AS),u=gn($S),[f,d]=T.useState(),[p,g]=T.useState(),v=qnt();if(aH()||!NZ.isEqual(n.inputs,p)){if(typeof e=="string"){const x=n.inputs||{},C=Object.keys(x),k=[];for(let z=0;z<C.length;z++){const V=C[z],D=x[V];k.push({name:V,styleIndex:z,content:D})}const R=k.sort((z,V)=>V.name.length-z.name.length),A=Rn.EditorState.createWithContent(Rn.ContentState.createFromText(e)),O=Xnt(A,R,n.template_format);d(O)}else if(typeof t=="string"){const x=Rn.EditorState.createWithContent(Rn.ContentState.createFromText(t));d(x)}g(n.inputs)}const w=x=>{const C=x.getSelection().getHasFocus(),k=Znt(x);if(k&&C&&s.current&&(l(k.data.name),s.current.blur()),!r)i&&i(x);else if(f){const R=f.getCurrentContent(),A=x.getCurrentContent();R!==A&&(gi.error("Formatted prompt is read only. Edit the template/variables instead."),u("Template")),x=Rn.EditorState.push(x,R,"insert-characters")}d(x)};if(!f)return null;const b=r?"Formatted prompt [Read Only]":"Formatted prompt";return S.jsx(cC,{className:"formatted-editor",title:o?b:void 0,clipboardValue:f==null?void 0:f.getCurrentContent().getPlainText(),sxChildren:vx(a||{},r?{caretColor:"transparent",backgroundColor:"transparent",borderColor:"transparent !important"}:{}),children:S.jsx(Rn.Editor,{ref:s,customStyleMap:v,editorState:f,onChange:w})})}function Jnt(e,t=200){return e.length>t?e.slice(0,t-1)+"...":e}function Qnt({children:e,decoratedText:t}){const n=gn(AS),r=Ct(ts),i=CI(!0),[o,a]=T.useState(),[s,l]=T.useState({}),u=r==null?void 0:r.prompt;if(!u)return null;T.useEffect(()=>{if(u.inputs&&t){const p=Object.keys(u.inputs).findIndex(g=>FZ(g,u.template_format)===t);if(p>-1){a(p);const g=p%(i.length-1);l({backgroundColor:i[g],borderRadius:"2px",cursor:"pointer"})}}},[t,u]);const[f,d]=o!==void 0?Object.entries(u.inputs||{})[o]:[];return S.jsx(yi,{title:d?Jnt(d):void 0,children:S.jsx("span",{className:f?`input-${f}`:void 0,style:s,onMouseDown:()=>n(f),children:e})})}const ert=(e,t,n,r)=>{const i=n.getText();let o;for(;(o=e.exec(i))!==null;){const{ok:a,localEndIndex:s,localStartIndex:l}=VD(o[1],o[0],t);if(!a)continue;const u=o.index+l,f=o.index+s;r(u,f)}};function BZ({prompt:e,template:t,onChange:n,showTitle:r=!0,sxEditorChildren:i}){const[o,a]=T.useState();if(aH()){const l=Rn.ContentState.createFromText(t),u={strategy:(d,p)=>{ert(Wnt(e.inputs,e.template_format),e.template_format,d,p)},component:Qnt},f=new Rn.CompositeDecorator([u]);a(Rn.EditorState.createWithContent(l,f))}return o?S.jsx(cC,{className:"template-editor",title:r?"Prompt Template":void 0,clipboardValue:o==null?void 0:o.getCurrentContent().getPlainText(),sxChildren:i,children:S.jsx(Rn.Editor,{editorState:o,onChange:l=>{a(l),n&&n(l)}})}):null}function trt({hasTemplate:e,prompt:t,restoredTime:n}){const r=Ct($S),i=gn(ts);if(t.messages)return null;const o=u=>{const f=u.getCurrentContent().getPlainText();i(d=>({...d,prompt:{...d.prompt,template:f}}))},a=u=>{const f=u.getCurrentContent().getPlainText();i(d=>({...d,prompt:{...d.prompt,formatted:f}}))},s=()=>S.jsx(BZ,{showTitle:!0,template:t.template||"",prompt:t,onChange:o}),l=()=>e?S.jsx(bx,{showTitle:!0,template:t.template,prompt:t,readOnly:!0}):typeof t.formatted=="string"?S.jsx(bx,{showTitle:!0,formatted:t.formatted,prompt:t,readOnly:!1,onChange:a}):S.jsx(ro,{severity:"error",children:"Neither template or formatted prompt provided."});return S.jsxs(Ht,{flex:1,width:"100%",children:[r==="Template"?s():null,r==="Formatted"?l():null,S.jsx(LZ,{completion:t.completion})]},n)}function nrt({message:e,prompt:t,mode:n,index:r,onChange:i}){var u;const o=Xn(),a={prompt:t,sxEditorChildren:{padding:o.spacing(2),backgroundColor:"","&:hover":{background:o.palette.background.paper}}},s=()=>S.jsx(BZ,{...a,showTitle:!1,template:e.template,onChange:f=>i(r,f)}),l=()=>typeof e.template=="string"?S.jsx(bx,{...a,template:e.template,readOnly:!0}):typeof e.formatted=="string"?S.jsx(bx,{...a,onChange:f=>i(r,f),formatted:e.formatted,readOnly:!1,showTitle:!1}):S.jsx(ro,{severity:"error",children:"Neither template or formatted prompt provided."});return S.jsx(PZ,{canSelectRole:!0,index:r,message:e,role:(u=e.role)==null?void 0:u.toUpperCase(),name:e.name,children:S.jsxs(S.Fragment,{children:[n==="Template"?s():null,n==="Formatted"?l():null]})})}const rrt=T.forwardRef(({hasTemplate:e,prompt:t,restoredTime:n},r)=>{const i=gn(ts),o=Ct($S),a=t.messages;if(!a)return null;const s=(u,f)=>{const d=f.getCurrentContent().getPlainText(),p=e?"template":"formatted";i(g=>{var v,y;return{...g,prompt:{...g.prompt,messages:(y=(v=g.prompt)==null?void 0:v.messages)==null?void 0:y.map((w,b)=>b===u?{...w,[p]:d}:w)}}})},l=o==="Formatted"?e?"Formatted messages [Read Only]":"Formatted messages":"Prompt messages";return S.jsxs(Ht,{sx:{width:"100%"},children:[S.jsx(Yt,{fontSize:"14px",fontWeight:700,color:dw[400],children:l}),S.jsxs(at,{ref:r,sx:{flex:1,height:"auto",overflow:"scroll",marginTop:1,gap:1},children:[a.length>0?S.jsx(Ht,{children:a.map((u,f)=>S.jsx(T.Fragment,{children:S.jsx(nrt,{message:u,prompt:t,mode:o,index:f,onChange:s})},`prompt-message-${f}`))}):null,S.jsx(LZ,{completion:t.completion,chatMode:!0})]},n)]})});function Gu({children:e,...t}){const n=Xn();return S.jsx("span",{style:{color:n.palette.text.primary},children:S.jsx(If,{color:n.palette.mode==="dark"?"inherit":"primary",...t,children:e})})}const irt=()=>{const[e,t]=T.useState(),[n,r]=ir(ts),[i,o]=ir(AS),a=Xn();T.useEffect(()=>{var u;i&&((u=n.prompt)!=null&&u.inputs)&&t(Rn.EditorState.createWithContent(Rn.ContentState.createFromText(n.prompt.inputs[i])))},[i]);const s=()=>{i&&(r(u=>{var f;return u!=null&&u.prompt?{...u,prompt:{...u.prompt,inputs:{...(f=u==null?void 0:u.prompt)==null?void 0:f.inputs,[i]:(e==null?void 0:e.getCurrentContent().getPlainText())||""}}}:u}),o(void 0))},l=()=>{o(void 0)};return i?S.jsx(mh,{id:"variable-modal",open:!!i,onClose:l,fullWidth:!0,maxWidth:"md",sx:{border:u=>u.palette.mode==="dark"?`1px solid ${dw[800]}`:null,borderRadius:1},children:S.jsxs(at,{bgcolor:"background.paper",children:[S.jsx(by,{children:S.jsx(Yt,{fontSize:"16px",fontWeight:700,color:"text.secondary",children:`Edit ${i}`})}),S.jsxs(vh,{children:[S.jsx(ro,{sx:{my:1},severity:"info",children:"Editing a variable will update its value in the formatted view. If you want to update the template instead, go to the template view."}),e?S.jsx(cC,{sx:{minHeight:"250px"},sxChildren:{padding:1},children:S.jsx(Rn.Editor,{customStyleFn:()=>({color:a.palette.text.primary,padding:"2px"}),editorState:e,onChange:u=>{u&&t(u)}})}):null]}),S.jsx(oS,{sx:{padding:a.spacing(0,3,2)},children:S.jsx(Gu,{id:"edit-variable",onClick:s,variant:"outlined",children:"Save"})})]})}):null};var HD={},ort=vn;Object.defineProperty(HD,"__esModule",{value:!0});var qD=HD.default=void 0,art=ort(yn()),srt=S,lrt=(0,art.default)((0,srt.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"Tune");qD=HD.default=lrt;const urt=e=>{const{id:t,items:n,label:r,onChange:i,value:o}=e,a=Ty();return S.jsx(jh,{id:t,label:r,sx:{width:"fit-content"},children:S.jsx(at,{sx:{border:s=>`1px solid ${s.palette.divider}`,backgroundColor:s=>s.palette.background.paper,borderRadius:1,padding:.5},children:S.jsx(x$e,{value:n.findIndex(s=>s===o),onChange:(s,l)=>i(n[l]),sx:{minHeight:"40px !important","& .MuiButtonBase-root":{textTransform:"none",zIndex:1,color:_t[a?600:500],fontSize:"14px",fontWeight:500,padding:0,minHeight:"40px !important",width:"125px"},"& .Mui-selected":{color:"white !important"},"& .MuiTabs-indicator":{background:s=>a?s.palette.divider:As[600],height:"100%",borderRadius:"5px"}},children:n.map(s=>S.jsx(tAe,{className:`tab-${s}`,disableRipple:!0,label:s},`tab-${s}`))})})})};function crt({hasTemplate:e}){const[t,n]=ir($S);return t==="Template"&&!e?(n("Formatted"),null):e?S.jsx(urt,{label:"View",id:"toggle-prompt-mode",value:t,items:["Template","Formatted"],onChange:r=>n(r)}):S.jsx(ro,{sx:{alignSelf:"flex-end"},severity:"info",id:"template-warning",children:"Prompt template not found. Only displaying formatted prompt instead."})}function frt({hasTemplate:e}){return e?S.jsx(yi,{title:"Coming soon!",children:S.jsx("span",{children:S.jsx(Gu,{size:"large",variant:"contained",disabled:!0,children:"Save"})})}):null}function drt(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var GD=drt,prt="__lodash_hash_undefined__";function hrt(e){return this.__data__.set(e,prt),this}var grt=hrt;function mrt(e){return this.__data__.has(e)}var vrt=mrt,yrt=DD,brt=grt,_rt=vrt;function _x(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new yrt;++t<n;)this.add(e[t])}_x.prototype.add=_x.prototype.push=brt;_x.prototype.has=_rt;var xrt=_x;function wrt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Srt=wrt;function Crt(e,t){return e.has(t)}var Ert=Crt,krt=xrt,Trt=Srt,Rrt=Ert,Art=1,$rt=2;function Ort(e,t,n,r,i,o){var a=n&Art,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),f=o.get(t);if(u&&f)return u==t&&f==e;var d=-1,p=!0,g=n&$rt?new krt:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var v=e[d],y=t[d];if(r)var w=a?r(y,v,d,t,e,o):r(v,y,d,e,t,o);if(w!==void 0){if(w)continue;p=!1;break}if(g){if(!Trt(t,function(b,x){if(!Rrt(g,x)&&(v===b||i(v,b,n,r,o)))return g.push(x)})){p=!1;break}}else if(!(v===y||i(v,y,n,r,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var jZ=Ort;function Irt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var Drt=Irt;function Prt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Lrt=Prt,B5=Dh,j5=vZ,Mrt=Gy,Frt=jZ,Nrt=Drt,Brt=Lrt,jrt=1,zrt=2,Urt="[object Boolean]",Krt="[object Date]",Wrt="[object Error]",Vrt="[object Map]",Hrt="[object Number]",qrt="[object RegExp]",Grt="[object Set]",Yrt="[object String]",Xrt="[object Symbol]",Zrt="[object ArrayBuffer]",Jrt="[object DataView]",z5=B5?B5.prototype:void 0,FT=z5?z5.valueOf:void 0;function Qrt(e,t,n,r,i,o,a){switch(n){case Jrt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Zrt:return!(e.byteLength!=t.byteLength||!o(new j5(e),new j5(t)));case Urt:case Krt:case Hrt:return Mrt(+e,+t);case Wrt:return e.name==t.name&&e.message==t.message;case qrt:case Yrt:return e==t+"";case Vrt:var s=Nrt;case Grt:var l=r&jrt;if(s||(s=Brt),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=zrt,a.set(e,t);var f=Frt(s(e),s(t),r,i,o,a);return a.delete(e),f;case Xrt:if(FT)return FT.call(e)==FT.call(t)}return!1}var eit=Qrt;function tit(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var YD=tit,nit=YD,rit=Ca;function iit(e,t,n){var r=t(e);return rit(e)?r:nit(r,n(e))}var zZ=iit;function oit(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}var ait=oit;function sit(){return[]}var UZ=sit,lit=ait,uit=UZ,cit=Object.prototype,fit=cit.propertyIsEnumerable,U5=Object.getOwnPropertySymbols,dit=U5?function(e){return e==null?[]:(e=Object(e),lit(U5(e),function(t){return fit.call(e,t)}))}:uit,XD=dit,pit=_Z,hit=pit(Object.keys,Object),git=hit,mit=MD,vit=git,yit=Object.prototype,bit=yit.hasOwnProperty;function _it(e){if(!mit(e))return vit(e);var t=[];for(var n in Object(e))bit.call(e,n)&&n!="constructor"&&t.push(n);return t}var xit=_it,wit=TZ,Sit=xit,Cit=Nh;function Eit(e){return Cit(e)?wit(e):Sit(e)}var Xy=Eit,kit=zZ,Tit=XD,Rit=Xy;function Ait(e){return kit(e,Rit,Tit)}var KZ=Ait,K5=KZ,$it=1,Oit=Object.prototype,Iit=Oit.hasOwnProperty;function Dit(e,t,n,r,i,o){var a=n&$it,s=K5(e),l=s.length,u=K5(t),f=u.length;if(l!=f&&!a)return!1;for(var d=l;d--;){var p=s[d];if(!(a?p in t:Iit.call(t,p)))return!1}var g=o.get(e),v=o.get(t);if(g&&v)return g==t&&v==e;var y=!0;o.set(e,t),o.set(t,e);for(var w=a;++d<l;){p=s[d];var b=e[p],x=t[p];if(r)var C=a?r(x,b,p,t,e,o):r(b,x,p,e,t,o);if(!(C===void 0?b===x||i(b,x,n,r,o):C)){y=!1;break}w||(w=p=="constructor")}if(y&&!w){var k=e.constructor,R=t.constructor;k!=R&&"constructor"in e&&"constructor"in t&&!(typeof k=="function"&&k instanceof k&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(e),o.delete(t),y}var Pit=Dit,Lit=Vf,Mit=rs,Fit=Lit(Mit,"DataView"),Nit=Fit,Bit=Vf,jit=rs,zit=Bit(jit,"Promise"),Uit=zit,Kit=Vf,Wit=rs,Vit=Kit(Wit,"Set"),Hit=Vit,qit=Vf,Git=rs,Yit=qit(Git,"WeakMap"),Xit=Yit,_$=Nit,x$=ID,w$=Uit,S$=Hit,C$=Xit,WZ=Ph,Uh=dZ,W5="[object Map]",Zit="[object Object]",V5="[object Promise]",H5="[object Set]",q5="[object WeakMap]",G5="[object DataView]",Jit=Uh(_$),Qit=Uh(x$),eot=Uh(w$),tot=Uh(S$),not=Uh(C$),zc=WZ;(_$&&zc(new _$(new ArrayBuffer(1)))!=G5||x$&&zc(new x$)!=W5||w$&&zc(w$.resolve())!=V5||S$&&zc(new S$)!=H5||C$&&zc(new C$)!=q5)&&(zc=function(e){var t=WZ(e),n=t==Zit?e.constructor:void 0,r=n?Uh(n):"";if(r)switch(r){case Jit:return G5;case Qit:return W5;case eot:return V5;case tot:return H5;case not:return q5}return t});var fC=zc,NT=aC,rot=jZ,iot=eit,oot=Pit,Y5=fC,X5=Ca,Z5=uC,aot=jD,sot=1,J5="[object Arguments]",Q5="[object Array]",vb="[object Object]",lot=Object.prototype,e6=lot.hasOwnProperty;function uot(e,t,n,r,i,o){var a=X5(e),s=X5(t),l=a?Q5:Y5(e),u=s?Q5:Y5(t);l=l==J5?vb:l,u=u==J5?vb:u;var f=l==vb,d=u==vb,p=l==u;if(p&&Z5(e)){if(!Z5(t))return!1;a=!0,f=!1}if(p&&!f)return o||(o=new NT),a||aot(e)?rot(e,t,n,r,i,o):iot(e,t,l,n,r,i,o);if(!(n&sot)){var g=f&&e6.call(e,"__wrapped__"),v=d&&e6.call(t,"__wrapped__");if(g||v){var y=g?e.value():e,w=v?t.value():t;return o||(o=new NT),i(y,w,n,r,o)}}return p?(o||(o=new NT),oot(e,t,n,r,i,o)):!1}var cot=uot,fot=cot,t6=Wl;function VZ(e,t,n,r,i){return e===t?!0:e==null||t==null||!t6(e)&&!t6(t)?e!==e&&t!==t:fot(e,t,n,r,VZ,i)}var HZ=VZ,dot=aC,pot=HZ,hot=1,got=2;function mot(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],u=e[l],f=s[1];if(a&&s[2]){if(u===void 0&&!(l in e))return!1}else{var d=new dot;if(r)var p=r(u,f,l,e,t,d);if(!(p===void 0?pot(f,u,hot|got,r,d):p))return!1}}return!0}var vot=mot,yot=is;function bot(e){return e===e&&!yot(e)}var qZ=bot,_ot=qZ,xot=Xy;function wot(e){for(var t=xot(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,_ot(i)]}return t}var Sot=wot;function Cot(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var GZ=Cot,Eot=vot,kot=Sot,Tot=GZ;function Rot(e){var t=kot(e);return t.length==1&&t[0][2]?Tot(t[0][0],t[0][1]):function(n){return n===e||Eot(n,e,t)}}var Aot=Rot,$ot=Ph,Oot=Wl,Iot="[object Symbol]";function Dot(e){return typeof e=="symbol"||Oot(e)&&$ot(e)==Iot}var dC=Dot,Pot=Ca,Lot=dC,Mot=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fot=/^\w*$/;function Not(e,t){if(Pot(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Lot(e)?!0:Fot.test(e)||!Mot.test(e)||t!=null&&e in Object(t)}var ZD=Not,YZ=DD,Bot="Expected a function";function JD(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Bot);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(JD.Cache||YZ),n}JD.Cache=YZ;var jot=JD,zot=jot,Uot=500;function Kot(e){var t=zot(e,function(r){return n.size===Uot&&n.clear(),r}),n=t.cache;return t}var Wot=Kot,Vot=Wot,Hot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qot=/\\(\\)?/g,Got=Vot(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Hot,function(n,r,i,o){t.push(i?o.replace(qot,"$1"):r||n)}),t}),Yot=Got,n6=Dh,Xot=GD,Zot=Ca,Jot=dC,Qot=1/0,r6=n6?n6.prototype:void 0,i6=r6?r6.toString:void 0;function XZ(e){if(typeof e=="string")return e;if(Zot(e))return Xot(e,XZ)+"";if(Jot(e))return i6?i6.call(e):"";var t=e+"";return t=="0"&&1/e==-Qot?"-0":t}var eat=XZ,tat=eat;function nat(e){return e==null?"":tat(e)}var rat=nat,iat=Ca,oat=ZD,aat=Yot,sat=rat;function lat(e,t){return iat(e)?e:oat(e,t)?[e]:aat(sat(e))}var pC=lat,uat=dC,cat=1/0;function fat(e){if(typeof e=="string"||uat(e))return e;var t=e+"";return t=="0"&&1/e==-cat?"-0":t}var Zy=fat,dat=pC,pat=Zy;function hat(e,t){t=dat(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[pat(t[n++])];return n&&n==r?e:void 0}var QD=hat,gat=QD;function mat(e,t,n){var r=e==null?void 0:gat(e,t);return r===void 0?n:r}var vat=mat;function yat(e,t){return e!=null&&t in Object(e)}var bat=yat,_at=pC,xat=lC,wat=Ca,Sat=zD,Cat=FD,Eat=Zy;function kat(e,t,n){t=_at(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=Eat(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Cat(i)&&Sat(a,i)&&(wat(e)||xat(e)))}var Tat=kat,Rat=bat,Aat=Tat;function $at(e,t){return e!=null&&Aat(e,t,Rat)}var Oat=$at,Iat=HZ,Dat=vat,Pat=Oat,Lat=ZD,Mat=qZ,Fat=GZ,Nat=Zy,Bat=1,jat=2;function zat(e,t){return Lat(e)&&Mat(t)?Fat(Nat(e),t):function(n){var r=Dat(n,e);return r===void 0&&r===t?Pat(n,e):Iat(t,r,Bat|jat)}}var Uat=zat;function Kat(e){return function(t){return t==null?void 0:t[e]}}var Wat=Kat,Vat=QD;function Hat(e){return function(t){return Vat(t,e)}}var qat=Hat,Gat=Wat,Yat=qat,Xat=ZD,Zat=Zy;function Jat(e){return Xat(e)?Gat(Zat(e)):Yat(e)}var Qat=Jat,est=Aot,tst=Uat,nst=UD,rst=Ca,ist=Qat;function ost(e){return typeof e=="function"?e:e==null?nst:typeof e=="object"?rst(e)?tst(e[0],e[1]):est(e):ist(e)}var ZZ=ost,ast=gZ,sst=Xy;function lst(e,t){return e&&ast(e,t,sst)}var JZ=lst,ust=Nh;function cst(e,t){return function(n,r){if(n==null)return n;if(!ust(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var fst=cst,dst=JZ,pst=fst,hst=pst(dst),gst=hst,mst=gst,vst=Nh;function yst(e,t){var n=-1,r=vst(e)?Array(e.length):[];return mst(e,function(i,o,a){r[++n]=t(i,o,a)}),r}var bst=yst,_st=GD,xst=ZZ,wst=bst,Sst=Ca;function Cst(e,t){var n=Sst(e)?_st:wst;return n(e,xst(t))}var Est=Cst;const kst=_i(Est),Tst=()=>{var i;const[e,t]=ir(AS),n=Ct(ts),r=kst((i=n==null?void 0:n.prompt)==null?void 0:i.inputs,(o,a)=>({label:a,value:a}));return(r==null?void 0:r.length)>0?S.jsx(zh,{items:r,id:"variable-select",value:e||"",label:"Select a variable",onChange:o=>t(o.target.value),sx:{maxWidth:"270px"}}):null};function Rst({hasTemplate:e,isSmallScreen:t,toggleDrawer:n,handleClose:r}){return S.jsxs(Ht,{direction:"row",alignItems:"center",children:[S.jsxs(Ht,{direction:"row",alignItems:"center",gap:1,children:[S.jsx(crt,{hasTemplate:e}),S.jsx(Tst,{})]}),S.jsxs(Ht,{sx:{ml:"auto"},direction:"row",alignItems:"center",gap:1,children:[S.jsx(Gu,{size:"large",target:"_blank",href:"https://docs.chainlit.io/concepts/prompt-playground",children:"Help"}),S.jsx(frt,{hasTemplate:e}),t?S.jsx(or,{"aria-label":"open drawer",edge:"end",onClick:n,sx:{mr:"4px"},children:S.jsx(qD,{})}):null,S.jsx(or,{edge:"end",id:"close-playground",onClick:r,children:S.jsx(yh,{sx:{height:"32px",width:"32px",color:_t[500]}})})]})]})}var o6=Array.isArray,a6=Object.keys,Ast=Object.prototype.hasOwnProperty,$st=typeof Element<"u";function E$(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=o6(e),r=o6(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!E$(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();var d=a6(e);if(o=d.length,o!==a6(t).length)return!1;for(i=o;i--!==0;)if(!Ast.call(t,d[i]))return!1;if($st&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=d[i],!(a==="_owner"&&e.$$typeof)&&!E$(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Ost=function(t,n){try{return E$(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Uc=_i(Ost);var Ist=function(t){return Dst(t)&&!Pst(t)};function Dst(e){return!!e&&typeof e=="object"}function Pst(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Fst(e)}var Lst=typeof Symbol=="function"&&Symbol.for,Mst=Lst?Symbol.for("react.element"):60103;function Fst(e){return e.$$typeof===Mst}function Nst(e){return Array.isArray(e)?[]:{}}function xx(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Gv(Nst(e),e,t):e}function Bst(e,t,n){return e.concat(t).map(function(r){return xx(r,n)})}function jst(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=xx(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=xx(t[i],n):r[i]=Gv(e[i],t[i],n)}),r}function Gv(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Bst,n.isMergeableObject=n.isMergeableObject||Ist;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):jst(e,t,n):xx(t,n)}Gv.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Gv(r,i,n)},{})};var k$=Gv,zst=typeof global=="object"&&global&&global.Object===Object&&global;const QZ=zst;var Ust=typeof self=="object"&&self&&self.Object===Object&&self,Kst=QZ||Ust||Function("return this")();const Xs=Kst;var Wst=Xs.Symbol;const Yu=Wst;var eJ=Object.prototype,Vst=eJ.hasOwnProperty,Hst=eJ.toString,wm=Yu?Yu.toStringTag:void 0;function qst(e){var t=Vst.call(e,wm),n=e[wm];try{e[wm]=void 0;var r=!0}catch{}var i=Hst.call(e);return r&&(t?e[wm]=n:delete e[wm]),i}var Gst=Object.prototype,Yst=Gst.toString;function Xst(e){return Yst.call(e)}var Zst="[object Null]",Jst="[object Undefined]",s6=Yu?Yu.toStringTag:void 0;function Hf(e){return e==null?e===void 0?Jst:Zst:s6&&s6 in Object(e)?qst(e):Xst(e)}function tJ(e,t){return function(n){return e(t(n))}}var Qst=tJ(Object.getPrototypeOf,Object);const eP=Qst;function qf(e){return e!=null&&typeof e=="object"}var elt="[object Object]",tlt=Function.prototype,nlt=Object.prototype,nJ=tlt.toString,rlt=nlt.hasOwnProperty,ilt=nJ.call(Object);function l6(e){if(!qf(e)||Hf(e)!=elt)return!1;var t=eP(e);if(t===null)return!0;var n=rlt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&nJ.call(n)==ilt}function olt(){this.__data__=[],this.size=0}function rJ(e,t){return e===t||e!==e&&t!==t}function hC(e,t){for(var n=e.length;n--;)if(rJ(e[n][0],t))return n;return-1}var alt=Array.prototype,slt=alt.splice;function llt(e){var t=this.__data__,n=hC(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():slt.call(t,n,1),--this.size,!0}function ult(e){var t=this.__data__,n=hC(t,e);return n<0?void 0:t[n][1]}function clt(e){return hC(this.__data__,e)>-1}function flt(e,t){var n=this.__data__,r=hC(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Vl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Vl.prototype.clear=olt;Vl.prototype.delete=llt;Vl.prototype.get=ult;Vl.prototype.has=clt;Vl.prototype.set=flt;function dlt(){this.__data__=new Vl,this.size=0}function plt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hlt(e){return this.__data__.get(e)}function glt(e){return this.__data__.has(e)}function Jy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var mlt="[object AsyncFunction]",vlt="[object Function]",ylt="[object GeneratorFunction]",blt="[object Proxy]";function iJ(e){if(!Jy(e))return!1;var t=Hf(e);return t==vlt||t==ylt||t==mlt||t==blt}var _lt=Xs["__core-js_shared__"];const BT=_lt;var u6=function(){var e=/[^.]+$/.exec(BT&&BT.keys&&BT.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function xlt(e){return!!u6&&u6 in e}var wlt=Function.prototype,Slt=wlt.toString;function Gf(e){if(e!=null){try{return Slt.call(e)}catch{}try{return e+""}catch{}}return""}var Clt=/[\\^$.*+?()[\]{}|]/g,Elt=/^\[object .+?Constructor\]$/,klt=Function.prototype,Tlt=Object.prototype,Rlt=klt.toString,Alt=Tlt.hasOwnProperty,$lt=RegExp("^"+Rlt.call(Alt).replace(Clt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Olt(e){if(!Jy(e)||xlt(e))return!1;var t=iJ(e)?$lt:Elt;return t.test(Gf(e))}function Ilt(e,t){return e==null?void 0:e[t]}function Yf(e,t){var n=Ilt(e,t);return Olt(n)?n:void 0}var Dlt=Yf(Xs,"Map");const Yv=Dlt;var Plt=Yf(Object,"create");const Xv=Plt;function Llt(){this.__data__=Xv?Xv(null):{},this.size=0}function Mlt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Flt="__lodash_hash_undefined__",Nlt=Object.prototype,Blt=Nlt.hasOwnProperty;function jlt(e){var t=this.__data__;if(Xv){var n=t[e];return n===Flt?void 0:n}return Blt.call(t,e)?t[e]:void 0}var zlt=Object.prototype,Ult=zlt.hasOwnProperty;function Klt(e){var t=this.__data__;return Xv?t[e]!==void 0:Ult.call(t,e)}var Wlt="__lodash_hash_undefined__";function Vlt(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Xv&&t===void 0?Wlt:t,this}function Cf(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Cf.prototype.clear=Llt;Cf.prototype.delete=Mlt;Cf.prototype.get=jlt;Cf.prototype.has=Klt;Cf.prototype.set=Vlt;function Hlt(){this.size=0,this.__data__={hash:new Cf,map:new(Yv||Vl),string:new Cf}}function qlt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function gC(e,t){var n=e.__data__;return qlt(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Glt(e){var t=gC(this,e).delete(e);return this.size-=t?1:0,t}function Ylt(e){return gC(this,e).get(e)}function Xlt(e){return gC(this,e).has(e)}function Zlt(e,t){var n=gC(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function dc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dc.prototype.clear=Hlt;dc.prototype.delete=Glt;dc.prototype.get=Ylt;dc.prototype.has=Xlt;dc.prototype.set=Zlt;var Jlt=200;function Qlt(e,t){var n=this.__data__;if(n instanceof Vl){var r=n.__data__;if(!Yv||r.length<Jlt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dc(r)}return n.set(e,t),this.size=n.size,this}function Kh(e){var t=this.__data__=new Vl(e);this.size=t.size}Kh.prototype.clear=dlt;Kh.prototype.delete=plt;Kh.prototype.get=hlt;Kh.prototype.has=glt;Kh.prototype.set=Qlt;function eut(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var tut=function(){try{var e=Yf(Object,"defineProperty");return e({},"",{}),e}catch{}}();const c6=tut;function oJ(e,t,n){t=="__proto__"&&c6?c6(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var nut=Object.prototype,rut=nut.hasOwnProperty;function aJ(e,t,n){var r=e[t];(!(rut.call(e,t)&&rJ(r,n))||n===void 0&&!(t in e))&&oJ(e,t,n)}function mC(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?oJ(n,s,l):aJ(n,s,l)}return n}function iut(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var out="[object Arguments]";function f6(e){return qf(e)&&Hf(e)==out}var sJ=Object.prototype,aut=sJ.hasOwnProperty,sut=sJ.propertyIsEnumerable,lut=f6(function(){return arguments}())?f6:function(e){return qf(e)&&aut.call(e,"callee")&&!sut.call(e,"callee")};const uut=lut;var cut=Array.isArray;const Qy=cut;function fut(){return!1}var lJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,d6=lJ&&typeof module=="object"&&module&&!module.nodeType&&module,dut=d6&&d6.exports===lJ,p6=dut?Xs.Buffer:void 0,put=p6?p6.isBuffer:void 0,hut=put||fut;const uJ=hut;var gut=9007199254740991,mut=/^(?:0|[1-9]\d*)$/;function vut(e,t){var n=typeof e;return t=t??gut,!!t&&(n=="number"||n!="symbol"&&mut.test(e))&&e>-1&&e%1==0&&e<t}var yut=9007199254740991;function cJ(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yut}var but="[object Arguments]",_ut="[object Array]",xut="[object Boolean]",wut="[object Date]",Sut="[object Error]",Cut="[object Function]",Eut="[object Map]",kut="[object Number]",Tut="[object Object]",Rut="[object RegExp]",Aut="[object Set]",$ut="[object String]",Out="[object WeakMap]",Iut="[object ArrayBuffer]",Dut="[object DataView]",Put="[object Float32Array]",Lut="[object Float64Array]",Mut="[object Int8Array]",Fut="[object Int16Array]",Nut="[object Int32Array]",But="[object Uint8Array]",jut="[object Uint8ClampedArray]",zut="[object Uint16Array]",Uut="[object Uint32Array]",Vn={};Vn[Put]=Vn[Lut]=Vn[Mut]=Vn[Fut]=Vn[Nut]=Vn[But]=Vn[jut]=Vn[zut]=Vn[Uut]=!0;Vn[but]=Vn[_ut]=Vn[Iut]=Vn[xut]=Vn[Dut]=Vn[wut]=Vn[Sut]=Vn[Cut]=Vn[Eut]=Vn[kut]=Vn[Tut]=Vn[Rut]=Vn[Aut]=Vn[$ut]=Vn[Out]=!1;function Kut(e){return qf(e)&&cJ(e.length)&&!!Vn[Hf(e)]}function tP(e){return function(t){return e(t)}}var fJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dv=fJ&&typeof module=="object"&&module&&!module.nodeType&&module,Wut=dv&&dv.exports===fJ,jT=Wut&&QZ.process,Vut=function(){try{var e=dv&&dv.require&&dv.require("util").types;return e||jT&&jT.binding&&jT.binding("util")}catch{}}();const ih=Vut;var h6=ih&&ih.isTypedArray,Hut=h6?tP(h6):Kut;const qut=Hut;var Gut=Object.prototype,Yut=Gut.hasOwnProperty;function dJ(e,t){var n=Qy(e),r=!n&&uut(e),i=!n&&!r&&uJ(e),o=!n&&!r&&!i&&qut(e),a=n||r||i||o,s=a?iut(e.length,String):[],l=s.length;for(var u in e)(t||Yut.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||vut(u,l)))&&s.push(u);return s}var Xut=Object.prototype;function nP(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xut;return e===n}var Zut=tJ(Object.keys,Object);const Jut=Zut;var Qut=Object.prototype,ect=Qut.hasOwnProperty;function tct(e){if(!nP(e))return Jut(e);var t=[];for(var n in Object(e))ect.call(e,n)&&n!="constructor"&&t.push(n);return t}function pJ(e){return e!=null&&cJ(e.length)&&!iJ(e)}function rP(e){return pJ(e)?dJ(e):tct(e)}function nct(e,t){return e&&mC(t,rP(t),e)}function rct(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var ict=Object.prototype,oct=ict.hasOwnProperty;function act(e){if(!Jy(e))return rct(e);var t=nP(e),n=[];for(var r in e)r=="constructor"&&(t||!oct.call(e,r))||n.push(r);return n}function iP(e){return pJ(e)?dJ(e,!0):act(e)}function sct(e,t){return e&&mC(t,iP(t),e)}var hJ=typeof exports=="object"&&exports&&!exports.nodeType&&exports,g6=hJ&&typeof module=="object"&&module&&!module.nodeType&&module,lct=g6&&g6.exports===hJ,m6=lct?Xs.Buffer:void 0,v6=m6?m6.allocUnsafe:void 0;function uct(e,t){if(t)return e.slice();var n=e.length,r=v6?v6(n):new e.constructor(n);return e.copy(r),r}function gJ(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function cct(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function mJ(){return[]}var fct=Object.prototype,dct=fct.propertyIsEnumerable,y6=Object.getOwnPropertySymbols,pct=y6?function(e){return e==null?[]:(e=Object(e),cct(y6(e),function(t){return dct.call(e,t)}))}:mJ;const oP=pct;function hct(e,t){return mC(e,oP(e),t)}function vJ(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var gct=Object.getOwnPropertySymbols,mct=gct?function(e){for(var t=[];e;)vJ(t,oP(e)),e=eP(e);return t}:mJ;const yJ=mct;function vct(e,t){return mC(e,yJ(e),t)}function bJ(e,t,n){var r=t(e);return Qy(e)?r:vJ(r,n(e))}function yct(e){return bJ(e,rP,oP)}function bct(e){return bJ(e,iP,yJ)}var _ct=Yf(Xs,"DataView");const T$=_ct;var xct=Yf(Xs,"Promise");const R$=xct;var wct=Yf(Xs,"Set");const A$=wct;var Sct=Yf(Xs,"WeakMap");const $$=Sct;var b6="[object Map]",Cct="[object Object]",_6="[object Promise]",x6="[object Set]",w6="[object WeakMap]",S6="[object DataView]",Ect=Gf(T$),kct=Gf(Yv),Tct=Gf(R$),Rct=Gf(A$),Act=Gf($$),Kc=Hf;(T$&&Kc(new T$(new ArrayBuffer(1)))!=S6||Yv&&Kc(new Yv)!=b6||R$&&Kc(R$.resolve())!=_6||A$&&Kc(new A$)!=x6||$$&&Kc(new $$)!=w6)&&(Kc=function(e){var t=Hf(e),n=t==Cct?e.constructor:void 0,r=n?Gf(n):"";if(r)switch(r){case Ect:return S6;case kct:return b6;case Tct:return _6;case Rct:return x6;case Act:return w6}return t});const aP=Kc;var $ct=Object.prototype,Oct=$ct.hasOwnProperty;function Ict(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Oct.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Dct=Xs.Uint8Array;const C6=Dct;function sP(e){var t=new e.constructor(e.byteLength);return new C6(t).set(new C6(e)),t}function Pct(e,t){var n=t?sP(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Lct=/\w*$/;function Mct(e){var t=new e.constructor(e.source,Lct.exec(e));return t.lastIndex=e.lastIndex,t}var E6=Yu?Yu.prototype:void 0,k6=E6?E6.valueOf:void 0;function Fct(e){return k6?Object(k6.call(e)):{}}function Nct(e,t){var n=t?sP(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Bct="[object Boolean]",jct="[object Date]",zct="[object Map]",Uct="[object Number]",Kct="[object RegExp]",Wct="[object Set]",Vct="[object String]",Hct="[object Symbol]",qct="[object ArrayBuffer]",Gct="[object DataView]",Yct="[object Float32Array]",Xct="[object Float64Array]",Zct="[object Int8Array]",Jct="[object Int16Array]",Qct="[object Int32Array]",eft="[object Uint8Array]",tft="[object Uint8ClampedArray]",nft="[object Uint16Array]",rft="[object Uint32Array]";function ift(e,t,n){var r=e.constructor;switch(t){case qct:return sP(e);case Bct:case jct:return new r(+e);case Gct:return Pct(e,n);case Yct:case Xct:case Zct:case Jct:case Qct:case eft:case tft:case nft:case rft:return Nct(e,n);case zct:return new r;case Uct:case Vct:return new r(e);case Kct:return Mct(e);case Wct:return new r;case Hct:return Fct(e)}}var T6=Object.create,oft=function(){function e(){}return function(t){if(!Jy(t))return{};if(T6)return T6(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const aft=oft;function sft(e){return typeof e.constructor=="function"&&!nP(e)?aft(eP(e)):{}}var lft="[object Map]";function uft(e){return qf(e)&&aP(e)==lft}var R6=ih&&ih.isMap,cft=R6?tP(R6):uft;const fft=cft;var dft="[object Set]";function pft(e){return qf(e)&&aP(e)==dft}var A6=ih&&ih.isSet,hft=A6?tP(A6):pft;const gft=hft;var mft=1,vft=2,yft=4,_J="[object Arguments]",bft="[object Array]",_ft="[object Boolean]",xft="[object Date]",wft="[object Error]",xJ="[object Function]",Sft="[object GeneratorFunction]",Cft="[object Map]",Eft="[object Number]",wJ="[object Object]",kft="[object RegExp]",Tft="[object Set]",Rft="[object String]",Aft="[object Symbol]",$ft="[object WeakMap]",Oft="[object ArrayBuffer]",Ift="[object DataView]",Dft="[object Float32Array]",Pft="[object Float64Array]",Lft="[object Int8Array]",Mft="[object Int16Array]",Fft="[object Int32Array]",Nft="[object Uint8Array]",Bft="[object Uint8ClampedArray]",jft="[object Uint16Array]",zft="[object Uint32Array]",Fn={};Fn[_J]=Fn[bft]=Fn[Oft]=Fn[Ift]=Fn[_ft]=Fn[xft]=Fn[Dft]=Fn[Pft]=Fn[Lft]=Fn[Mft]=Fn[Fft]=Fn[Cft]=Fn[Eft]=Fn[wJ]=Fn[kft]=Fn[Tft]=Fn[Rft]=Fn[Aft]=Fn[Nft]=Fn[Bft]=Fn[jft]=Fn[zft]=!0;Fn[wft]=Fn[xJ]=Fn[$ft]=!1;function e_(e,t,n,r,i,o){var a,s=t&mft,l=t&vft,u=t&yft;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!Jy(e))return e;var f=Qy(e);if(f){if(a=Ict(e),!s)return gJ(e,a)}else{var d=aP(e),p=d==xJ||d==Sft;if(uJ(e))return uct(e,s);if(d==wJ||d==_J||p&&!i){if(a=l||p?{}:sft(e),!s)return l?vct(e,sct(a,e)):hct(e,nct(a,e))}else{if(!Fn[d])return i?e:{};a=ift(e,d,s)}}o||(o=new Kh);var g=o.get(e);if(g)return g;o.set(e,a),gft(e)?e.forEach(function(w){a.add(e_(w,t,n,w,e,o))}):fft(e)&&e.forEach(function(w,b){a.set(b,e_(w,t,n,b,e,o))});var v=u?l?bct:yct:l?iP:rP,y=f?void 0:v(e);return eut(y||e,function(w,b){y&&(b=w,w=e[b]),aJ(a,b,e_(w,t,n,b,e,o))}),a}var Uft=4;function $6(e){return e_(e,Uft)}function SJ(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Kft="[object Symbol]";function lP(e){return typeof e=="symbol"||qf(e)&&Hf(e)==Kft}var Wft="Expected a function";function uP(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Wft);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(uP.Cache||dc),n}uP.Cache=dc;var Vft=500;function Hft(e){var t=uP(e,function(r){return n.size===Vft&&n.clear(),r}),n=t.cache;return t}var qft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gft=/\\(\\)?/g,Yft=Hft(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(qft,function(n,r,i,o){t.push(i?o.replace(Gft,"$1"):r||n)}),t});const Xft=Yft;var Zft=1/0;function Jft(e){if(typeof e=="string"||lP(e))return e;var t=e+"";return t=="0"&&1/e==-Zft?"-0":t}var Qft=1/0,O6=Yu?Yu.prototype:void 0,I6=O6?O6.toString:void 0;function CJ(e){if(typeof e=="string")return e;if(Qy(e))return SJ(e,CJ)+"";if(lP(e))return I6?I6.call(e):"";var t=e+"";return t=="0"&&1/e==-Qft?"-0":t}function edt(e){return e==null?"":CJ(e)}function EJ(e){return Qy(e)?SJ(e,Jft):lP(e)?[e]:gJ(Xft(edt(e)))}var tdt=!0;function ndt(e,t){if(!tdt){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}function Zr(){return Zr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zr.apply(this,arguments)}function kJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Fa=function(t){return typeof t=="function"},vC=function(t){return t!==null&&typeof t=="object"},rdt=function(t){return String(Math.floor(Number(t)))===t},zT=function(t){return Object.prototype.toString.call(t)==="[object String]"},UT=function(t){return vC(t)&&Fa(t.then)};function Xo(e,t,n,r){r===void 0&&(r=0);for(var i=EJ(t);e&&r<i.length;)e=e[i[r++]];return e===void 0?n:e}function sf(e,t,n){for(var r=$6(e),i=r,o=0,a=EJ(t);o<a.length-1;o++){var s=a[o],l=Xo(e,a.slice(0,o+1));if(l&&(vC(l)||Array.isArray(l)))i=i[s]=$6(l);else{var u=a[o+1];i=i[s]=rdt(u)&&Number(u)>=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function TJ(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i<o.length;i++){var a=o[i],s=e[a];vC(s)?n.get(s)||(n.set(s,!0),r[a]=Array.isArray(s)?[]:{},TJ(s,t,n,r[a])):r[a]=t}return r}var yC=T.createContext(void 0);yC.displayName="FormikContext";yC.Provider;yC.Consumer;function idt(){var e=T.useContext(yC);return e||ndt(!1),e}function odt(e,t){switch(t.type){case"SET_VALUES":return Zr({},e,{values:t.payload});case"SET_TOUCHED":return Zr({},e,{touched:t.payload});case"SET_ERRORS":return Uc(e.errors,t.payload)?e:Zr({},e,{errors:t.payload});case"SET_STATUS":return Zr({},e,{status:t.payload});case"SET_ISSUBMITTING":return Zr({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Zr({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Zr({},e,{values:sf(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Zr({},e,{touched:sf(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Zr({},e,{errors:sf(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Zr({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Zr({},e,{touched:TJ(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return Zr({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Zr({},e,{isSubmitting:!1});default:return e}}var Lc={},yb={};function cP(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,o=e.validateOnMount,a=o===void 0?!1:o,s=e.isInitialValid,l=e.enableReinitialize,u=l===void 0?!1:l,f=e.onSubmit,d=kJ(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=Zr({validateOnChange:n,validateOnBlur:i,validateOnMount:a,onSubmit:f},d),g=T.useRef(p.initialValues),v=T.useRef(p.initialErrors||Lc),y=T.useRef(p.initialTouched||yb),w=T.useRef(p.initialStatus),b=T.useRef(!1),x=T.useRef({});T.useEffect(function(){return b.current=!0,function(){b.current=!1}},[]);var C=T.useReducer(odt,{values:p.initialValues,errors:p.initialErrors||Lc,touched:p.initialTouched||yb,status:p.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),k=C[0],R=C[1],A=T.useCallback(function(he,Ae){return new Promise(function(Re,Ne){var U=p.validate(he,Ae);U==null?Re(Lc):UT(U)?U.then(function(H){Re(H||Lc)},function(H){Ne(H)}):Re(U)})},[p.validate]),O=T.useCallback(function(he,Ae){var Re=p.validationSchema,Ne=Fa(Re)?Re(Ae):Re,U=Ae&&Ne.validateAt?Ne.validateAt(Ae,he):sdt(he,Ne);return new Promise(function(H,fe){U.then(function(){H(Lc)},function(Y){Y.name==="ValidationError"?H(adt(Y)):fe(Y)})})},[p.validationSchema]),z=T.useCallback(function(he,Ae){return new Promise(function(Re){return Re(x.current[he].validate(Ae))})},[]),V=T.useCallback(function(he){var Ae=Object.keys(x.current).filter(function(Ne){return Fa(x.current[Ne].validate)}),Re=Ae.length>0?Ae.map(function(Ne){return z(Ne,Xo(he,Ne))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Re).then(function(Ne){return Ne.reduce(function(U,H,fe){return H==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||H&&(U=sf(U,Ae[fe],H)),U},{})})},[z]),D=T.useCallback(function(he){return Promise.all([V(he),p.validationSchema?O(he):{},p.validate?A(he):{}]).then(function(Ae){var Re=Ae[0],Ne=Ae[1],U=Ae[2],H=k$.all([Re,Ne,U],{arrayMerge:ldt});return H})},[p.validate,p.validationSchema,V,A,O]),W=Go(function(he){return he===void 0&&(he=k.values),R({type:"SET_ISVALIDATING",payload:!0}),D(he).then(function(Ae){return b.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:Ae})),Ae})});T.useEffect(function(){a&&b.current===!0&&Uc(g.current,p.initialValues)&&W(g.current)},[a,W]);var ie=T.useCallback(function(he){var Ae=he&&he.values?he.values:g.current,Re=he&&he.errors?he.errors:v.current?v.current:p.initialErrors||{},Ne=he&&he.touched?he.touched:y.current?y.current:p.initialTouched||{},U=he&&he.status?he.status:w.current?w.current:p.initialStatus;g.current=Ae,v.current=Re,y.current=Ne,w.current=U;var H=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!he&&!!he.isSubmitting,errors:Re,touched:Ne,status:U,values:Ae,isValidating:!!he&&!!he.isValidating,submitCount:he&&he.submitCount&&typeof he.submitCount=="number"?he.submitCount:0}})};if(p.onReset){var fe=p.onReset(k.values,Be);UT(fe)?fe.then(H):H()}else H()},[p.initialErrors,p.initialStatus,p.initialTouched]);T.useEffect(function(){b.current===!0&&!Uc(g.current,p.initialValues)&&(u&&(g.current=p.initialValues,ie()),a&&W(g.current))},[u,p.initialValues,ie,a,W]),T.useEffect(function(){u&&b.current===!0&&!Uc(v.current,p.initialErrors)&&(v.current=p.initialErrors||Lc,R({type:"SET_ERRORS",payload:p.initialErrors||Lc}))},[u,p.initialErrors]),T.useEffect(function(){u&&b.current===!0&&!Uc(y.current,p.initialTouched)&&(y.current=p.initialTouched||yb,R({type:"SET_TOUCHED",payload:p.initialTouched||yb}))},[u,p.initialTouched]),T.useEffect(function(){u&&b.current===!0&&!Uc(w.current,p.initialStatus)&&(w.current=p.initialStatus,R({type:"SET_STATUS",payload:p.initialStatus}))},[u,p.initialStatus,p.initialTouched]);var se=Go(function(he){if(x.current[he]&&Fa(x.current[he].validate)){var Ae=Xo(k.values,he),Re=x.current[he].validate(Ae);return UT(Re)?(R({type:"SET_ISVALIDATING",payload:!0}),Re.then(function(Ne){return Ne}).then(function(Ne){R({type:"SET_FIELD_ERROR",payload:{field:he,value:Ne}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:he,value:Re}}),Promise.resolve(Re))}else if(p.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),O(k.values,he).then(function(Ne){return Ne}).then(function(Ne){R({type:"SET_FIELD_ERROR",payload:{field:he,value:Ne[he]}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),K=T.useCallback(function(he,Ae){var Re=Ae.validate;x.current[he]={validate:Re}},[]),G=T.useCallback(function(he){delete x.current[he]},[]),Q=Go(function(he,Ae){R({type:"SET_TOUCHED",payload:he});var Re=Ae===void 0?i:Ae;return Re?W(k.values):Promise.resolve()}),le=T.useCallback(function(he){R({type:"SET_ERRORS",payload:he})},[]),Z=Go(function(he,Ae){var Re=Fa(he)?he(k.values):he;R({type:"SET_VALUES",payload:Re});var Ne=Ae===void 0?n:Ae;return Ne?W(Re):Promise.resolve()}),ee=T.useCallback(function(he,Ae){R({type:"SET_FIELD_ERROR",payload:{field:he,value:Ae}})},[]),P=Go(function(he,Ae,Re){R({type:"SET_FIELD_VALUE",payload:{field:he,value:Ae}});var Ne=Re===void 0?n:Re;return Ne?W(sf(k.values,he,Ae)):Promise.resolve()}),ge=T.useCallback(function(he,Ae){var Re=Ae,Ne=he,U;if(!zT(he)){he.persist&&he.persist();var H=he.target?he.target:he.currentTarget,fe=H.type,Y=H.name,X=H.id,oe=H.value,xe=H.checked,Ce=H.outerHTML,_e=H.options,nt=H.multiple;Re=Ae||Y||X,Ne=/number|range/.test(fe)?(U=parseFloat(oe),isNaN(U)?"":U):/checkbox/.test(fe)?cdt(Xo(k.values,Re),xe,oe):_e&&nt?udt(_e):oe}Re&&P(Re,Ne)},[P,k.values]),B=Go(function(he){if(zT(he))return function(Ae){return ge(Ae,he)};ge(he)}),L=Go(function(he,Ae,Re){Ae===void 0&&(Ae=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:he,value:Ae}});var Ne=Re===void 0?i:Re;return Ne?W(k.values):Promise.resolve()}),ae=T.useCallback(function(he,Ae){he.persist&&he.persist();var Re=he.target,Ne=Re.name,U=Re.id,H=Re.outerHTML,fe=Ae||Ne||U;L(fe,!0)},[L]),ue=Go(function(he){if(zT(he))return function(Ae){return ae(Ae,he)};ae(he)}),ne=T.useCallback(function(he){Fa(he)?R({type:"SET_FORMIK_STATE",payload:he}):R({type:"SET_FORMIK_STATE",payload:function(){return he}})},[]),we=T.useCallback(function(he){R({type:"SET_STATUS",payload:he})},[]),Te=T.useCallback(function(he){R({type:"SET_ISSUBMITTING",payload:he})},[]),Ee=Go(function(){return R({type:"SUBMIT_ATTEMPT"}),W().then(function(he){var Ae=he instanceof Error,Re=!Ae&&Object.keys(he).length===0;if(Re){var Ne;try{if(Ne=Ie(),Ne===void 0)return}catch(U){throw U}return Promise.resolve(Ne).then(function(U){return b.current&&R({type:"SUBMIT_SUCCESS"}),U}).catch(function(U){if(b.current)throw R({type:"SUBMIT_FAILURE"}),U})}else if(b.current&&(R({type:"SUBMIT_FAILURE"}),Ae))throw he})}),Le=Go(function(he){he&&he.preventDefault&&Fa(he.preventDefault)&&he.preventDefault(),he&&he.stopPropagation&&Fa(he.stopPropagation)&&he.stopPropagation(),Ee().catch(function(Ae){console.warn("Warning: An unhandled error was caught from submitForm()",Ae)})}),Be={resetForm:ie,validateForm:W,validateField:se,setErrors:le,setFieldError:ee,setFieldTouched:L,setFieldValue:P,setStatus:we,setSubmitting:Te,setTouched:Q,setValues:Z,setFormikState:ne,submitForm:Ee},Ie=Go(function(){return f(k.values,Be)}),Pe=Go(function(he){he&&he.preventDefault&&Fa(he.preventDefault)&&he.preventDefault(),he&&he.stopPropagation&&Fa(he.stopPropagation)&&he.stopPropagation(),ie()}),je=T.useCallback(function(he){return{value:Xo(k.values,he),error:Xo(k.errors,he),touched:!!Xo(k.touched,he),initialValue:Xo(g.current,he),initialTouched:!!Xo(y.current,he),initialError:Xo(v.current,he)}},[k.errors,k.touched,k.values]),Fe=T.useCallback(function(he){return{setValue:function(Re,Ne){return P(he,Re,Ne)},setTouched:function(Re,Ne){return L(he,Re,Ne)},setError:function(Re){return ee(he,Re)}}},[P,L,ee]),tt=T.useCallback(function(he){var Ae=vC(he),Re=Ae?he.name:he,Ne=Xo(k.values,Re),U={name:Re,value:Ne,onChange:B,onBlur:ue};if(Ae){var H=he.type,fe=he.value,Y=he.as,X=he.multiple;H==="checkbox"?fe===void 0?U.checked=!!Ne:(U.checked=!!(Array.isArray(Ne)&&~Ne.indexOf(fe)),U.value=fe):H==="radio"?(U.checked=Ne===fe,U.value=fe):Y==="select"&&X&&(U.value=U.value||[],U.multiple=!0)}return U},[ue,B,k.values]),Xe=T.useMemo(function(){return!Uc(g.current,k.values)},[g.current,k.values]),Ye=T.useMemo(function(){return typeof s<"u"?Xe?k.errors&&Object.keys(k.errors).length===0:s!==!1&&Fa(s)?s(p):s:k.errors&&Object.keys(k.errors).length===0},[s,Xe,k.errors,p]),st=Zr({},k,{initialValues:g.current,initialErrors:v.current,initialTouched:y.current,initialStatus:w.current,handleBlur:ue,handleChange:B,handleReset:Pe,handleSubmit:Le,resetForm:ie,setErrors:le,setFormikState:ne,setFieldTouched:L,setFieldValue:P,setFieldError:ee,setStatus:we,setSubmitting:Te,setTouched:Q,setValues:Z,submitForm:Ee,validateForm:W,validateField:se,isValid:Ye,dirty:Xe,unregisterField:G,registerField:K,getFieldProps:tt,getFieldMeta:je,getFieldHelpers:Fe,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return st}function adt(e){var t={};if(e.inner){if(e.inner.length===0)return sf(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Xo(t,a.path)||(t=sf(t,a.path,a.message))}}return t}function sdt(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=O$(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function O$(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||l6(i)?O$(i):i!==""?i:void 0}):l6(e[r])?t[r]=O$(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function ldt(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?k$(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=k$(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function udt(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function cdt(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var fdt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?T.useLayoutEffect:T.useEffect;function Go(e){var t=T.useRef(e);return fdt(function(){t.current=e}),T.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var ddt=T.forwardRef(function(e,t){var n=e.action,r=kJ(e,["action"]),i=n??"#",o=idt(),a=o.handleReset,s=o.handleSubmit;return T.createElement("form",Object.assign({onSubmit:s,ref:t,onReset:a,action:i},r))});ddt.displayName="Form";function pdt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var hdt=pdt,gdt=Bh,mdt=Xy;function vdt(e,t){return e&&gdt(t,mdt(t),e)}var ydt=vdt,bdt=Bh,_dt=Yy;function xdt(e,t){return e&&bdt(t,_dt(t),e)}var wdt=xdt,Sdt=Bh,Cdt=XD;function Edt(e,t){return Sdt(e,Cdt(e),t)}var kdt=Edt,Tdt=YD,Rdt=LD,Adt=XD,$dt=UZ,Odt=Object.getOwnPropertySymbols,Idt=Odt?function(e){for(var t=[];e;)Tdt(t,Adt(e)),e=Rdt(e);return t}:$dt,RJ=Idt,Ddt=Bh,Pdt=RJ;function Ldt(e,t){return Ddt(e,Pdt(e),t)}var Mdt=Ldt,Fdt=zZ,Ndt=RJ,Bdt=Yy;function jdt(e){return Fdt(e,Bdt,Ndt)}var AJ=jdt,zdt=Object.prototype,Udt=zdt.hasOwnProperty;function Kdt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Udt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Wdt=Kdt,Vdt=PD;function Hdt(e,t){var n=t?Vdt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var qdt=Hdt,Gdt=/\w*$/;function Ydt(e){var t=new e.constructor(e.source,Gdt.exec(e));return t.lastIndex=e.lastIndex,t}var Xdt=Ydt,D6=Dh,P6=D6?D6.prototype:void 0,L6=P6?P6.valueOf:void 0;function Zdt(e){return L6?Object(L6.call(e)):{}}var Jdt=Zdt,Qdt=PD,ept=qdt,tpt=Xdt,npt=Jdt,rpt=yZ,ipt="[object Boolean]",opt="[object Date]",apt="[object Map]",spt="[object Number]",lpt="[object RegExp]",upt="[object Set]",cpt="[object String]",fpt="[object Symbol]",dpt="[object ArrayBuffer]",ppt="[object DataView]",hpt="[object Float32Array]",gpt="[object Float64Array]",mpt="[object Int8Array]",vpt="[object Int16Array]",ypt="[object Int32Array]",bpt="[object Uint8Array]",_pt="[object Uint8ClampedArray]",xpt="[object Uint16Array]",wpt="[object Uint32Array]";function Spt(e,t,n){var r=e.constructor;switch(t){case dpt:return Qdt(e);case ipt:case opt:return new r(+e);case ppt:return ept(e,n);case hpt:case gpt:case mpt:case vpt:case ypt:case bpt:case _pt:case xpt:case wpt:return rpt(e,n);case apt:return new r;case spt:case cpt:return new r(e);case lpt:return tpt(e);case upt:return new r;case fpt:return npt(e)}}var Cpt=Spt,Ept=fC,kpt=Wl,Tpt="[object Map]";function Rpt(e){return kpt(e)&&Ept(e)==Tpt}var Apt=Rpt,$pt=Apt,Opt=ND,M6=BD,F6=M6&&M6.isMap,Ipt=F6?Opt(F6):$pt,Dpt=Ipt,Ppt=fC,Lpt=Wl,Mpt="[object Set]";function Fpt(e){return Lpt(e)&&Ppt(e)==Mpt}var Npt=Fpt,Bpt=Npt,jpt=ND,N6=BD,B6=N6&&N6.isSet,zpt=B6?jpt(B6):Bpt,Upt=zpt,Kpt=aC,Wpt=hdt,Vpt=kZ,Hpt=ydt,qpt=wdt,Gpt=mZ,Ypt=bZ,Xpt=kdt,Zpt=Mdt,Jpt=KZ,Qpt=AJ,eht=fC,tht=Wdt,nht=Cpt,rht=xZ,iht=Ca,oht=uC,aht=Dpt,sht=is,lht=Upt,uht=Xy,cht=Yy,fht=1,dht=2,pht=4,$J="[object Arguments]",hht="[object Array]",ght="[object Boolean]",mht="[object Date]",vht="[object Error]",OJ="[object Function]",yht="[object GeneratorFunction]",bht="[object Map]",_ht="[object Number]",IJ="[object Object]",xht="[object RegExp]",wht="[object Set]",Sht="[object String]",Cht="[object Symbol]",Eht="[object WeakMap]",kht="[object ArrayBuffer]",Tht="[object DataView]",Rht="[object Float32Array]",Aht="[object Float64Array]",$ht="[object Int8Array]",Oht="[object Int16Array]",Iht="[object Int32Array]",Dht="[object Uint8Array]",Pht="[object Uint8ClampedArray]",Lht="[object Uint16Array]",Mht="[object Uint32Array]",Nn={};Nn[$J]=Nn[hht]=Nn[kht]=Nn[Tht]=Nn[ght]=Nn[mht]=Nn[Rht]=Nn[Aht]=Nn[$ht]=Nn[Oht]=Nn[Iht]=Nn[bht]=Nn[_ht]=Nn[IJ]=Nn[xht]=Nn[wht]=Nn[Sht]=Nn[Cht]=Nn[Dht]=Nn[Pht]=Nn[Lht]=Nn[Mht]=!0;Nn[vht]=Nn[OJ]=Nn[Eht]=!1;function t_(e,t,n,r,i,o){var a,s=t&fht,l=t&dht,u=t&pht;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!sht(e))return e;var f=iht(e);if(f){if(a=tht(e),!s)return Ypt(e,a)}else{var d=eht(e),p=d==OJ||d==yht;if(oht(e))return Gpt(e,s);if(d==IJ||d==$J||p&&!i){if(a=l||p?{}:rht(e),!s)return l?Zpt(e,qpt(a,e)):Xpt(e,Hpt(a,e))}else{if(!Nn[d])return i?e:{};a=nht(e,d,s)}}o||(o=new Kpt);var g=o.get(e);if(g)return g;o.set(e,a),lht(e)?e.forEach(function(w){a.add(t_(w,t,n,w,e,o))}):aht(e)&&e.forEach(function(w,b){a.set(b,t_(w,t,n,b,e,o))});var v=u?l?Qpt:Jpt:l?cht:uht,y=f?void 0:v(e);return Wpt(y||e,function(w,b){y&&(b=w,w=e[b]),Vpt(a,b,t_(w,t,n,b,e,o))}),a}var DJ=t_,Fht=DJ,Nht=1,Bht=4;function jht(e){return Fht(e,Nht|Bht)}var zht=jht;const PJ=_i(zht);function Xf(e){this._maxSize=e,this.clear()}Xf.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Xf.prototype.get=function(e){return this._values[e]};Xf.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var Uht=/[^.^\]^[]+|(?=\[\]|\.\.)/g,LJ=/^\d+$/,Kht=/^\d/,Wht=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Vht=/^\s*(['"]?)(.*?)(\1)\s*$/,fP=512,j6=new Xf(fP),z6=new Xf(fP),U6=new Xf(fP),lf={Cache:Xf,split:I$,normalizePath:KT,setter:function(e){var t=KT(e);return z6.get(e)||z6.set(e,function(r,i){for(var o=0,a=t.length,s=r;o<a-1;){var l=t[o];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;s=s[t[o++]]}s[t[o]]=i})},getter:function(e,t){var n=KT(e);return U6.get(e)||U6.set(e,function(i){for(var o=0,a=n.length;o<a;)if(i!=null||!t)i=i[n[o++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(dP(n)||LJ.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){Hht(Array.isArray(e)?e:I$(e),t,n)}};function KT(e){return j6.get(e)||j6.set(e,I$(e).map(function(t){return t.replace(Vht,"$2")}))}function I$(e){return e.match(Uht)||[""]}function Hht(e,t,n){var r=e.length,i,o,a,s;for(o=0;o<r;o++)i=e[o],i&&(Yht(i)&&(i='"'+i+'"'),s=dP(i),a=!s&&/^\d+$/.test(i),t.call(n,i,s,a,o,e))}function dP(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function qht(e){return e.match(Kht)&&!e.match(LJ)}function Ght(e){return Wht.test(e)}function Yht(e){return!dP(e)&&(qht(e)||Ght(e))}const Xht=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,bC=e=>e.match(Xht)||[],_C=e=>e[0].toUpperCase()+e.slice(1),pP=(e,t)=>bC(e).join(t).toLowerCase(),MJ=e=>bC(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),Zht=e=>_C(MJ(e)),Jht=e=>pP(e,"_"),Qht=e=>pP(e,"-"),egt=e=>_C(pP(e," ")),tgt=e=>bC(e).map(_C).join(" ");var WT={words:bC,upperFirst:_C,camelCase:MJ,pascalCase:Zht,snakeCase:Jht,kebabCase:Qht,sentenceCase:egt,titleCase:tgt},hP={exports:{}};hP.exports=function(e){return FJ(ngt(e),e)};hP.exports.array=FJ;function FJ(e,t){var n=e.length,r=new Array(n),i={},o=n,a=rgt(t),s=igt(e);for(t.forEach(function(u){if(!s.has(u[0])||!s.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});o--;)i[o]||l(e[o],o,new Set);return r;function l(u,f,d){if(d.has(u)){var p;try{p=", node was:"+JSON.stringify(u)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[f]){i[f]=!0;var g=a.get(u)||new Set;if(g=Array.from(g),f=g.length){d.add(u);do{var v=g[--f];l(v,s.get(v),d)}while(f);d.delete(u)}r[--n]=u}}}function ngt(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function rgt(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function igt(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var ogt=hP.exports;const agt=_i(ogt),sgt=Object.prototype.toString,lgt=Error.prototype.toString,ugt=RegExp.prototype.toString,cgt=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",fgt=/^Symbol\((.*)\)(.*)$/;function dgt(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function K6(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return dgt(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return cgt.call(e).replace(fgt,"Symbol($1)");const r=sgt.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+lgt.call(e)+"]":r==="RegExp"?ugt.call(e):null}function uf(e,t){let n=K6(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let o=K6(this[r],t);return o!==null?o:i},2)}function NJ(e){return e==null?[]:[].concat(e)}let pgt=/\$\{\s*(\w+)\s*\}/g;class wo extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(pgt,(i,o)=>uf(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],NJ(t).forEach(o=>{wo.isError(o)?(this.errors.push(...o.errors),this.inner=this.inner.concat(o.inner.length?o.inner:o)):this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,wo)}}let bl={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${uf(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${uf(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${uf(n,!0)}\``+i}},Na={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},mu={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},D$={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},hgt={isValue:"${path} field must be ${value}"},P$={noUnknown:"${path} field has unspecified keys: ${unknown}"},n_={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:bl,string:Na,number:mu,date:D$,object:P$,array:n_,boolean:hgt});const xC=e=>e&&e.__isYupSchema__;class wx{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:o}=n,a=typeof r=="function"?r:(...s)=>s.every(l=>l===r);return new wx(t,(s,l)=>{var u;let f=a(...s)?i:o;return(u=f==null?void 0:f(l))!=null?u:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!xC(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const bb={context:"$",value:"."};class Zf{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===bb.context,this.isValue=this.key[0]===bb.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?bb.context:this.isValue?bb.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&lf.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Zf.prototype.__isYupRef=!0;const Is=e=>e==null;function Nd(e){function t({value:n,path:r="",options:i,originalValue:o,schema:a},s,l){const{name:u,test:f,params:d,message:p,skipAbsent:g}=e;let{parent:v,context:y,abortEarly:w=a.spec.abortEarly}=i;function b(D){return Zf.isRef(D)?D.getValue(n,v,y):D}function x(D={}){const W=Object.assign({value:n,originalValue:o,label:a.spec.label,path:D.path||r,spec:a.spec},d,D.params);for(const se of Object.keys(W))W[se]=b(W[se]);const ie=new wo(wo.formatError(D.message||p,W),n,W.path,D.type||u);return ie.params=W,ie}const C=w?s:l;let k={path:r,parent:v,type:u,from:i.from,createError:x,resolve:b,options:i,originalValue:o,schema:a};const R=D=>{wo.isError(D)?C(D):D?l(null):C(x())},A=D=>{wo.isError(D)?C(D):s(D)},O=g&&Is(n);if(!i.sync){try{Promise.resolve(O?!0:f.call(k,n,k)).then(R,A)}catch(D){A(D)}return}let z;try{var V;if(z=O?!0:f.call(k,n,k),typeof((V=z)==null?void 0:V.then)=="function")throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(D){A(D);return}R(z)}return t.OPTIONS=e,t}function ggt(e,t,n,r=n){let i,o,a;return t?(lf.forEach(t,(s,l,u)=>{let f=l?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:i,value:n});let d=e.type==="tuple",p=u?parseInt(f,10):0;if(e.innerType||d){if(d&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=d?e.spec.types[p]:e.innerType}if(!u){if(!e.fields||!e.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=n,n=n&&n[f],e=e.fields[f]}o=f,a=l?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:o}):{parent:i,parentPath:t,schema:e}}class Sx extends Set{describe(){const t=[];for(const n of this.values())t.push(Zf.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Sx(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function up(e,t=new Map){if(xC(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=up(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,up(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(up(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=up(i,t)}else throw Error(`Unable to clone ${e}`);return n}class ma{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Sx,this._blacklist=new Sx,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(bl.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=up(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(o=>{t.tests.forEach(a=>{o.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,o)=>o.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",o=r._cast(t,n);if(n.assert!==!1&&!r.isType(o)){if(i&&Is(o))return o;let a=uf(t),s=uf(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
488
488
|
|
|
489
489
|
attempted value: ${a}
|
|
490
|
-
`+(s!==a?`result of cast: ${s}`:""))}return o}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,o)=>o.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r,i){let{path:o,originalValue:a=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:o,value:l,originalValue:a,options:n,tests:u},r,f=>{if(f.length)return i(f,l);this.runTests({path:o,value:l,originalValue:a,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:o,value:a,originalValue:s,path:l,options:u}=t,f=y=>{i||(i=!0,n(y,a))},d=y=>{i||(i=!0,r(y,a))},p=o.length,g=[];if(!p)return d([]);let v={value:a,originalValue:s,path:l,options:u,schema:this};for(let y=0;y<o.length;y++){const w=o[y];w(v,f,function(x){x&&(g=g.concat(x)),--p<=0&&d(g)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:o,options:a}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let u=r[s];const f=Object.assign({},a,{strict:!0,parent:r,value:u,originalValue:o[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${i||""}[${u?s:`"${s}"`}]`:(i?`${i}.`:"")+t});return(d,p,g)=>this.resolve(f)._validate(u,f,p,g)}validate(t,n){let r=this.resolve(Object.assign({},n,{value:t}));return new Promise((i,o)=>r._validate(t,n,(a,s)=>{wo.isError(a)&&(a.value=s),o(a)},(a,s)=>{a.length?o(new wo(a,s)):i(s)}))}validateSync(t,n){let r=this.resolve(Object.assign({},n,{value:t})),i;return r._validate(t,Object.assign({},n,{sync:!0}),(o,a)=>{throw wo.isError(o)&&(o.value=a),o},(o,a)=>{if(o.length)throw new wo(o,t);i=a}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(wo.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(wo.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):up(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Nd({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Nd({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=bl.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=bl.notNull){return this.nullability(!1,t)}required(t=bl.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=bl.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Nd(n),o=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(o||a.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=NJ(t).map(o=>new Zf(o));return i.forEach(o=>{o.isSibling&&r.deps.push(o.key)}),r.conditions.push(typeof n=="function"?new wx(i,n):wx.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Nd({message:t,name:"typeError",test(r){return!Is(r)&&!this.schema._typeCheck(r)?this.createError({params:{type:this.schema.type}}):!0}}),n}oneOf(t,n=bl.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Nd({message:n,name:"oneOf",skipAbsent:!0,test(i){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),r}notOneOf(t,n=bl.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Nd({message:n,name:"notOneOf",test(i){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:o,nullable:a}=n.spec;return{meta:i,label:r,optional:o,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,f)=>f.findIndex(d=>d.name===l.name)===u)}}}ma.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ma.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:o,schema:a}=hgt(this,t,n,r.context);return a[e](i&&i[o],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])ma.prototype[e]=ma.prototype.oneOf;for(const e of["not","nope"])ma.prototype[e]=ma.prototype.notOneOf;let ggt=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,mgt=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,vgt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,ygt=e=>Is(e)||e===e.trim(),bgt={}.toString();function Cx(){return new BJ}class BJ extends ma{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===bgt?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||bl.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Na.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Na.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Na.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,o;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:o}=n:i=n),this.test({name:o||"matches",message:i||Na.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=Na.email){return this.matches(ggt,{name:"email",message:t,excludeEmptyString:!0})}url(t=Na.url){return this.matches(mgt,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Na.uuid){return this.matches(vgt,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Na.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:ygt})}lowercase(t=Na.lowercase){return this.transform(n=>Is(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Is(n)||n===n.toLowerCase()})}uppercase(t=Na.uppercase){return this.transform(n=>Is(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Is(n)||n===n.toUpperCase()})}}Cx.prototype=BJ.prototype;let _gt=e=>e!=+e;function jJ(){return new zJ}class zJ extends ma{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!_gt(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)?i:parseFloat(i)})})}min(t,n=mu.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=mu.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=mu.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=mu.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=mu.positive){return this.moreThan(0,t)}negative(t=mu.negative){return this.lessThan(0,t)}integer(t=mu.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>Is(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>Is(i)?i:Math[t](i))}}jJ.prototype=zJ.prototype;var xgt=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function wgt(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=xgt.exec(e)){for(var o=0,a;a=t[o];++o)i[a]=+i[a]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let Sgt=new Date(""),Cgt=e=>Object.prototype.toString.call(e)==="[object Date]";class wC extends ma{constructor(){super({type:"date",check(t){return Cgt(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)?t:(t=wgt(t),isNaN(t)?wC.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Zf.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=D$.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=D$.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}wC.INVALID_DATE=Sgt;wC.prototype;function Egt(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([a,s])=>`${a}-${s}`));function o(a,s){let l=lf.split(a)[0];r.add(l),i.has(`${s}-${l}`)||n.push([s,l])}for(const a of Object.keys(e)){let s=e[a];r.add(a),Zf.isRef(s)&&s.isSibling?o(s.path,a):xC(s)&&"deps"in s&&s.deps.forEach(l=>o(l,a))}return ogt.array(Array.from(r),n).reverse()}function W6(e,t){let n=1/0;return e.some((r,i)=>{var o;if((o=t.path)!=null&&o.includes(r))return n=i,!0}),n}function UJ(e){return(t,n)=>W6(e,t)-W6(e,n)}const KJ=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function r_(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=r_(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=r_(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(r_)}):"optional"in e?e.optional():e}const kgt=(e,t)=>{const n=[...lf.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=lf.getter(lf.join(n),!0)(e);return!!(i&&r in i)};let V6=e=>Object.prototype.toString.call(e)==="[object Object]";function Tgt(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Rgt=UJ([]);function gP(e){return new WJ(e)}class WJ extends ma{constructor(t){super({type:"object",check(n){return V6(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Rgt,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let o=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(d=>!this._nodes.includes(d))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),f=!1;for(const d of s){let p=o[d],g=d in i;if(p){let v,y=i[d];u.path=(n.path?`${n.path}.`:"")+d,p=p.resolve({value:y,context:n.context,parent:l});let w=p instanceof ma?p.spec:void 0,b=w==null?void 0:w.strict;if(w!=null&&w.strip){f=f||d in i;continue}v=!n.__validating||!b?p.cast(i[d],u):i[d],v!==void 0&&(l[d]=v)}else g&&!a&&(l[d]=i[d]);(g!==d in l||l[d]!==i[d])&&(f=!0)}return f?l:i}_validate(t,n={},r,i){let{from:o=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,u)=>{if(!s||!V6(u)){i(l,u);return}a=a||u;let f=[];for(let d of this._nodes){let p=this.fields[d];!p||Zf.isRef(p)||f.push(p.asNestedTest({options:n,key:d,parent:u,parentPath:n.path,originalParent:a}))}this.runTests({tests:f,value:u,originalValue:a,options:n},r,d=>{i(d.sort(this._sortErrors).concat(l),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,o]of Object.entries(this.fields)){const a=r[i];r[i]=a===void 0?o:a}return n.withMutation(i=>i.setFields(r,this._excludedEdges))}_getDefault(){if("default"in this.spec)return super._getDefault();if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]=r&&"getDefault"in r?r.getDefault():void 0}),t}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=Egt(t,n),r._sortErrors=UJ(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return r_(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n)}omit(t){const n=Object.assign({},this.fields);for(const r of t)delete n[r];return this.setFields(n)}from(t,n,r){let i=lf.getter(t,!0);return this.transform(o=>{if(!o)return o;let a=o;return kgt(o,t)&&(a=Object.assign({},o),r||delete a[t],a[n]=i(o)),a})}json(){return this.transform(KJ)}noUnknown(t=!0,n=P$.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const o=Tgt(this.schema,i);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=P$.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(WT.camelCase)}snakeCase(){return this.transformKeys(WT.snakeCase)}constantCase(){return this.transformKeys(t=>WT.snakeCase(t).toUpperCase())}describe(t){let n=super.describe(t);n.fields={};for(const[i,o]of Object.entries(this.fields)){var r;let a=t;(r=a)!=null&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),n.fields[i]=o.describe(a)}return n}}gP.prototype=WJ.prototype;function VJ(e){return new HJ(e)}class HJ extends ma{constructor(t){super({type:"array",check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const o=r.map((a,s)=>{const l=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return l!==a&&(i=!0),l});return i?o:r}_validate(t,n={},r,i){var o;let a=this.innerType,s=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,u)=>{var f;if(!s||!a||!this._typeCheck(u)){i(l,u);return}let d=new Array(u.length);for(let g=0;g<u.length;g++){var p;d[g]=a.asNestedTest({options:n,index:g,parent:u,parentPath:n.path,originalParent:(p=n.originalValue)!=null?p:t})}this.runTests({value:u,tests:d,originalValue:(f=n.originalValue)!=null?f:t,options:n},r,g=>i(g.concat(l),u))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(KJ)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!xC(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+uf(t));return n.innerType=t,n}length(t,n=n_.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||n_.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||n_.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,o)=>!t(r,i,o):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){let n=super.describe(t);if(this.innerType){var r;let i=t;(r=i)!=null&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=this.innerType.describe(t)}return n}}VJ.prototype=HJ.prototype;var mP={},Agt=vn;Object.defineProperty(mP,"__esModule",{value:!0});var qJ=mP.default=void 0,$gt=Agt(yn()),Ogt=S,Igt=(0,$gt.default)((0,Ogt.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");qJ=mP.default=Igt;function Dgt(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Pgt=Dgt;function Lgt(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var Mgt=Lgt,Fgt=QD,Ngt=Mgt;function Bgt(e,t){return t.length<2?e:Fgt(e,Ngt(t,0,-1))}var jgt=Bgt,zgt=pC,Ugt=Pgt,Kgt=jgt,Wgt=Zy;function Vgt(e,t){return t=zgt(t,e),e=Kgt(e,t),e==null||delete e[Wgt(Ugt(t))]}var Hgt=Vgt,qgt=CZ;function Ggt(e){return qgt(e)?void 0:e}var Ygt=Ggt,H6=Dh,Xgt=lC,Zgt=Ca,q6=H6?H6.isConcatSpreadable:void 0;function Jgt(e){return Zgt(e)||Xgt(e)||!!(q6&&e&&e[q6])}var Qgt=Jgt,emt=YD,tmt=Qgt;function GJ(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=tmt),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?GJ(s,t-1,n,r,i):emt(i,s):r||(i[i.length]=s)}return i}var nmt=GJ,rmt=nmt;function imt(e){var t=e==null?0:e.length;return t?rmt(e,1):[]}var omt=imt,amt=omt,smt=AZ,lmt=$Z;function umt(e){return lmt(smt(e,void 0,amt),e+"")}var cmt=umt,fmt=GD,dmt=DJ,pmt=Hgt,hmt=pC,gmt=Bh,mmt=Ygt,vmt=cmt,ymt=AJ,bmt=1,_mt=2,xmt=4,wmt=vmt(function(e,t){var n={};if(e==null)return n;var r=!1;t=fmt(t,function(o){return o=hmt(o,e),r||(r=o.length>1),o}),gmt(e,ymt(e),n),r&&(n=dmt(n,bmt|_mt|xmt,mmt));for(var i=t.length;i--;)pmt(n,t[i]);return n}),Smt=wmt;const _b=_i(Smt);function i_(e){const{checked:t,description:n,disabled:r,hasError:i,id:o,inputProps:a,label:s,onChange:l,tooltip:u}=e;return S.jsx(jh,{description:n,hasError:i,id:o,label:s,tooltip:u,children:S.jsx(Cmt,{name:o,disabled:r,edge:"end",onChange:l,checked:t,inputProps:a})})}const Cmt=Me(e=>S.jsx(GRe,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...e}))(({theme:e})=>{const t=e.palette.mode==="dark";return{width:40,height:24,padding:0,"& .MuiSwitch-switchBase":{margin:0,padding:"4px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:oI[500],opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-disabled .MuiSwitch-thumb":{color:t?e.palette.grey[600]:e.palette.grey[100]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t?.3:.7}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:16,height:16,boxShadow:"unset"},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:e.palette.grey[400],opacity:1,transition:e.transitions.create(["background-color"],{duration:500})}}}),Zv={enter:"Enter",backspace:"Backspace"},Emt={ime:229},kmt=Me(F2)(({theme:e,size:t})=>`
|
|
490
|
+
`+(s!==a?`result of cast: ${s}`:""))}return o}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,o)=>o.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r,i){let{path:o,originalValue:a=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:o,value:l,originalValue:a,options:n,tests:u},r,f=>{if(f.length)return i(f,l);this.runTests({path:o,value:l,originalValue:a,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:o,value:a,originalValue:s,path:l,options:u}=t,f=y=>{i||(i=!0,n(y,a))},d=y=>{i||(i=!0,r(y,a))},p=o.length,g=[];if(!p)return d([]);let v={value:a,originalValue:s,path:l,options:u,schema:this};for(let y=0;y<o.length;y++){const w=o[y];w(v,f,function(x){x&&(g=g.concat(x)),--p<=0&&d(g)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:o,options:a}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let u=r[s];const f=Object.assign({},a,{strict:!0,parent:r,value:u,originalValue:o[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${i||""}[${u?s:`"${s}"`}]`:(i?`${i}.`:"")+t});return(d,p,g)=>this.resolve(f)._validate(u,f,p,g)}validate(t,n){let r=this.resolve(Object.assign({},n,{value:t}));return new Promise((i,o)=>r._validate(t,n,(a,s)=>{wo.isError(a)&&(a.value=s),o(a)},(a,s)=>{a.length?o(new wo(a,s)):i(s)}))}validateSync(t,n){let r=this.resolve(Object.assign({},n,{value:t})),i;return r._validate(t,Object.assign({},n,{sync:!0}),(o,a)=>{throw wo.isError(o)&&(o.value=a),o},(o,a)=>{if(o.length)throw new wo(o,t);i=a}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(wo.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(wo.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):up(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Nd({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Nd({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=bl.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=bl.notNull){return this.nullability(!1,t)}required(t=bl.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=bl.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Nd(n),o=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(o||a.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=NJ(t).map(o=>new Zf(o));return i.forEach(o=>{o.isSibling&&r.deps.push(o.key)}),r.conditions.push(typeof n=="function"?new wx(i,n):wx.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Nd({message:t,name:"typeError",test(r){return!Is(r)&&!this.schema._typeCheck(r)?this.createError({params:{type:this.schema.type}}):!0}}),n}oneOf(t,n=bl.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Nd({message:n,name:"oneOf",skipAbsent:!0,test(i){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),r}notOneOf(t,n=bl.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Nd({message:n,name:"notOneOf",test(i){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:o,nullable:a}=n.spec;return{meta:i,label:r,optional:o,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,f)=>f.findIndex(d=>d.name===l.name)===u)}}}ma.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ma.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:o,schema:a}=ggt(this,t,n,r.context);return a[e](i&&i[o],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])ma.prototype[e]=ma.prototype.oneOf;for(const e of["not","nope"])ma.prototype[e]=ma.prototype.notOneOf;let mgt=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,vgt=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,ygt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,bgt=e=>Is(e)||e===e.trim(),_gt={}.toString();function Cx(){return new BJ}class BJ extends ma{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===_gt?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||bl.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Na.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Na.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Na.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,o;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:o}=n:i=n),this.test({name:o||"matches",message:i||Na.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=Na.email){return this.matches(mgt,{name:"email",message:t,excludeEmptyString:!0})}url(t=Na.url){return this.matches(vgt,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Na.uuid){return this.matches(ygt,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Na.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:bgt})}lowercase(t=Na.lowercase){return this.transform(n=>Is(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Is(n)||n===n.toLowerCase()})}uppercase(t=Na.uppercase){return this.transform(n=>Is(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Is(n)||n===n.toUpperCase()})}}Cx.prototype=BJ.prototype;let xgt=e=>e!=+e;function jJ(){return new zJ}class zJ extends ma{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!xgt(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)?i:parseFloat(i)})})}min(t,n=mu.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=mu.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=mu.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return r<this.resolve(t)}})}moreThan(t,n=mu.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(r){return r>this.resolve(t)}})}positive(t=mu.positive){return this.moreThan(0,t)}negative(t=mu.negative){return this.lessThan(0,t)}integer(t=mu.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>Is(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>Is(i)?i:Math[t](i))}}jJ.prototype=zJ.prototype;var wgt=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Sgt(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=wgt.exec(e)){for(var o=0,a;a=t[o];++o)i[a]=+i[a]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let Cgt=new Date(""),Egt=e=>Object.prototype.toString.call(e)==="[object Date]";class wC extends ma{constructor(){super({type:"date",check(t){return Egt(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)?t:(t=Sgt(t),isNaN(t)?wC.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Zf.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=D$.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=D$.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}wC.INVALID_DATE=Cgt;wC.prototype;function kgt(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([a,s])=>`${a}-${s}`));function o(a,s){let l=lf.split(a)[0];r.add(l),i.has(`${s}-${l}`)||n.push([s,l])}for(const a of Object.keys(e)){let s=e[a];r.add(a),Zf.isRef(s)&&s.isSibling?o(s.path,a):xC(s)&&"deps"in s&&s.deps.forEach(l=>o(l,a))}return agt.array(Array.from(r),n).reverse()}function W6(e,t){let n=1/0;return e.some((r,i)=>{var o;if((o=t.path)!=null&&o.includes(r))return n=i,!0}),n}function UJ(e){return(t,n)=>W6(e,t)-W6(e,n)}const KJ=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function r_(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=r_(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=r_(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(r_)}):"optional"in e?e.optional():e}const Tgt=(e,t)=>{const n=[...lf.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=lf.getter(lf.join(n),!0)(e);return!!(i&&r in i)};let V6=e=>Object.prototype.toString.call(e)==="[object Object]";function Rgt(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Agt=UJ([]);function gP(e){return new WJ(e)}class WJ extends ma{constructor(t){super({type:"object",check(n){return V6(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Agt,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let o=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(d=>!this._nodes.includes(d))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),f=!1;for(const d of s){let p=o[d],g=d in i;if(p){let v,y=i[d];u.path=(n.path?`${n.path}.`:"")+d,p=p.resolve({value:y,context:n.context,parent:l});let w=p instanceof ma?p.spec:void 0,b=w==null?void 0:w.strict;if(w!=null&&w.strip){f=f||d in i;continue}v=!n.__validating||!b?p.cast(i[d],u):i[d],v!==void 0&&(l[d]=v)}else g&&!a&&(l[d]=i[d]);(g!==d in l||l[d]!==i[d])&&(f=!0)}return f?l:i}_validate(t,n={},r,i){let{from:o=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(l,u)=>{if(!s||!V6(u)){i(l,u);return}a=a||u;let f=[];for(let d of this._nodes){let p=this.fields[d];!p||Zf.isRef(p)||f.push(p.asNestedTest({options:n,key:d,parent:u,parentPath:n.path,originalParent:a}))}this.runTests({tests:f,value:u,originalValue:a,options:n},r,d=>{i(d.sort(this._sortErrors).concat(l),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,o]of Object.entries(this.fields)){const a=r[i];r[i]=a===void 0?o:a}return n.withMutation(i=>i.setFields(r,this._excludedEdges))}_getDefault(){if("default"in this.spec)return super._getDefault();if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]=r&&"getDefault"in r?r.getDefault():void 0}),t}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=kgt(t,n),r._sortErrors=UJ(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return r_(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n)}omit(t){const n=Object.assign({},this.fields);for(const r of t)delete n[r];return this.setFields(n)}from(t,n,r){let i=lf.getter(t,!0);return this.transform(o=>{if(!o)return o;let a=o;return Tgt(o,t)&&(a=Object.assign({},o),r||delete a[t],a[n]=i(o)),a})}json(){return this.transform(KJ)}noUnknown(t=!0,n=P$.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const o=Rgt(this.schema,i);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=P$.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(WT.camelCase)}snakeCase(){return this.transformKeys(WT.snakeCase)}constantCase(){return this.transformKeys(t=>WT.snakeCase(t).toUpperCase())}describe(t){let n=super.describe(t);n.fields={};for(const[i,o]of Object.entries(this.fields)){var r;let a=t;(r=a)!=null&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),n.fields[i]=o.describe(a)}return n}}gP.prototype=WJ.prototype;function VJ(e){return new HJ(e)}class HJ extends ma{constructor(t){super({type:"array",check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const o=r.map((a,s)=>{const l=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return l!==a&&(i=!0),l});return i?o:r}_validate(t,n={},r,i){var o;let a=this.innerType,s=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(l,u)=>{var f;if(!s||!a||!this._typeCheck(u)){i(l,u);return}let d=new Array(u.length);for(let g=0;g<u.length;g++){var p;d[g]=a.asNestedTest({options:n,index:g,parent:u,parentPath:n.path,originalParent:(p=n.originalValue)!=null?p:t})}this.runTests({value:u,tests:d,originalValue:(f=n.originalValue)!=null?f:t,options:n},r,g=>i(g.concat(l),u))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(KJ)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!xC(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+uf(t));return n.innerType=t,n}length(t,n=n_.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||n_.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||n_.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,o)=>!t(r,i,o):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){let n=super.describe(t);if(this.innerType){var r;let i=t;(r=i)!=null&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=this.innerType.describe(t)}return n}}VJ.prototype=HJ.prototype;var mP={},$gt=vn;Object.defineProperty(mP,"__esModule",{value:!0});var qJ=mP.default=void 0,Ogt=$gt(yn()),Igt=S,Dgt=(0,Ogt.default)((0,Igt.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");qJ=mP.default=Dgt;function Pgt(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Lgt=Pgt;function Mgt(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var Fgt=Mgt,Ngt=QD,Bgt=Fgt;function jgt(e,t){return t.length<2?e:Ngt(e,Bgt(t,0,-1))}var zgt=jgt,Ugt=pC,Kgt=Lgt,Wgt=zgt,Vgt=Zy;function Hgt(e,t){return t=Ugt(t,e),e=Wgt(e,t),e==null||delete e[Vgt(Kgt(t))]}var qgt=Hgt,Ggt=CZ;function Ygt(e){return Ggt(e)?void 0:e}var Xgt=Ygt,H6=Dh,Zgt=lC,Jgt=Ca,q6=H6?H6.isConcatSpreadable:void 0;function Qgt(e){return Jgt(e)||Zgt(e)||!!(q6&&e&&e[q6])}var emt=Qgt,tmt=YD,nmt=emt;function GJ(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=nmt),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?GJ(s,t-1,n,r,i):tmt(i,s):r||(i[i.length]=s)}return i}var rmt=GJ,imt=rmt;function omt(e){var t=e==null?0:e.length;return t?imt(e,1):[]}var amt=omt,smt=amt,lmt=AZ,umt=$Z;function cmt(e){return umt(lmt(e,void 0,smt),e+"")}var fmt=cmt,dmt=GD,pmt=DJ,hmt=qgt,gmt=pC,mmt=Bh,vmt=Xgt,ymt=fmt,bmt=AJ,_mt=1,xmt=2,wmt=4,Smt=ymt(function(e,t){var n={};if(e==null)return n;var r=!1;t=dmt(t,function(o){return o=gmt(o,e),r||(r=o.length>1),o}),mmt(e,bmt(e),n),r&&(n=pmt(n,_mt|xmt|wmt,vmt));for(var i=t.length;i--;)hmt(n,t[i]);return n}),Cmt=Smt;const _b=_i(Cmt);function i_(e){const{checked:t,description:n,disabled:r,hasError:i,id:o,inputProps:a,label:s,onChange:l,tooltip:u}=e;return S.jsx(jh,{description:n,hasError:i,id:o,label:s,tooltip:u,children:S.jsx(Emt,{name:o,disabled:r,edge:"end",onChange:l,checked:t,inputProps:a})})}const Emt=Me(e=>S.jsx(GRe,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...e}))(({theme:e})=>{const t=e.palette.mode==="dark";return{width:40,height:24,padding:0,"& .MuiSwitch-switchBase":{margin:0,padding:"4px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:oI[500],opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-disabled .MuiSwitch-thumb":{color:t?e.palette.grey[600]:e.palette.grey[100]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t?.3:.7}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:16,height:16,boxShadow:"unset"},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:e.palette.grey[400],opacity:1,transition:e.transitions.create(["background-color"],{duration:500})}}}),Zv={enter:"Enter",backspace:"Backspace"},kmt={ime:229},Tmt=Me(F2)(({theme:e,size:t})=>`
|
|
491
491
|
max-width: 100%;
|
|
492
492
|
margin: 2px 4px;
|
|
493
493
|
height: ${t==="small"?"26px":"32px"};
|
|
@@ -502,12 +502,12 @@ attempted value: ${a}
|
|
|
502
502
|
background-color: ${e.palette.primary.light};
|
|
503
503
|
color: ${e.palette.primary.contrastText};
|
|
504
504
|
}
|
|
505
|
-
`),
|
|
505
|
+
`),Rmt={ChipStyled:Tmt},G6=e=>{const{className:t,index:n,onDelete:r,disabled:i,onEdit:o,isEditing:a,disableEdition:s,...l}=e,u=p=>{p.key===Zv.enter&&r(n)},f=p=>{var g,v;(g=p==null?void 0:p.preventDefault)==null||g.call(p),(v=p==null?void 0:p.stopPropagation)==null||v.call(p),r(n)},d=p=>{p.target.textContent===l.label&&(i||o(n))};return S.jsx(Rmt.ChipStyled,{className:`MuiChipsInput-Chip ${a?"MuiChipsInput-Chip-Editing":""} ${t||""}`,onKeyDown:u,disabled:i,onDoubleClick:s?void 0:d,tabIndex:i?-1:0,"aria-disabled":i,onDelete:f,...l})};function Amt(e){return typeof e=="boolean"}function $mt(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}function Omt(e,t){typeof t=="function"?t(e):t&&$mt(t)&&"current"in t&&(t.current=e)}const Imt=Me("div")`
|
|
506
506
|
top: 50%;
|
|
507
507
|
transform: translateY(-50%);
|
|
508
508
|
right: 10px;
|
|
509
509
|
position: absolute;
|
|
510
|
-
`,
|
|
510
|
+
`,Dmt=Me(lS)(e=>{var t;return`
|
|
511
511
|
max-width: 100%;
|
|
512
512
|
|
|
513
513
|
.MuiInputBase-root {
|
|
@@ -529,7 +529,7 @@ attempted value: ${a}
|
|
|
529
529
|
align-self: center;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
`}),
|
|
532
|
+
`}),Pmt=Me(F2)(({theme:e,size:t})=>`
|
|
533
533
|
max-width: 100%;
|
|
534
534
|
margin: 2px 4px;
|
|
535
535
|
height: ${t==="small"?"26px":"32px"};
|
|
@@ -538,6 +538,6 @@ attempted value: ${a}
|
|
|
538
538
|
color: ${e.palette.action.disabled};
|
|
539
539
|
cursor: default;
|
|
540
540
|
}
|
|
541
|
-
`),Y6={ChipStyled:
|
|
542
|
-
${i.name} instead.`:`Provider not specified, using ${i.name} instead.`}),l=cP({initialValues:e,validationSchema:t,enableReinitialize:!0,onSubmit:async()=>{}});T.useEffect(()=>{r(g=>({...g,prompt:{...g.prompt,settings:l.values}}))},[l.values]);const u=g=>{r(v=>vx(PJ(v),{prompt:{provider:g.target.value}}))},f=()=>{var g,v;return i.is_chat&&!((g=n.prompt)!=null&&g.messages)?`${i.name} is message-based. This prompt will be wrapped in a message before being sent to ${i.name}.`:!i.is_chat&&((v=n.prompt)!=null&&v.messages)?`${i.name} is prompt-based. The messages will converted to a single prompt before being sent to ${i.name}.`:void 0};return S.jsxs(at,{width:250,sx:{height:"inherit"},children:[S.jsx(Yt,{fontSize:"16px",fontWeight:600,color:"text.primary",children:"Settings"}),S.jsxs(Ht,{spacing:2,sx:{overflowY:"auto",overflowX:"hidden",height:"100%"},children:[S.jsx(zh,{items:o==null?void 0:o.map(g=>({label:g.name,value:g.id})),id:"llm-providers",value:i.id,label:"LLM Provider",tooltip:f(),onChange:u}),s,i.inputs.map((g,v)=>S.jsx(at,{sx:{paddingBottom:v===i.inputs.length-1?2:0},children:S.jsx(ZJ,{element:{...g,id:g.id,value:l.values[g.id],onChange:y=>{l.handleChange(y)},setField:(y,w,b)=>{l.setFieldValue(y,w,b)}}})},g.id))]})]})},X6=()=>{var s,l;const e=Ct(ts),{provider:t}=vP(e);if(!t)return null;const n={},r=((s=e==null?void 0:e.prompt)==null?void 0:s.settings)||{},i=((l=e==null?void 0:e.originalPrompt)==null?void 0:l.settings)||{},o=(u,f)=>{var d;return f.type==="select"?!!((d=f==null?void 0:f.items)!=null&&d.find(p=>p.value===u)):!0},a=gP(t.inputs.reduce((u,f)=>{const d=r[f.id]!==void 0?r[f.id]:i[f.id];switch(d!==void 0&&o(d,f)?n[f.id]=d:f.initial!==void 0&&(n[f.id]=f.initial),f.type){case"select":u[f.id]=Cx();break;case"slider":{let p=jJ();f.min&&(p=p.min(f.min)),f.max&&(p=p.max(f.max)),u[f.id]=p;break}case"tags":u[f.id]=VJ().of(Cx());break}return u},{}));return S.jsx(jmt,{schema:a,settings:n})};function zmt({isSmallScreen:e,isDrawerOpen:t,toggleDrawer:n}){return e?S.jsxs(lV,{sx:{"& .MuiDrawer-paper":{}},variant:"persistent",anchor:"right",open:t,children:[S.jsx(at,{sx:{display:"flex",justifyContent:"flex-end",pt:2,pr:1},children:S.jsx(or,{onClick:n,children:S.jsx(qJ,{})})}),S.jsx(at,{px:3,children:S.jsx(X6,{})})]}):S.jsx(at,{ml:"32px !important",height:"100%",children:S.jsx(X6,{})})}function Umt({onSubmit:e}){const[t,n]=T.useState(),r=Ct(Df),[i,o]=ir(ts),a=Ct(cS),s=async()=>{try{const{provider:l}=vP(i),u=NZ.cloneDeep(i.prompt);u.provider=l.id;const f=new AbortController;n(f),o(d=>d!=null&&d.prompt?{...d,prompt:{...d.prompt,completion:""}}:d),await OS.getCompletion(u,a,f,r,(d,p)=>{if(e&&e(),d){n(void 0);return}o(g=>{var v;return g!=null&&g.prompt?{...g,prompt:{...g.prompt,completion:(((v=g.prompt)==null?void 0:v.completion)||"")+p}}:g})})}catch{n(void 0)}};return t?S.jsx(Oy,{onClick:()=>{t.abort(),n(void 0)},children:"Cancel"}):S.jsx(Gu,{id:"submit-prompt",variant:"outlined",onClick:s,children:"Submit"})}function JJ(){var y,w;const[e,t]=ir(ts),{data:n,error:r,mutate:i}=bh("/project/llm-providers"),[o,a]=T.useState(0),[s,l]=J2(!1),u=T.useRef(null),f=Xn(),d=aS(b=>b.breakpoints.down("md"));T.useEffect(()=>{e!=null&&e.prompt&&i()},[e==null?void 0:e.prompt]),T.useEffect(()=>{n&&t(b=>({...b,providers:n.providers}))},[n]);const p=()=>{e&&(t(b=>({...b,prompt:b.originalPrompt})),a(b=>b+1))},g=()=>{t(b=>({...b,prompt:void 0}))};if(!(e!=null&&e.prompt))return null;const v=(y=e==null?void 0:e.prompt)!=null&&y.messages?e.prompt.messages.every(b=>typeof b.template=="string"):typeof((w=e==null?void 0:e.prompt)==null?void 0:w.template)=="string";return S.jsxs(mh,{open:!!e.prompt,fullScreen:!0,PaperProps:{style:{backgroundColor:f.palette.background.default,backgroundImage:"none"}},onClose:g,id:"playground","aria-labelledby":"playground","aria-describedby":"playground",children:[S.jsx(by,{sx:{display:"flex",flexDirection:"column"},children:S.jsx(Tst,{hasTemplate:v,isSmallScreen:d,toggleDrawer:l,handleClose:g})}),S.jsx(vh,{sx:{display:"flex",direction:"row",padding:3},children:S.jsxs(dG,{prefix:"Prompt Playground error",children:[S.jsxs(Ht,{gap:3,width:"100%",children:[r?S.jsx(ro,{severity:"error",children:"An error occurred while fetching providers settings"}):null,S.jsxs(Ht,{direction:"row",spacing:1.5,sx:{overflowY:"auto",paddingBottom:2,height:"100%"},children:[S.jsx(rrt,{}),S.jsx(ert,{restoredTime:o,hasTemplate:v,prompt:e.prompt}),S.jsx(nrt,{ref:u,restoredTime:o,hasTemplate:v,prompt:e.prompt})]})]}),S.jsx(zmt,{isSmallScreen:d,isDrawerOpen:s,toggleDrawer:l})]})}),S.jsxs(Wje,{children:[S.jsx(yi,{title:"Restore original",children:S.jsx(or,{onClick:p,children:S.jsx(fG,{})})}),S.jsx(Umt,{onSubmit:()=>{u!=null&&u.current&&(u.current.scrollTop=u.current.scrollHeight)}})]})]})}function Kmt(){const{id:e}=R9(),{data:t,error:n}=bh(e?`/project/conversation/${e}`:null);if(!t||n)return null;const r=t.elements,i=[];return S.jsxs(at,{display:"flex",flexGrow:1,width:"100%",overflow:"scroll",children:[S.jsx(JJ,{}),S.jsxs(Nq,{children:[S.jsx(at,{my:1}),S.jsx(cG,{actions:i,elements:r,messages:t.messages})]})]})}var yP={},Wmt=vn;Object.defineProperty(yP,"__esModule",{value:!0});var QJ=yP.default=void 0,Vmt=Wmt(yn()),Hmt=S,qmt=(0,Vmt.default)((0,Hmt.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");QJ=yP.default=qmt;const Gmt=e=>S.jsx(V_,{...e,viewBox:"0 0 98 96",children:S.jsx("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z"})});function Ymt({href:e}){return e?S.jsx(yi,{title:"See on Github",children:S.jsx(or,{color:"inherit",href:e,target:"_blank",children:S.jsx(Gmt,{})})}):null}function Xmt(){var n;const{user:e}=sc(),t=Xn();return e?S.jsx(hA,{sx:{width:32,height:32},src:e.picture||void 0,children:(n=e.name)==null?void 0:n[0]}):S.jsx(at,{color:t.palette.mode==="dark"?"text.primary":"primary.main",children:S.jsx(hA,{sx:{width:32,height:32,bgcolor:"transparent",color:"inherit"}})})}var bP={},Zmt=vn;Object.defineProperty(bP,"__esModule",{value:!0});var eQ=bP.default=void 0,Jmt=Zmt(yn()),Qmt=S,evt=(0,Jmt.default)((0,Qmt.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04L21 10zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}),"Key");eQ=bP.default=evt;var _P={},tvt=vn;Object.defineProperty(_P,"__esModule",{value:!0});var tQ=_P.default=void 0,nvt=tvt(yn()),rvt=S,ivt=(0,nvt.default)((0,rvt.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"}),"Logout");tQ=_P.default=ivt;var xP={},ovt=vn;Object.defineProperty(xP,"__esModule",{value:!0});var nQ=xP.default=void 0,avt=ovt(yn()),svt=S,lvt=(0,avt.default)((0,svt.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");nQ=xP.default=lvt;function uvt({anchorEl:e,open:t,handleClose:n}){var v,y;const{user:r,logout:i}=sc(),o=Ct(ya),a=gn(Hs),s=!!((y=(v=o==null?void 0:o.project)==null?void 0:v.user_env)!=null&&y.length),p=[r&&S.jsxs(iv,{sx:{display:"flex",flexDirection:"column"},children:[S.jsx(Yt,{width:"100%",fontSize:"14px",fontWeight:700,children:r.name}),S.jsx(Yt,{width:"100%",fontSize:"13px",fontWeight:400,children:r.email})]},"user-name"),S.jsxs(ov,{onClick:()=>{a(w=>({...w,open:!0})),n()},children:[S.jsx(xp,{children:S.jsx(nQ,{fontSize:"small"})}),S.jsx(Wb,{children:"Settings"}),S.jsx(Yt,{variant:"body2",color:"text.secondary",children:"S"})]},"settings"),s&&S.jsxs(ov,{component:ey,to:"/env",children:[S.jsx(xp,{children:S.jsx(eQ,{fontSize:"small"})}),"API keys"]},"env"),r&&S.jsxs(ov,{onClick:()=>{i({logoutParams:{returnTo:window.location.origin}}),n()},children:[S.jsx(xp,{children:S.jsx(tQ,{fontSize:"small"})}),"Logout"]},"logout")].filter(w=>!!w),g=p.reduce((w,b,x)=>x===p.length-1?[...w,b]:[...w,b,S.jsx(jCe,{sx:{my:1}},`divider-${x}`)],[]);return S.jsx(xy,{anchorEl:e,id:"account-menu",open:t,onClose:n,PaperProps:{sx:{width:220,overflow:"visible",mt:1.5,backgroundImage:"none",border:w=>`1px solid ${w.palette.divider}`,boxShadow:w=>w.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D","& .MuiAvatar-root":{width:32,height:32,ml:-.5,mr:1},"&:before":{content:'""',display:"block",position:"absolute",top:0,right:14,width:10,height:10,bgcolor:"background.default",transform:"translateY(-50%) rotate(45deg)",zIndex:0}}},transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},children:g})}function cvt(){const[e,t]=T.useState(null),n=!!e,r=o=>{t(o.currentTarget)},i=()=>{t(null)};return S.jsxs("div",{children:[S.jsx(or,{edge:"end",onClick:r,size:"small","aria-controls":n?"account-menu":void 0,"aria-haspopup":"true","aria-expanded":n?"true":void 0,children:S.jsx(Xmt,{})}),S.jsx(uvt,{open:n,anchorEl:e,handleClose:i})]})}var wP={},fvt=vn;Object.defineProperty(wP,"__esModule",{value:!0});var SP=wP.default=void 0,dvt=fvt(yn()),pvt=S,hvt=(0,dvt.default)((0,pvt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");SP=wP.default=hvt;const CP=Yn({key:"Actions",default:[]});function gvt(){const e=gn(kS),t=gn(mS),n=gn(eI),r=gn(tI),i=gn(CP),o=gn(nI),a=gn(Bq),s=Bb(Ay),l=Bb(xI),u=Bb(KV),f=Ct(uc);return()=>{f==null||f.socket.emit("clear_session"),f==null||f.socket.disconnect(),u(),f==null||f.socket.connect(),e([]),t([]),n([]),r([]),i([]),o(void 0),a(0),s(),l()}}function mvt(){const e=Zu(),[t,n]=T.useState(!1),r=gvt(),i=()=>{n(!0)},o=()=>{n(!1)},a=()=>{r(),e("/"),o()};return S.jsxs(at,{children:[S.jsx(Gu,{id:"new-chat-button",variant:"outlined",onClick:i,startIcon:S.jsx(SP,{}),children:"New Chat"}),S.jsxs(mh,{open:t,onClose:o,id:"new-chat-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:[S.jsx(by,{id:"alert-dialog-title",children:"Create a new chat?"}),S.jsx(vh,{children:S.jsx(oV,{id:"alert-dialog-description",children:"This will clear the current messages and start a new chat."})}),S.jsxs(oS,{sx:{p:2},children:[S.jsx(Oy,{onClick:o,children:"Cancel"}),S.jsx(Gu,{id:"confirm",variant:"outlined",onClick:a,autoFocus:!0,children:"Confirm"})]})]})]})}function vvt({to:e,label:t}){return S.jsx(Oy,{component:ey,to:e,children:t},e)}function yvt({to:e,label:t}){return S.jsx(If,{component:ey,to:e,sx:{textTransform:"none",color:"text.secondary","&:hover":{background:"transparent"}},children:t},e)}function bvt({hasDb:e,hasReadme:t}){const n=sh(),r=Xn(),[i,o]=T.useState(!1),a=T.useRef();let s;i&&a.current&&(s=a.current);const l=aS(r.breakpoints.down("md")),u=[{to:"/",label:"Chat"}];e&&u.push({to:"/dataset",label:"History"}),t&&u.push({to:"/readme",label:"Readme"});const f=S.jsx(Ht,{direction:l?"column":"row",spacing:1,children:u.map(d=>{const p=n.pathname===d.to;return S.jsx("div",{children:p?S.jsx(vvt,{...d}):S.jsx(yvt,{...d})},d.to)})});return l?S.jsxs(S.Fragment,{children:[S.jsx(or,{ref:a,edge:"start","aria-label":"open nav",onClick:()=>o(!0),children:S.jsx(QJ,{})}),S.jsx(xy,{autoFocus:!0,anchorEl:s,open:i,onClose:()=>o(!1),PaperProps:{sx:{p:1,backgroundImage:"none",mt:-2,ml:-1,overflow:"visible",overflowY:"auto",border:d=>`1px solid ${d.palette.divider}`,boxShadow:d=>d.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:f})]}):f}function rQ(){var t,n;const e=Ct(ya);return S.jsx(kwe,{elevation:0,color:"transparent",position:"static",children:S.jsxs(UAe,{sx:{minHeight:"60px !important",borderBottomWidth:"1px",borderBottomStyle:"solid",background:r=>r.palette.background.paper,borderBottomColor:r=>r.palette.divider},children:[S.jsx(Ht,{alignItems:"center",direction:"row",children:S.jsx(bvt,{hasDb:!!((t=e==null?void 0:e.project)!=null&&t.database),hasReadme:!!(e!=null&&e.markdown)})}),S.jsxs(Ht,{alignItems:"center",sx:{ml:"auto"},direction:"row",spacing:1,color:"text.primary",children:[S.jsx(mvt,{}),S.jsx(at,{ml:1}),S.jsx(Ymt,{href:(n=e==null?void 0:e.ui)==null?void 0:n.github}),S.jsx(cvt,{})]})]})})}const e0=({children:e})=>{var d;const{isProjectMember:t,authenticating:n,isAuthenticated:r,accessToken:i,role:o}=sc(),a=Ct(ya),s=Ct(cS),l=Zu(),u=a&&!((d=a.project)!=null&&d.public);if(T.useEffect(()=>{var p,g;if((p=a==null?void 0:a.project)!=null&&p.user_env)for(const v of((g=a.project)==null?void 0:g.user_env)||[])s[v]||l("/env");u&&!r&&!n&&l("/login")},[a,r,n,s]),!a||u&&(!i||!o))return null;const f=u&&o&&!t;return S.jsxs(at,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:[S.jsx(rQ,{}),f?S.jsx(ro,{severity:"error",children:"You are not part of this project."}):e]})},SC=Yn({key:"DatasetFilters",default:{}});function _vt(){const e=Ct(V2),[t,n]=ir(SC),{data:r,isLoading:i}=bh("/project/members");if(!i||!r||e==="USER")return null;const o=[{value:"All",label:"All"},...r.map(s=>({value:s.email,label:s.email}))],a=s=>{const l=s.target.value;n({...t,authorEmail:l==="All"?void 0:l})};return S.jsx(at,{sx:{width:200},children:S.jsx(zh,{items:o,id:"author-filter-select",value:t.authorEmail||"All",label:"Author",onChange:a})})}const xvt=[{value:0,label:"All"},{value:1,label:"Good"},{value:-1,label:"Bad"}];function wvt(){const[e,t]=ir(SC),n=r=>{t({...e,feedback:parseInt(r.target.value)})};return S.jsx(at,{sx:{width:120},children:S.jsx(zh,{items:xvt,id:"feedback-filter-select",value:e.feedback||0,label:"Feedback",onChange:n})})}var Svt=rs,Cvt=function(){return Svt.Date.now()},Evt=Cvt,kvt=/\s/;function Tvt(e){for(var t=e.length;t--&&kvt.test(e.charAt(t)););return t}var Rvt=Tvt,Avt=Rvt,$vt=/^\s+/;function Ovt(e){return e&&e.slice(0,Avt(e)+1).replace($vt,"")}var Ivt=Ovt,Dvt=Ivt,Z6=is,Pvt=dC,J6=0/0,Lvt=/^[-+]0x[0-9a-f]+$/i,Mvt=/^0b[01]+$/i,Fvt=/^0o[0-7]+$/i,Nvt=parseInt;function Bvt(e){if(typeof e=="number")return e;if(Pvt(e))return J6;if(Z6(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Z6(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Dvt(e);var n=Mvt.test(e);return n||Fvt.test(e)?Nvt(e.slice(2),n?2:8):Lvt.test(e)?J6:+e}var jvt=Bvt,zvt=is,VT=Evt,Q6=jvt,Uvt="Expected a function",Kvt=Math.max,Wvt=Math.min;function Vvt(e,t,n){var r,i,o,a,s,l,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(Uvt);t=Q6(t)||0,zvt(n)&&(f=!!n.leading,d="maxWait"in n,o=d?Kvt(Q6(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p);function g(A){var O=r,z=i;return r=i=void 0,u=A,a=e.apply(z,O),a}function v(A){return u=A,s=setTimeout(b,t),f?g(A):a}function y(A){var O=A-l,z=A-u,V=t-O;return d?Wvt(V,o-z):V}function w(A){var O=A-l,z=A-u;return l===void 0||O>=t||O<0||d&&z>=o}function b(){var A=VT();if(w(A))return x(A);s=setTimeout(b,y(A))}function x(A){return s=void 0,p&&r?g(A):(r=i=void 0,a)}function C(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function k(){return s===void 0?a:x(VT())}function R(){var A=VT(),O=w(A);if(r=arguments,i=this,l=A,O){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(b,t),g(l)}return s===void 0&&(s=setTimeout(b,t)),a}return R.cancel=C,R.flush=k,R}var Hvt=Vvt;const qvt=_i(Hvt);var EP={},Gvt=vn;Object.defineProperty(EP,"__esModule",{value:!0});var iQ=EP.default=void 0,Yvt=Gvt(yn()),Xvt=S,Zvt=(0,Yvt.default)((0,Xvt.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");iQ=EP.default=Zvt;const Jvt=Me("div")(({theme:e})=>({position:"relative",color:e.palette.text.primary,borderRadius:e.shape.borderRadius,border:`${e.palette.divider} solid 1px`,"&:hover":{border:`${e.palette.primary} solid 1px !important`},marginLeft:0,display:"flex",[e.breakpoints.up("sm")]:{width:"auto"}})),eU=Me("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center"})),Qvt=Me(rS)(({theme:e})=>({color:"inherit","& .MuiInputBase-input":{padding:e.spacing(1,1,1,0),paddingLeft:`calc(1em + ${e.spacing(3)})`,transition:e.transitions.create("width"),width:"100%",[e.breakpoints.up("md")]:{width:"20ch"}}}));function eyt(){const[e,t]=ir(SC),r=qvt(a=>{a=a.trim(),t({...e,search:a===""?void 0:a})},300),i=T.useRef(),o=()=>{r(""),i.current&&(i.current.value="")};return S.jsxs(Jvt,{children:[S.jsx(eU,{sx:{position:"absolute",pointerEvents:"none",height:"100%",paddingX:1},children:S.jsx(iQ,{})}),S.jsx(Qvt,{placeholder:"Search messages...",inputProps:{"aria-label":"search",ref:i},onChange:a=>r(a.target.value)}),S.jsx(eU,{children:S.jsx(or,{onClick:o,children:S.jsx(yh,{})})})]})}function tyt(){return S.jsxs(Ht,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[S.jsx(eyt,{}),S.jsxs(Ht,{direction:"row",alignItems:"center",spacing:2,children:[S.jsx(wvt,{}),S.jsx(_vt,{})]})]})}var nyt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},oQ={};let ua;typeof window<"u"?ua=window:typeof self<"u"?ua=self:ua=nyt;let M$=null,F$=null;const tU=20,HT=ua.clearTimeout,nU=ua.setTimeout,qT=ua.cancelAnimationFrame||ua.mozCancelAnimationFrame||ua.webkitCancelAnimationFrame,rU=ua.requestAnimationFrame||ua.mozRequestAnimationFrame||ua.webkitRequestAnimationFrame;qT==null||rU==null?(M$=HT,F$=function(t){return nU(t,tU)}):(M$=function([t,n]){qT(t),HT(n)},F$=function(t){const n=rU(function(){HT(r),t()}),r=nU(function(){qT(n),t()},tU);return[n,r]});function ryt(e){let t,n,r,i,o,a,s;const l=typeof document<"u"&&document.attachEvent;if(!l){a=function(b){const x=b.__resizeTriggers__,C=x.firstElementChild,k=x.lastElementChild,R=C.firstElementChild;k.scrollLeft=k.scrollWidth,k.scrollTop=k.scrollHeight,R.style.width=C.offsetWidth+1+"px",R.style.height=C.offsetHeight+1+"px",C.scrollLeft=C.scrollWidth,C.scrollTop=C.scrollHeight},o=function(b){return b.offsetWidth!==b.__resizeLast__.width||b.offsetHeight!==b.__resizeLast__.height},s=function(b){if(b.target.className&&typeof b.target.className.indexOf=="function"&&b.target.className.indexOf("contract-trigger")<0&&b.target.className.indexOf("expand-trigger")<0)return;const x=this;a(this),this.__resizeRAF__&&M$(this.__resizeRAF__),this.__resizeRAF__=F$(function(){o(x)&&(x.__resizeLast__.width=x.offsetWidth,x.__resizeLast__.height=x.offsetHeight,x.__resizeListeners__.forEach(function(R){R.call(x,b)}))})};let p=!1,g="";r="animationstart";const v="Webkit Moz O ms".split(" ");let y="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),w="";{const b=document.createElement("fakeelement");if(b.style.animationName!==void 0&&(p=!0),p===!1){for(let x=0;x<v.length;x++)if(b.style[v[x]+"AnimationName"]!==void 0){w=v[x],g="-"+w.toLowerCase()+"-",r=y[x],p=!0;break}}}n="resizeanim",t="@"+g+"keyframes "+n+" { from { opacity: 0; } to { opacity: 0; } } ",i=g+"animation: 1ms "+n+"; "}const u=function(p){if(!p.getElementById("detectElementResize")){const g=(t||"")+".resize-triggers { "+(i||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',v=p.head||p.getElementsByTagName("head")[0],y=p.createElement("style");y.id="detectElementResize",y.type="text/css",e!=null&&y.setAttribute("nonce",e),y.styleSheet?y.styleSheet.cssText=g:y.appendChild(p.createTextNode(g)),v.appendChild(y)}};return{addResizeListener:function(p,g){if(l)p.attachEvent("onresize",g);else{if(!p.__resizeTriggers__){const v=p.ownerDocument,y=ua.getComputedStyle(p);y&&y.position==="static"&&(p.style.position="relative"),u(v),p.__resizeLast__={},p.__resizeListeners__=[],(p.__resizeTriggers__=v.createElement("div")).className="resize-triggers";const w=v.createElement("div");w.className="expand-trigger",w.appendChild(v.createElement("div"));const b=v.createElement("div");b.className="contract-trigger",p.__resizeTriggers__.appendChild(w),p.__resizeTriggers__.appendChild(b),p.appendChild(p.__resizeTriggers__),a(p),p.addEventListener("scroll",s,!0),r&&(p.__resizeTriggers__.__animationListener__=function(C){C.animationName===n&&a(p)},p.__resizeTriggers__.addEventListener(r,p.__resizeTriggers__.__animationListener__))}p.__resizeListeners__.push(g)}},removeResizeListener:function(p,g){if(l)p.detachEvent("onresize",g);else if(p.__resizeListeners__.splice(p.__resizeListeners__.indexOf(g),1),!p.__resizeListeners__.length){p.removeEventListener("scroll",s,!0),p.__resizeTriggers__.__animationListener__&&(p.__resizeTriggers__.removeEventListener(r,p.__resizeTriggers__.__animationListener__),p.__resizeTriggers__.__animationListener__=null);try{p.__resizeTriggers__=!p.removeChild(p.__resizeTriggers__)}catch{}}}}}oQ={createDetectElementResize:ryt};class aQ extends T.Component{constructor(){super(...arguments);ds(this,"state",{height:this.props.defaultHeight||0,width:this.props.defaultWidth||0});ds(this,"_parentNode",null);ds(this,"_autoSizer",null);ds(this,"_detectElementResize",null);ds(this,"_onResize",()=>{const{disableHeight:n,disableWidth:r,onResize:i}=this.props;if(this._parentNode){const o=this._parentNode.getBoundingClientRect(),a=o.height||0,s=o.width||0,l=window.getComputedStyle(this._parentNode)||{},u=parseInt(l.paddingLeft,10)||0,f=parseInt(l.paddingRight,10)||0,d=parseInt(l.paddingTop,10)||0,p=parseInt(l.paddingBottom,10)||0,g=a-d-p,v=s-u-f;(!n&&this.state.height!==g||!r&&this.state.width!==v)&&(this.setState({height:a-d-p,width:s-u-f}),typeof i=="function"&&i({height:a,width:s}))}});ds(this,"_setRef",n=>{this._autoSizer=n})}componentDidMount(){const{nonce:n}=this.props;if(this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement){this._parentNode=this._autoSizer.parentNode;const r=(0,oQ.createDetectElementResize)(n);r.addResizeListener(this._parentNode,this._onResize),this._detectElementResize=r,this._onResize()}}componentWillUnmount(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}render(){const{children:n,defaultHeight:r,defaultWidth:i,disableHeight:o,disableWidth:a,nonce:s,onResize:l,style:u,tagName:f="div",...d}=this.props,{height:p,width:g}=this.state,v={overflow:"visible"},y={};let w=!1;return o||(p===0&&(w=!0),v.height=0,y.height=p),a||(g===0&&(w=!0),v.width=0,y.width=g),T.createElement(f,{ref:this._setRef,style:{...v,...u},...d},!w&&n(y))}}ds(aQ,"defaultProps",{onResize:()=>{},disableHeight:!1,disableWidth:!1,style:{}});var iyt=aQ,iU=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function oyt(e,t){return!!(e===t||iU(e)&&iU(t))}function ayt(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!oyt(e[n],t[n]))return!1;return!0}function GT(e,t){t===void 0&&(t=ayt);var n,r=[],i,o=!1;function a(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return o&&n===this&&t(s,r)||(i=e.apply(this,s),o=!0,n=this,r=s),i}return a}var syt=typeof performance=="object"&&typeof performance.now=="function",oU=syt?function(){return performance.now()}:function(){return Date.now()};function aU(e){cancelAnimationFrame(e.id)}function lyt(e,t){var n=oU();function r(){oU()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var YT=-1;function sU(e){if(e===void 0&&(e=!1),YT===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),YT=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return YT}var Bd=null;function lU(e){if(e===void 0&&(e=!1),Bd===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Bd="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Bd="negative":Bd="positive-ascending"),document.body.removeChild(t),Bd}return Bd}var uyt=150,cyt=function(t,n){return t};function fyt(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return t=function(d){D2(p,d);function p(v){var y;return y=d.call(this,v)||this,y._instanceProps=l(y.props,G_(y)),y._outerRef=void 0,y._resetIsScrollingTimeoutId=null,y.state={instance:G_(y),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof y.props.initialScrollOffset=="number"?y.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},y._callOnItemsRendered=void 0,y._callOnItemsRendered=GT(function(w,b,x,C){return y.props.onItemsRendered({overscanStartIndex:w,overscanStopIndex:b,visibleStartIndex:x,visibleStopIndex:C})}),y._callOnScroll=void 0,y._callOnScroll=GT(function(w,b,x){return y.props.onScroll({scrollDirection:w,scrollOffset:b,scrollUpdateWasRequested:x})}),y._getItemStyle=void 0,y._getItemStyle=function(w){var b=y.props,x=b.direction,C=b.itemSize,k=b.layout,R=y._getItemStyleCache(u&&C,u&&k,u&&x),A;if(R.hasOwnProperty(w))A=R[w];else{var O=n(y.props,w,y._instanceProps),z=i(y.props,w,y._instanceProps),V=x==="horizontal"||k==="horizontal",D=x==="rtl",W=V?O:0;R[w]=A={position:"absolute",left:D?void 0:W,right:D?W:void 0,top:V?0:O,height:V?"100%":z,width:V?z:"100%"}}return A},y._getItemStyleCache=void 0,y._getItemStyleCache=GT(function(w,b,x){return{}}),y._onScrollHorizontal=function(w){var b=w.currentTarget,x=b.clientWidth,C=b.scrollLeft,k=b.scrollWidth;y.setState(function(R){if(R.scrollOffset===C)return null;var A=y.props.direction,O=C;if(A==="rtl")switch(lU()){case"negative":O=-C;break;case"positive-descending":O=k-x-C;break}return O=Math.max(0,Math.min(O,k-x)),{isScrolling:!0,scrollDirection:R.scrollOffset<C?"forward":"backward",scrollOffset:O,scrollUpdateWasRequested:!1}},y._resetIsScrollingDebounced)},y._onScrollVertical=function(w){var b=w.currentTarget,x=b.clientHeight,C=b.scrollHeight,k=b.scrollTop;y.setState(function(R){if(R.scrollOffset===k)return null;var A=Math.max(0,Math.min(k,C-x));return{isScrolling:!0,scrollDirection:R.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},y._resetIsScrollingDebounced)},y._outerRefSetter=function(w){var b=y.props.outerRef;y._outerRef=w,typeof b=="function"?b(w):b!=null&&typeof b=="object"&&b.hasOwnProperty("current")&&(b.current=w)},y._resetIsScrollingDebounced=function(){y._resetIsScrollingTimeoutId!==null&&aU(y._resetIsScrollingTimeoutId),y._resetIsScrollingTimeoutId=lyt(y._resetIsScrolling,uyt)},y._resetIsScrolling=function(){y._resetIsScrollingTimeoutId=null,y.setState({isScrolling:!1},function(){y._getItemStyleCache(-1,null)})},y}p.getDerivedStateFromProps=function(y,w){return dyt(y,w),f(y),null};var g=p.prototype;return g.scrollTo=function(y){y=Math.max(0,y),this.setState(function(w){return w.scrollOffset===y?null:{scrollDirection:w.scrollOffset<y?"forward":"backward",scrollOffset:y,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(y,w){w===void 0&&(w="auto");var b=this.props,x=b.itemCount,C=b.layout,k=this.state.scrollOffset;y=Math.max(0,Math.min(y,x-1));var R=0;if(this._outerRef){var A=this._outerRef;C==="vertical"?R=A.scrollWidth>A.clientWidth?sU():0:R=A.scrollHeight>A.clientHeight?sU():0}this.scrollTo(o(this.props,y,w,k,this._instanceProps,R))},g.componentDidMount=function(){var y=this.props,w=y.direction,b=y.initialScrollOffset,x=y.layout;if(typeof b=="number"&&this._outerRef!=null){var C=this._outerRef;w==="horizontal"||x==="horizontal"?C.scrollLeft=b:C.scrollTop=b}this._callPropsCallbacks()},g.componentDidUpdate=function(){var y=this.props,w=y.direction,b=y.layout,x=this.state,C=x.scrollOffset,k=x.scrollUpdateWasRequested;if(k&&this._outerRef!=null){var R=this._outerRef;if(w==="horizontal"||b==="horizontal")if(w==="rtl")switch(lU()){case"negative":R.scrollLeft=-C;break;case"positive-ascending":R.scrollLeft=C;break;default:var A=R.clientWidth,O=R.scrollWidth;R.scrollLeft=O-A-C;break}else R.scrollLeft=C;else R.scrollTop=C}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&aU(this._resetIsScrollingTimeoutId)},g.render=function(){var y=this.props,w=y.children,b=y.className,x=y.direction,C=y.height,k=y.innerRef,R=y.innerElementType,A=y.innerTagName,O=y.itemCount,z=y.itemData,V=y.itemKey,D=V===void 0?cyt:V,W=y.layout,ie=y.outerElementType,se=y.outerTagName,K=y.style,G=y.useIsScrolling,Q=y.width,le=this.state.isScrolling,Z=x==="horizontal"||W==="horizontal",ee=Z?this._onScrollHorizontal:this._onScrollVertical,P=this._getRangeToRender(),ge=P[0],B=P[1],L=[];if(O>0)for(var ae=ge;ae<=B;ae++)L.push(T.createElement(w,{data:z,key:D(ae,z),index:ae,isScrolling:G?le:void 0,style:this._getItemStyle(ae)}));var ue=r(this.props,this._instanceProps);return T.createElement(ie||se||"div",{className:b,onScroll:ee,ref:this._outerRefSetter,style:M({position:"relative",height:C,width:Q,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},K)},T.createElement(R||A||"div",{children:L,ref:k,style:{height:Z?"100%":ue,pointerEvents:le?"none":void 0,width:Z?ue:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var y=this.props.itemCount;if(y>0){var w=this._getRangeToRender(),b=w[0],x=w[1],C=w[2],k=w[3];this._callOnItemsRendered(b,x,C,k)}}if(typeof this.props.onScroll=="function"){var R=this.state,A=R.scrollDirection,O=R.scrollOffset,z=R.scrollUpdateWasRequested;this._callOnScroll(A,O,z)}},g._getRangeToRender=function(){var y=this.props,w=y.itemCount,b=y.overscanCount,x=this.state,C=x.isScrolling,k=x.scrollDirection,R=x.scrollOffset;if(w===0)return[0,0,0,0];var A=a(this.props,R,this._instanceProps),O=s(this.props,A,R,this._instanceProps),z=!C||k==="backward"?Math.max(1,b):1,V=!C||k==="forward"?Math.max(1,b):1;return[Math.max(0,A-z),Math.max(0,Math.min(w-1,O+V)),A,O]},p}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var dyt=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},pyt=fyt({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,i,o,a){var s=t.direction,l=t.height,u=t.itemCount,f=t.itemSize,d=t.layout,p=t.width,g=s==="horizontal"||d==="horizontal",v=g?p:l,y=Math.max(0,u*f-v),w=Math.min(y,n*f),b=Math.max(0,n*f-v+f+a);switch(r==="smart"&&(i>=b-v&&i<=w+v?r="auto":r="center"),r){case"start":return w;case"end":return b;case"center":{var x=Math.round(b+(w-b)/2);return x<Math.ceil(v/2)?0:x>y+Math.floor(v/2)?y:x}case"auto":default:return i>=b&&i<=w?i:i<b?b:w}},getStartIndexForOffset:function(t,n){var r=t.itemCount,i=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/i)))},getStopIndexForStartIndex:function(t,n,r){var i=t.direction,o=t.height,a=t.itemCount,s=t.itemSize,l=t.layout,u=t.width,f=i==="horizontal"||l==="horizontal",d=n*s,p=f?u:o,g=Math.ceil((p+r-d)/s);return Math.max(0,Math.min(a-1,n+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function hyt(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,r=e.startIndex,i=e.stopIndex;return!(r>n||i<t)}function gyt(e){for(var t=e.isItemLoaded,n=e.itemCount,r=e.minimumBatchSize,i=e.startIndex,o=e.stopIndex,a=[],s=null,l=null,u=i;u<=o;u++){var f=t(u);f?l!==null&&(a.push(s,l),s=l=null):(l=u,s===null&&(s=u))}if(l!==null){for(var d=Math.min(Math.max(l,s+r-1),n-1),p=l+1;p<=d&&!t(p);p++)l=p;a.push(s,l)}if(a.length)for(;a[1]-a[0]+1<r&&a[0]>0;){var g=a[0]-1;if(!t(g))a[0]=g;else break}return a}var myt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},vyt=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),yyt=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},uU=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},byt=function(e){yyt(t,e);function t(){var n,r,i,o;myt(this,t);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return o=(r=(i=uU(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(s))),i),i._lastRenderedStartIndex=-1,i._lastRenderedStopIndex=-1,i._memoizedUnloadedRanges=[],i._onItemsRendered=function(u){var f=u.visibleStartIndex,d=u.visibleStopIndex;i._lastRenderedStartIndex=f,i._lastRenderedStopIndex=d,i._ensureRowsLoaded(f,d)},i._setRef=function(u){i._listRef=u},r),uU(i,o)}return vyt(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,i){var o=this.props,a=o.isItemLoaded,s=o.itemCount,l=o.minimumBatchSize,u=l===void 0?10:l,f=o.threshold,d=f===void 0?15:f,p=gyt({isItemLoaded:a,itemCount:s,minimumBatchSize:u,startIndex:Math.max(0,r-d),stopIndex:Math.min(s-1,i+d)});(this._memoizedUnloadedRanges.length!==p.length||this._memoizedUnloadedRanges.some(function(g,v){return p[v]!==g}))&&(this._memoizedUnloadedRanges=p,this._loadUnloadedRanges(p))}},{key:"_loadUnloadedRanges",value:function(r){for(var i=this,o=this.props.loadMoreItems||this.props.loadMoreRows,a=function(u){var f=r[u],d=r[u+1],p=o(f,d);p!=null&&p.then(function(){if(hyt({lastRenderedStartIndex:i._lastRenderedStartIndex,lastRenderedStopIndex:i._lastRenderedStopIndex,startIndex:f,stopIndex:d})){if(i._listRef==null)return;typeof i._listRef.resetAfterIndex=="function"?i._listRef.resetAfterIndex(f,!0):(typeof i._listRef._getItemStyleCache=="function"&&i._listRef._getItemStyleCache(-1),i._listRef.forceUpdate())}})},s=0;s<r.length;s+=2)a(s)}}]),t}(T.PureComponent),kP={},_yt=vn;Object.defineProperty(kP,"__esModule",{value:!0});var sQ=kP.default=void 0,xyt=_yt(yn()),wyt=S,Syt=(0,xyt.default)((0,wyt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");sQ=kP.default=Syt;function Cyt({conversationId:e,onDelete:t}){const[n,r]=T.useState(!1),i=Ct(Df),o=()=>{r(!0)},a=()=>{r(!1)},s=async()=>{await pv.promise(OS.deleteConversation(e,i),{loading:"Deleting conversation...",success:"Conversation deleted!",error:l=>l instanceof kA?S.jsx("span",{children:l.message}):S.jsx("span",{})}),t(),a()};return S.jsxs("div",{children:[S.jsx(or,{className:"delete-conversation-button",size:"small",color:"error",onClick:o,children:S.jsx(sQ,{})}),n&&S.jsxs(mh,{open:n,onClose:a,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",PaperProps:{sx:{backgroundImage:"none"}},children:[S.jsx(by,{id:"alert-dialog-title",children:"Delete conversation?"}),S.jsx(vh,{children:S.jsx(oV,{id:"alert-dialog-description",children:"This will delete the conversation as well as it's messages and elements."})}),S.jsxs(oS,{sx:{color:"text.secondary",p:2},children:[S.jsx(If,{variant:"outlined",color:"inherit",onClick:a,children:"Cancel"}),S.jsx(RS,{variant:"outlined",color:"primary",onClick:s,autoFocus:!0,children:"Confirm"})]})]})]})}var TP={},Eyt=vn;Object.defineProperty(TP,"__esModule",{value:!0});var lQ=TP.default=void 0,kyt=Eyt(yn()),Tyt=S,Ryt=(0,kyt.default)((0,Tyt.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility");lQ=TP.default=Ryt;function Ayt({conversationId:e}){return S.jsx(or,{className:"open-conversation-button",component:ey,to:`/conversations/${e}`,size:"small",color:"primary",children:S.jsx(lQ,{})})}const $yt=30,Oyt=e=>{const t={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"};return new Date(e).toLocaleDateString(void 0,t)};function Iyt(){const e=Ct(SC),t=Ct(Df),[n,r]=T.useState([]),[i,o]=T.useState(),[a,s]=T.useState(void 0),[l,u]=T.useState(!0),f=T.useCallback(async x=>{try{const{pageInfo:C,data:k}=await OS.getConversations({first:$yt,cursor:x},e,t);o(C),s(void 0),r(R=>[...R,...k])}catch(C){C instanceof Error&&s(C.message)}finally{u(!1)}},[t,e]),d=T.useCallback(async()=>{r([]),u(!0),o(void 0),f(void 0)},[f]);T.useEffect(()=>{d()},[d]);const p=T.useCallback(()=>{i!=null&&i.hasNextPage&&f(i.endCursor)},[i,f]);if(a)return S.jsx(ro,{severity:"error",children:a.message});if(l)return S.jsx(Yt,{color:"text.primary",children:"Loading..."});const g=n.length;if(g===0)return S.jsx(ro,{severity:"info",children:"No result"});const v={Id:{minWidth:"60px",width:"5%"},Author:{minWidth:"130px",width:"25%"},Input:{minWidth:"200px",width:"35%"},Date:{minWidth:"120px",width:"25%"},Actions:{minWidth:"80px",width:"10%"}},y=({text:x,col:C})=>S.jsx(Yt,{noWrap:!0,sx:{width:C.width,minWidth:C.minWidth,fontSize:"0.875rem"},color:"text.primary",children:x}),w=({index:x,style:C})=>{var R,A;const k=n[x];return S.jsxs(at,{className:"conversation-row",style:C,sx:{display:"flex",alignItems:"center",borderBottom:O=>`1px solid ${O.palette.divider}`},children:[S.jsx(y,{text:k.id,col:v.Id}),S.jsx(y,{text:((R=k.author)==null?void 0:R.email)||"LocalUser",col:v.Author}),S.jsx(y,{text:(A=k.messages[0])==null?void 0:A.content,col:v.Input}),S.jsx(y,{text:Oyt(k.createdAt),col:v.Date}),S.jsxs(Ht,{direction:"row",sx:{width:v.Actions.width,minWidth:v.Actions.minWidth},children:[S.jsx(Ayt,{conversationId:k.id}),S.jsx(Cyt,{conversationId:k.id,onDelete:()=>d()})]})]})},b=Object.entries(v).map(([x,C])=>S.jsx(Yt,{sx:{fontSize:"0.875rem",width:C.width,minWidth:C.minWidth},color:"primary",children:x},x));return S.jsxs(at,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[S.jsx(at,{sx:{display:"flex",alignItems:"center",height:"40px",borderBottom:x=>`1px solid ${x.palette.divider}`},children:b}),S.jsx(at,{flexGrow:1,children:S.jsx(iyt,{children:({height:x,width:C})=>S.jsx(byt,{isItemLoaded:k=>!!n[k],itemCount:i!=null&&i.hasNextPage?g+1:g,loadMoreItems:p,children:({onItemsRendered:k,ref:R})=>S.jsx(pyt,{height:x,width:C,itemSize:55,itemCount:g,onItemsRendered:k,ref:R,children:w})})})})]})}function Dyt(){return S.jsxs(at,{display:"flex",flexDirection:"column",width:"100%",maxWidth:"60rem",mx:"auto",flexGrow:1,children:[S.jsx(at,{my:2}),S.jsx(tyt,{}),S.jsx(at,{my:2}),S.jsx(Iyt,{})]})}function Pyt(){return S.jsx(e0,{children:S.jsx(Dyt,{})})}function Lyt(){const e=Zu();return ir(Hs),Ty(),T.useState("Platform"),e&&e("/"),S.jsx(S.Fragment,{})}function Myt(){return S.jsx(e0,{children:S.jsx(bBe,{})})}function Fyt(){const[e,t]=ir(cS),n=Ct(ya),r=Zu(),i=(n==null?void 0:n.project.user_env)||[],o={},a={};i.forEach(f=>{o[f]=e[f]||"",a[f]=Cx().required()});const s=gP(a),l=cP({initialValues:o,validationSchema:s,onSubmit:async f=>{localStorage.setItem("userEnv",JSON.stringify(f)),t(f),gi.success("Saved successfully"),r("/")}});i.length===0&&r("/");const u=f=>{const d=!!l.errors[f];return S.jsx(L$,{id:f,className:f,label:f,value:l.values[f],size:"medium",hasError:d,description:d?l.errors[f]:"",onChange:p=>l.setFieldValue(f,p.target.value)})};return S.jsxs(at,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[S.jsx(rQ,{}),S.jsxs(at,{id:"env",display:"flex",flexDirection:"column",flexGrow:1,gap:2,sx:{maxWidth:"60rem",width:"100%",mx:"auto"},children:[S.jsx(Yt,{mt:5,fontSize:"18px",fontWeight:700,color:"text.primary",children:"Required API keys"}),S.jsx(ro,{severity:"info",children:"To use this app, the following API keys are required. The keys are stored on your device's local storage."}),S.jsxs("form",{onSubmit:l.handleSubmit,children:[i.map(f=>u(f)),S.jsx(If,{id:"submit-env",fullWidth:!0,type:"submit",variant:"contained",sx:{mt:1},children:"Save"})]})]})]})}const Nyt=({status:e})=>e==="running"?S.jsx(at,{sx:{marginTop:"-2px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:_t[700]},children:S.jsx(B2,{color:"inherit",size:18})}):S.jsxs(V_,{width:24,height:24,sx:{marginTop:"-2px",fill:"none"},children:[e==="done"&&S.jsxs(S.Fragment,{children:[S.jsx("circle",{cx:12,cy:12,r:9,fill:oI[500]}),S.jsx("path",{stroke:Tl,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m15.333 9.5-4.583 4.583L8.667 12"})]}),e==="ready"&&S.jsx("circle",{cx:12,cy:12,r:8.25,stroke:_t[700],strokeWidth:1.5}),e==="failed"&&S.jsxs(S.Fragment,{children:[S.jsx("circle",{cx:12,cy:12,r:9,fill:As[500]}),S.jsx("path",{stroke:Tl,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m14.5 9.5-5 5m0-5 5 5"})]})]}),cU=({index:e,task:t})=>{const n=gn(zq),r=Xn();return S.jsx(iv,{disableGutters:!0,className:`task task-status-${t.status}`,children:S.jsxs(Ake,{disableRipple:!t.forId,sx:{color:{ready:r.palette.mode==="dark"?_t[300]:_t[700],running:r.palette.mode==="dark"?_t[100]:_t[850],done:_t[500],failed:_t[500]}[t.status]||r.palette.text.secondary,fontWeight:t.status==="running"?"700":"500",alignItems:"flex-start",fontSize:"14px",lineHeight:1.36,cursor:t.forId?"pointer":"default"},onClick:()=>{if(t.forId){n(t.forId);const i=document.getElementById(`message-${t.forId}`);i&&i.scrollIntoView({behavior:"smooth",block:"start",inline:"start"})}},children:[S.jsx(at,{sx:{paddingRight:r.spacing(1),flex:"0 0 18px",width:"18px"},children:e}),S.jsx(Nyt,{status:t.status}),S.jsx(at,{sx:{paddingLeft:r.spacing(2)},children:t.title})]})})},fU=({status:e})=>{const t=Xn();return S.jsxs(at,{sx:{display:"flex",alignItems:"center",flexDirection:"row",padding:t.spacing(2)},children:[S.jsx(at,{sx:{flexGrow:"1",fontWeight:"600",paddingLeft:t.spacing(1)},children:"🗒️ Task List"}),S.jsx(F2,{label:e||"?",sx:{fontWeight:"500",borderRadius:"4px",backgroundColor:t.palette.background.default,color:t.palette.mode==="dark"?_t[500]:_t[600]}})]})},dU=e=>({background:e.palette.background.paper,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:"100%",display:"flex",flexDirection:"column",boxShadow:e.palette.mode==="dark"?"0px 4px 20px 0px rgba(0, 0, 0, 0.20)":"0px 4px 20px 0px rgba(0, 0, 0, 0.05)"});function pU({tasklist:e,isMobile:t}){const n=Xn();let r=null;try{e!=null&&e.content&&(r=JSON.parse(e.content))}catch(o){console.error(o),r=null}if(!r)return null;const i=r.tasks;if(t){let o=i.length-1;for(let s=0;s<i.length;s++)if(i[s].status==="running"||i[s].status==="ready"){o=s;break}const a=i==null?void 0:i[o];return S.jsx(at,{component:"aside",sx:{color:n.palette.text.primary,padding:n.spacing(2),width:"100%",boxSizing:"border-box",display:{xs:"flex",md:"none"}},className:"tasklist tasklist-mobile",children:S.jsxs(at,{sx:{...dU(n)},children:[S.jsx(fU,{status:r.status}),a&&S.jsx(Y_,{children:S.jsx(cU,{index:o+1,task:a})})]})})}return S.jsx(at,{component:"aside",sx:{color:n.palette.text.primary,padding:n.spacing(2),width:"380px",flexShrink:"0",display:{xs:"none",md:"flex"}},className:"tasklist tasklist-desktop",children:S.jsxs(at,{sx:{...dU(n)},children:[S.jsx(fU,{status:r==null?void 0:r.status}),S.jsx(at,{sx:{overflowY:"auto"},children:S.jsx(Y_,{children:i==null?void 0:i.map((o,a)=>S.jsx(cU,{index:a+1,task:o},a))})})]})})}const Byt="chat_history",jyt=e=>({setSelf:t,onSet:n})=>{const r=localStorage.getItem(e);r!=null&&t(JSON.parse(r)),n((i,o,a)=>{a?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(i))})},RP=Yn({key:"ChatHistory",default:{open:!1,messages:[]},effects:[jyt(Byt)]});function zyt(){const[e,t]=ir(Ry),n=Ct(uc);if(!e)return null;const r=()=>{t(!1),n==null||n.socket.emit("stop")};return S.jsx(at,{margin:"auto",children:S.jsx(sI,{id:"stop-button",startIcon:S.jsx(yh,{}),variant:"contained",onClick:r,children:"Stop task"})})}var AP={},Uyt=vn;Object.defineProperty(AP,"__esModule",{value:!0});var uQ=AP.default=void 0;Vyt(T);var Kyt=Uyt(yn()),Wyt=S;function cQ(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(cQ=function(r){return r?n:t})(e)}function Vyt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=cQ(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}var Hyt=(0,Kyt.default)((0,Wyt.jsx)("path",{d:"M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"}),"Telegram");uQ=AP.default=Hyt;var $P={},qyt=vn;Object.defineProperty($P,"__esModule",{value:!0});var fQ=$P.default=void 0,Gyt=qyt(yn()),hU=S,Yyt=(0,Gyt.default)([(0,hU.jsx)("path",{d:"M15 2h-3.5l-1-1h-5l-1 1H1v2h14zm1 7c-.7 0-1.37.1-2 .29V5H2v12c0 1.1.9 2 2 2h5.68c1.12 2.36 3.53 4 6.32 4 3.87 0 7-3.13 7-7s-3.13-7-7-7zm0 12c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"},"0"),(0,hU.jsx)("path",{d:"M16.5 12H15v5l3.6 2.1.8-1.2-2.9-1.7z"},"1")],"AutoDelete");fQ=$P.default=Yyt;var OP={},Xyt=vn;Object.defineProperty(OP,"__esModule",{value:!0});var dQ=OP.default=void 0,Zyt=Xyt(yn()),gU=S,Jyt=(0,Zyt.default)([(0,gU.jsx)("path",{d:"M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"},"0"),(0,gU.jsx)("path",{d:"m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"},"1")],"KeyboardDoubleArrowUp");dQ=OP.default=Jyt;function Qyt(e){const t={},n=PJ(e).reverse();return n==null||n.forEach(r=>{const{createdAt:i,content:o}=r,a={day:"numeric",month:"numeric",year:"numeric"},s=new Date(i).toLocaleDateString(void 0,a);t[s]||(t[s]=[]);const l={hour:"numeric",minute:"numeric"};t[s].push({key:i,hour:new Date(i).toLocaleTimeString(void 0,l),content:o})}),t}function e0t({onClick:e}){const[t,n]=ir(RP),r=T.useRef(),[i,o]=T.useState(null);t.open&&!i&&r.current&&o(r.current);const a=p=>n(g=>({...g,open:p})),s=S.jsxs(Ht,{disabled:!0,direction:"row",p:1,justifyContent:"space-between",alignItems:"center",children:[S.jsx(Yt,{color:"text.primary",sx:{fontSize:"14px",fontWeight:700},children:"Last messages"}),S.jsx(or,{onClick:()=>n(p=>({...p,messages:[]})),children:S.jsx(fQ,{})})]},"title"),l=(t==null?void 0:t.messages.length)===0?S.jsx("div",{id:"history-empty",disabled:!0,children:S.jsx(Yt,{color:"text.secondary",sx:{fontSize:"12px",fontWeight:700,padding:"16px 12px",textTransform:"uppercase"},children:"Such empty..."})},"empty"):null,u=t.messages?null:S.jsx("div",{id:"history-loading",disabled:!0,children:S.jsx(Yt,{color:"text.secondary",sx:{fontSize:"12px",fontWeight:700,padding:"16px 12px",textTransform:"uppercase"},children:"Loading..."})},"loading"),f=[s,l,u];if(t.messages){const p=Qyt(t.messages);Object.keys(p).forEach(g=>{f.push(S.jsx("div",{disabled:!0,children:S.jsx(Yt,{color:"text.primary",sx:{p:1,fontSize:"10px",fontWeight:700,color:_t[500]},children:g})},g));let v="";p[g].forEach(y=>{v!==y.content&&(v=y.content,f.push(S.jsx(ov,{className:"history-item",onClick:w=>{w.stopPropagation(),w.preventDefault(),a(!1),e(y.content)},disableRipple:!0,sx:{p:1,alignItems:"baseline",borderRadius:"4px"},children:S.jsx(Yt,{color:"text.primary",sx:{whiteSpace:"pre-wrap",fontSize:"14px",maxHeight:"50px",display:"-webkit-box",WebkitLineClamp:"2",WebkitBoxOrient:"vertical",flexGrow:0,overflow:"hidden",textOverflow:"ellipsis",lineHeight:"24px"},children:y.content})},y.key)))})})}const d=i?S.jsx(xy,{autoFocus:!0,anchorEl:i,open:t.open,onClose:()=>a(!1),PaperProps:{sx:{p:1,backgroundImage:"none",mt:-2,ml:-1,overflow:"visible",maxHeight:"314px",width:"334px",overflowY:"auto",border:p=>`1px solid ${p.palette.divider}`,boxShadow:p=>p.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:f}):null;return S.jsxs("div",{children:[d,S.jsx(yi,{title:"Show history",children:S.jsx(or,{color:"inherit",onClick:()=>a(!t.open),ref:r,children:S.jsx(dQ,{})})})]})}const t0t=({fileSpec:e,session:t})=>{const n=tG({spec:e,onResolved:a=>t==null?void 0:t.socket.emit("file_upload",a)});if(!n)return null;const{getRootProps:r,getInputProps:i,uploading:o}=n;return S.jsx(yi,{title:"Upload files",children:S.jsxs(RS,{id:o?"upload-button-loading":"upload-button",loading:o,sx:{minWidth:0,borderRadius:"50%"},color:"inherit",...r({className:"dropzone"}),children:[S.jsx("input",{...i()}),S.jsx(SP,{})]})})};function n0t(){const e=Ct(jq),t=Ct(uc);return!e||!t?null:S.jsx(t0t,{fileSpec:e,session:t})}function r0t(e){const t=e.querySelector("textarea");return t?t.value.split(`
|
|
543
|
-
`).length:0}const i0t=({onSubmit:e,onReply:t})=>{const n=T.useRef(null),r=gn(RP),[i,o]=ir(Ay),a=Ct(Ry),s=Ct(TS),l=Ct(uc),[u,f]=T.useState(""),[d,p]=T.useState(!1),v=!((l==null?void 0:l.socket)&&!(l!=null&&l.error))||a||(s==null?void 0:s.spec.type)==="file";T.useEffect(()=>{n.current&&!a&&!v&&n.current.focus()},[a,v]);const y=T.useCallback(()=>{u===""||v||(s?t(u):e(u),f(""))},[u,v,f,s,e]),w=()=>{p(!0)},b=()=>{p(!1)},x=T.useCallback(A=>{A.key==="Enter"&&!A.shiftKey?d||(A.preventDefault(),y()):A.key==="ArrowUp"&&r0t(A.currentTarget)<=1&&r(z=>({...z,open:!0}))},[y,r,d]),C=T.useCallback(A=>{n.current&&f(A)},[]),k=S.jsxs(S.Fragment,{children:[i.inputs.length>0&&S.jsx(or,{disabled:v,color:"inherit",onClick:()=>o(A=>({...A,open:!0})),children:S.jsx(qD,{})}),S.jsx(e0t,{onClick:C}),S.jsx(n0t,{})]}),R=S.jsx(or,{disabled:v,color:"inherit",onClick:()=>y(),children:S.jsx(uQ,{})});return S.jsx(lS,{inputRef:n,id:"chat-input",autoFocus:!0,multiline:!0,variant:"standard",autoComplete:"false",placeholder:"Type your message here...",disabled:v,onChange:A=>f(A.target.value),onKeyDown:x,onCompositionStart:w,onCompositionEnd:b,value:u,fullWidth:!0,InputProps:{disableUnderline:!0,startAdornment:S.jsx(PB,{sx:{ml:1,color:"text.secondary"},position:"start",children:k}),endAdornment:S.jsx(PB,{position:"end",sx:{mr:1,color:"text.secondary"},children:R})},sx:{backgroundColor:"background.paper",borderRadius:1,border:A=>`1px solid ${A.palette.divider}`,boxShadow:"box-shadow: 0px 2px 4px 0px #0000000D",textarea:{height:"34px",maxHeight:"30vh",overflowY:"auto !important",resize:"none",paddingBottom:"0.75rem",paddingTop:"0.75rem",color:"text.primary",lineHeight:"24px"}}})},o0t="/assets/logo_dark-bc7401f6.svg",a0t="/assets/logo_light-f19fc2ea.svg",s0t=({width:e,style:t})=>{const{theme:n}=Ct(Hs),r=n==="light"?a0t:o0t;return S.jsx("img",{src:r,style:t,width:e||40})};function l0t(){return S.jsx(Ht,{mx:"auto",children:S.jsxs("a",{href:"https://github.com/Chainlit/chainlit",target:"_blank",style:{display:"flex",alignItems:"center",textDecoration:"none"},children:[S.jsx(Yt,{fontSize:"12px",color:"text.secondary",children:"Built with"}),S.jsx(s0t,{width:65,style:{filter:"grayscale(1)",marginLeft:"4px"}})]})})}function u0t({onSubmit:e,onReply:t}){return S.jsxs(at,{display:"flex",flexDirection:"column",gap:1,py:2,sx:{boxSizing:"border-box",width:"100%",maxWidth:"60rem",m:"auto",justifyContent:"center"},children:[S.jsx(zyt,{}),S.jsx(at,{children:S.jsx(i0t,{onSubmit:e,onReply:t})}),S.jsx(l0t,{})]})}var c0t=sC,f0t=JZ,d0t=ZZ;function p0t(e,t){var n={};return t=d0t(t),f0t(e,function(r,i,o){c0t(n,i,t(r,i,o))}),n}var h0t=p0t;const g0t=_i(h0t);function m0t(){const e=Ct(uc),[t,n]=ir(Ay),[r,i]=ir(xI),o=Ct(Uq),a=cP({initialValues:r,enableReinitialize:!0,onSubmit:async()=>{}}),s=()=>n(f=>({...f,open:!1})),l=()=>{i(a.values);const f=g0t(a.values,d=>d!==""?d:null);e==null||e.socket.emit("chat_settings_change",f),s()},u=()=>{a.setValues(o)};return S.jsxs(mh,{open:t.open,onClose:s,id:"chat-settings-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:[S.jsx(by,{id:"alert-dialog-title",children:"Settings panel"}),S.jsx(vh,{children:S.jsx(at,{sx:{display:"flex",flexDirection:"column",minWidth:"20vw",maxHeight:"70vh",gap:"15px"},children:t.inputs.map(f=>S.jsx(ZJ,{element:{...f,value:a.values[f.id],onChange:a.handleChange,setField:a.setFieldValue}},f.id))})}),S.jsxs(oS,{sx:{p:2},children:[S.jsx(Gu,{onClick:u,color:"primary",variant:"outlined",children:"Reset"}),S.jsx("div",{style:{flex:"1 0 0"}}),S.jsx(Oy,{onClick:s,children:"Cancel"}),S.jsx(Gu,{id:"confirm",variant:"outlined",onClick:l,autoFocus:!0,children:"Confirm"})]})]})}const pQ=()=>{const e=Ct(ya);return e!=null&&e.markdown?S.jsx(at,{overflow:"auto",flexGrow:1,children:S.jsx(at,{id:"welcome-screen",sx:{maxWidth:"60rem",width:"100%",m:"auto",color:"text.primary",lineHeight:"25px",fontSize:"1rem",fontFamily:"-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji",display:"flex",flexDirection:"column"},children:e!=null&&e.markdown?S.jsx(CS,{remarkPlugins:[yI],components:{a:({children:t,...n})=>S.jsx(_y,{...n,target:"_blank",children:t}),code:({...t})=>S.jsx(_I,{...t})},children:e==null?void 0:e.markdown}):null})}):S.jsx(at,{flexGrow:1})},v0t=()=>{const{user:e,isAuthenticated:t}=sc(),n=Ct(uc),r=Ct(TS),[i,o]=ir(kS),a=Ct(mS),s=Ct(tI),l=Ct(CP),u=Ct(ya),f=gn(RP),[d,p]=T.useState(!0),g=T.useCallback(async w=>{if(!(n==null?void 0:n.socket.id))return;const x={id:Z_(),author:(e==null?void 0:e.name)||"User",authorIsUser:!0,content:w,createdAt:new Date().toISOString()};f(C=>{const R=[...C.messages||[]];return R.push({content:w,createdAt:new Date().getTime()}),{...C,messages:R.length>50?R.slice(R.length-50):R}}),p(!0),o(C=>[...C,x]),n==null||n.socket.emit("ui_message",x)},[e,n,t,u]),v=T.useCallback(async w=>{if(!r)return;const b={id:Z_(),author:(e==null?void 0:e.name)||"User",authorIsUser:!0,content:w,createdAt:new Date().toISOString()};r.callback(b),p(!0),o(x=>[...x,b])},[r,e]),y=s.at(-1);return S.jsxs(at,{display:"flex",width:"100%",height:"0",flexGrow:1,children:[S.jsx(JJ,{}),S.jsx(m0t,{}),S.jsx(pU,{tasklist:y,isMobile:!1}),S.jsxs(Nq,{children:[S.jsx(pU,{tasklist:y,isMobile:!0}),S.jsx(at,{my:1}),(n==null?void 0:n.error)&&S.jsx(ro,{id:"session-error",severity:"error",children:"Could not reach the server."}),S.jsxs(dG,{children:[!!i.length&&S.jsx(cG,{actions:l,elements:a,messages:i,autoScroll:d,setAutoScroll:p}),!i.length&&S.jsx(pQ,{}),S.jsx(u0t,{onReply:v,onSubmit:g})]})]})]})};function y0t(){return S.jsx(e0,{children:S.jsx(v0t,{})})}function b0t(){const{loginWithRedirect:e,isAuthenticated:t}=sc(),n=Zu();return T.useEffect(()=>{t?n("/"):e({authorizationParams:{audience:"chainlit-cloud"}})},[t]),null}function _0t(){return S.jsx(e0,{children:S.jsx(at,{sx:{px:2},children:S.jsx(pQ,{})})})}const x0t=Cle([{path:"/",element:S.jsx(y0t,{})},{path:"/readme",element:S.jsx(_0t,{})},{path:"/env",element:S.jsx(Fyt,{})},{path:"/conversations/:id",element:S.jsx(e0,{children:S.jsx(Kmt,{})})},{path:"/dataset",element:S.jsx(Pyt,{})},{path:"/element/:id",element:S.jsx(Myt,{})},{path:"/login",element:S.jsx(b0t,{})},{path:"/design",element:S.jsx(Lyt,{})},{path:"/api/auth/callback",element:S.jsx(gOe,{})},{path:"*",element:S.jsx(mle,{replace:!0,to:"/"})}]);function N$(){return N$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N$.apply(this,arguments)}var hQ=["shift","alt","meta","mod","ctrl"],w0t={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function $u(e){return(w0t[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function S0t(e){return hQ.includes(e)}function XT(e,t){return t===void 0&&(t=","),e.split(t)}function ZT(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(a){return $u(a)}),i={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},o=r.filter(function(a){return!hQ.includes(a)});return N$({},i,{keys:o,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&gQ([$u(e.key),$u(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&mQ([$u(e.key),$u(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Ou.clear()})})();var Ou=new Set;function C0t(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return Ou.has(r.trim().toLowerCase())})}function gQ(e){var t=Array.isArray(e)?e:[e];Ou.has("meta")&&Ou.forEach(function(n){return!S0t(n)&&Ou.delete(n.toLowerCase())}),t.forEach(function(n){return Ou.add(n.toLowerCase())})}function mQ(e){var t=Array.isArray(e)?e:[e];e==="meta"?Ou.clear():t.forEach(function(n){return Ou.delete(n.toLowerCase())})}function E0t(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function k0t(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function T0t(e){return vQ(e,["input","textarea","select"])}function vQ(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return t instanceof Array?!!(r&&t&&t.some(function(i){return i.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function R0t(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var A0t=function(t,n,r){r===void 0&&(r=!1);var i=n.alt,o=n.meta,a=n.mod,s=n.shift,l=n.ctrl,u=n.keys,f=t.key,d=t.code,p=t.ctrlKey,g=t.metaKey,v=t.shiftKey,y=t.altKey,w=$u(d),b=f.toLowerCase();if(!r){if(i===!y&&b!=="alt"||s===!v&&b!=="shift")return!1;if(a){if(!g&&!p)return!1}else if(o===!g&&b!=="meta"&&b!=="os"||l===!p&&b!=="ctrl"&&b!=="control")return!1}return u&&u.length===1&&(u.includes(b)||u.includes(w))?!0:u?C0t(u):!u},$0t=T.createContext(void 0),O0t=function(){return T.useContext($0t)};function yQ(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&yQ(e[r],t[r])},!0):e===t}var I0t=T.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),D0t=function(){return T.useContext(I0t)};function P0t(e){var t=T.useRef(void 0);return yQ(t.current,e)||(t.current=e),t.current}var mU=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},L0t=typeof window<"u"?T.useLayoutEffect:T.useEffect;function M0t(e,t,n,r){var i=T.useRef(null),o=T.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=e instanceof Array?e.join(a==null?void 0:a.splitKey):e,l=n instanceof Array?n:r instanceof Array?r:void 0,u=T.useCallback(t,l??[]),f=T.useRef(u);l?f.current=u:f.current=t;var d=P0t(a),p=D0t(),g=p.enabledScopes,v=O0t();return L0t(function(){if(!((d==null?void 0:d.enabled)===!1||!R0t(g,d==null?void 0:d.scopes))){var y=function(k,R){var A;if(R===void 0&&(R=!1),!(T0t(k)&&!vQ(k,d==null?void 0:d.enableOnFormTags))&&!(d!=null&&d.ignoreEventWhen!=null&&d.ignoreEventWhen(k))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){mU(k);return}(A=k.target)!=null&&A.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||XT(s,d==null?void 0:d.splitKey).forEach(function(O){var z,V=ZT(O,d==null?void 0:d.combinationKey);if(A0t(k,V,d==null?void 0:d.ignoreModifiers)||(z=V.keys)!=null&&z.includes("*")){if(R&&o.current)return;if(E0t(k,V,d==null?void 0:d.preventDefault),!k0t(k,V,d==null?void 0:d.enabled)){mU(k);return}f.current(k,V),R||(o.current=!0)}})}},w=function(k){k.key!==void 0&&(gQ($u(k.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&y(k))},b=function(k){k.key!==void 0&&(mQ($u(k.code)),o.current=!1,d!=null&&d.keyup&&y(k,!0))},x=i.current||(a==null?void 0:a.document)||document;return x.addEventListener("keyup",b),x.addEventListener("keydown",w),v&&XT(s,d==null?void 0:d.splitKey).forEach(function(C){return v.addHotkey(ZT(C,d==null?void 0:d.combinationKey,d==null?void 0:d.description))}),function(){x.removeEventListener("keyup",b),x.removeEventListener("keydown",w),v&&XT(s,d==null?void 0:d.splitKey).forEach(function(C){return v.removeHotkey(ZT(C,d==null?void 0:d.combinationKey,d==null?void 0:d.description))})}}},[s,d,g]),i}function F0t(){const e=gn(Hs);return M0t("s",()=>e(t=>({...t,open:!t.open}))),null}var IP={},N0t=vn;Object.defineProperty(IP,"__esModule",{value:!0});var bQ=IP.default=void 0,B0t=N0t(yn()),j0t=S,z0t=(0,B0t.default)((0,j0t.jsx)("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49zM12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"}),"DarkModeOutlined");bQ=IP.default=z0t;var DP={},U0t=vn;Object.defineProperty(DP,"__esModule",{value:!0});var _Q=DP.default=void 0,K0t=U0t(yn()),W0t=S,V0t=(0,K0t.default)((0,W0t.jsx)("path",{d:"M12 3c-.46 0-.93.04-1.4.14-2.76.53-4.96 2.76-5.48 5.52-.48 2.61.48 5.01 2.22 6.56.43.38.66.91.66 1.47V19c0 1.1.9 2 2 2h.28c.35.6.98 1 1.72 1s1.38-.4 1.72-1H14c1.1 0 2-.9 2-2v-2.31c0-.55.22-1.09.64-1.46C18.09 13.95 19 12.08 19 10c0-3.87-3.13-7-7-7zm2 16h-4v-1h4v1zm0-2h-4v-1h4v1zm-1.5-5.59V14h-1v-2.59L9.67 9.59l.71-.71L12 10.5l1.62-1.62.71.71-1.83 1.82z"}),"EmojiObjects");_Q=DP.default=V0t;var PP={},H0t=vn;Object.defineProperty(PP,"__esModule",{value:!0});var xQ=PP.default=void 0,q0t=H0t(yn()),G0t=S,Y0t=(0,q0t.default)((0,G0t.jsx)("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand");xQ=PP.default=Y0t;function X0t(){const[e,t]=ir(Hs);return S.jsx(mh,{open:e.open,onClose:()=>t(n=>({...n,open:!1})),id:"settings-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:S.jsx(vh,{children:S.jsxs(Y_,{sx:{width:"100%",maxWidth:360},subheader:S.jsx(Lwe,{children:"Settings"}),children:[S.jsxs(iv,{sx:{display:"flex",gap:2},children:[S.jsx(xp,{children:S.jsx(xQ,{})}),S.jsx(Wb,{id:"list-expand-all",primary:"Expand Messages"}),S.jsx(at,{children:S.jsx(i_,{id:"switch-expand-all",onChange:()=>t(n=>({...n,expandAll:!n.expandAll})),checked:e.expandAll,inputProps:{"aria-labelledby":"switch-expand-all"}})})]}),S.jsxs(iv,{sx:{display:"flex",gap:2},children:[S.jsx(xp,{children:S.jsx(_Q,{})}),S.jsx(Wb,{id:"hide-cot",primary:"Hide Chain of Thought"}),S.jsx(at,{children:S.jsx(i_,{id:"switch-hide-cot",onChange:()=>t(n=>({...n,hideCot:!n.hideCot})),checked:e.hideCot,inputProps:{"aria-labelledby":"hide-cot"}})})]}),S.jsxs(iv,{sx:{display:"flex",gap:2},children:[S.jsx(xp,{children:S.jsx(bQ,{})}),S.jsx(Wb,{id:"switch-theme",primary:"Dark mode"}),S.jsx(at,{children:S.jsx(i_,{id:"switch-theme",onChange:()=>{const n=e.theme==="light"?"dark":"light";localStorage.setItem("themeVariant",n),t(r=>({...r,theme:n}))},checked:e.theme==="dark",inputProps:{"aria-labelledby":"switch-theme"}})})]})]})})})}function vU(e){return e!=null&&typeof e=="object"}function wQ(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i],a=t[i],s=vU(o)&&vU(a);if(s&&!wQ(o,a)||!s&&o!==a)return!1}return!0}const js=Object.create(null);js.open="0";js.close="1";js.ping="2";js.pong="3";js.message="4";js.upgrade="5";js.noop="6";const o_=Object.create(null);Object.keys(js).forEach(e=>{o_[js[e]]=e});const Z0t={type:"error",data:"parser error"},J0t=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Q0t=typeof ArrayBuffer=="function",e1t=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,SQ=({type:e,data:t},n,r)=>J0t&&t instanceof Blob?n?r(t):yU(t,r):Q0t&&(t instanceof ArrayBuffer||e1t(t))?n?r(t):yU(new Blob([t]),r):r(js[e]+(t||"")),yU=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)},bU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nm=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<bU.length;e++)Nm[bU.charCodeAt(e)]=e;const t1t=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r<n;r+=4)o=Nm[e.charCodeAt(r)],a=Nm[e.charCodeAt(r+1)],s=Nm[e.charCodeAt(r+2)],l=Nm[e.charCodeAt(r+3)],f[i++]=o<<2|a>>4,f[i++]=(a&15)<<4|s>>2,f[i++]=(s&3)<<6|l&63;return u},n1t=typeof ArrayBuffer=="function",CQ=(e,t)=>{if(typeof e!="string")return{type:"message",data:EQ(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:r1t(e.substring(1),t)}:o_[n]?e.length>1?{type:o_[n],data:e.substring(1)}:{type:o_[n]}:Z0t},r1t=(e,t)=>{if(n1t){const n=t1t(e);return EQ(n,t)}else return{base64:!0,data:e}},EQ=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},kQ=String.fromCharCode(30),i1t=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{SQ(o,!1,s=>{r[a]=s,++i===n&&t(r.join(kQ))})})},o1t=(e,t)=>{const n=e.split(kQ),r=[];for(let i=0;i<n.length;i++){const o=CQ(n[i],t);if(r.push(o),o.type==="error")break}return r},TQ=4;function Or(e){if(e)return a1t(e)}function a1t(e){for(var t in Or.prototype)e[t]=Or.prototype[t];return e}Or.prototype.on=Or.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Or.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Or.prototype.off=Or.prototype.removeListener=Or.prototype.removeAllListeners=Or.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Or.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Or.prototype.emitReserved=Or.prototype.emit;Or.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Or.prototype.hasListeners=function(e){return!!this.listeners(e).length};const na=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function RQ(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const s1t=na.setTimeout,l1t=na.clearTimeout;function CC(e,t){t.useNativeTimers?(e.setTimeoutFn=s1t.bind(na),e.clearTimeoutFn=l1t.bind(na)):(e.setTimeoutFn=na.setTimeout.bind(na),e.clearTimeoutFn=na.clearTimeout.bind(na))}const u1t=1.33;function c1t(e){return typeof e=="string"?f1t(e):Math.ceil((e.byteLength||e.size)*u1t)}function f1t(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}class d1t extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class AQ extends Or{constructor(t){super(),this.writable=!1,CC(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new d1t(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=CQ(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}const $Q="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),B$=64,p1t={};let _U=0,xb=0,xU;function wU(e){let t="";do t=$Q[e%B$]+t,e=Math.floor(e/B$);while(e>0);return t}function OQ(){const e=wU(+new Date);return e!==xU?(_U=0,xU=e):e+"."+wU(_U++)}for(;xb<B$;xb++)p1t[$Q[xb]]=xb;function IQ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function h1t(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}let DQ=!1;try{DQ=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const g1t=DQ;function PQ(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||g1t))return new XMLHttpRequest}catch{}if(!t)try{return new na[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function m1t(){}const v1t=function(){return new PQ({xdomain:!1}).responseType!=null}();class y1t extends AQ{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port,this.xs=t.secure!==r}const n=t&&t.forceBase64;this.supportsBinary=v1t&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};o1t(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,i1t(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=OQ()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=IQ(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Ep(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let Ep=class a_ extends Or{constructor(t,n){super(),CC(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=RQ(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new PQ(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=a_.requestsCount++,a_.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=m1t,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete a_.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Ep.requestsCount=0;Ep.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",SU);else if(typeof addEventListener=="function"){const e="onpagehide"in na?"pagehide":"unload";addEventListener(e,SU,!1)}}function SU(){for(let e in Ep.requests)Ep.requests.hasOwnProperty(e)&&Ep.requests[e].abort()}const LQ=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),wb=na.WebSocket||na.MozWebSocket,CU=!0,b1t="arraybuffer",EU=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class _1t extends AQ{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=EU?{}:RQ(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=CU&&!EU?n?new wb(t,n):new wb(t):new wb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||b1t,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;SQ(r,this.supportsBinary,o=>{const a={};try{CU&&this.ws.send(o)}catch{}i&&LQ(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=OQ()),this.supportsBinary||(t.b64=1);const i=IQ(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!wb}}const x1t={websocket:_1t,polling:y1t},w1t=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,S1t=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function j$(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=w1t.exec(e||""),o={},a=14;for(;a--;)o[S1t[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=C1t(o,o.path),o.queryKey=E1t(o,o.query),o}function C1t(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function E1t(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let MQ=class Hd extends Or{constructor(t,n={}){super(),this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=j$(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=j$(n.host).host),CC(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=h1t(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=TQ,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new x1t[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Hd.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Hd.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Hd.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,f(),n.close(),n=null)}const a=d=>{const p=new Error("probe error: "+d);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function s(){a("transport closed")}function l(){a("socket closed")}function u(d){n&&d.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Hd.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=c1t(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Hd.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};MQ.protocol=TQ;function k1t(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=j$(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const T1t=typeof ArrayBuffer=="function",R1t=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,FQ=Object.prototype.toString,A1t=typeof Blob=="function"||typeof Blob<"u"&&FQ.call(Blob)==="[object BlobConstructor]",$1t=typeof File=="function"||typeof File<"u"&&FQ.call(File)==="[object FileConstructor]";function LP(e){return T1t&&(e instanceof ArrayBuffer||R1t(e))||A1t&&e instanceof Blob||$1t&&e instanceof File}function s_(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(s_(e[n]))return!0;return!1}if(LP(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return s_(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&s_(e[n]))return!0;return!1}function O1t(e){const t=[],n=e.data,r=e;return r.data=z$(n,t),r.attachments=t.length,{packet:r,buffers:t}}function z$(e,t){if(!e)return e;if(LP(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=z$(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=z$(e[r],t));return n}return e}function I1t(e,t){return e.data=U$(e.data,t),delete e.attachments,e}function U$(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=U$(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=U$(e[n],t));return e}const D1t=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],P1t=5;var tn;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(tn||(tn={}));class L1t{constructor(t){this.replacer=t}encode(t){return(t.type===tn.EVENT||t.type===tn.ACK)&&s_(t)?this.encodeAsBinary({type:t.type===tn.EVENT?tn.BINARY_EVENT:tn.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===tn.BINARY_EVENT||t.type===tn.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=O1t(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function kU(e){return Object.prototype.toString.call(e)==="[object Object]"}class MP extends Or{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===tn.BINARY_EVENT;r||n.type===tn.BINARY_ACK?(n.type=r?tn.EVENT:tn.ACK,this.reconstructor=new M1t(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(LP(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(tn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===tn.BINARY_EVENT||r.type===tn.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(MP.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case tn.CONNECT:return kU(n);case tn.DISCONNECT:return n===void 0;case tn.CONNECT_ERROR:return typeof n=="string"||kU(n);case tn.EVENT:case tn.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&D1t.indexOf(n[0])===-1);case tn.ACK:case tn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class M1t{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=I1t(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const F1t=Object.freeze(Object.defineProperty({__proto__:null,Decoder:MP,Encoder:L1t,get PacketType(){return tn},protocol:P1t},Symbol.toStringTag,{value:"Module"}));function Ua(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const N1t=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let NQ=class extends Or{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ua(t,"open",this.onopen.bind(this)),Ua(t,"packet",this.onpacket.bind(this)),Ua(t,"error",this.onerror.bind(this)),Ua(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(N1t.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:tn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:tn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case tn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tn.EVENT:case tn.BINARY_EVENT:this.onevent(t);break;case tn.ACK:case tn.BINARY_ACK:this.onack(t);break;case tn.DISCONNECT:this.ondisconnect();break;case tn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:tn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function Wh(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Wh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Wh.prototype.reset=function(){this.attempts=0};Wh.prototype.setMin=function(e){this.ms=e};Wh.prototype.setMax=function(e){this.max=e};Wh.prototype.setJitter=function(e){this.jitter=e};class K$ extends Or{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,CC(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Wh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||F1t;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new MQ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ua(n,"open",function(){r.onopen(),t&&t()}),o=Ua(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ua(t,"ping",this.onping.bind(this)),Ua(t,"data",this.ondata.bind(this)),Ua(t,"error",this.onerror.bind(this)),Ua(t,"close",this.onclose.bind(this)),Ua(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){LQ(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new NQ(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Sm={};function l_(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=k1t(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Sm[i]&&o in Sm[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new K$(r,t):(Sm[i]||(Sm[i]=new K$(r,t)),l=Sm[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(l_,{Manager:K$,Socket:NQ,io:l_,connect:l_});const JT=(e,t)=>e.id&&t.id?e.id===t.id:!1,B1t=T.memo(function(){const t=Ct(ya),{accessToken:n,authenticating:r}=sc(),i=Ct(cS),o=gn(Ry),a=Ct(KV),[s,l]=ir(uc),u=gn(kS),f=gn(Bq),d=gn(jq),p=gn(TS),g=gn(mS),v=gn(eI),y=gn(tI),w=gn(CP),b=gn(Ay),x=Bb(xI);return T.useEffect(()=>{if(r||!t)return;s!=null&&s.socket&&(s.socket.removeAllListeners(),s.socket.close());const C=l_(Y2e,{path:"/ws/socket.io",extraHeaders:{Authorization:n||"","X-Chainlit-Session-Id":a,"user-env":JSON.stringify(i)}});l({socket:C}),C.on("connect",()=>{C.emit("connection_successful"),l(k=>({...k,error:!1}))}),C.on("connect_error",k=>{console.error("failed to connect",k),l(R=>({...R,error:!0}))}),C.on("task_start",()=>{o(!0)}),C.on("task_end",()=>{o(!1)}),C.on("reload",()=>{C.emit("clear_session"),window.location.reload()}),C.on("new_message",k=>{u(R=>{const A=R.findIndex(O=>JT(O,k));return A===-1?[...R,k]:[...R.slice(0,A),k,...R.slice(A+1)]})}),C.on("update_message",k=>{u(R=>{const A=R.findIndex(O=>JT(O,k));return A===-1?R:(k.newId&&(k.id=k.newId,delete k.newId),[...R.slice(0,A),k,...R.slice(A+1)])})}),C.on("delete_message",k=>{u(R=>{const A=R.findIndex(O=>JT(O,k));return A===-1?R:[...R.slice(0,A),...R.slice(A+1)]})}),C.on("stream_start",k=>{u(R=>[...R,k])}),C.on("stream_token",({id:k,token:R,isSequence:A})=>{u(O=>{const z=O.findIndex(W=>W.id===k);if(z===-1)return O;const D={...O[z]};return A?D.content=R:D.content+=R,[...O.slice(0,z),D,...O.slice(z+1)]})}),C.on("ask",({msg:k,spec:R},A)=>{p({spec:R,callback:A}),u(O=>[...O,k]),o(!1)}),C.on("enable_file_upload",k=>{d(k),o(!1)}),C.on("ask_timeout",()=>{p(void 0),o(!1)}),C.on("clear_ask",()=>{p(void 0)}),C.on("chat_settings",k=>{b(R=>({...R,inputs:k})),x()}),C.on("element",k=>{k.type==="avatar"?v(R=>[...R,k]):k.type==="tasklist"?y(R=>[...R,k]):g(R=>[...R,k])}),C.on("update_element",k=>{g(R=>{const A=R.findIndex(V=>V.id===k.id);if(A===-1)return R;const z={...R[A],forIds:k.forIds};return[...R.slice(0,A),z,...R.slice(A+1)]})}),C.on("remove_element",k=>{g(R=>R.filter(A=>A.id!==k.id)),y(R=>R.filter(A=>A.id!==k.id)),v(R=>R.filter(A=>A.id!==k.id))}),C.on("action",k=>{w(R=>[...R,k])}),C.on("remove_action",k=>{w(R=>{const A=R.findIndex(O=>wQ(O,k));return A===-1?R:[...R.slice(0,A),...R.slice(A+1)]})}),C.on("token_usage",k=>{f(R=>R+k)})},[i,r,t]),null});function j1t(){const{theme:e}=Ct(Hs),[t,n]=ir(Df),[r,i]=ir(V2),{isAuthenticated:o,getAccessTokenSilently:a,logout:s}=sc(),l=KIe(e),{data:u,error:f}=bh(!r&&t?"/project/role":null);return T.useEffect(()=>{u!=="ANONYMOUS"&&!r&&i(f?"ANONYMOUS":u)},[u,f]),T.useEffect(()=>{o&&t===void 0&&a({authorizationParams:{audience:"chainlit-cloud"}}).then(d=>n(d)).catch(d=>{console.error(d),s({logoutParams:{returnTo:window.location.origin}})})},[o,a,t,n]),S.jsxs(FW,{theme:l,children:[S.jsx(eV,{styles:{body:{backgroundColor:l.palette.background.default}}}),S.jsx(ose,{toastOptions:{className:"toast",style:{maxWidth:500,fontFamily:"Inter",background:l.palette.background.paper,border:`1px solid ${l.palette.divider}`,padding:l.spacing(1),color:l.palette.text.primary,boxShadow:l.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}}}),S.jsxs(at,{display:"flex",height:"100vh",width:"100vw",children:[S.jsx(B1t,{}),S.jsx(F0t,{}),S.jsx(X0t,{}),S.jsx(gle,{router:x0t})]})]})}const z1t=T.memo(function({children:t}){var r;const n=Ct(ya);return(r=n==null?void 0:n.project)!=null&&r.id?S.jsx(uOe,{domain:"https://auth.chainlit.io",clientId:"ADo93BBXDn8Z35lEi8arCWiR7C0ncrjx",authorizationParams:{redirect_uri:`${window.location.origin}/api/auth/callback`},useRefreshTokens:!0,cacheLocation:"localstorage",children:t}):S.jsx(S.Fragment,{children:t})});function U1t(){const[e,t]=ir(ya),n=gn(Hs),{data:r}=bh(e===void 0?"/project/settings":null);return T.useEffect(()=>{r&&(t(r),n(i=>({...i,expandAll:!!r.ui.default_expand_messages,hideCot:!!r.ui.hide_cot})))},[r]),S.jsx(z1t,{children:S.jsx(j1t,{})})}var W$={},TU=Af;W$.createRoot=TU.createRoot,W$.hydrateRoot=TU.hydrateRoot;W$.createRoot(document.getElementById("root")).render(S.jsx(gt.StrictMode,{children:S.jsx(_ve,{children:S.jsx(U1t,{})})}));export{ni as c,_i as g};
|
|
541
|
+
`),Y6={ChipStyled:Pmt,TextFieldStyled:Dmt,EndAdornmentClose:Imt},YJ=gt.forwardRef((e,t)=>{const{chips:n,onAddChip:r,onEditChip:i,onDeleteChip:o,onDeleteAllChips:a,InputProps:s,onInputChange:l,disabled:u,clearInputOnBlur:f,validate:d,error:p,helperText:g,hideClearAll:v,inputProps:y,size:w,disableDeleteOnBackspace:b,disableEdition:x,className:C,renderChip:k,addOnWhichKey:R,onFocus:A,inputValue:O,...z}=e,[V,D]=gt.useState(""),[W,ie]=gt.useState(""),se=gt.useRef(null),K=gt.useRef(!1),G=gt.useRef(typeof O=="string"),[Q,le]=gt.useState(null),{onKeyDown:Z,...ee}=y||{},{inputRef:P,...ge}=s||{},B=()=>{ie("")},L=G.current,ae=L?O:V,ue=Re=>{l==null||l(Re),L||D(Re)},ne=Re=>{ue(n[Re]),le(Re),B()},we=()=>{le(null)},Te=()=>{B(),ue("")},Ee=Re=>{ue(Re.target.value)},Le=()=>{!K.current||(Q!==null?(we(),Te()):f&&Te(),K.current=!1)},Be=Re=>{se.current=Re,t&&Omt(Re,t)},Ie=(Re,Ne)=>U=>{if(typeof d=="function"){const H=d(Re);if(H===!1){Ne.preventDefault();return}if(!Amt(H)&&H.isError){Ne.preventDefault(),ie(H.textError);return}}U()},Pe=(Re,Ne,U)=>{Ie(Re,U)(()=>{i==null||i(Re,Ne),we(),Te()})},je=(Re,Ne)=>{Ie(Re,Ne)(()=>{r==null||r(ae.trim()),Te()})},Fe=(Re,Ne)=>Ne===kmt.ime?!1:R?Array.isArray(R)?R.some(U=>U===Re):R===Re:Re===Zv.enter,tt=Re=>{const Ne=Fe(Re.key,Re.keyCode),U=Re.key===Zv.backspace,H=ae.trim();if(Re.code==="Tab"){Le();return}if(Ne&&Re.preventDefault(),ae.length>0&&Ne)H.length===0?Te():Q!==null?Pe(H,Q,Re):je(H,Re);else if(U&&ae.length===0&&n.length>0&&!b){const fe=n.length-1;o==null||o(fe),Q===fe&&we()}Z==null||Z(Re)},Xe=Re=>{Re.preventDefault(),A==null||A(Re),K.current=!0},Ye=Re=>{Re.preventDefault(),!v&&!u&&(a==null||a(),Te(),we())},st=Re=>{var Ne;Re===Q?(Te(),we()):ne(Re),(Ne=se.current)==null||Ne.focus()},he=Re=>{u||(o==null||o(Re),Q!==null&&(we(),Te()))},Ae=n.length>0;return S.jsx(rbe,{onClickAway:Le,children:S.jsx(Y6.TextFieldStyled,{value:ae,onChange:Ee,ref:t,className:`MuiChipsInput-TextField ${C||""}`,size:w,placeholder:"Type and press enter",onFocus:Xe,inputProps:{onKeyDown:tt,...ee},disabled:u,error:!!W||p,helperText:W||g,InputProps:{inputRef:Be,startAdornment:Ae?n.map((Re,Ne)=>{const U=`chip-${Ne}`,H={index:Ne,onEdit:st,label:Re,title:Re,isEditing:Ne===Q,size:w,disabled:u,disableEdition:x,onDelete:he};return k?k(G6,U,H):T.createElement(G6,{...H,key:U})}):null,endAdornment:v?null:S.jsx(Y6.EndAdornmentClose,{style:{visibility:Ae?"visible":"hidden"},children:S.jsx(or,{"aria-label":"Clear",title:"Clear",disabled:u,size:"small",onClick:Ye,children:S.jsx(yh,{fontSize:"small"})})}),...ge},...z})})});YJ.defaultProps={onInputChange:()=>{},clearInputOnBlur:!1,hideClearAll:!1,disableDeleteOnBackspace:!1,disableEdition:!1,addOnWhichKey:Zv.enter,onDeleteChip:()=>{},onAddChip:()=>{},inputValue:void 0,onEditChip:()=>{},renderChip:void 0,onDeleteAllChips:()=>{},validate:()=>!0};function Lmt(e,t){return[...e,t]}function Mmt(e,t){return e.filter((n,r)=>t!==r)}function Fmt(e,t,n){return e.map((r,i)=>t===i?n:r)}const XJ=gt.forwardRef((e,t)=>{const{value:n,onChange:r,onAddChip:i,onInputChange:o,onDeleteChip:a,disabled:s,validate:l,clearInputOnBlur:u,hideClearAll:f,disableDeleteOnBackspace:d,onEditChip:p,renderChip:g,disableEdition:v,addOnWhichKey:y,inputValue:w,...b}=e;return S.jsx(YJ,{chips:n,onAddChip:x=>{if(s)return;const C=Lmt(n,x),k=C.length-1;i==null||i(x,k),r==null||r(C)},onInputChange:o,disableDeleteOnBackspace:d,onDeleteChip:x=>{if(s)return;const C=n[x];r==null||r(Mmt(n,x)),a==null||a(C,x)},onEditChip:(x,C)=>{s||v||(r==null||r(Fmt(n,C,x)),p==null||p(x,C))},renderChip:g,onDeleteAllChips:()=>{r==null||r([])},clearInputOnBlur:u,disabled:s,disableEdition:v,validate:l,inputValue:w,hideClearAll:f,addOnWhichKey:y,...b,ref:t})});XJ.defaultProps={value:[],onChange:()=>{},onAddChip:()=>{},onDeleteChip:()=>{},onInputChange:()=>{},onEditChip:()=>{},addOnWhichKey:Zv.enter,clearInputOnBlur:!1,disableEdition:!1,hideClearAll:!1,disableDeleteOnBackspace:!1,validate:()=>!0};function Nmt({description:e,hasError:t,id:n,label:r,size:i="small",tooltip:o,setField:a,...s}){return S.jsx(jh,{description:e,hasError:t,id:n,label:r,tooltip:o,children:S.jsx(XJ,{...s,sx:{my:.5},size:i,onChange:l=>a==null?void 0:a(n,l,!1),inputProps:{id:n,name:n}})})}function L$({description:e,disabled:t,hasError:n,id:r,label:i,size:o="small",tooltip:a,...s}){return S.jsx(jh,{description:e,hasError:n,id:r,label:i,tooltip:a,children:S.jsx(lS,{disabled:t,inputProps:{...s,id:r,name:r,sx:{height:o==="small"?"7px":"15px"}},fullWidth:!0,sx:{fontSize:"14px",fontWeight:400,my:.5}})})}const Bmt=({description:e,hasError:t,id:n,label:r,tooltip:i,setField:o,...a})=>{var l;const s=u=>{const f=parseFloat(u.target.value),{min:d,max:p,onChange:g}=a;p&&f>p?o&&o(n,p):d&&f<d?o&&o(n,d):g&&g(u,f,0)};return S.jsx(jh,{description:e,hasError:t,id:n,label:r,tooltip:i,notificationsProps:{count:((l=a.value)==null?void 0:l.toString())||"0",inputProps:{id:n,max:a.max,min:a.min,step:a.step||1,onChange:s}},children:S.jsx(jmt,{...a,id:n,name:n})})},jmt=Me(SRe)(({theme:e})=>{const t=e.palette.mode==="light";return{width:"calc(100% - 18px)",marginLeft:"8px",color:_t[t?300:850],height:3,"& .MuiSlider-track":{border:"none",color:_t[500]},"& .MuiSlider-thumb":{height:15,width:15,backgroundColor:t?_t[600]:"white",border:`4px solid ${t?_t[300]:_t[800]}`,"&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:"inherit"},"&:before":{display:"none"}},"& .MuiSlider-valueLabel":{lineHeight:1.2,fontSize:12,background:"unset",padding:0,width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"#52af77",transformOrigin:"bottom left",transform:"translate(50%, -100%) rotate(-45deg) scale(0)","&:before":{display:"none"},"&.MuiSlider-valueLabelOpen":{transform:"translate(50%, -100%) rotate(-45deg) scale(1)"},"& > *":{transform:"rotate(45deg)"}}}}),ZJ=({element:e})=>{var t;switch(e.type){case"select":return S.jsx(zh,{..._b(e,"setField"),value:e.value??""});case"slider":return S.jsx(Bmt,{...e,value:e.value??0});case"tags":return S.jsx(Nmt,{...e,value:e.value??[]});case"switch":return S.jsx(i_,{..._b(e,"setField"),checked:!!e.value,inputProps:{id:e.id,name:e.id}});case"textinput":return S.jsx(L$,{..._b(e,"setField"),value:e.value??""});case"numberinput":return S.jsx(L$,{..._b(e,"setField"),type:"number",value:((t=e.value)==null?void 0:t.toString())??"0"});default:return S.jsx(S.Fragment,{})}},vP=e=>{const t=(e==null?void 0:e.providers)||[];if(!(t!=null&&t.length))throw new Error("No LLM provider available");let n=t.find(i=>{var o;return i.id===((o=e.prompt)==null?void 0:o.provider)});const r=!!n;return n=n||t[0],{provider:n,providerFound:r,providers:t}},zmt=({settings:e,schema:t})=>{var d,p;const[n,r]=ir(ts),{provider:i,providers:o,providerFound:a}=vP(n),s=a?null:S.jsx(ro,{severity:"warning",children:(d=n.prompt)!=null&&d.provider?`${(p=n==null?void 0:n.prompt)==null?void 0:p.provider} provider is not found, using
|
|
542
|
+
${i.name} instead.`:`Provider not specified, using ${i.name} instead.`}),l=cP({initialValues:e,validationSchema:t,enableReinitialize:!0,onSubmit:async()=>{}});T.useEffect(()=>{r(g=>({...g,prompt:{...g.prompt,settings:l.values}}))},[l.values]);const u=g=>{r(v=>vx(PJ(v),{prompt:{provider:g.target.value}}))},f=()=>{var g,v;return i.is_chat&&!((g=n.prompt)!=null&&g.messages)?`${i.name} is message-based. This prompt will be wrapped in a message before being sent to ${i.name}.`:!i.is_chat&&((v=n.prompt)!=null&&v.messages)?`${i.name} is prompt-based. The messages will converted to a single prompt before being sent to ${i.name}.`:void 0};return S.jsxs(at,{width:250,sx:{height:"inherit"},children:[S.jsx(Yt,{fontSize:"16px",fontWeight:600,color:"text.primary",children:"Settings"}),S.jsxs(Ht,{spacing:2,sx:{overflowY:"auto",overflowX:"hidden",height:"100%"},children:[S.jsx(zh,{items:o==null?void 0:o.map(g=>({label:g.name,value:g.id})),id:"llm-providers",value:i.id,label:"LLM Provider",tooltip:f(),onChange:u}),s,i.inputs.map((g,v)=>S.jsx(at,{sx:{paddingBottom:v===i.inputs.length-1?2:0},children:S.jsx(ZJ,{element:{...g,id:g.id,value:l.values[g.id],onChange:y=>{l.handleChange(y)},setField:(y,w,b)=>{l.setFieldValue(y,w,b)}}})},g.id))]})]})},X6=()=>{var s,l;const e=Ct(ts),{provider:t}=vP(e);if(!t)return null;const n={},r=((s=e==null?void 0:e.prompt)==null?void 0:s.settings)||{},i=((l=e==null?void 0:e.originalPrompt)==null?void 0:l.settings)||{},o=(u,f)=>{var d;return f.type==="select"?!!((d=f==null?void 0:f.items)!=null&&d.find(p=>p.value===u)):!0},a=gP(t.inputs.reduce((u,f)=>{const d=r[f.id]!==void 0?r[f.id]:i[f.id];switch(d!==void 0&&o(d,f)?n[f.id]=d:f.initial!==void 0&&(n[f.id]=f.initial),f.type){case"select":u[f.id]=Cx();break;case"slider":{let p=jJ();f.min&&(p=p.min(f.min)),f.max&&(p=p.max(f.max)),u[f.id]=p;break}case"tags":u[f.id]=VJ().of(Cx());break}return u},{}));return S.jsx(zmt,{schema:a,settings:n})};function Umt({isSmallScreen:e,isDrawerOpen:t,toggleDrawer:n}){return e?S.jsxs(lV,{sx:{"& .MuiDrawer-paper":{}},variant:"persistent",anchor:"right",open:t,children:[S.jsx(at,{sx:{display:"flex",justifyContent:"flex-end",pt:2,pr:1},children:S.jsx(or,{onClick:n,children:S.jsx(qJ,{})})}),S.jsx(at,{px:3,children:S.jsx(X6,{})})]}):S.jsx(at,{ml:"32px !important",height:"100%",children:S.jsx(X6,{})})}function Kmt({onSubmit:e}){const[t,n]=T.useState(),r=Ct(Df),[i,o]=ir(ts),a=Ct(cS),s=async()=>{try{const{provider:l}=vP(i),u=NZ.cloneDeep(i.prompt);u.provider=l.id;const f=new AbortController;n(f),o(d=>d!=null&&d.prompt?{...d,prompt:{...d.prompt,completion:""}}:d),await OS.getCompletion(u,a,f,r,(d,p)=>{if(e&&e(),d){n(void 0);return}o(g=>{var v;return g!=null&&g.prompt?{...g,prompt:{...g.prompt,completion:(((v=g.prompt)==null?void 0:v.completion)||"")+p}}:g})})}catch{n(void 0)}};return t?S.jsx(Oy,{onClick:()=>{t.abort(),n(void 0)},children:"Cancel"}):S.jsx(Gu,{id:"submit-prompt",variant:"outlined",onClick:s,children:"Submit"})}function JJ(){var y,w;const[e,t]=ir(ts),{data:n,error:r,mutate:i}=bh("/project/llm-providers"),[o,a]=T.useState(0),[s,l]=J2(!1),u=T.useRef(null),f=Xn(),d=aS(b=>b.breakpoints.down("md"));T.useEffect(()=>{e!=null&&e.prompt&&i()},[e==null?void 0:e.prompt]),T.useEffect(()=>{n&&t(b=>({...b,providers:n.providers}))},[n]);const p=()=>{e&&(t(b=>({...b,prompt:b.originalPrompt})),a(b=>b+1))},g=()=>{t(b=>({...b,prompt:void 0}))};if(!(e!=null&&e.prompt))return null;const v=(y=e==null?void 0:e.prompt)!=null&&y.messages?e.prompt.messages.every(b=>typeof b.template=="string"):typeof((w=e==null?void 0:e.prompt)==null?void 0:w.template)=="string";return S.jsxs(mh,{open:!!e.prompt,fullScreen:!0,PaperProps:{style:{backgroundColor:f.palette.background.default,backgroundImage:"none"}},onClose:g,id:"playground","aria-labelledby":"playground","aria-describedby":"playground",children:[S.jsx(by,{sx:{display:"flex",flexDirection:"column"},children:S.jsx(Rst,{hasTemplate:v,isSmallScreen:d,toggleDrawer:l,handleClose:g})}),S.jsx(vh,{sx:{display:"flex",direction:"row",padding:3},children:S.jsxs(dG,{prefix:"Prompt Playground error",children:[S.jsxs(Ht,{gap:3,width:"100%",children:[r?S.jsx(ro,{severity:"error",children:"An error occurred while fetching providers settings"}):null,S.jsxs(Ht,{direction:"row",spacing:1.5,sx:{overflowY:"auto",paddingBottom:2,height:"100%"},children:[S.jsx(irt,{}),S.jsx(trt,{restoredTime:o,hasTemplate:v,prompt:e.prompt}),S.jsx(rrt,{ref:u,restoredTime:o,hasTemplate:v,prompt:e.prompt})]})]}),S.jsx(Umt,{isSmallScreen:d,isDrawerOpen:s,toggleDrawer:l})]})}),S.jsxs(Vje,{children:[S.jsx(yi,{title:"Restore original",children:S.jsx(or,{onClick:p,children:S.jsx(fG,{})})}),S.jsx(Kmt,{onSubmit:()=>{u!=null&&u.current&&(u.current.scrollTop=u.current.scrollHeight)}})]})]})}function Wmt(){const{id:e}=R9(),{data:t,error:n}=bh(e?`/project/conversation/${e}`:null);if(!t||n)return null;const r=t.elements,i=[];return S.jsxs(at,{display:"flex",flexGrow:1,width:"100%",overflow:"scroll",children:[S.jsx(JJ,{}),S.jsxs(Nq,{children:[S.jsx(at,{my:1}),S.jsx(cG,{actions:i,elements:r,messages:t.messages})]})]})}var yP={},Vmt=vn;Object.defineProperty(yP,"__esModule",{value:!0});var QJ=yP.default=void 0,Hmt=Vmt(yn()),qmt=S,Gmt=(0,Hmt.default)((0,qmt.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");QJ=yP.default=Gmt;const Ymt=e=>S.jsx(V_,{...e,viewBox:"0 0 98 96",children:S.jsx("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z"})});function Xmt({href:e}){return e?S.jsx(yi,{title:"See on Github",children:S.jsx(or,{color:"inherit",href:e,target:"_blank",children:S.jsx(Ymt,{})})}):null}function Zmt(){var n;const{user:e}=sc(),t=Xn();return e?S.jsx(hA,{sx:{width:32,height:32},src:e.picture||void 0,children:(n=e.name)==null?void 0:n[0]}):S.jsx(at,{color:t.palette.mode==="dark"?"text.primary":"primary.main",children:S.jsx(hA,{sx:{width:32,height:32,bgcolor:"transparent",color:"inherit"}})})}var bP={},Jmt=vn;Object.defineProperty(bP,"__esModule",{value:!0});var eQ=bP.default=void 0,Qmt=Jmt(yn()),evt=S,tvt=(0,Qmt.default)((0,evt.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04L21 10zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}),"Key");eQ=bP.default=tvt;var _P={},nvt=vn;Object.defineProperty(_P,"__esModule",{value:!0});var tQ=_P.default=void 0,rvt=nvt(yn()),ivt=S,ovt=(0,rvt.default)((0,ivt.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"}),"Logout");tQ=_P.default=ovt;var xP={},avt=vn;Object.defineProperty(xP,"__esModule",{value:!0});var nQ=xP.default=void 0,svt=avt(yn()),lvt=S,uvt=(0,svt.default)((0,lvt.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");nQ=xP.default=uvt;function cvt({anchorEl:e,open:t,handleClose:n}){var v,y;const{user:r,logout:i}=sc(),o=Ct(ya),a=gn(Hs),s=!!((y=(v=o==null?void 0:o.project)==null?void 0:v.user_env)!=null&&y.length),p=[r&&S.jsxs(iv,{sx:{display:"flex",flexDirection:"column"},children:[S.jsx(Yt,{width:"100%",fontSize:"14px",fontWeight:700,children:r.name}),S.jsx(Yt,{width:"100%",fontSize:"13px",fontWeight:400,children:r.email})]},"user-name"),S.jsxs(ov,{onClick:()=>{a(w=>({...w,open:!0})),n()},children:[S.jsx(xp,{children:S.jsx(nQ,{fontSize:"small"})}),S.jsx(Wb,{children:"Settings"}),S.jsx(Yt,{variant:"body2",color:"text.secondary",children:"S"})]},"settings"),s&&S.jsxs(ov,{component:ey,to:"/env",children:[S.jsx(xp,{children:S.jsx(eQ,{fontSize:"small"})}),"API keys"]},"env"),r&&S.jsxs(ov,{onClick:()=>{i({logoutParams:{returnTo:window.location.origin}}),n()},children:[S.jsx(xp,{children:S.jsx(tQ,{fontSize:"small"})}),"Logout"]},"logout")].filter(w=>!!w),g=p.reduce((w,b,x)=>x===p.length-1?[...w,b]:[...w,b,S.jsx(jCe,{sx:{my:1}},`divider-${x}`)],[]);return S.jsx(xy,{anchorEl:e,id:"account-menu",open:t,onClose:n,PaperProps:{sx:{width:220,overflow:"visible",mt:1.5,backgroundImage:"none",border:w=>`1px solid ${w.palette.divider}`,boxShadow:w=>w.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D","& .MuiAvatar-root":{width:32,height:32,ml:-.5,mr:1},"&:before":{content:'""',display:"block",position:"absolute",top:0,right:14,width:10,height:10,bgcolor:"background.default",transform:"translateY(-50%) rotate(45deg)",zIndex:0}}},transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},children:g})}function fvt(){const[e,t]=T.useState(null),n=!!e,r=o=>{t(o.currentTarget)},i=()=>{t(null)};return S.jsxs("div",{children:[S.jsx(or,{edge:"end",onClick:r,size:"small","aria-controls":n?"account-menu":void 0,"aria-haspopup":"true","aria-expanded":n?"true":void 0,children:S.jsx(Zmt,{})}),S.jsx(cvt,{open:n,anchorEl:e,handleClose:i})]})}var wP={},dvt=vn;Object.defineProperty(wP,"__esModule",{value:!0});var SP=wP.default=void 0,pvt=dvt(yn()),hvt=S,gvt=(0,pvt.default)((0,hvt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");SP=wP.default=gvt;const CP=Yn({key:"Actions",default:[]});function mvt(){const e=gn(kS),t=gn(mS),n=gn(eI),r=gn(tI),i=gn(CP),o=gn(nI),a=gn(Bq),s=Bb(Ay),l=Bb(xI),u=Bb(KV),f=Ct(uc);return()=>{f==null||f.socket.emit("clear_session"),f==null||f.socket.disconnect(),u(),f==null||f.socket.connect(),e([]),t([]),n([]),r([]),i([]),o(void 0),a(0),s(),l()}}function vvt(){const e=Zu(),[t,n]=T.useState(!1),r=mvt(),i=()=>{n(!0)},o=()=>{n(!1)},a=()=>{r(),e("/"),o()};return S.jsxs(at,{children:[S.jsx(Gu,{id:"new-chat-button",variant:"outlined",onClick:i,startIcon:S.jsx(SP,{}),children:"New Chat"}),S.jsxs(mh,{open:t,onClose:o,id:"new-chat-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:[S.jsx(by,{id:"alert-dialog-title",children:"Create a new chat?"}),S.jsx(vh,{children:S.jsx(oV,{id:"alert-dialog-description",children:"This will clear the current messages and start a new chat."})}),S.jsxs(oS,{sx:{p:2},children:[S.jsx(Oy,{onClick:o,children:"Cancel"}),S.jsx(Gu,{id:"confirm",variant:"outlined",onClick:a,autoFocus:!0,children:"Confirm"})]})]})]})}function yvt({to:e,label:t}){return S.jsx(Oy,{component:ey,to:e,children:t},e)}function bvt({to:e,label:t}){return S.jsx(If,{component:ey,to:e,sx:{textTransform:"none",color:"text.secondary","&:hover":{background:"transparent"}},children:t},e)}function _vt({hasDb:e,hasReadme:t}){const n=sh(),r=Xn(),[i,o]=T.useState(!1),a=T.useRef();let s;i&&a.current&&(s=a.current);const l=aS(r.breakpoints.down("md")),u=[{to:"/",label:"Chat"}];e&&u.push({to:"/dataset",label:"History"}),t&&u.push({to:"/readme",label:"Readme"});const f=S.jsx(Ht,{direction:l?"column":"row",spacing:1,children:u.map(d=>{const p=n.pathname===d.to;return S.jsx("div",{children:p?S.jsx(yvt,{...d}):S.jsx(bvt,{...d})},d.to)})});return l?S.jsxs(S.Fragment,{children:[S.jsx(or,{ref:a,edge:"start","aria-label":"open nav",onClick:()=>o(!0),children:S.jsx(QJ,{})}),S.jsx(xy,{autoFocus:!0,anchorEl:s,open:i,onClose:()=>o(!1),PaperProps:{sx:{p:1,backgroundImage:"none",mt:-2,ml:-1,overflow:"visible",overflowY:"auto",border:d=>`1px solid ${d.palette.divider}`,boxShadow:d=>d.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:f})]}):f}function rQ(){var t,n;const e=Ct(ya);return S.jsx(kwe,{elevation:0,color:"transparent",position:"static",children:S.jsxs(UAe,{sx:{minHeight:"60px !important",borderBottomWidth:"1px",borderBottomStyle:"solid",background:r=>r.palette.background.paper,borderBottomColor:r=>r.palette.divider},children:[S.jsx(Ht,{alignItems:"center",direction:"row",children:S.jsx(_vt,{hasDb:!!((t=e==null?void 0:e.project)!=null&&t.database),hasReadme:!!(e!=null&&e.markdown)})}),S.jsxs(Ht,{alignItems:"center",sx:{ml:"auto"},direction:"row",spacing:1,color:"text.primary",children:[S.jsx(vvt,{}),S.jsx(at,{ml:1}),S.jsx(Xmt,{href:(n=e==null?void 0:e.ui)==null?void 0:n.github}),S.jsx(fvt,{})]})]})})}const e0=({children:e})=>{var d;const{isProjectMember:t,authenticating:n,isAuthenticated:r,accessToken:i,role:o}=sc(),a=Ct(ya),s=Ct(cS),l=Zu(),u=a&&!((d=a.project)!=null&&d.public);if(T.useEffect(()=>{var p,g;if((p=a==null?void 0:a.project)!=null&&p.user_env)for(const v of((g=a.project)==null?void 0:g.user_env)||[])s[v]||l("/env");u&&!r&&!n&&l("/login")},[a,r,n,s]),!a||u&&(!i||!o))return null;const f=u&&o&&!t;return S.jsxs(at,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:[S.jsx(rQ,{}),f?S.jsx(ro,{severity:"error",children:"You are not part of this project."}):e]})},SC=Yn({key:"DatasetFilters",default:{}});function xvt(){const e=Ct(V2),[t,n]=ir(SC),{data:r,isLoading:i}=bh("/project/members");if(!i||!r||e==="USER")return null;const o=[{value:"All",label:"All"},...r.map(s=>({value:s.email,label:s.email}))],a=s=>{const l=s.target.value;n({...t,authorEmail:l==="All"?void 0:l})};return S.jsx(at,{sx:{width:200},children:S.jsx(zh,{items:o,id:"author-filter-select",value:t.authorEmail||"All",label:"Author",onChange:a})})}const wvt=[{value:0,label:"All"},{value:1,label:"Good"},{value:-1,label:"Bad"}];function Svt(){const[e,t]=ir(SC),n=r=>{t({...e,feedback:parseInt(r.target.value)})};return S.jsx(at,{sx:{width:120},children:S.jsx(zh,{items:wvt,id:"feedback-filter-select",value:e.feedback||0,label:"Feedback",onChange:n})})}var Cvt=rs,Evt=function(){return Cvt.Date.now()},kvt=Evt,Tvt=/\s/;function Rvt(e){for(var t=e.length;t--&&Tvt.test(e.charAt(t)););return t}var Avt=Rvt,$vt=Avt,Ovt=/^\s+/;function Ivt(e){return e&&e.slice(0,$vt(e)+1).replace(Ovt,"")}var Dvt=Ivt,Pvt=Dvt,Z6=is,Lvt=dC,J6=0/0,Mvt=/^[-+]0x[0-9a-f]+$/i,Fvt=/^0b[01]+$/i,Nvt=/^0o[0-7]+$/i,Bvt=parseInt;function jvt(e){if(typeof e=="number")return e;if(Lvt(e))return J6;if(Z6(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Z6(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Pvt(e);var n=Fvt.test(e);return n||Nvt.test(e)?Bvt(e.slice(2),n?2:8):Mvt.test(e)?J6:+e}var zvt=jvt,Uvt=is,VT=kvt,Q6=zvt,Kvt="Expected a function",Wvt=Math.max,Vvt=Math.min;function Hvt(e,t,n){var r,i,o,a,s,l,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(Kvt);t=Q6(t)||0,Uvt(n)&&(f=!!n.leading,d="maxWait"in n,o=d?Wvt(Q6(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p);function g(A){var O=r,z=i;return r=i=void 0,u=A,a=e.apply(z,O),a}function v(A){return u=A,s=setTimeout(b,t),f?g(A):a}function y(A){var O=A-l,z=A-u,V=t-O;return d?Vvt(V,o-z):V}function w(A){var O=A-l,z=A-u;return l===void 0||O>=t||O<0||d&&z>=o}function b(){var A=VT();if(w(A))return x(A);s=setTimeout(b,y(A))}function x(A){return s=void 0,p&&r?g(A):(r=i=void 0,a)}function C(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function k(){return s===void 0?a:x(VT())}function R(){var A=VT(),O=w(A);if(r=arguments,i=this,l=A,O){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(b,t),g(l)}return s===void 0&&(s=setTimeout(b,t)),a}return R.cancel=C,R.flush=k,R}var qvt=Hvt;const Gvt=_i(qvt);var EP={},Yvt=vn;Object.defineProperty(EP,"__esModule",{value:!0});var iQ=EP.default=void 0,Xvt=Yvt(yn()),Zvt=S,Jvt=(0,Xvt.default)((0,Zvt.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");iQ=EP.default=Jvt;const Qvt=Me("div")(({theme:e})=>({position:"relative",color:e.palette.text.primary,borderRadius:e.shape.borderRadius,border:`${e.palette.divider} solid 1px`,"&:hover":{border:`${e.palette.primary} solid 1px !important`},marginLeft:0,display:"flex",[e.breakpoints.up("sm")]:{width:"auto"}})),eU=Me("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center"})),eyt=Me(rS)(({theme:e})=>({color:"inherit","& .MuiInputBase-input":{padding:e.spacing(1,1,1,0),paddingLeft:`calc(1em + ${e.spacing(3)})`,transition:e.transitions.create("width"),width:"100%",[e.breakpoints.up("md")]:{width:"20ch"}}}));function tyt(){const[e,t]=ir(SC),r=Gvt(a=>{a=a.trim(),t({...e,search:a===""?void 0:a})},300),i=T.useRef(),o=()=>{r(""),i.current&&(i.current.value="")};return S.jsxs(Qvt,{children:[S.jsx(eU,{sx:{position:"absolute",pointerEvents:"none",height:"100%",paddingX:1},children:S.jsx(iQ,{})}),S.jsx(eyt,{placeholder:"Search messages...",inputProps:{"aria-label":"search",ref:i},onChange:a=>r(a.target.value)}),S.jsx(eU,{children:S.jsx(or,{onClick:o,children:S.jsx(yh,{})})})]})}function nyt(){return S.jsxs(Ht,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[S.jsx(tyt,{}),S.jsxs(Ht,{direction:"row",alignItems:"center",spacing:2,children:[S.jsx(Svt,{}),S.jsx(xvt,{})]})]})}var ryt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{},oQ={};let ua;typeof window<"u"?ua=window:typeof self<"u"?ua=self:ua=ryt;let M$=null,F$=null;const tU=20,HT=ua.clearTimeout,nU=ua.setTimeout,qT=ua.cancelAnimationFrame||ua.mozCancelAnimationFrame||ua.webkitCancelAnimationFrame,rU=ua.requestAnimationFrame||ua.mozRequestAnimationFrame||ua.webkitRequestAnimationFrame;qT==null||rU==null?(M$=HT,F$=function(t){return nU(t,tU)}):(M$=function([t,n]){qT(t),HT(n)},F$=function(t){const n=rU(function(){HT(r),t()}),r=nU(function(){qT(n),t()},tU);return[n,r]});function iyt(e){let t,n,r,i,o,a,s;const l=typeof document<"u"&&document.attachEvent;if(!l){a=function(b){const x=b.__resizeTriggers__,C=x.firstElementChild,k=x.lastElementChild,R=C.firstElementChild;k.scrollLeft=k.scrollWidth,k.scrollTop=k.scrollHeight,R.style.width=C.offsetWidth+1+"px",R.style.height=C.offsetHeight+1+"px",C.scrollLeft=C.scrollWidth,C.scrollTop=C.scrollHeight},o=function(b){return b.offsetWidth!==b.__resizeLast__.width||b.offsetHeight!==b.__resizeLast__.height},s=function(b){if(b.target.className&&typeof b.target.className.indexOf=="function"&&b.target.className.indexOf("contract-trigger")<0&&b.target.className.indexOf("expand-trigger")<0)return;const x=this;a(this),this.__resizeRAF__&&M$(this.__resizeRAF__),this.__resizeRAF__=F$(function(){o(x)&&(x.__resizeLast__.width=x.offsetWidth,x.__resizeLast__.height=x.offsetHeight,x.__resizeListeners__.forEach(function(R){R.call(x,b)}))})};let p=!1,g="";r="animationstart";const v="Webkit Moz O ms".split(" ");let y="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),w="";{const b=document.createElement("fakeelement");if(b.style.animationName!==void 0&&(p=!0),p===!1){for(let x=0;x<v.length;x++)if(b.style[v[x]+"AnimationName"]!==void 0){w=v[x],g="-"+w.toLowerCase()+"-",r=y[x],p=!0;break}}}n="resizeanim",t="@"+g+"keyframes "+n+" { from { opacity: 0; } to { opacity: 0; } } ",i=g+"animation: 1ms "+n+"; "}const u=function(p){if(!p.getElementById("detectElementResize")){const g=(t||"")+".resize-triggers { "+(i||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',v=p.head||p.getElementsByTagName("head")[0],y=p.createElement("style");y.id="detectElementResize",y.type="text/css",e!=null&&y.setAttribute("nonce",e),y.styleSheet?y.styleSheet.cssText=g:y.appendChild(p.createTextNode(g)),v.appendChild(y)}};return{addResizeListener:function(p,g){if(l)p.attachEvent("onresize",g);else{if(!p.__resizeTriggers__){const v=p.ownerDocument,y=ua.getComputedStyle(p);y&&y.position==="static"&&(p.style.position="relative"),u(v),p.__resizeLast__={},p.__resizeListeners__=[],(p.__resizeTriggers__=v.createElement("div")).className="resize-triggers";const w=v.createElement("div");w.className="expand-trigger",w.appendChild(v.createElement("div"));const b=v.createElement("div");b.className="contract-trigger",p.__resizeTriggers__.appendChild(w),p.__resizeTriggers__.appendChild(b),p.appendChild(p.__resizeTriggers__),a(p),p.addEventListener("scroll",s,!0),r&&(p.__resizeTriggers__.__animationListener__=function(C){C.animationName===n&&a(p)},p.__resizeTriggers__.addEventListener(r,p.__resizeTriggers__.__animationListener__))}p.__resizeListeners__.push(g)}},removeResizeListener:function(p,g){if(l)p.detachEvent("onresize",g);else if(p.__resizeListeners__.splice(p.__resizeListeners__.indexOf(g),1),!p.__resizeListeners__.length){p.removeEventListener("scroll",s,!0),p.__resizeTriggers__.__animationListener__&&(p.__resizeTriggers__.removeEventListener(r,p.__resizeTriggers__.__animationListener__),p.__resizeTriggers__.__animationListener__=null);try{p.__resizeTriggers__=!p.removeChild(p.__resizeTriggers__)}catch{}}}}}oQ={createDetectElementResize:iyt};class aQ extends T.Component{constructor(){super(...arguments);ds(this,"state",{height:this.props.defaultHeight||0,width:this.props.defaultWidth||0});ds(this,"_parentNode",null);ds(this,"_autoSizer",null);ds(this,"_detectElementResize",null);ds(this,"_onResize",()=>{const{disableHeight:n,disableWidth:r,onResize:i}=this.props;if(this._parentNode){const o=this._parentNode.getBoundingClientRect(),a=o.height||0,s=o.width||0,l=window.getComputedStyle(this._parentNode)||{},u=parseInt(l.paddingLeft,10)||0,f=parseInt(l.paddingRight,10)||0,d=parseInt(l.paddingTop,10)||0,p=parseInt(l.paddingBottom,10)||0,g=a-d-p,v=s-u-f;(!n&&this.state.height!==g||!r&&this.state.width!==v)&&(this.setState({height:a-d-p,width:s-u-f}),typeof i=="function"&&i({height:a,width:s}))}});ds(this,"_setRef",n=>{this._autoSizer=n})}componentDidMount(){const{nonce:n}=this.props;if(this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement){this._parentNode=this._autoSizer.parentNode;const r=(0,oQ.createDetectElementResize)(n);r.addResizeListener(this._parentNode,this._onResize),this._detectElementResize=r,this._onResize()}}componentWillUnmount(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}render(){const{children:n,defaultHeight:r,defaultWidth:i,disableHeight:o,disableWidth:a,nonce:s,onResize:l,style:u,tagName:f="div",...d}=this.props,{height:p,width:g}=this.state,v={overflow:"visible"},y={};let w=!1;return o||(p===0&&(w=!0),v.height=0,y.height=p),a||(g===0&&(w=!0),v.width=0,y.width=g),T.createElement(f,{ref:this._setRef,style:{...v,...u},...d},!w&&n(y))}}ds(aQ,"defaultProps",{onResize:()=>{},disableHeight:!1,disableWidth:!1,style:{}});var oyt=aQ,iU=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function ayt(e,t){return!!(e===t||iU(e)&&iU(t))}function syt(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ayt(e[n],t[n]))return!1;return!0}function GT(e,t){t===void 0&&(t=syt);var n,r=[],i,o=!1;function a(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return o&&n===this&&t(s,r)||(i=e.apply(this,s),o=!0,n=this,r=s),i}return a}var lyt=typeof performance=="object"&&typeof performance.now=="function",oU=lyt?function(){return performance.now()}:function(){return Date.now()};function aU(e){cancelAnimationFrame(e.id)}function uyt(e,t){var n=oU();function r(){oU()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var YT=-1;function sU(e){if(e===void 0&&(e=!1),YT===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),YT=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return YT}var Bd=null;function lU(e){if(e===void 0&&(e=!1),Bd===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Bd="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Bd="negative":Bd="positive-ascending"),document.body.removeChild(t),Bd}return Bd}var cyt=150,fyt=function(t,n){return t};function dyt(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,f=e.validateProps;return t=function(d){D2(p,d);function p(v){var y;return y=d.call(this,v)||this,y._instanceProps=l(y.props,G_(y)),y._outerRef=void 0,y._resetIsScrollingTimeoutId=null,y.state={instance:G_(y),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof y.props.initialScrollOffset=="number"?y.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},y._callOnItemsRendered=void 0,y._callOnItemsRendered=GT(function(w,b,x,C){return y.props.onItemsRendered({overscanStartIndex:w,overscanStopIndex:b,visibleStartIndex:x,visibleStopIndex:C})}),y._callOnScroll=void 0,y._callOnScroll=GT(function(w,b,x){return y.props.onScroll({scrollDirection:w,scrollOffset:b,scrollUpdateWasRequested:x})}),y._getItemStyle=void 0,y._getItemStyle=function(w){var b=y.props,x=b.direction,C=b.itemSize,k=b.layout,R=y._getItemStyleCache(u&&C,u&&k,u&&x),A;if(R.hasOwnProperty(w))A=R[w];else{var O=n(y.props,w,y._instanceProps),z=i(y.props,w,y._instanceProps),V=x==="horizontal"||k==="horizontal",D=x==="rtl",W=V?O:0;R[w]=A={position:"absolute",left:D?void 0:W,right:D?W:void 0,top:V?0:O,height:V?"100%":z,width:V?z:"100%"}}return A},y._getItemStyleCache=void 0,y._getItemStyleCache=GT(function(w,b,x){return{}}),y._onScrollHorizontal=function(w){var b=w.currentTarget,x=b.clientWidth,C=b.scrollLeft,k=b.scrollWidth;y.setState(function(R){if(R.scrollOffset===C)return null;var A=y.props.direction,O=C;if(A==="rtl")switch(lU()){case"negative":O=-C;break;case"positive-descending":O=k-x-C;break}return O=Math.max(0,Math.min(O,k-x)),{isScrolling:!0,scrollDirection:R.scrollOffset<C?"forward":"backward",scrollOffset:O,scrollUpdateWasRequested:!1}},y._resetIsScrollingDebounced)},y._onScrollVertical=function(w){var b=w.currentTarget,x=b.clientHeight,C=b.scrollHeight,k=b.scrollTop;y.setState(function(R){if(R.scrollOffset===k)return null;var A=Math.max(0,Math.min(k,C-x));return{isScrolling:!0,scrollDirection:R.scrollOffset<A?"forward":"backward",scrollOffset:A,scrollUpdateWasRequested:!1}},y._resetIsScrollingDebounced)},y._outerRefSetter=function(w){var b=y.props.outerRef;y._outerRef=w,typeof b=="function"?b(w):b!=null&&typeof b=="object"&&b.hasOwnProperty("current")&&(b.current=w)},y._resetIsScrollingDebounced=function(){y._resetIsScrollingTimeoutId!==null&&aU(y._resetIsScrollingTimeoutId),y._resetIsScrollingTimeoutId=uyt(y._resetIsScrolling,cyt)},y._resetIsScrolling=function(){y._resetIsScrollingTimeoutId=null,y.setState({isScrolling:!1},function(){y._getItemStyleCache(-1,null)})},y}p.getDerivedStateFromProps=function(y,w){return pyt(y,w),f(y),null};var g=p.prototype;return g.scrollTo=function(y){y=Math.max(0,y),this.setState(function(w){return w.scrollOffset===y?null:{scrollDirection:w.scrollOffset<y?"forward":"backward",scrollOffset:y,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(y,w){w===void 0&&(w="auto");var b=this.props,x=b.itemCount,C=b.layout,k=this.state.scrollOffset;y=Math.max(0,Math.min(y,x-1));var R=0;if(this._outerRef){var A=this._outerRef;C==="vertical"?R=A.scrollWidth>A.clientWidth?sU():0:R=A.scrollHeight>A.clientHeight?sU():0}this.scrollTo(o(this.props,y,w,k,this._instanceProps,R))},g.componentDidMount=function(){var y=this.props,w=y.direction,b=y.initialScrollOffset,x=y.layout;if(typeof b=="number"&&this._outerRef!=null){var C=this._outerRef;w==="horizontal"||x==="horizontal"?C.scrollLeft=b:C.scrollTop=b}this._callPropsCallbacks()},g.componentDidUpdate=function(){var y=this.props,w=y.direction,b=y.layout,x=this.state,C=x.scrollOffset,k=x.scrollUpdateWasRequested;if(k&&this._outerRef!=null){var R=this._outerRef;if(w==="horizontal"||b==="horizontal")if(w==="rtl")switch(lU()){case"negative":R.scrollLeft=-C;break;case"positive-ascending":R.scrollLeft=C;break;default:var A=R.clientWidth,O=R.scrollWidth;R.scrollLeft=O-A-C;break}else R.scrollLeft=C;else R.scrollTop=C}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&aU(this._resetIsScrollingTimeoutId)},g.render=function(){var y=this.props,w=y.children,b=y.className,x=y.direction,C=y.height,k=y.innerRef,R=y.innerElementType,A=y.innerTagName,O=y.itemCount,z=y.itemData,V=y.itemKey,D=V===void 0?fyt:V,W=y.layout,ie=y.outerElementType,se=y.outerTagName,K=y.style,G=y.useIsScrolling,Q=y.width,le=this.state.isScrolling,Z=x==="horizontal"||W==="horizontal",ee=Z?this._onScrollHorizontal:this._onScrollVertical,P=this._getRangeToRender(),ge=P[0],B=P[1],L=[];if(O>0)for(var ae=ge;ae<=B;ae++)L.push(T.createElement(w,{data:z,key:D(ae,z),index:ae,isScrolling:G?le:void 0,style:this._getItemStyle(ae)}));var ue=r(this.props,this._instanceProps);return T.createElement(ie||se||"div",{className:b,onScroll:ee,ref:this._outerRefSetter,style:M({position:"relative",height:C,width:Q,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:x},K)},T.createElement(R||A||"div",{children:L,ref:k,style:{height:Z?"100%":ue,pointerEvents:le?"none":void 0,width:Z?ue:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var y=this.props.itemCount;if(y>0){var w=this._getRangeToRender(),b=w[0],x=w[1],C=w[2],k=w[3];this._callOnItemsRendered(b,x,C,k)}}if(typeof this.props.onScroll=="function"){var R=this.state,A=R.scrollDirection,O=R.scrollOffset,z=R.scrollUpdateWasRequested;this._callOnScroll(A,O,z)}},g._getRangeToRender=function(){var y=this.props,w=y.itemCount,b=y.overscanCount,x=this.state,C=x.isScrolling,k=x.scrollDirection,R=x.scrollOffset;if(w===0)return[0,0,0,0];var A=a(this.props,R,this._instanceProps),O=s(this.props,A,R,this._instanceProps),z=!C||k==="backward"?Math.max(1,b):1,V=!C||k==="forward"?Math.max(1,b):1;return[Math.max(0,A-z),Math.max(0,Math.min(w-1,O+V)),A,O]},p}(T.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var pyt=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},hyt=dyt({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,i,o,a){var s=t.direction,l=t.height,u=t.itemCount,f=t.itemSize,d=t.layout,p=t.width,g=s==="horizontal"||d==="horizontal",v=g?p:l,y=Math.max(0,u*f-v),w=Math.min(y,n*f),b=Math.max(0,n*f-v+f+a);switch(r==="smart"&&(i>=b-v&&i<=w+v?r="auto":r="center"),r){case"start":return w;case"end":return b;case"center":{var x=Math.round(b+(w-b)/2);return x<Math.ceil(v/2)?0:x>y+Math.floor(v/2)?y:x}case"auto":default:return i>=b&&i<=w?i:i<b?b:w}},getStartIndexForOffset:function(t,n){var r=t.itemCount,i=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/i)))},getStopIndexForStartIndex:function(t,n,r){var i=t.direction,o=t.height,a=t.itemCount,s=t.itemSize,l=t.layout,u=t.width,f=i==="horizontal"||l==="horizontal",d=n*s,p=f?u:o,g=Math.ceil((p+r-d)/s);return Math.max(0,Math.min(a-1,n+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function gyt(e){var t=e.lastRenderedStartIndex,n=e.lastRenderedStopIndex,r=e.startIndex,i=e.stopIndex;return!(r>n||i<t)}function myt(e){for(var t=e.isItemLoaded,n=e.itemCount,r=e.minimumBatchSize,i=e.startIndex,o=e.stopIndex,a=[],s=null,l=null,u=i;u<=o;u++){var f=t(u);f?l!==null&&(a.push(s,l),s=l=null):(l=u,s===null&&(s=u))}if(l!==null){for(var d=Math.min(Math.max(l,s+r-1),n-1),p=l+1;p<=d&&!t(p);p++)l=p;a.push(s,l)}if(a.length)for(;a[1]-a[0]+1<r&&a[0]>0;){var g=a[0]-1;if(!t(g))a[0]=g;else break}return a}var vyt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},yyt=function(){function e(t,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),byt=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},uU=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},_yt=function(e){byt(t,e);function t(){var n,r,i,o;vyt(this,t);for(var a=arguments.length,s=Array(a),l=0;l<a;l++)s[l]=arguments[l];return o=(r=(i=uU(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(s))),i),i._lastRenderedStartIndex=-1,i._lastRenderedStopIndex=-1,i._memoizedUnloadedRanges=[],i._onItemsRendered=function(u){var f=u.visibleStartIndex,d=u.visibleStopIndex;i._lastRenderedStartIndex=f,i._lastRenderedStopIndex=d,i._ensureRowsLoaded(f,d)},i._setRef=function(u){i._listRef=u},r),uU(i,o)}return yyt(t,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,i){var o=this.props,a=o.isItemLoaded,s=o.itemCount,l=o.minimumBatchSize,u=l===void 0?10:l,f=o.threshold,d=f===void 0?15:f,p=myt({isItemLoaded:a,itemCount:s,minimumBatchSize:u,startIndex:Math.max(0,r-d),stopIndex:Math.min(s-1,i+d)});(this._memoizedUnloadedRanges.length!==p.length||this._memoizedUnloadedRanges.some(function(g,v){return p[v]!==g}))&&(this._memoizedUnloadedRanges=p,this._loadUnloadedRanges(p))}},{key:"_loadUnloadedRanges",value:function(r){for(var i=this,o=this.props.loadMoreItems||this.props.loadMoreRows,a=function(u){var f=r[u],d=r[u+1],p=o(f,d);p!=null&&p.then(function(){if(gyt({lastRenderedStartIndex:i._lastRenderedStartIndex,lastRenderedStopIndex:i._lastRenderedStopIndex,startIndex:f,stopIndex:d})){if(i._listRef==null)return;typeof i._listRef.resetAfterIndex=="function"?i._listRef.resetAfterIndex(f,!0):(typeof i._listRef._getItemStyleCache=="function"&&i._listRef._getItemStyleCache(-1),i._listRef.forceUpdate())}})},s=0;s<r.length;s+=2)a(s)}}]),t}(T.PureComponent),kP={},xyt=vn;Object.defineProperty(kP,"__esModule",{value:!0});var sQ=kP.default=void 0,wyt=xyt(yn()),Syt=S,Cyt=(0,wyt.default)((0,Syt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");sQ=kP.default=Cyt;function Eyt({conversationId:e,onDelete:t}){const[n,r]=T.useState(!1),i=Ct(Df),o=()=>{r(!0)},a=()=>{r(!1)},s=async()=>{await pv.promise(OS.deleteConversation(e,i),{loading:"Deleting conversation...",success:"Conversation deleted!",error:l=>l instanceof kA?S.jsx("span",{children:l.message}):S.jsx("span",{})}),t(),a()};return S.jsxs("div",{children:[S.jsx(or,{className:"delete-conversation-button",size:"small",color:"error",onClick:o,children:S.jsx(sQ,{})}),n&&S.jsxs(mh,{open:n,onClose:a,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",PaperProps:{sx:{backgroundImage:"none"}},children:[S.jsx(by,{id:"alert-dialog-title",children:"Delete conversation?"}),S.jsx(vh,{children:S.jsx(oV,{id:"alert-dialog-description",children:"This will delete the conversation as well as it's messages and elements."})}),S.jsxs(oS,{sx:{color:"text.secondary",p:2},children:[S.jsx(If,{variant:"outlined",color:"inherit",onClick:a,children:"Cancel"}),S.jsx(RS,{variant:"outlined",color:"primary",onClick:s,autoFocus:!0,children:"Confirm"})]})]})]})}var TP={},kyt=vn;Object.defineProperty(TP,"__esModule",{value:!0});var lQ=TP.default=void 0,Tyt=kyt(yn()),Ryt=S,Ayt=(0,Tyt.default)((0,Ryt.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility");lQ=TP.default=Ayt;function $yt({conversationId:e}){return S.jsx(or,{className:"open-conversation-button",component:ey,to:`/conversations/${e}`,size:"small",color:"primary",children:S.jsx(lQ,{})})}const Oyt=30,Iyt=e=>{const t={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"};return new Date(e).toLocaleDateString(void 0,t)};function Dyt(){const e=Ct(SC),t=Ct(Df),[n,r]=T.useState([]),[i,o]=T.useState(),[a,s]=T.useState(void 0),[l,u]=T.useState(!0),f=T.useCallback(async x=>{try{const{pageInfo:C,data:k}=await OS.getConversations({first:Oyt,cursor:x},e,t);o(C),s(void 0),r(R=>[...R,...k])}catch(C){C instanceof Error&&s(C.message)}finally{u(!1)}},[t,e]),d=T.useCallback(async()=>{r([]),u(!0),o(void 0),f(void 0)},[f]);T.useEffect(()=>{d()},[d]);const p=T.useCallback(()=>{i!=null&&i.hasNextPage&&f(i.endCursor)},[i,f]);if(a)return S.jsx(ro,{severity:"error",children:a.message});if(l)return S.jsx(Yt,{color:"text.primary",children:"Loading..."});const g=n.length;if(g===0)return S.jsx(ro,{severity:"info",children:"No result"});const v={Id:{minWidth:"60px",width:"5%"},Author:{minWidth:"130px",width:"25%"},Input:{minWidth:"200px",width:"35%"},Date:{minWidth:"120px",width:"25%"},Actions:{minWidth:"80px",width:"10%"}},y=({text:x,col:C})=>S.jsx(Yt,{noWrap:!0,sx:{width:C.width,minWidth:C.minWidth,fontSize:"0.875rem"},color:"text.primary",children:x}),w=({index:x,style:C})=>{var R,A;const k=n[x];return S.jsxs(at,{className:"conversation-row",style:C,sx:{display:"flex",alignItems:"center",borderBottom:O=>`1px solid ${O.palette.divider}`},children:[S.jsx(y,{text:k.id,col:v.Id}),S.jsx(y,{text:((R=k.author)==null?void 0:R.email)||"LocalUser",col:v.Author}),S.jsx(y,{text:(A=k.messages[0])==null?void 0:A.content,col:v.Input}),S.jsx(y,{text:Iyt(k.createdAt),col:v.Date}),S.jsxs(Ht,{direction:"row",sx:{width:v.Actions.width,minWidth:v.Actions.minWidth},children:[S.jsx($yt,{conversationId:k.id}),S.jsx(Eyt,{conversationId:k.id,onDelete:()=>d()})]})]})},b=Object.entries(v).map(([x,C])=>S.jsx(Yt,{sx:{fontSize:"0.875rem",width:C.width,minWidth:C.minWidth},color:"primary",children:x},x));return S.jsxs(at,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[S.jsx(at,{sx:{display:"flex",alignItems:"center",height:"40px",borderBottom:x=>`1px solid ${x.palette.divider}`},children:b}),S.jsx(at,{flexGrow:1,children:S.jsx(oyt,{children:({height:x,width:C})=>S.jsx(_yt,{isItemLoaded:k=>!!n[k],itemCount:i!=null&&i.hasNextPage?g+1:g,loadMoreItems:p,children:({onItemsRendered:k,ref:R})=>S.jsx(hyt,{height:x,width:C,itemSize:55,itemCount:g,onItemsRendered:k,ref:R,children:w})})})})]})}function Pyt(){return S.jsxs(at,{display:"flex",flexDirection:"column",width:"100%",maxWidth:"60rem",mx:"auto",flexGrow:1,children:[S.jsx(at,{my:2}),S.jsx(nyt,{}),S.jsx(at,{my:2}),S.jsx(Dyt,{})]})}function Lyt(){return S.jsx(e0,{children:S.jsx(Pyt,{})})}function Myt(){const e=Zu();return ir(Hs),Ty(),T.useState("Platform"),e&&e("/"),S.jsx(S.Fragment,{})}function Fyt(){return S.jsx(e0,{children:S.jsx(bBe,{})})}function Nyt(){const[e,t]=ir(cS),n=Ct(ya),r=Zu(),i=(n==null?void 0:n.project.user_env)||[],o={},a={};i.forEach(f=>{o[f]=e[f]||"",a[f]=Cx().required()});const s=gP(a),l=cP({initialValues:o,validationSchema:s,onSubmit:async f=>{localStorage.setItem("userEnv",JSON.stringify(f)),t(f),gi.success("Saved successfully"),r("/")}});i.length===0&&r("/");const u=f=>{const d=!!l.errors[f];return S.jsx(L$,{id:f,className:f,label:f,value:l.values[f],size:"medium",hasError:d,description:d?l.errors[f]:"",onChange:p=>l.setFieldValue(f,p.target.value)})};return S.jsxs(at,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[S.jsx(rQ,{}),S.jsxs(at,{id:"env",display:"flex",flexDirection:"column",flexGrow:1,gap:2,sx:{maxWidth:"60rem",width:"100%",mx:"auto"},children:[S.jsx(Yt,{mt:5,fontSize:"18px",fontWeight:700,color:"text.primary",children:"Required API keys"}),S.jsx(ro,{severity:"info",children:"To use this app, the following API keys are required. The keys are stored on your device's local storage."}),S.jsxs("form",{onSubmit:l.handleSubmit,children:[i.map(f=>u(f)),S.jsx(If,{id:"submit-env",fullWidth:!0,type:"submit",variant:"contained",sx:{mt:1},children:"Save"})]})]})]})}const Byt=({status:e})=>e==="running"?S.jsx(at,{sx:{marginTop:"-2px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:_t[700]},children:S.jsx(B2,{color:"inherit",size:18})}):S.jsxs(V_,{width:24,height:24,sx:{marginTop:"-2px",fill:"none"},children:[e==="done"&&S.jsxs(S.Fragment,{children:[S.jsx("circle",{cx:12,cy:12,r:9,fill:oI[500]}),S.jsx("path",{stroke:Tl,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m15.333 9.5-4.583 4.583L8.667 12"})]}),e==="ready"&&S.jsx("circle",{cx:12,cy:12,r:8.25,stroke:_t[700],strokeWidth:1.5}),e==="failed"&&S.jsxs(S.Fragment,{children:[S.jsx("circle",{cx:12,cy:12,r:9,fill:As[500]}),S.jsx("path",{stroke:Tl,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m14.5 9.5-5 5m0-5 5 5"})]})]}),cU=({index:e,task:t})=>{const n=gn(zq),r=Xn();return S.jsx(iv,{disableGutters:!0,className:`task task-status-${t.status}`,children:S.jsxs(Ake,{disableRipple:!t.forId,sx:{color:{ready:r.palette.mode==="dark"?_t[300]:_t[700],running:r.palette.mode==="dark"?_t[100]:_t[850],done:_t[500],failed:_t[500]}[t.status]||r.palette.text.secondary,fontWeight:t.status==="running"?"700":"500",alignItems:"flex-start",fontSize:"14px",lineHeight:1.36,cursor:t.forId?"pointer":"default"},onClick:()=>{if(t.forId){n(t.forId);const i=document.getElementById(`message-${t.forId}`);i&&i.scrollIntoView({behavior:"smooth",block:"start",inline:"start"})}},children:[S.jsx(at,{sx:{paddingRight:r.spacing(1),flex:"0 0 18px",width:"18px"},children:e}),S.jsx(Byt,{status:t.status}),S.jsx(at,{sx:{paddingLeft:r.spacing(2)},children:t.title})]})})},fU=({status:e})=>{const t=Xn();return S.jsxs(at,{sx:{display:"flex",alignItems:"center",flexDirection:"row",padding:t.spacing(2)},children:[S.jsx(at,{sx:{flexGrow:"1",fontWeight:"600",paddingLeft:t.spacing(1)},children:"🗒️ Task List"}),S.jsx(F2,{label:e||"?",sx:{fontWeight:"500",borderRadius:"4px",backgroundColor:t.palette.background.default,color:t.palette.mode==="dark"?_t[500]:_t[600]}})]})},dU=e=>({background:e.palette.background.paper,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:"100%",display:"flex",flexDirection:"column",boxShadow:e.palette.mode==="dark"?"0px 4px 20px 0px rgba(0, 0, 0, 0.20)":"0px 4px 20px 0px rgba(0, 0, 0, 0.05)"});function pU({tasklist:e,isMobile:t}){const n=Xn();let r=null;try{e!=null&&e.content&&(r=JSON.parse(e.content))}catch(o){console.error(o),r=null}if(!r)return null;const i=r.tasks;if(t){let o=i.length-1;for(let s=0;s<i.length;s++)if(i[s].status==="running"||i[s].status==="ready"){o=s;break}const a=i==null?void 0:i[o];return S.jsx(at,{component:"aside",sx:{color:n.palette.text.primary,padding:n.spacing(2),width:"100%",boxSizing:"border-box",display:{xs:"flex",md:"none"}},className:"tasklist tasklist-mobile",children:S.jsxs(at,{sx:{...dU(n)},children:[S.jsx(fU,{status:r.status}),a&&S.jsx(Y_,{children:S.jsx(cU,{index:o+1,task:a})})]})})}return S.jsx(at,{component:"aside",sx:{color:n.palette.text.primary,padding:n.spacing(2),width:"380px",flexShrink:"0",display:{xs:"none",md:"flex"}},className:"tasklist tasklist-desktop",children:S.jsxs(at,{sx:{...dU(n)},children:[S.jsx(fU,{status:r==null?void 0:r.status}),S.jsx(at,{sx:{overflowY:"auto"},children:S.jsx(Y_,{children:i==null?void 0:i.map((o,a)=>S.jsx(cU,{index:a+1,task:o},a))})})]})})}const jyt="chat_history",zyt=e=>({setSelf:t,onSet:n})=>{const r=localStorage.getItem(e);r!=null&&t(JSON.parse(r)),n((i,o,a)=>{a?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(i))})},RP=Yn({key:"ChatHistory",default:{open:!1,messages:[]},effects:[zyt(jyt)]});function Uyt(){const[e,t]=ir(Ry),n=Ct(uc);if(!e)return null;const r=()=>{t(!1),n==null||n.socket.emit("stop")};return S.jsx(at,{margin:"auto",children:S.jsx(sI,{id:"stop-button",startIcon:S.jsx(yh,{}),variant:"contained",onClick:r,children:"Stop task"})})}var AP={},Kyt=vn;Object.defineProperty(AP,"__esModule",{value:!0});var uQ=AP.default=void 0;Hyt(T);var Wyt=Kyt(yn()),Vyt=S;function cQ(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(cQ=function(r){return r?n:t})(e)}function Hyt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=cQ(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}var qyt=(0,Wyt.default)((0,Vyt.jsx)("path",{d:"M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"}),"Telegram");uQ=AP.default=qyt;var $P={},Gyt=vn;Object.defineProperty($P,"__esModule",{value:!0});var fQ=$P.default=void 0,Yyt=Gyt(yn()),hU=S,Xyt=(0,Yyt.default)([(0,hU.jsx)("path",{d:"M15 2h-3.5l-1-1h-5l-1 1H1v2h14zm1 7c-.7 0-1.37.1-2 .29V5H2v12c0 1.1.9 2 2 2h5.68c1.12 2.36 3.53 4 6.32 4 3.87 0 7-3.13 7-7s-3.13-7-7-7zm0 12c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"},"0"),(0,hU.jsx)("path",{d:"M16.5 12H15v5l3.6 2.1.8-1.2-2.9-1.7z"},"1")],"AutoDelete");fQ=$P.default=Xyt;var OP={},Zyt=vn;Object.defineProperty(OP,"__esModule",{value:!0});var dQ=OP.default=void 0,Jyt=Zyt(yn()),gU=S,Qyt=(0,Jyt.default)([(0,gU.jsx)("path",{d:"M6 17.59 7.41 19 12 14.42 16.59 19 18 17.59l-6-6z"},"0"),(0,gU.jsx)("path",{d:"m6 11 1.41 1.41L12 7.83l4.59 4.58L18 11l-6-6z"},"1")],"KeyboardDoubleArrowUp");dQ=OP.default=Qyt;function e0t(e){const t={},n=PJ(e).reverse();return n==null||n.forEach(r=>{const{createdAt:i,content:o}=r,a={day:"numeric",month:"numeric",year:"numeric"},s=new Date(i).toLocaleDateString(void 0,a);t[s]||(t[s]=[]);const l={hour:"numeric",minute:"numeric"};t[s].push({key:i,hour:new Date(i).toLocaleTimeString(void 0,l),content:o})}),t}function t0t({onClick:e}){const[t,n]=ir(RP),r=T.useRef(),[i,o]=T.useState(null);t.open&&!i&&r.current&&o(r.current);const a=p=>n(g=>({...g,open:p})),s=S.jsxs(Ht,{disabled:!0,direction:"row",p:1,justifyContent:"space-between",alignItems:"center",children:[S.jsx(Yt,{color:"text.primary",sx:{fontSize:"14px",fontWeight:700},children:"Last messages"}),S.jsx(or,{onClick:()=>n(p=>({...p,messages:[]})),children:S.jsx(fQ,{})})]},"title"),l=(t==null?void 0:t.messages.length)===0?S.jsx("div",{id:"history-empty",disabled:!0,children:S.jsx(Yt,{color:"text.secondary",sx:{fontSize:"12px",fontWeight:700,padding:"16px 12px",textTransform:"uppercase"},children:"Such empty..."})},"empty"):null,u=t.messages?null:S.jsx("div",{id:"history-loading",disabled:!0,children:S.jsx(Yt,{color:"text.secondary",sx:{fontSize:"12px",fontWeight:700,padding:"16px 12px",textTransform:"uppercase"},children:"Loading..."})},"loading"),f=[s,l,u];if(t.messages){const p=e0t(t.messages);Object.keys(p).forEach(g=>{f.push(S.jsx("div",{disabled:!0,children:S.jsx(Yt,{color:"text.primary",sx:{p:1,fontSize:"10px",fontWeight:700,color:_t[500]},children:g})},g));let v="";p[g].forEach(y=>{v!==y.content&&(v=y.content,f.push(S.jsx(ov,{className:"history-item",onClick:w=>{w.stopPropagation(),w.preventDefault(),a(!1),e(y.content)},disableRipple:!0,sx:{p:1,alignItems:"baseline",borderRadius:"4px"},children:S.jsx(Yt,{color:"text.primary",sx:{whiteSpace:"pre-wrap",fontSize:"14px",maxHeight:"50px",display:"-webkit-box",WebkitLineClamp:"2",WebkitBoxOrient:"vertical",flexGrow:0,overflow:"hidden",textOverflow:"ellipsis",lineHeight:"24px"},children:y.content})},y.key)))})})}const d=i?S.jsx(xy,{autoFocus:!0,anchorEl:i,open:t.open,onClose:()=>a(!1),PaperProps:{sx:{p:1,backgroundImage:"none",mt:-2,ml:-1,overflow:"visible",maxHeight:"314px",width:"334px",overflowY:"auto",border:p=>`1px solid ${p.palette.divider}`,boxShadow:p=>p.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:f}):null;return S.jsxs("div",{children:[d,S.jsx(yi,{title:"Show history",children:S.jsx(or,{color:"inherit",onClick:()=>a(!t.open),ref:r,children:S.jsx(dQ,{})})})]})}const n0t=({fileSpec:e,session:t})=>{const n=tG({spec:e,onResolved:a=>t==null?void 0:t.socket.emit("file_upload",a)});if(!n)return null;const{getRootProps:r,getInputProps:i,uploading:o}=n;return S.jsx(yi,{title:"Upload files",children:S.jsxs(RS,{id:o?"upload-button-loading":"upload-button",loading:o,sx:{minWidth:0,borderRadius:"50%"},color:"inherit",...r({className:"dropzone"}),children:[S.jsx("input",{...i()}),S.jsx(SP,{})]})})};function r0t(){const e=Ct(jq),t=Ct(uc);return!e||!t?null:S.jsx(n0t,{fileSpec:e,session:t})}function i0t(e){const t=e.querySelector("textarea");return t?t.value.split(`
|
|
543
|
+
`).length:0}const o0t=({onSubmit:e,onReply:t})=>{const n=T.useRef(null),r=gn(RP),[i,o]=ir(Ay),a=Ct(Ry),s=Ct(TS),l=Ct(uc),[u,f]=T.useState(""),[d,p]=T.useState(!1),v=!((l==null?void 0:l.socket)&&!(l!=null&&l.error))||a||(s==null?void 0:s.spec.type)==="file";T.useEffect(()=>{n.current&&!a&&!v&&n.current.focus()},[a,v]);const y=T.useCallback(()=>{u===""||v||(s?t(u):e(u),f(""))},[u,v,f,s,e]),w=()=>{p(!0)},b=()=>{p(!1)},x=T.useCallback(A=>{A.key==="Enter"&&!A.shiftKey?d||(A.preventDefault(),y()):A.key==="ArrowUp"&&i0t(A.currentTarget)<=1&&r(z=>({...z,open:!0}))},[y,r,d]),C=T.useCallback(A=>{n.current&&f(A)},[]),k=S.jsxs(S.Fragment,{children:[i.inputs.length>0&&S.jsx(or,{disabled:v,color:"inherit",onClick:()=>o(A=>({...A,open:!0})),children:S.jsx(qD,{})}),S.jsx(t0t,{onClick:C}),S.jsx(r0t,{})]}),R=S.jsx(or,{disabled:v,color:"inherit",onClick:()=>y(),children:S.jsx(uQ,{})});return S.jsx(lS,{inputRef:n,id:"chat-input",autoFocus:!0,multiline:!0,variant:"standard",autoComplete:"false",placeholder:"Type your message here...",disabled:v,onChange:A=>f(A.target.value),onKeyDown:x,onCompositionStart:w,onCompositionEnd:b,value:u,fullWidth:!0,InputProps:{disableUnderline:!0,startAdornment:S.jsx(PB,{sx:{ml:1,color:"text.secondary"},position:"start",children:k}),endAdornment:S.jsx(PB,{position:"end",sx:{mr:1,color:"text.secondary"},children:R})},sx:{backgroundColor:"background.paper",borderRadius:1,border:A=>`1px solid ${A.palette.divider}`,boxShadow:"box-shadow: 0px 2px 4px 0px #0000000D",textarea:{height:"34px",maxHeight:"30vh",overflowY:"auto !important",resize:"none",paddingBottom:"0.75rem",paddingTop:"0.75rem",color:"text.primary",lineHeight:"24px"}}})},a0t="/assets/logo_dark-bc7401f6.svg",s0t="/assets/logo_light-f19fc2ea.svg",l0t=({width:e,style:t})=>{const{theme:n}=Ct(Hs),r=n==="light"?s0t:a0t;return S.jsx("img",{src:r,style:t,width:e||40})};function u0t(){return S.jsx(Ht,{mx:"auto",children:S.jsxs("a",{href:"https://github.com/Chainlit/chainlit",target:"_blank",style:{display:"flex",alignItems:"center",textDecoration:"none"},children:[S.jsx(Yt,{fontSize:"12px",color:"text.secondary",children:"Built with"}),S.jsx(l0t,{width:65,style:{filter:"grayscale(1)",marginLeft:"4px"}})]})})}function c0t({onSubmit:e,onReply:t}){return S.jsxs(at,{display:"flex",flexDirection:"column",gap:1,py:2,sx:{boxSizing:"border-box",width:"100%",maxWidth:"60rem",m:"auto",justifyContent:"center"},children:[S.jsx(Uyt,{}),S.jsx(at,{children:S.jsx(o0t,{onSubmit:e,onReply:t})}),S.jsx(u0t,{})]})}var f0t=sC,d0t=JZ,p0t=ZZ;function h0t(e,t){var n={};return t=p0t(t),d0t(e,function(r,i,o){f0t(n,i,t(r,i,o))}),n}var g0t=h0t;const m0t=_i(g0t);function v0t(){const e=Ct(uc),[t,n]=ir(Ay),[r,i]=ir(xI),o=Ct(Uq),a=cP({initialValues:r,enableReinitialize:!0,onSubmit:async()=>{}}),s=()=>n(f=>({...f,open:!1})),l=()=>{i(a.values);const f=m0t(a.values,d=>d!==""?d:null);e==null||e.socket.emit("chat_settings_change",f),s()},u=()=>{a.setValues(o)};return S.jsxs(mh,{open:t.open,onClose:s,id:"chat-settings-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:[S.jsx(by,{id:"alert-dialog-title",children:"Settings panel"}),S.jsx(vh,{children:S.jsx(at,{sx:{display:"flex",flexDirection:"column",minWidth:"20vw",maxHeight:"70vh",gap:"15px"},children:t.inputs.map(f=>S.jsx(ZJ,{element:{...f,value:a.values[f.id],onChange:a.handleChange,setField:a.setFieldValue}},f.id))})}),S.jsxs(oS,{sx:{p:2},children:[S.jsx(Gu,{onClick:u,color:"primary",variant:"outlined",children:"Reset"}),S.jsx("div",{style:{flex:"1 0 0"}}),S.jsx(Oy,{onClick:s,children:"Cancel"}),S.jsx(Gu,{id:"confirm",variant:"outlined",onClick:l,autoFocus:!0,children:"Confirm"})]})]})}const pQ=()=>{const e=Ct(ya);return e!=null&&e.markdown?S.jsx(at,{overflow:"auto",flexGrow:1,children:S.jsx(at,{id:"welcome-screen",sx:{maxWidth:"60rem",width:"100%",m:"auto",color:"text.primary",lineHeight:"25px",fontSize:"1rem",fontFamily:"-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji",display:"flex",flexDirection:"column"},children:e!=null&&e.markdown?S.jsx(CS,{remarkPlugins:[yI],components:{a:({children:t,...n})=>S.jsx(_y,{...n,target:"_blank",children:t}),code:({...t})=>S.jsx(_I,{...t})},children:e==null?void 0:e.markdown}):null})}):S.jsx(at,{flexGrow:1})},y0t=()=>{const{user:e,isAuthenticated:t}=sc(),n=Ct(uc),r=Ct(TS),[i,o]=ir(kS),a=Ct(mS),s=Ct(tI),l=Ct(CP),u=Ct(ya),f=gn(RP),[d,p]=T.useState(!0),g=T.useCallback(async w=>{if(!(n==null?void 0:n.socket.id))return;const x={id:Z_(),author:(e==null?void 0:e.name)||"User",authorIsUser:!0,content:w,createdAt:new Date().toISOString()};f(C=>{const R=[...C.messages||[]];return R.push({content:w,createdAt:new Date().getTime()}),{...C,messages:R.length>50?R.slice(R.length-50):R}}),p(!0),o(C=>[...C,x]),n==null||n.socket.emit("ui_message",x)},[e,n,t,u]),v=T.useCallback(async w=>{if(!r)return;const b={id:Z_(),author:(e==null?void 0:e.name)||"User",authorIsUser:!0,content:w,createdAt:new Date().toISOString()};r.callback(b),p(!0),o(x=>[...x,b])},[r,e]),y=s.at(-1);return S.jsxs(at,{display:"flex",width:"100%",height:"0",flexGrow:1,children:[S.jsx(JJ,{}),S.jsx(v0t,{}),S.jsx(pU,{tasklist:y,isMobile:!1}),S.jsxs(Nq,{children:[S.jsx(pU,{tasklist:y,isMobile:!0}),S.jsx(at,{my:1}),(n==null?void 0:n.error)&&S.jsx(ro,{id:"session-error",severity:"error",children:"Could not reach the server."}),S.jsxs(dG,{children:[!!i.length&&S.jsx(cG,{actions:l,elements:a,messages:i,autoScroll:d,setAutoScroll:p}),!i.length&&S.jsx(pQ,{}),S.jsx(c0t,{onReply:v,onSubmit:g})]})]})]})};function b0t(){return S.jsx(e0,{children:S.jsx(y0t,{})})}function _0t(){const{loginWithRedirect:e,isAuthenticated:t}=sc(),n=Zu();return T.useEffect(()=>{t?n("/"):e({authorizationParams:{audience:"chainlit-cloud"}})},[t]),null}function x0t(){return S.jsx(e0,{children:S.jsx(at,{sx:{px:2},children:S.jsx(pQ,{})})})}const w0t=Cle([{path:"/",element:S.jsx(b0t,{})},{path:"/readme",element:S.jsx(x0t,{})},{path:"/env",element:S.jsx(Nyt,{})},{path:"/conversations/:id",element:S.jsx(e0,{children:S.jsx(Wmt,{})})},{path:"/dataset",element:S.jsx(Lyt,{})},{path:"/element/:id",element:S.jsx(Fyt,{})},{path:"/login",element:S.jsx(_0t,{})},{path:"/design",element:S.jsx(Myt,{})},{path:"/api/auth/callback",element:S.jsx(gOe,{})},{path:"*",element:S.jsx(mle,{replace:!0,to:"/"})}]);function N$(){return N$=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N$.apply(this,arguments)}var hQ=["shift","alt","meta","mod","ctrl"],S0t={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function $u(e){return(S0t[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function C0t(e){return hQ.includes(e)}function XT(e,t){return t===void 0&&(t=","),e.split(t)}function ZT(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(a){return $u(a)}),i={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},o=r.filter(function(a){return!hQ.includes(a)});return N$({},i,{keys:o,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&gQ([$u(e.key),$u(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&mQ([$u(e.key),$u(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Ou.clear()})})();var Ou=new Set;function E0t(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return Ou.has(r.trim().toLowerCase())})}function gQ(e){var t=Array.isArray(e)?e:[e];Ou.has("meta")&&Ou.forEach(function(n){return!C0t(n)&&Ou.delete(n.toLowerCase())}),t.forEach(function(n){return Ou.add(n.toLowerCase())})}function mQ(e){var t=Array.isArray(e)?e:[e];e==="meta"?Ou.clear():t.forEach(function(n){return Ou.delete(n.toLowerCase())})}function k0t(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function T0t(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function R0t(e){return vQ(e,["input","textarea","select"])}function vQ(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return t instanceof Array?!!(r&&t&&t.some(function(i){return i.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function A0t(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var $0t=function(t,n,r){r===void 0&&(r=!1);var i=n.alt,o=n.meta,a=n.mod,s=n.shift,l=n.ctrl,u=n.keys,f=t.key,d=t.code,p=t.ctrlKey,g=t.metaKey,v=t.shiftKey,y=t.altKey,w=$u(d),b=f.toLowerCase();if(!r){if(i===!y&&b!=="alt"||s===!v&&b!=="shift")return!1;if(a){if(!g&&!p)return!1}else if(o===!g&&b!=="meta"&&b!=="os"||l===!p&&b!=="ctrl"&&b!=="control")return!1}return u&&u.length===1&&(u.includes(b)||u.includes(w))?!0:u?E0t(u):!u},O0t=T.createContext(void 0),I0t=function(){return T.useContext(O0t)};function yQ(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&yQ(e[r],t[r])},!0):e===t}var D0t=T.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),P0t=function(){return T.useContext(D0t)};function L0t(e){var t=T.useRef(void 0);return yQ(t.current,e)||(t.current=e),t.current}var mU=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},M0t=typeof window<"u"?T.useLayoutEffect:T.useEffect;function F0t(e,t,n,r){var i=T.useRef(null),o=T.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,s=e instanceof Array?e.join(a==null?void 0:a.splitKey):e,l=n instanceof Array?n:r instanceof Array?r:void 0,u=T.useCallback(t,l??[]),f=T.useRef(u);l?f.current=u:f.current=t;var d=L0t(a),p=P0t(),g=p.enabledScopes,v=I0t();return M0t(function(){if(!((d==null?void 0:d.enabled)===!1||!A0t(g,d==null?void 0:d.scopes))){var y=function(k,R){var A;if(R===void 0&&(R=!1),!(R0t(k)&&!vQ(k,d==null?void 0:d.enableOnFormTags))&&!(d!=null&&d.ignoreEventWhen!=null&&d.ignoreEventWhen(k))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){mU(k);return}(A=k.target)!=null&&A.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||XT(s,d==null?void 0:d.splitKey).forEach(function(O){var z,V=ZT(O,d==null?void 0:d.combinationKey);if($0t(k,V,d==null?void 0:d.ignoreModifiers)||(z=V.keys)!=null&&z.includes("*")){if(R&&o.current)return;if(k0t(k,V,d==null?void 0:d.preventDefault),!T0t(k,V,d==null?void 0:d.enabled)){mU(k);return}f.current(k,V),R||(o.current=!0)}})}},w=function(k){k.key!==void 0&&(gQ($u(k.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&y(k))},b=function(k){k.key!==void 0&&(mQ($u(k.code)),o.current=!1,d!=null&&d.keyup&&y(k,!0))},x=i.current||(a==null?void 0:a.document)||document;return x.addEventListener("keyup",b),x.addEventListener("keydown",w),v&&XT(s,d==null?void 0:d.splitKey).forEach(function(C){return v.addHotkey(ZT(C,d==null?void 0:d.combinationKey,d==null?void 0:d.description))}),function(){x.removeEventListener("keyup",b),x.removeEventListener("keydown",w),v&&XT(s,d==null?void 0:d.splitKey).forEach(function(C){return v.removeHotkey(ZT(C,d==null?void 0:d.combinationKey,d==null?void 0:d.description))})}}},[s,d,g]),i}function N0t(){const e=gn(Hs);return F0t("s",()=>e(t=>({...t,open:!t.open}))),null}var IP={},B0t=vn;Object.defineProperty(IP,"__esModule",{value:!0});var bQ=IP.default=void 0,j0t=B0t(yn()),z0t=S,U0t=(0,j0t.default)((0,z0t.jsx)("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49zM12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"}),"DarkModeOutlined");bQ=IP.default=U0t;var DP={},K0t=vn;Object.defineProperty(DP,"__esModule",{value:!0});var _Q=DP.default=void 0,W0t=K0t(yn()),V0t=S,H0t=(0,W0t.default)((0,V0t.jsx)("path",{d:"M12 3c-.46 0-.93.04-1.4.14-2.76.53-4.96 2.76-5.48 5.52-.48 2.61.48 5.01 2.22 6.56.43.38.66.91.66 1.47V19c0 1.1.9 2 2 2h.28c.35.6.98 1 1.72 1s1.38-.4 1.72-1H14c1.1 0 2-.9 2-2v-2.31c0-.55.22-1.09.64-1.46C18.09 13.95 19 12.08 19 10c0-3.87-3.13-7-7-7zm2 16h-4v-1h4v1zm0-2h-4v-1h4v1zm-1.5-5.59V14h-1v-2.59L9.67 9.59l.71-.71L12 10.5l1.62-1.62.71.71-1.83 1.82z"}),"EmojiObjects");_Q=DP.default=H0t;var PP={},q0t=vn;Object.defineProperty(PP,"__esModule",{value:!0});var xQ=PP.default=void 0,G0t=q0t(yn()),Y0t=S,X0t=(0,G0t.default)((0,Y0t.jsx)("path",{d:"M4 20h16v2H4zM4 2h16v2H4zm9 7h3l-4-4-4 4h3v6H8l4 4 4-4h-3z"}),"Expand");xQ=PP.default=X0t;function Z0t(){const[e,t]=ir(Hs);return S.jsx(mh,{open:e.open,onClose:()=>t(n=>({...n,open:!1})),id:"settings-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:S.jsx(vh,{children:S.jsxs(Y_,{sx:{width:"100%",maxWidth:360},subheader:S.jsx(Lwe,{children:"Settings"}),children:[S.jsxs(iv,{sx:{display:"flex",gap:2},children:[S.jsx(xp,{children:S.jsx(xQ,{})}),S.jsx(Wb,{id:"list-expand-all",primary:"Expand Messages"}),S.jsx(at,{children:S.jsx(i_,{id:"switch-expand-all",onChange:()=>t(n=>({...n,expandAll:!n.expandAll})),checked:e.expandAll,inputProps:{"aria-labelledby":"switch-expand-all"}})})]}),S.jsxs(iv,{sx:{display:"flex",gap:2},children:[S.jsx(xp,{children:S.jsx(_Q,{})}),S.jsx(Wb,{id:"hide-cot",primary:"Hide Chain of Thought"}),S.jsx(at,{children:S.jsx(i_,{id:"switch-hide-cot",onChange:()=>t(n=>({...n,hideCot:!n.hideCot})),checked:e.hideCot,inputProps:{"aria-labelledby":"hide-cot"}})})]}),S.jsxs(iv,{sx:{display:"flex",gap:2},children:[S.jsx(xp,{children:S.jsx(bQ,{})}),S.jsx(Wb,{id:"switch-theme",primary:"Dark mode"}),S.jsx(at,{children:S.jsx(i_,{id:"switch-theme",onChange:()=>{const n=e.theme==="light"?"dark":"light";localStorage.setItem("themeVariant",n),t(r=>({...r,theme:n}))},checked:e.theme==="dark",inputProps:{"aria-labelledby":"switch-theme"}})})]})]})})})}function vU(e){return e!=null&&typeof e=="object"}function wQ(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i],a=t[i],s=vU(o)&&vU(a);if(s&&!wQ(o,a)||!s&&o!==a)return!1}return!0}const js=Object.create(null);js.open="0";js.close="1";js.ping="2";js.pong="3";js.message="4";js.upgrade="5";js.noop="6";const o_=Object.create(null);Object.keys(js).forEach(e=>{o_[js[e]]=e});const J0t={type:"error",data:"parser error"},Q0t=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",e1t=typeof ArrayBuffer=="function",t1t=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,SQ=({type:e,data:t},n,r)=>Q0t&&t instanceof Blob?n?r(t):yU(t,r):e1t&&(t instanceof ArrayBuffer||t1t(t))?n?r(t):yU(new Blob([t]),r):r(js[e]+(t||"")),yU=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)},bU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nm=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<bU.length;e++)Nm[bU.charCodeAt(e)]=e;const n1t=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r<n;r+=4)o=Nm[e.charCodeAt(r)],a=Nm[e.charCodeAt(r+1)],s=Nm[e.charCodeAt(r+2)],l=Nm[e.charCodeAt(r+3)],f[i++]=o<<2|a>>4,f[i++]=(a&15)<<4|s>>2,f[i++]=(s&3)<<6|l&63;return u},r1t=typeof ArrayBuffer=="function",CQ=(e,t)=>{if(typeof e!="string")return{type:"message",data:EQ(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:i1t(e.substring(1),t)}:o_[n]?e.length>1?{type:o_[n],data:e.substring(1)}:{type:o_[n]}:J0t},i1t=(e,t)=>{if(r1t){const n=n1t(e);return EQ(n,t)}else return{base64:!0,data:e}},EQ=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},kQ=String.fromCharCode(30),o1t=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{SQ(o,!1,s=>{r[a]=s,++i===n&&t(r.join(kQ))})})},a1t=(e,t)=>{const n=e.split(kQ),r=[];for(let i=0;i<n.length;i++){const o=CQ(n[i],t);if(r.push(o),o.type==="error")break}return r},TQ=4;function Or(e){if(e)return s1t(e)}function s1t(e){for(var t in Or.prototype)e[t]=Or.prototype[t];return e}Or.prototype.on=Or.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Or.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Or.prototype.off=Or.prototype.removeListener=Or.prototype.removeAllListeners=Or.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Or.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Or.prototype.emitReserved=Or.prototype.emit;Or.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Or.prototype.hasListeners=function(e){return!!this.listeners(e).length};const na=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function RQ(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const l1t=na.setTimeout,u1t=na.clearTimeout;function CC(e,t){t.useNativeTimers?(e.setTimeoutFn=l1t.bind(na),e.clearTimeoutFn=u1t.bind(na)):(e.setTimeoutFn=na.setTimeout.bind(na),e.clearTimeoutFn=na.clearTimeout.bind(na))}const c1t=1.33;function f1t(e){return typeof e=="string"?d1t(e):Math.ceil((e.byteLength||e.size)*c1t)}function d1t(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}class p1t extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class AQ extends Or{constructor(t){super(),this.writable=!1,CC(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new p1t(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=CQ(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}const $Q="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),B$=64,h1t={};let _U=0,xb=0,xU;function wU(e){let t="";do t=$Q[e%B$]+t,e=Math.floor(e/B$);while(e>0);return t}function OQ(){const e=wU(+new Date);return e!==xU?(_U=0,xU=e):e+"."+wU(_U++)}for(;xb<B$;xb++)h1t[$Q[xb]]=xb;function IQ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function g1t(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}let DQ=!1;try{DQ=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const m1t=DQ;function PQ(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||m1t))return new XMLHttpRequest}catch{}if(!t)try{return new na[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function v1t(){}const y1t=function(){return new PQ({xdomain:!1}).responseType!=null}();class b1t extends AQ{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port,this.xs=t.secure!==r}const n=t&&t.forceBase64;this.supportsBinary=y1t&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};a1t(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,o1t(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=OQ()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=IQ(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Ep(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let Ep=class a_ extends Or{constructor(t,n){super(),CC(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=RQ(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new PQ(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=a_.requestsCount++,a_.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=v1t,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete a_.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Ep.requestsCount=0;Ep.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",SU);else if(typeof addEventListener=="function"){const e="onpagehide"in na?"pagehide":"unload";addEventListener(e,SU,!1)}}function SU(){for(let e in Ep.requests)Ep.requests.hasOwnProperty(e)&&Ep.requests[e].abort()}const LQ=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),wb=na.WebSocket||na.MozWebSocket,CU=!0,_1t="arraybuffer",EU=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class x1t extends AQ{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=EU?{}:RQ(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=CU&&!EU?n?new wb(t,n):new wb(t):new wb(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||_1t,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;SQ(r,this.supportsBinary,o=>{const a={};try{CU&&this.ws.send(o)}catch{}i&&LQ(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=OQ()),this.supportsBinary||(t.b64=1);const i=IQ(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!wb}}const w1t={websocket:x1t,polling:b1t},S1t=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,C1t=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function j$(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=S1t.exec(e||""),o={},a=14;for(;a--;)o[C1t[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=E1t(o,o.path),o.queryKey=k1t(o,o.query),o}function E1t(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function k1t(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let MQ=class Hd extends Or{constructor(t,n={}){super(),this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=j$(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=j$(n.host).host),CC(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=g1t(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=TQ,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new w1t[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Hd.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Hd.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Hd.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,f(),n.close(),n=null)}const a=d=>{const p=new Error("probe error: "+d);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function s(){a("transport closed")}function l(){a("socket closed")}function u(d){n&&d.name!==n.name&&o()}const f=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Hd.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=f1t(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Hd.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};MQ.protocol=TQ;function T1t(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=j$(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const R1t=typeof ArrayBuffer=="function",A1t=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,FQ=Object.prototype.toString,$1t=typeof Blob=="function"||typeof Blob<"u"&&FQ.call(Blob)==="[object BlobConstructor]",O1t=typeof File=="function"||typeof File<"u"&&FQ.call(File)==="[object FileConstructor]";function LP(e){return R1t&&(e instanceof ArrayBuffer||A1t(e))||$1t&&e instanceof Blob||O1t&&e instanceof File}function s_(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(s_(e[n]))return!0;return!1}if(LP(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return s_(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&s_(e[n]))return!0;return!1}function I1t(e){const t=[],n=e.data,r=e;return r.data=z$(n,t),r.attachments=t.length,{packet:r,buffers:t}}function z$(e,t){if(!e)return e;if(LP(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=z$(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=z$(e[r],t));return n}return e}function D1t(e,t){return e.data=U$(e.data,t),delete e.attachments,e}function U$(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=U$(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=U$(e[n],t));return e}const P1t=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],L1t=5;var tn;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(tn||(tn={}));class M1t{constructor(t){this.replacer=t}encode(t){return(t.type===tn.EVENT||t.type===tn.ACK)&&s_(t)?this.encodeAsBinary({type:t.type===tn.EVENT?tn.BINARY_EVENT:tn.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===tn.BINARY_EVENT||t.type===tn.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=I1t(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function kU(e){return Object.prototype.toString.call(e)==="[object Object]"}class MP extends Or{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===tn.BINARY_EVENT;r||n.type===tn.BINARY_ACK?(n.type=r?tn.EVENT:tn.ACK,this.reconstructor=new F1t(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(LP(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(tn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===tn.BINARY_EVENT||r.type===tn.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(MP.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case tn.CONNECT:return kU(n);case tn.DISCONNECT:return n===void 0;case tn.CONNECT_ERROR:return typeof n=="string"||kU(n);case tn.EVENT:case tn.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&P1t.indexOf(n[0])===-1);case tn.ACK:case tn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class F1t{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=D1t(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const N1t=Object.freeze(Object.defineProperty({__proto__:null,Decoder:MP,Encoder:M1t,get PacketType(){return tn},protocol:L1t},Symbol.toStringTag,{value:"Module"}));function Ua(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const B1t=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let NQ=class extends Or{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ua(t,"open",this.onopen.bind(this)),Ua(t,"packet",this.onpacket.bind(this)),Ua(t,"error",this.onerror.bind(this)),Ua(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(B1t.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:tn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:tn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case tn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case tn.EVENT:case tn.BINARY_EVENT:this.onevent(t);break;case tn.ACK:case tn.BINARY_ACK:this.onack(t);break;case tn.DISCONNECT:this.ondisconnect();break;case tn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:tn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:tn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function Wh(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Wh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Wh.prototype.reset=function(){this.attempts=0};Wh.prototype.setMin=function(e){this.ms=e};Wh.prototype.setMax=function(e){this.max=e};Wh.prototype.setJitter=function(e){this.jitter=e};class K$ extends Or{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,CC(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Wh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||N1t;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new MQ(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ua(n,"open",function(){r.onopen(),t&&t()}),o=Ua(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ua(t,"ping",this.onping.bind(this)),Ua(t,"data",this.ondata.bind(this)),Ua(t,"error",this.onerror.bind(this)),Ua(t,"close",this.onclose.bind(this)),Ua(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){LQ(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new NQ(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Sm={};function l_(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=T1t(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Sm[i]&&o in Sm[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new K$(r,t):(Sm[i]||(Sm[i]=new K$(r,t)),l=Sm[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(l_,{Manager:K$,Socket:NQ,io:l_,connect:l_});const JT=(e,t)=>e.id&&t.id?e.id===t.id:!1,j1t=T.memo(function(){const t=Ct(ya),{accessToken:n,authenticating:r}=sc(),i=Ct(cS),o=gn(Ry),a=Ct(KV),[s,l]=ir(uc),u=gn(kS),f=gn(Bq),d=gn(jq),p=gn(TS),g=gn(mS),v=gn(eI),y=gn(tI),w=gn(CP),b=gn(Ay),x=Bb(xI);return T.useEffect(()=>{if(r||!t)return;s!=null&&s.socket&&(s.socket.removeAllListeners(),s.socket.close());const C=l_(Y2e,{path:"/ws/socket.io",extraHeaders:{Authorization:n||"","X-Chainlit-Session-Id":a,"user-env":JSON.stringify(i)}});l({socket:C}),C.on("connect",()=>{C.emit("connection_successful"),l(k=>({...k,error:!1}))}),C.on("connect_error",k=>{console.error("failed to connect",k),l(R=>({...R,error:!0}))}),C.on("task_start",()=>{o(!0)}),C.on("task_end",()=>{o(!1)}),C.on("reload",()=>{C.emit("clear_session"),window.location.reload()}),C.on("new_message",k=>{u(R=>{const A=R.findIndex(O=>JT(O,k));return A===-1?[...R,k]:[...R.slice(0,A),k,...R.slice(A+1)]})}),C.on("update_message",k=>{u(R=>{const A=R.findIndex(O=>JT(O,k));return A===-1?R:(k.newId&&(k.id=k.newId,delete k.newId),[...R.slice(0,A),k,...R.slice(A+1)])})}),C.on("delete_message",k=>{u(R=>{const A=R.findIndex(O=>JT(O,k));return A===-1?R:[...R.slice(0,A),...R.slice(A+1)]})}),C.on("stream_start",k=>{u(R=>[...R,k])}),C.on("stream_token",({id:k,token:R,isSequence:A})=>{u(O=>{const z=O.findIndex(W=>W.id===k);if(z===-1)return O;const D={...O[z]};return A?D.content=R:D.content+=R,[...O.slice(0,z),D,...O.slice(z+1)]})}),C.on("ask",({msg:k,spec:R},A)=>{p({spec:R,callback:A}),u(O=>[...O,k]),o(!1)}),C.on("enable_file_upload",k=>{d(k),o(!1)}),C.on("ask_timeout",()=>{p(void 0),o(!1)}),C.on("clear_ask",()=>{p(void 0)}),C.on("chat_settings",k=>{b(R=>({...R,inputs:k})),x()}),C.on("element",k=>{k.type==="avatar"?v(R=>[...R,k]):k.type==="tasklist"?y(R=>[...R,k]):g(R=>[...R,k])}),C.on("update_element",k=>{g(R=>{const A=R.findIndex(V=>V.id===k.id);if(A===-1)return R;const z={...R[A],forIds:k.forIds};return[...R.slice(0,A),z,...R.slice(A+1)]})}),C.on("remove_element",k=>{g(R=>R.filter(A=>A.id!==k.id)),y(R=>R.filter(A=>A.id!==k.id)),v(R=>R.filter(A=>A.id!==k.id))}),C.on("action",k=>{w(R=>[...R,k])}),C.on("remove_action",k=>{w(R=>{const A=R.findIndex(O=>wQ(O,k));return A===-1?R:[...R.slice(0,A),...R.slice(A+1)]})}),C.on("token_usage",k=>{f(R=>R+k)})},[i,r,t]),null});function z1t(){const{theme:e}=Ct(Hs),[t,n]=ir(Df),[r,i]=ir(V2),{isAuthenticated:o,getAccessTokenSilently:a,logout:s}=sc(),l=KIe(e),{data:u,error:f}=bh(!r&&t?"/project/role":null);return T.useEffect(()=>{u!=="ANONYMOUS"&&!r&&i(f?"ANONYMOUS":u)},[u,f]),T.useEffect(()=>{o&&t===void 0&&a({authorizationParams:{audience:"chainlit-cloud"}}).then(d=>n(d)).catch(d=>{console.error(d),s({logoutParams:{returnTo:window.location.origin}})})},[o,a,t,n]),S.jsxs(FW,{theme:l,children:[S.jsx(eV,{styles:{body:{backgroundColor:l.palette.background.default}}}),S.jsx(ose,{toastOptions:{className:"toast",style:{maxWidth:500,fontFamily:"Inter",background:l.palette.background.paper,border:`1px solid ${l.palette.divider}`,padding:l.spacing(1),color:l.palette.text.primary,boxShadow:l.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}}}),S.jsxs(at,{display:"flex",height:"100vh",width:"100vw",children:[S.jsx(j1t,{}),S.jsx(N0t,{}),S.jsx(Z0t,{}),S.jsx(gle,{router:w0t})]})]})}const U1t=T.memo(function({children:t}){var r;const n=Ct(ya);return(r=n==null?void 0:n.project)!=null&&r.id?S.jsx(uOe,{domain:"https://auth.chainlit.io",clientId:"ADo93BBXDn8Z35lEi8arCWiR7C0ncrjx",authorizationParams:{redirect_uri:`${window.location.origin}/api/auth/callback`},useRefreshTokens:!0,cacheLocation:"localstorage",children:t}):S.jsx(S.Fragment,{children:t})});function K1t(){const[e,t]=ir(ya),n=gn(Hs),{data:r}=bh(e===void 0?"/project/settings":null);return T.useEffect(()=>{r&&(t(r),n(i=>({...i,expandAll:!!r.ui.default_expand_messages,hideCot:!!r.ui.hide_cot})))},[r]),S.jsx(U1t,{children:S.jsx(z1t,{})})}var W$={},TU=Af;W$.createRoot=TU.createRoot,W$.hydrateRoot=TU.hydrateRoot;W$.createRoot(document.getElementById("root")).render(S.jsx(gt.StrictMode,{children:S.jsx(_ve,{children:S.jsx(K1t,{})})}));export{ni as c,_i as g};
|